Search code examples
vimagfzf

How to enable AG in vim + fzf


I am new to vim. I read online that one of the best fuzzy finder in vim is fzf. I have started using it. But whenever I write the command :Ag I get ag is not found. I don't know what it means and I don't know how to fix it.


Solution

  • You need to install ag, in case you are on a mac:

    brew install the_silver_searcher
    

    As another option for testing fzf you could also use ctrl p to call :Files by using this map:

    nnoremap <c-p> :Files<CR>
    

    And you could use ripgrep when calling :Files, for this you will need to modify the default FZF_DEFAULT_COMMAND:

    export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'
    

    You can find more information here: https://github.com/junegunn/fzf#usage