Perform a non-regex search/replace in vim

前端 未结 7 1706
暖寄归人
暖寄归人 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:42

    For the :s command there is a shortcut to disable or force magic. To turn off magic use :sno like:

    :sno/search_string/replace_string/g
    

    Found here: http://vim.wikia.com/wiki/Simplifying_regular_expressions_using_magic_and_no-magic

提交回复
热议问题