Browse Source

feat(vim): prefer ripgrep if installed

Kyle P Davis 2 năm trước cách đây
mục cha
commit
9ded05b012
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      .vimrc

+ 5 - 2
.vimrc

@@ -43,8 +43,11 @@ autocmd BufNewFile,BufReadPost *.json set filetype=json syntax=javascript
 autocmd BufNewFile,BufReadPost *.md set filetype=markdown
 autocmd BufNewFile,BufReadPost *.go set filetype=go
 
-" run prettier with the = key
-autocmd FileType * setlocal equalprg=npx\ -q\ prettier\ --stdin-filepath\ %
+" prefer ripgrep if available
+if executable('rg')
+	set grepprg=rg\ --vimgrep\ $*
+	set grepformat^=%f:%l:%c:%m
+endif
 
 " VIM-PLUG PLUGINS (WITH FIRST-RUN AUTOINSTALL)
 if empty(glob('~/.vim/autoload/plug.vim'))