浏览代码

feat(vim): prefer ripgrep if installed

Kyle P Davis 2 年之前
父节点
当前提交
9ded05b012
共有 1 个文件被更改,包括 5 次插入2 次删除
  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'))