Skip to main content
added 10 characters in body; edited title
Source Link
Vivian De Smedt
  • 21.1k
  • 5
  • 22
  • 40

How to setup AG (the silver searcher) in vimVim?

I am using AG to simplifying and improve the search in my vimVim. I remapped K to search for the current selected word as follows:

if executable('ag')
  set grepprg=ag\ --nogroup\ --nocolor
  command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!

  nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
  nnoremap ff :Ag<SPACE>
endif

However this doesn't work as expected. When I hit the keyboard K, a small windows opens up in the bottom, showing the following message  :

enter image description here

Then, I hit ENTEREnter and it goes to the results. How can I avoid this window message and go directly to the result page?

How to setup AG (the silver searcher) in vim?

I am using AG to simplifying and improve the search in my vim. I remapped K to search for the current selected word as follows:

if executable('ag')
  set grepprg=ag\ --nogroup\ --nocolor
  command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!

  nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
  nnoremap ff :Ag<SPACE>
endif

However this doesn't work as expected. When I hit the keyboard K, a small windows opens up in the bottom, showing the following message  :

enter image description here

Then, I hit ENTER and it goes to the results. How can I avoid this window message and go directly to the result page?

How to setup AG (the silver searcher) in Vim?

I am using AG to simplifying and improve the search in my Vim. I remapped K to search for the current selected word as follows:

if executable('ag')
  set grepprg=ag\ --nogroup\ --nocolor
  command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!

  nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
  nnoremap ff :Ag<SPACE>
endif

However this doesn't work as expected. When I hit the keyboard K, a small windows opens up in the bottom, showing the following message:

enter image description here

Then, I hit Enter and it goes to the results. How can I avoid this window message and go directly to the result page?

Fast greping with How to setup AG (the silver searcher) in vim?

edited title; edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
Loading
edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
Loading
edited tags; edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
Loading
Source Link
Loading