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

前端 未结 3 1610
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 01:41

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 thi

3条回答
  •  难免孤独
    2020-12-24 02:12

    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.

提交回复
热议问题