forked from thoughtbot/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.local
65 lines (50 loc) · 1.55 KB
/
vimrc.local
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
set cursorline
syntax on
syntax enable
let g:solarized_termtrans = 1
set background=dark
colorscheme solarized
" Fast saving, reload, quit
nmap <leader>w :w<cr>
nmap <leader>e :e<cr>
nmap <leader>q :q<cr>
" Navigate vim panes
nnoremap <leader>l <c-w><c-l>
nnoremap <leader>k <c-w><c-k>
nnoremap <leader>j <c-w><c-j>
nnoremap <leader>h <c-w><c-h>
" Format JSON string
function! FormatJSON()
execute '%!python -m json.tool' | w
endfunction
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
nmap <silent> <leader>t :TestNearest<CR>
nmap <silent> <leader>T :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
nmap <silent> <leader>l :TestLast<CR>
nmap <silent> <leader>g :TestVisit<CR>
" make test commands execute using dispatch.vim
let test#strategy = "vtr"
" Vimix (Elixir testing)
let g:vimix_map_keys = 1
" http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement/
set relativenumber
set number
" mxw/vim-jsx
let g:jsx_ext_required = 0
" https://robots.thoughtbot.com/faster-grepping-in-vim
" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" bind K to grep word under cursor
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
" bind \ (backward slash) to grep shortcut
command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>