-
Notifications
You must be signed in to change notification settings - Fork 0
/
bindings
60 lines (47 loc) · 1.36 KB
/
bindings
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
" Leaders
map <leader>d :NERDTreeToggle<cr>
map <leader>n :nohlsearch<cr>
" Make =====
nnoremap <leader>1 yypVr=
" strip all trailing whitespace in the current file
nnoremap <leader>w :%s/\s\+$//<cr>:let @/=''<CR>
" reselect the text that was just pasted so I can perform commands (like indentation) on it
nnoremap <leader>v V`]
nnoremap <tab> %
vnoremap <tab> %
" nnoremap <up> <nop>
" nnoremap <down> <nop>
" nnoremap <left> <nop>
" nnoremap <right> <nop>
" inoremap <up> <nop>
" inoremap <down> <nop>
" inoremap <left> <nop>
" inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
"inoremap <ESC> <nop>
"nnoremap <ESC> <nop>
"vnoremap <ESC> <nop>
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
map <F2> :bp<CR>
map <F3> :bn<CR>
if has("gui_macvim")
map <D-/> <plug>NERDCommenterToggle<CR>
endif
" http://vimcasts.org/episodes/bubbling-text/
" Bubble single lines
nmap <C-Up> [e
nmap <C-Down> ]e
" Bubble multiple lines
vmap <C-Up> [egv
vmap <C-Down> ]egv
" Visually select the text that was last edited/pasted
nmap gV `[v`]
set pastetoggle=<F12> " Toggle insert-paste mode with F12
" from http://peepcode.com/products/play-by-play-bernhardt
" Seriously, guys, it's not like :W is bound to anything anyway.
command! W :w
" http://www.commandlinefu.com/commands/view/1204/save-a-file-you-edited-in-vim-without-the-needed-permissions
cmap w!! %!sudo tee > /dev/null %