@@ -38,6 +38,8 @@ Plugin 'marcweber/vim-addon-mw-utils'
3838Plugin ' tomtom/tlib_vim'
3939Plugin ' garbas/vim-snipmate'
4040Plugin ' honza/vim-snippets'
41+ Plugin ' evidens/vim-twig'
42+ Plugin ' rking/ag.vim'
4143
4244" vim-scripts
4345Plugin ' Tabular'
@@ -112,7 +114,6 @@ endif
112114" Set filetype {{{2
113115 if has (" autocmd" )
114116au BufNewFile ,BufRead *.hbs set ft = html
115- au BufNewFile ,BufRead *.twig set ft = html
116117 endif
117118" Save on losing focus {{{2
118119au FocusLost * :wa
@@ -221,7 +222,7 @@ vmap <D-[> <gv
221222vmap <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>
225226nnoremap <C-y> 3<C-y>
226227
227228" Syntax highlighting groups for word under cursor {{{2
@@ -256,7 +257,7 @@ endfunction
256257
257258inoremap <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
260261inoremap <F1> <ESC>
261262nnoremap <F1> <ESC>
262263vnoremap <F1> <ESC>
@@ -275,8 +276,8 @@ nmap <silent> <leader>s :set spell!<CR>
275276
276277" Toggle set list -- l {{{2
277278nmap <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
282283nnoremap <leader> ` 0v$S`
@@ -473,6 +474,17 @@ if exists(":Tabularize")
473474nmap <Leader> a: :Tabularize /:\zs<CR>
474475vmap <Leader> a: :Tabularize /:\zs<CR>
475476endif
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
477489set modelines = 1
478490" vim: set foldmethod = marker:
0 commit comments