Skip to content

Commit 6423b39

Browse files
committed
Using the silver searcher
CtrlP now uses silverness ack.vim is still hanging around for when I dont install ag Added twig.vim for current project Small Cleanup
1 parent 25bc49b commit 6423b39

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

vimrc

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Plugin 'marcweber/vim-addon-mw-utils'
3838
Plugin 'tomtom/tlib_vim'
3939
Plugin 'garbas/vim-snipmate'
4040
Plugin 'honza/vim-snippets'
41+
Plugin 'evidens/vim-twig'
42+
Plugin 'rking/ag.vim'
4143

4244
" vim-scripts
4345
Plugin 'Tabular'
@@ -112,7 +114,6 @@ endif
112114
" Set filetype {{{2
113115
if has("autocmd")
114116
au BufNewFile,BufRead *.hbs set ft=html
115-
au BufNewFile,BufRead *.twig set ft=html
116117
endif
117118
" Save on losing focus {{{2
118119
au FocusLost * :wa
@@ -221,7 +222,7 @@ vmap <D-[> <gv
221222
vmap <D-[> >gv
222223
223224
" Viewport Scrolling {{{2
224-
nnoremap <C-e> 3<C-e>" Speed up viewport scrolling
225+
nnoremap <C-e> 3<C-e>
225226
nnoremap <C-y> 3<C-y>
226227
227228
" Syntax highlighting groups for word under cursor {{{2
@@ -256,7 +257,7 @@ endfunction
256257

257258
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
258259
259-
" Fuck F1 one help tp rule them all :h {{{2
260+
" Fuck F1 one help to rule them all :h {{{2
260261
inoremap <F1> <ESC>
261262
nnoremap <F1> <ESC>
262263
vnoremap <F1> <ESC>
@@ -275,8 +276,8 @@ nmap <silent> <leader>s :set spell!<CR>
275276
276277
" Toggle set list -- l {{{2
277278
nmap <Leader>l :set list!<CR>
278-
" Ack -- a {{{2
279-
nmap <Leader>a :Ack
279+
" Ag -- a {{{2
280+
nmap <Leader>a :Ag<SPACE>
280281
" Surround selection with -- ` ' " {{{2
281282
" Surround selection with backticks
282283
nnoremap <leader>` 0v$S`
@@ -473,6 +474,17 @@ if exists(":Tabularize")
473474
nmap <Leader>a: :Tabularize /:\zs<CR>
474475
vmap <Leader>a: :Tabularize /:\zs<CR>
475476
endif
477+
" Ag The Silver Searcher {{{2
478+
if executable('ag')
479+
" Use ag over grep
480+
set grepprg=ag\ --nogroup\ --nocolor
481+
482+
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
483+
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
484+
485+
" ag is fast enough that CtrlP doesn't need to cache
486+
let g:ctrlp_use_caching = 0
487+
endif
476488
" [ Modeline ] {{{1
477489
set modelines=1
478490
" vim: set foldmethod=marker:

0 commit comments

Comments
 (0)