diff --git a/.vimrc b/.vimrc index 7d087c3..aea69b1 100644 --- a/.vimrc +++ b/.vimrc @@ -1,16 +1,14 @@ call plug#begin() Plug 'junegunn/fzf' -Plug 'junegunn/fzf.vim' Plug 'tpope/vim-fugitive' Plug 'airblade/vim-gitgutter' Plug 'vim-airline/vim-airline' call plug#end() -" Use ripgrep to list files (fast, respects .gitignore) -let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --glob "!.git/*"' - let mapleader = " " +let g:fzf_layout = { 'down': '40%' } + " set autochdir set expandtab @@ -39,6 +37,15 @@ colorscheme habamax set autoread " Mappings -nnoremap f :Files -nnoremap b :Buffers -nnoremap g :Rg +nnoremap f :FZF + +" ripgrep as the grep engine +if executable('rg') + set grepprg=rg\ --vimgrep\ --smart-case + set grepformat=%f:%l:%c:%m +endif + +" :Rg pattern -> search, drop results in quickfix at the bottom, no auto-jump +command! -nargs=+ Rg execute 'silent grep! ' . | botright cwindow + +nnoremap g :Rg