From fd93985d53a629ab28b4108f86b97819ac5241c8 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Thu, 28 Jun 2018 15:40:24 +0200 Subject: [PATCH] vim grep under cursor --- .vim/vimrc | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index 628566a..db3b55e 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -43,7 +43,6 @@ set mouse=nvi set mousemodel=popup set number "set pastetoggle= -set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin set printoptions=paper:letter set scrolloff=1 set shiftround @@ -65,11 +64,9 @@ set wildmenu set wildmode=longest:full,full set wildignore+=tags,.*.un~,*.pyc set winaltkeys=no +set shell=/bin/bash +set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin -"if !has("gui_running") && $display == '' || !has("gui") -" set mouse= -"endif -" "set makeprg=cmake\ --build\ . " Visual studio 2013 "set errorformat=\ %#%f(%l):\ %m @@ -77,8 +74,15 @@ set winaltkeys=no "set errorformat=%.%#>\ %#%f(%l)\ :\ %m " " IAR compiler -set makeprg=vim-iarbuild.cmd -set errorformat=%f(%l)\ :\ %m +if executable('vim-iarbuild.cmd') + set makeprg=vim-iarbuild.cmd + set errorformat=%f(%l)\ :\ %m +endif + +if executable('ag') + set grepprg=ag\ --vimgrep\ --skip-vcs-ignores\ --path-to-ignore\ ~/.ignore\ --cpp + set grepformat^=%f:%l:%c:%m " file:line:coloumn:message +endif "syn match pythonDefStatement /^\s*\%(def\|class\)/ " \ nextgroup=pythonFunction skipwhite @@ -94,27 +98,14 @@ let g:netrw_liststyle=3 let g:netrw_banner = 0 let g:netrw_sort_sequence = '[\/]$,*' -"let g:ctrlp_map = '' -"let g:ctrlp_cmd = 'CtrlP' -"let g:ctrlp_working_path_mode = 'ra' "let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] "let g:markdown_syntax_conceal = 0 -" %s is replaced with fzf command -"let g:fzf_launcher = 'xterm -e bash -ic %s' -"let g:fzf_launcher = "in_a_new_term_function %s" "for airline -"let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#enabled = 1 -"for ack.vim -"if executable('rg') -" let g:ackprg = 'rg --path-separator="//"' -"endif -if executable('ag') - let g:ackprg = 'ag --vimgrep --skip-vcs-ignores --path-to-ignore ~/.ignore --cpp' -endif let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] @@ -139,7 +130,6 @@ let python_folding = 1 " }}}2 " section: commands {{{1 "----------------------- -set shell=/bin/bash if has("cscope") set nocscopetag @@ -176,6 +166,8 @@ endif" " let mapleader = "," +" Grep the word under cursor +nnoremap * :silent grep \| copen " redraws the screen " Quickly edit/reload the vimrc file nmap ev :e $MYVIMRC -- 2.43.0