[nvim] add functions to workaround some interesting behaviors of vim

This commit is contained in:
Dmytro Meleshko 2021-02-05 11:54:51 +02:00 committed by pull[bot]
parent a27c05856a
commit 618995cc7f
1 changed files with 5 additions and 0 deletions

View File

@ -152,6 +152,11 @@ set commentstring=//%s
\|xmap # <Cmd>call <SID>VisualStarSearch('?')<CR>N
augroup END
" <https://vim.fandom.com/wiki/Searching_for_expressions_which_include_slashes#Searching_for_slash_as_normal_text>
command! -nargs=+ Search let @/ = escape(<q-args>, '/') | normal /<C-R>/<CR>
" <https://vim.fandom.com/wiki/Searching_for_expressions_which_include_slashes#Searching_for_all_characters_as_normal_text>
command! -nargs=+ SearchLiteral let @/ = '\V'.escape(<q-args>, '/\') | normal /<C-R>/<CR>
" }}}