Permalink
Browse files

[vim] Some handy shortcuts:

\<Space> - :noh
<C-N><C-N> - Now rotates between 'number', 'relativenumber', and 'nonumber'
jj - Types <ESC> when in insert mode (shockingly useful)
\w - :w
  • Loading branch information...
1 parent c378b4f commit 8590d7b86193e5fe865383af9cb063057d032e6f @BestFriendChris committed Mar 5, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 vim/_vimrc
View
@@ -76,11 +76,13 @@ set scrolloff=2
set ignorecase
set smartcase
+nmap <silent> <Leader><Space> :noh<CR>
" Don't litter the filesystem with .swp files
set directory=~/.vim/swp//
-nmap <silent> <C-N><C-N> :set invnumber<CR>
+" Rotate between number, relativenumber, and nothing
+nmap <silent> <C-N><C-N> :exec 'set ' &nu+&rnu ? 'rnu!' : 'nu'<CR>
nmap <silent> <C-W><C-W> :set invwrap<CR>
nmap <silent> <C-G><C-G> :let &background = ( &background == "dark" ? "light" : "dark" )<CR>
nmap <silent> <C-Z><C-Z> :let &foldcolumn = ( &foldcolumn == 0 ? 5 : 0 )<CR>
@@ -161,3 +163,7 @@ command! W w !sudo tee % > /dev/null
"No more accidently hitting <F1>
map <F1> <Nop>
map <D-F1> <Nop>
+
+" Trying these out; we'll see if I like/use it
+imap jj <ESC>
+nmap <silent> <Leader>w :w<CR>

0 comments on commit 8590d7b

Please sign in to comment.