From 7fa0b2742ebcdeebc83fd315ea35b0ce3b28b8bd Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 18 Apr 2021 00:34:02 +0200 Subject: NVim search enhancements --- nvim/nvim/init.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'nvim') diff --git a/nvim/nvim/init.vim b/nvim/nvim/init.vim index 1f558e4..e11f18a 100644 --- a/nvim/nvim/init.vim +++ b/nvim/nvim/init.vim @@ -48,6 +48,12 @@ call vundle#end() " required " Activate syntax highlighting by default syntax on +" Keep 10 lines of space from the cursor to the window corners +set scrolloff=10 + +" Show completion in a menu +set wildmenu + " Enable TRUE COLORS let $NVIM_TUI_ENABLE_TRUE_COLOR=1 let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 @@ -128,6 +134,20 @@ set nomodeline " SEARCH +" Search through files in the current tree (like :find) +set path+=** + +" Make ctags so we can search with ^] and g^] and ^t +command! MakeTags !ctags -R . + +" Use ripgrep as search tool +if executable("rg") + set grepprg=rg\ --vimgrep\ --no-heading + set grepformat=%f:%l:%c:%m,%f:%l:%m +endif + +command! -nargs=+ Sgrep execute 'silent grep! ' | copen 10 + " HighLight search set hlsearch -- cgit v1.2.3