-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.keybindings
112 lines (86 loc) · 2.7 KB
/
.vimrc.keybindings
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
let mapleader = ','
let maplocalleader = '_'
" Ignore F1
map <F1> :noh<CR>
" command line with over support
nmap ; :
nmap <silent><C-;> :OverCommandLine<CR>
" Escape with jj
imap jj <Esc>
" remove search highlight
map <C-f> :noh<CR>
" Folding
map <silent> <TAB> @=((foldclosed('.') > 0)?'zO':'zazO')<CR>
map <silent> <S-Z> za
map <silent> <S-X> zX
map <silent> z1 :set foldlevel=1<CR>
map <silent> z2 :set foldlevel=2<CR>
map <silent> z3 :set foldlevel=3<CR>
map <silent> z0 :set foldlevel=0<CR>
" context based selection
imap <C-w> <C-o><C-w>
" omni complete
imap <C-j> <C-X><C-O><C-P>
" Easy Motion
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
nmap s <Plug>(easymotion-s)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
" wildfire quick selection
nmap <Leader>w <Plug>(wildfire-quick-select)
" Python Tmux nosetests
nmap <F5> :RunNoseTestFocused<CR>
nmap <F6> :RunAllNoseTests<CR>
" deal with vimux pane
map <Leader>rq :VimuxCloseRunner<CR>
map <Leader>ri :VimuxInspectRunner<CR>
map <Leader>rz :VimuxZoomRunner<CR>
" cycle loc list (erros)
nmap <F3> :try<bar>lnext<bar>catch /^Vim\%((\a\+)\)\=:E\%(553\<bar>42\):/<bar>lfirst<bar>endtry<cr>
" toggle error pannel
nmap <silent> <C-e> :<C-u>call ToggleErrors()<CR>
" disable syntastic
nmap <F7> :SyntasticToggleMode<CR>
" search for string in all files
nmap <leader>a :Ack<space>
" search in buffer
nmap <leader>b :CtrlPBuffer<CR>
" search files (fuzzy)
nmap <leader>t :CtrlP<CR>
" toggle nerd tree
nmap <leader>f :NERDTreeToggle %<CR>
" toggle git gutter info
nmap <leader>g :GITDiff<CR>
" clear whitespaces
nmap <Leader>ds :call StripTrailingWhitespace()<CR>
nmap <silent> <leader>dd <Plug>DashSearch
nmap <leader>d<space> :Dash<space>
" Wrapped lines goes down/up to next row, rather than next line in file.
noremap j gj
noremap k gk
" Stupid shift key fixes
command! -bang -nargs=* -complete=file W w<bang> <args>
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
command! -bang Q q<bang>
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$
" Find merge conflict markers
map <leader>fc /\v^[<\|=>]{7}( .*\|$)<CR>
" Visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
" Vim Projectionist
nnoremap <Leader>gt :Etest<SPACE>
nnoremap <Leader>gc :Esource<SPACE>
nnoremap <Leader>gs :Estyle style<CR>
nnoremap <silent> <Leader>ga :A<CR>
" Camelcase moviments
map <silent> e <Plug>CamelCaseMotion_e
map <silent> E <Plug>CamelCaseMotion_b
map <silent> ge <Plug>CamelCaseMotion_ge