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
Jonathan Hodgson 4 years ago
parent 60941bc007
commit 9cd1b37475
  1. 4
      nvim/.config/nvim/plugin/mappings.vim

@ -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

Loading…
Cancel
Save