From 9cd1b374751cb82b8be2447ed03687a030028e00 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sat, 10 Oct 2020 18:06:49 +0100 Subject: [PATCH] VIM: Adds bindings to default to "very magic" searching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default, vim's reg-ex matching is weird. For example: > * is special when not escaped but… > + is special when escaped > \{x,y} (escaping only the opening bracket) works but… > You have to use \( \) (escape both parens) > [] is special when both are unescaped Source: https://wincent.com/wiki/Vim_regexes For more details, check out Greg Hurrell's screencast: https://www.youtube.com/watch?v=VjOcINs6QWs --- nvim/.config/nvim/plugin/mappings.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nvim/.config/nvim/plugin/mappings.vim b/nvim/.config/nvim/plugin/mappings.vim index 1aba94b0..c4e79ba8 100644 --- a/nvim/.config/nvim/plugin/mappings.vim +++ b/nvim/.config/nvim/plugin/mappings.vim @@ -67,3 +67,7 @@ nnoremap cL :w! \| !compiler % letter " Opens the compiled documents " If something like html, it doesn't need to be compiled first nnoremap co :!opout % + +" Makes vim default to "very magic" searching +nnoremap / /\v +vnoremap / /\v