Added the highlight visual after pressing enter

This commit is contained in:
Marcin Woźniak 2022-07-25 23:54:17 +02:00
parent 611e7d5234
commit e43a84feaf
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -561,6 +561,10 @@ au BufNewFile,BufRead *.conf setfiletype conf
autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritepre * %s/\n\+\%$//e autocmd BufWritepre * %s/\n\+\%$//e
" Source: https://vi.stackexchange.com/questions/20077/automatically-highlight-all-occurrences-of-the-selected-text-in-visual-mode
" highlight the visual selection after pressing enter.
xnoremap <silent> <cr> "*y:silent! let searchTerm = '\V'.substitute(escape(@*, '\/'), "\n", '\\n', "g") <bar> let @/ = searchTerm <bar> echo '/'.@/ <bar> call histadd("search", searchTerm) <bar> set hls<cr>
"""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""
" FZF " FZF
"""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""