-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaps.vim
88 lines (69 loc) · 2.07 KB
/
maps.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
" from default vimrc
map! <xHome> <Home>
map! <xEnd> <End>
vnoremap p :let current_reg = @"gvdi=current_reg
map <xHome> <Home>
map <xEnd> <End>
" find and close the/a help window
function s:helpclose()
let l:helpnum = 0
windo if &buftype == 'help' | let l:helpnum = winnr() | endif
if l:helpnum != 0
exe l:helpnum . 'wincmd w'
close
endif
endfunc
nnoremap <F1> :call <SID>helpclose()<CR>
nnoremap <C-F1> :pcl<CR>
" Tagexplorer plugin
nnoremap <silent> <F2> :Tlist<Enter>
nnoremap <silent> <F3> :nohlsearch<Enter>
inoremap <silent> <F3> :nohlsearch<Enter>
" switch to other file
nnoremap <silent> <F4> :Switch<Enter>
nnoremap <F5> :make<Enter>
nnoremap <S-F5> :!sudo make install<Enter>
" re-break paragraph under cursor
nnoremap <F6> gwap
" put an undo point and re-break current line
inoremap <F6> ugww<Right>
" :tn and :cn are too much typing
nnoremap <silent> <F7> :tn<Enter>
nnoremap <silent> <S-F7> :tprev<Enter>
nnoremap <silent> <F8> :cn<Enter>
nnoremap <silent> <S-F8> :cprev<Enter>
nnoremap <silent> <C-F8> :ccl<Enter>
nnoremap <silent> <S-PageUp> :Next<Enter>
nnoremap <silent> <S-PageDown> :next<Enter>
nnoremap <Space> <PageDown>
vnoremap <Space> <PageDown>
nnoremap <BS> <PageUp>
vnoremap <BS> <PageUp>
" use FuzzyFinder
nnoremap <silent> <Leader>t :FufTag<CR>
nnoremap <silent> <Leader>b :FufBuffer<CR>
" split lines (opposite of J)
nnoremap S m'a<CR><Esc>==`'
" add an undo point before pasting
inoremap u
inoremap <MiddleMouse> u<MiddleMouse>
" make ^l act like it does in normal mode in insert mode
inoremap
" paste with current indent plus 1
" should work with registers too, but this is entirely by accident
nnoremap [p ]p>']
nnoremap [P ]P>']
" I paste the default reg all the time and ^R" is too much reaching
imap "
cnoremap "
cnoremap
" ^R^L to insert the cursor line into the command line
cnoremap =getline('.')<CR>
" deprecate these unnecessary maps
nnoremap [f :echo "Use CTRL-W f instead, you retard."<CR>
nnoremap [F :echo "Use CTRL-W F instead, you retard."<CR>
" swap : and ; (very experimental)
noremap ; :
noremap : ;