On 22/04/11 11:39, Ben Schmidt wrote:
On 21/04/11 8:37 PM, Kai Weber wrote:
Hi,

Currently my workflow replacing a visual selection is like this:

1. Go to Visual mode
2. Select text
3. y'ank
4. :%s/<c-r>*/foo/g

Something else nobody has mentioned is that putting \V at the beginning
of the pattern (for very nomagic) can at least lessen the number of
characters that need to be escaped. Not very helpful, but something
that's handy to know, perhaps with other more convenient uses.

Ben.




Whether to use very-magic, magic, nomagic, or very-nomagic may depend on various criteria. Personally I stay with the default 'magic' state, this way I don't have to remember more than one meaning for each pattern atom, applicable everywhere including in mappings and functions, and also to the great majority of patterns in stuff that I don't write myself. (YMMV.)

What I do use OTOH is \c and \C to set or clear case-folding respectively (my vimrc has "set ignorecase smartcase" which means: if the pattern is all lowercase or all nonalphabetic, match case-folded; if it includes at least one uppercase letter, match case-sensitive; but sometimes I want to depart from my own defaults and some searches are case-sensitive by default).


Best regards,
Tony.
--
If everything is coming your way then you're in the wrong lane.

--
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

Reply via email to