I have recently started using vim and i have been playing around with it for sometime now.
i use FZF
with Ag
to get searching files and searching in files done. but i am not able to search in particular file types for example
i want to search "getUserInfo"
only in .js
files.
here are my configs
bashrc
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
init.vim
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
i simply use :Ag
in vim to search in entire directory
Both of the other answers did not work for me, after digging through related issues to the one Gregory linked I found a solution that worked for me:
If you type
Into the terminal you can determine what to replace --python with in the above example to capture the correct filetype.
Finally you simply type :Agpy or whatever you name the command into vim to execute.
This also executes in whatever your present working directory is, which is preferable to only a fixed directory in the other example.