Search code examples
vim

How to enable "Very magic" mode in vim with vimrc?


When search something, always typing \v is quite boring.
How to write .vimrc to make it the default regular expression mode?


Solution

  • I don't think there is a dedicated setting (like :set magic) but I have this line in my ~/.vimrc:

    nnoremap / /\v
    

    that make every forward search "very magic".

    --- EDIT ---

    FWIW, I removed that mapping a long time ago as I got used to the default level of magic.