VIM: Adds bindings to default to "very magic" searching

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
This commit is contained in:
Jonathan Hodgson 2020-10-10 18:06:49 +01:00
parent 7a4a785ac7
commit c050efe3b5

View file

@ -67,3 +67,7 @@ nnoremap <leader>cL :w! \| !compiler <c-r>% letter<CR>
" Opens the compiled documents " Opens the compiled documents
" If something like html, it doesn't need to be compiled first " If something like html, it doesn't need to be compiled first
nnoremap <leader>co :!opout <c-r>%<CR><CR> nnoremap <leader>co :!opout <c-r>%<CR><CR>
" Makes vim default to "very magic" searching
nnoremap / /\v
vnoremap / /\v