Skip to Content

Vim - Ag search with specific file type

Posted on

I use vim-ag plugin for searching.

Today I learned how to limiting silver-searcher to only search specific file types. We can use one of this ways:

ag key_word --ruby
ag -G "\.rb$" key_word

To detect supported file type, we can run ag --list-file-type command. For example, --ruby option makes ag search in .rb .rhtml .rjs .rxml .erb .rake .spec extensions.

comments powered by Disqus