> <file file_id="myid">c:\test.txt</file> > > When the cursor is on the 'm' of 'myid' and I press 'vw', > a word is selected in visual mode. However, the " at the > end of 'myid' is also selected. How do I change the list > of 'word separators'?
Well, the answer to your question is that there's a setting called 'iskeyword' to which you can add and from which you can remove characters. However, by default, it doesn't include the double-quote character. What you're seeing is an expression of that range from the drop-point "m" *up to, but not including* where the cursor is (on the quote). If you follow your "vw" example with "y" to yank it, and then paste it elsewhere, you'll see that the selection was accurately just "myid", not "myid"" > On a related note, when I have 'myid' selected and I want > to replace it with the contents of the yank buffer, I > press 'p'. But the original contents of the yank buffer > are then replaced my 'myid', i.e. the text that was > replaced in the paste operation. How do I change this > behaviour? The best solution I know is to use "_p instead of just "p". This sends the deleted text (the stuff you previously had highlighted) into the "black-hole register", leaving your default register untouched. Alternatively, register 0 is the "last yanked text" register, which is unaffected by such deletes--only yanks. Thus, you could use (and easily map) "0p to always paste the last thing you yanked. This has two side effects of which it's best to be aware: It does change your default (unnamed) register to the most recently replaced text; and if you delete something (rather than yank something) with the intent to use it later for overwriting a visual block, you'll get unexpected results, as you're pasting the last *yanked* thing, rather than the last *deleted* thing. For more info, you can read at :help "_ :help "0 :help v_p Hope this helps you find a solution to what you're trying to do. -tim