-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeymaps.vim
113 lines (88 loc) · 2.26 KB
/
keymaps.vim
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
113
" vim beginners mode: disables arrow keys so you can get used to hjkl.
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" Shortcuts to work with windows
nnoremap <left> <C-W><
nnoremap <right> <C-W>>
nnoremap <C-W>s <C-W>s<C-W>j
nnoremap <C-W>v <C-W>v<C-W>l
nnoremap <C-W><C-V> <C-W>v<C-W>l
" Visual move between lines
nnoremap <down> gj
nnoremap <up> gk
" Horizontal scroll
nnoremap <C-h> 3zh
nnoremap <C-l> 3zl
" Vertical scroll
nnoremap <C-j> 3gj
nnoremap <C-k> 3gk
" Inserir uma linha abaixo do cursor e continuar no modo normal
map ,o o<Esc>
map <Return> o<Esc>k
map ,O O<Esc>
" Opposite of Shift+J
nmap K i<CR><Esc>k$hl
" Sometimes I type Lw instead of :w
nmap Lw :w
" Change from -> to .
nmap ,. xr.
" Change from . to ->
nmap ,> xi-><ESC>h
" Append the word under cursor to search terms
nmap ,/w /<up>\\|\<<C-R><C-W>\><CR>N
" Helper search to resolve merge conflicts
nmap ,/m /<<<<<<<\\|=======\\|>>>>>>><CR>
" Easier way to copy/paste from an external program
map ,- "*
map ,= "+
map <F11> "*
map <S-F11> "+
" 0 vai para o inicio da linha. ^ faz o mesmo, mas pula os espaços/tabs iniciais
map 0 ^
" Change tabs
map <C-Left> gT
map <C-Right> gt
inoremap <C-Left> <Esc>gT
inoremap <C-Right> <Esc>gt
" Move a line of text using ALT+[Up/Down]
nmap <A-Down> mz:m+<cr>`z
nmap <A-Up> mz:m-2<cr>`z
vmap <A-Down> :m'>+<cr>`<my`>mzgv`yo`z
vmap <A-Up> :m'<-2<cr>`>my`<mzgv`yo`z
if MySys() == "mac"
nmap <Esc><Esc>[B mz:m+<cr>`z
nmap <Esc><Esc>[A mz:m-2<cr>`z
vmap <Esc><Esc>[B :m'>+<cr>`<my`>mzgv`yo`z
vmap <Esc><Esc>[A :m'<-2<cr>`>my`<mzgv`yo`z
endif
" Turn spell check on/off
map <F1> :call SpellCheckToggle()<CR>
" Toggle line number
map <F3> :call LineNumberToggle()<CR>
" Reload all opened files
nmap <F5> :tabdo windo edit<CR>
map ,n :call ShowNumberStatus()<CR>
"""" PLUGINS
"" NERDTree
map <F2> :NERDTreeToggle<CR>
if MySys() == "mac"
map <Leader><F2> :NERDTreeFind<CR>
else
map <S-F2> :NERDTreeFind<CR>
endif
"" A
nmap <F4> :A<CR>
" iunmap <buffer> \ih
" iunmap <Leader>is
" iunmap <Leader>ihn
"" Tagbar
nnoremap <F8> :TagbarToggle<CR>
"" Bookmarking
map ,bb :ToggleBookmark<CR>
map ,bn :NextBookmark<CR>
map ,bp :PreviousBookmark<CR>
"" GitGutter
nnoremap ]g :GitGutterNextHunk<CR>
nnoremap [g :GitGutterPrevHunk<CR>