-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc.local
80 lines (62 loc) · 2.19 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
66
67
68
69
70
71
72
73
74
75
76
77
78
" colors
highlight Pmenu ctermbg=232 ctermfg=202
highlight PmenuSel ctermbg=202 ctermfg=232
highlight DiffAdd cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffDelete cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffChange cterm=bold ctermfg=10 ctermbg=17 gui=none guifg=bg guibg=Red
highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Red
" esc in normal mode
imap kj <esc>
imap jk <esc>
" save in insert mode
imap æ <esc>:w<CR>
imap œ <esc>:wq<CR>
" Emacs-like beginning and end of line.
imap <c-e> <c-o>$
imap <c-a> <c-o>^
" j and k on wrapped lines
nmap j gj
nmap k gk
" ctrl + t to open a new tab
nmap <c-t> :tabnew<CR>
" Custom Leader commands
" leader being <space>
nmap <leader>s :w<CR>
nmap <leader>vr :tabedit $MYVIMRC.local<CR>
nmap <leader>so :source $MYVIMRC<CR>
" Custom commands
command! Q q
command! Qall qall
command! QA qall
command! E e
" silver search
let g:ctrlp_user_command = 'ag %s -l --hidden --nocolor -g ""'
let g:ctrlp_use_caching = 0
" status bar colors
hi StatusLine ctermbg=16 ctermfg=3
hi StatusLineNC ctermbg=16 ctermfg=246
" -------------------------- tmux integration ----------------------------------
autocmd VimResized * :wincmd =
nnoremap <leader>- :wincmd _<CR>:wincmd \|<CR>
nnoremap <leader>= :wincmd =<CR>
" -------------------------- tmux runner ---------------------------------------
let g:VtrUseVtrMaps = 1
" rspec runner
let g:rspec_command = "call VtrSendCommand('rspec {spec}')"
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
" --------------------------- enable matchit ----------------------------------
runtime macros/matchit.vim
" -------------------------- commentary --------------------------------------
nmap cm <Plug>Commentary
" -------------------------- commentary --------------------------------------
" nmap ySS <Plug>YSsurround
" nmap ySs <Plug>YSsurround
" nmap yss <Plug>Yssurround
" nmap yS <Plug>YSurround
nmap ys <Plug>Ysurround
" -------------------------- exchange ------------------------------------------
nmap cX <Plug>(ExchangeLine)
nmap <C-x> cxiw