Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not override :Ag command #682

Closed
fievelk opened this issue Jan 2, 2021 · 0 comments · Fixed by #706
Closed

Do not override :Ag command #682

fievelk opened this issue Jan 2, 2021 · 0 comments · Fixed by #706

Comments

@fievelk
Copy link

fievelk commented Jan 2, 2021

The current vimrc file is defining a custom :Ag command to use ag:

dotfiles/vimrc

Lines 97 to 101 in 2a59c18

if !exists(":Ag")
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>
endif
endif

This command raises an error when I try to run it without arguments. Also, it doesn't open a new interactive window with the Ag> shell.

I believe that defining this command is not necessary nor optimal anymore.
The fzf.vim plugin defines its own :Ag command. This command can't be run at the moment (because it's overridden by our vimrc).

In my opinion, the lines that define the custom :Ag command in vimrc should be removed and we should allow the :Ag command from fzf.vim to work as expected.

danielnolan added a commit that referenced this issue Sep 20, 2022
* The Ag command from fzf.vim that loads the fzf shell does seem
  more useful than than the command being defined here. The one downside
  I see though is that `:Ag some_search` will open the fzf shell rather than
  populating the vim quickfix window, however you can just select all
  files in the fzf shell with alt-a and click enter to add all the files
  in the fzf shell to a quickfix window.
* Remove custom :Ag command vim in favor of :Ag command defined in
  fzf.vim
* Closes #682
danielnolan added a commit that referenced this issue Sep 23, 2022
* The Ag command from fzf.vim that loads the fzf shell does seem
  more useful than than the command being defined here. The one downside
  I see though is that `:Ag some_search` will open the fzf shell rather than
  populating the vim quickfix window, however you can just select all
  files in the fzf shell with alt-a and click enter to add all the files
  in the fzf shell to a quickfix window.
* Remove custom :Ag command vim in favor of :Ag command defined in
  fzf.vim
* Closes #682
kmorisoto pushed a commit to kmorisoto/dotfiles that referenced this issue Dec 18, 2022
* The Ag command from fzf.vim that loads the fzf shell does seem
  more useful than than the command being defined here. The one downside
  I see though is that `:Ag some_search` will open the fzf shell rather than
  populating the vim quickfix window, however you can just select all
  files in the fzf shell with alt-a and click enter to add all the files
  in the fzf shell to a quickfix window.
* Remove custom :Ag command vim in favor of :Ag command defined in
  fzf.vim
* Closes thoughtbot#682
adamjparrott pushed a commit to adamjparrott/dotfiles that referenced this issue Jul 2, 2023
* The Ag command from fzf.vim that loads the fzf shell does seem
  more useful than than the command being defined here. The one downside
  I see though is that `:Ag some_search` will open the fzf shell rather than
  populating the vim quickfix window, however you can just select all
  files in the fzf shell with alt-a and click enter to add all the files
  in the fzf shell to a quickfix window.
* Remove custom :Ag command vim in favor of :Ag command defined in
  fzf.vim
* Closes thoughtbot#682
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant