vim

In vim, is there a way to set "very magic" permanently and globally?


I use "very magic" for regexp searches (i.e. /\v or %s/\v) but I wish I could set some option so I don't have to include \v anymore, anywhere. Is there a way to do this?


Solution

  • Not directly, however you can always use a mapping:

    :nnoremap / /\v
    :cnoremap %s/ %s/\v
    

    Even if you could set 'very magic' in the way you can set nomagic, you really wouldn't want to as it would break pretty much every plugin in existence.

    Edit

    See also this page.