Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add ack.vim plugin
I have long wanted an easy way to replicate TextMate's "Find in Project",
and this delivers it via a backslash shortcut and selectable results in
a "quickfix" window. If present, Ripgrep or The Silver Searcher (Ag) will
be used instead of Ack for faster search results.

https://github.com/mileszs/ack.vim#keyboard-shortcuts
https://github.com/BurntSushi/ripgrep#whirlwind-tour
  • Loading branch information
justinmayer committed Sep 27, 2016
1 parent e863cf9 commit 6a455cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/bootstrap.sh
Expand Up @@ -17,7 +17,7 @@ if [ "$OS" = "darwin" ]; then
[ ! -f /usr/local/bin/brew ] && /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install basic packages
for pkg in git grc pixz ssh-copy-id vcprompt wget
for pkg in git grc pixz ssh-copy-id vcprompt wget ripgrep
do
[ ! -f /usr/local/bin/$pkg ] && brew install $pkg
done
Expand Down
7 changes: 6 additions & 1 deletion vim/keys.vim
@@ -1,4 +1,4 @@
" Directional keys -------------------------------------------------------------
" Directional keys ------------------------------------------------------------

" When wrapping is on, move cursor by displayed lines instead of file lines
noremap j gj
Expand All @@ -10,3 +10,8 @@ noremap gk k
noremap H ^
noremap L $
vnoremap L g_

" Plugin key bindings ---------------------------------------------------------

" Backslash invokes ack.vim
nnoremap \ :Ack<SPACE>
8 changes: 8 additions & 0 deletions vim/plugins.vim
Expand Up @@ -4,3 +4,11 @@ python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
set laststatus=2 " Always show the statusline

" ack.vim: use ripgrep/ag if available ----------------------------------------

if executable('rg')
let g:ackprg = 'rg -S --no-heading --vimgrep'
elseif executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
1 change: 1 addition & 0 deletions vim/vundle.vim
Expand Up @@ -12,6 +12,7 @@ Plugin 'VundleVim/Vundle.vim'
Plugin 'twerth/ir_black'

" Behaviors
Plugin 'mileszs/ack.vim'
Plugin 'matchit.zip'
Plugin 'tpope/vim-commentary'
Plugin 'bronson/vim-trailing-whitespace'
Expand Down

0 comments on commit 6a455cb

Please sign in to comment.