Perform a non-regex search/replace in vim

前端 未结 7 1714
暖寄归人
暖寄归人 2021-02-01 12:22

When doing search/replace in vim, I almost never need to use regex, so it\'s a pain to constantly be escaping everything, Is there a way to make it default to not using regex or

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-01 12:55

    Here’s how to disable regular expression search/replace only in command mode:

    autocmd CmdWinEnter * set nomagic
    autocmd CmdWinLeave * set magic
    

    All plugins that depends on regular expression such as white-space remover should works as usual.

提交回复
热议问题