-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vim_mappings.vim
87 lines (68 loc) · 1.82 KB
/
.vim_mappings.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
" Map s to save and Ctrl-s to s
noremap <C-s> s
noremap s :w<CR>
" Make Y consistent with C and D
noremap Y y$
" ` jumps to line and column, ' just jumps to line.
nnoremap ' `
nnoremap ` '
" H for start of line, L for end of line
noremap H ^
noremap L $
" Map gh to clear hilighting
noremap gh :noh<CR>
" Map gl to invoke shell commands
noremap gl :!
" Switch macro playback and macro record
noremap q @
noremap @ q
" Map Control-L to Escape
" noremap! <C-l>
" Map gs to invoke a perl substitute regular expression
noremap gs :%!perl -p -i -e 's/
" Map gd to run current file
noremap gd :!./%<CR>
" Map o and O to exit insert mode
noremap o o<ESC>
noremap O O<ESC>
" Enable Nerd Tree
noremap gn :NERDTree
noremap gnt :NERDTree .<CR>
" Disable Nerd Tree
noremap gq :NERDTreeClose<CR>
" Completion
" noremap! <C-j> <C-x><C-u>
" Vimperator-style tab navigation
" noremap <C-n> OB
" noremap <C-p> OA
" Sober Keybinding System
inoremap <C-a> <C-o>^
inoremap <C-f> <C-o>w
inoremap <C-s> <ESC>/
inoremap <C-l> <C-o>b
inoremap <C-e> <C-o>x
inoremap <C-r> <C-o>db
inoremap <C-u> <C-o>p
inoremap <C-o>u
" Map j and k to work with screen lines, not logical lines
nnoremap k gk
nnoremap j gj
nnoremap gk k
nnoremap gj j
" Swap ; and :
noremap ; :
noremap : ;
" toggle paste mode
set pastetoggle=<C-g>
" John Zila's * and # Keybindings
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy/<C-R><C-R>=substitute(
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy?<C-R><C-R>=substitute(
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
nnoremap * :set hls<CR>:let @/="<C-r><C-w>"<CR>