All Projects → vim-scripts → Ag.vim

vim-scripts / Ag.vim

Use ag, the_silver_searcher (better than ack, which is better than grep)

Labels

Projects that are alternatives of or similar to Ag.vim

Dotfiles Windows
[pt-BR] meus dotfiles para windows
Stars: ✭ 7 (-69.57%)
Mutual labels:  viml
Gist.vim
Create gists from Vim
Stars: ✭ 18 (-21.74%)
Mutual labels:  viml
Learnviml
A suggested path for learning Vim's scripting language, VimL
Stars: ✭ 22 (-4.35%)
Mutual labels:  viml
Rainbow parentheses.vim
Better Rainbow Parentheses
Stars: ✭ 892 (+3778.26%)
Mutual labels:  viml
Vim Stim
StIm - Star Improved
Stars: ✭ 18 (-21.74%)
Mutual labels:  viml
Funcoo.vim
Functional Object Oriented VimL
Stars: ✭ 18 (-21.74%)
Mutual labels:  viml
Vim Pants
Vim plugin for Pants
Stars: ✭ 6 (-73.91%)
Mutual labels:  viml
Insertlessly
Waste no more time entering insert mode just to insert enters!
Stars: ✭ 22 (-4.35%)
Mutual labels:  viml
Vimrc
Stars: ✭ 18 (-21.74%)
Mutual labels:  viml
Vim lib
Stars: ✭ 22 (-4.35%)
Mutual labels:  viml
Vimpeg
A PEG parser for Vim
Stars: ✭ 16 (-30.43%)
Mutual labels:  viml
Vim Diff Toggle
🛠 Vim plugin to speed up editing diff files
Stars: ✭ 17 (-26.09%)
Mutual labels:  viml
Markmywords
Arbitrary bookmarks for your files and Vim docs
Stars: ✭ 19 (-17.39%)
Mutual labels:  viml
Easytags.vim
Automated tag file generation and syntax highlighting of tags in Vim
Stars: ✭ 15 (-34.78%)
Mutual labels:  viml
Stupid Easymotion
A dumbed down version of EasyMotion that aids navigation on the current line
Stars: ✭ 22 (-4.35%)
Mutual labels:  viml
Vim Slantstatus
A segmented vim statusline plugin
Stars: ✭ 6 (-73.91%)
Mutual labels:  viml
Dotfiles
My dot files
Stars: ✭ 18 (-21.74%)
Mutual labels:  viml
Cheatsheets
personal cheatsheets on various technologies
Stars: ✭ 23 (+0%)
Mutual labels:  viml
Scala Vim Support
Unofficial mirror of Scala Vim support - With a few fixes added.
Stars: ✭ 22 (-4.35%)
Mutual labels:  viml
Vim Session
Extended session management for Vim (:mksession on steroids)
Stars: ✭ 907 (+3843.48%)
Mutual labels:  viml

This is a mirror of http://www.vim.org/scripts/script.php?script_id=4450

Just like ack.vim but for the faster 'ag' utility.

For better formatting, see: https://github.com/rking/ag.vim#readme

This plugin is a front for ag, A.K.A. the_silver_searcher. Ag can be used as a replacement for 153% of the uses of ack. This plugin will allow you to run ag from vim, and shows the results in a split window. Installation

The Silver Searcher

You have to install ag, of course.

Usually it's a package named 'the_silver_searcher', but it should install easily from Github, otherwise:

git clone https://github.com/ggreer/the_silver_searcher cd the_silver_searcher && ./build.sh && install

Then, if you're using pathogen:

cd ~/.vim/bundle && git clone https://github.com/rking/ag.vim

And run :Helptags from within vim

If you're using something else (whether it's manual install or some vim package manager), feel free to give me the pasteable line to put here as instructions. Really, people should probably be using Pathogen, in my opinion. Configuation

You can specify a custom ag name and path in your .vimrc like so:

let g:agprg=" --column"

Usage

:Ag [options] {pattern} [{directory}]

Search recursively in {directory} (which defaults to the current directory) for the {pattern}.

Files containing the search term will be listed in the split window, along with the line number of the occurrence, once for each occurrence. [Enter] on a line in this window will open the file, and place the cursor on the matching line.

Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use :Ag, :AgAdd, :LAg, and :LAgAdd respectively. (See doc/ag.txt, or install and :h Ag for more information.) Gotchas

Some characters have special meaning, and need to be escaped your search pattern. For instance, '#'. You have to escape it like this :Ag '\#define foo' to search for #define foo.

Sometimes git grep is even faster, though in my experience it's not noticably so. Keyboard Shortcuts

In the quickfix window, you can use:

o to open (same as enter) go to preview file (open but maintain focus on ag.vim results) t to open in new tab T to open in new tab silently h to open in horizontal split H to open in horizontal split silently v to open in vertical split gv to open in vertical split silently q to close the quickfix window

Acknowledgements

This Vim plugin is derived (and by derived, I mean copied, almost entirely) from milesz's ack.vim, which I also recommend installing since you might be in a situation where you have ack but not ag, and don't want to stop to install ag. Also, ack supports --type, and a few other features.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].