On Feb 21, 10:41 am, David Kahn <[email protected]> wrote: > Relatively new to vim. I know there are other ways to do this specific task > such as search/replace but I want to understand how to repeatedly paste some > text but also overwrite a certain character, in the case I want to do it > manually. This has brought me to need to understand if there is a sort of > clipboard/yank history. > > For example, I have yanked this text: > > .truncate( > > I want to replace the comma ',' in the lines below with my yanked text in > each line: > > word,12) > word2,12) > word3,12) > > So what I do is move in regular mode to the first comma and press 'x' to > remove the comma, and then press 'p'... however instead of getting my yanked > text, I get the text now under the cursor, in this case '1'. So how do I > handle a yank > delete > put operation, and multiple times?
You've got a lot of great suggestions, let me add one more (which may work depending on what you're trying to do): 1. align the commas in the lines you wish to replace: word ,12) word2,12) word3,12) 2. Select a VISUAL BLOCK around the commas (either use CTRL-V or CTRL- Q in normal mode with the cursor on the topmost comma, then use j to select all the commas you wish to replace) 3. Press the 'c' key to remove the commas and enter insert mode. Paste the copied text with CTRL-R followed by 0 4. Press escape to exit visual block mode. Your text insertion is automatically applied to each line which was selected. -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
