summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2012-02-02 22:47:30 -0500
committerJune McEnroe <june@causal.agency>2012-02-02 22:47:30 -0500
commitac39ce2bf9a85c78492ebe47270eb83e5bd75875 (patch)
tree842fa6669c0823fd79cac72334f5b7f21420fb4a
parentAdd itchy.vim (diff)
downloadsrc-ac39ce2bf9a85c78492ebe47270eb83e5bd75875.tar.gz
src-ac39ce2bf9a85c78492ebe47270eb83e5bd75875.zip
Add mapping to toggle relative/absolute numbering
-rw-r--r--.vimrc12
1 files changed, 12 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index eb214fe1..5d5e517c 100644
--- a/.vimrc
+++ b/.vimrc
@@ -92,6 +92,7 @@ nnoremap ` '
 
 " Clear search highlights
 nmap <silent> <leader>n :silent :nohlsearch<CR>
+
 " Toggle visible whitespace
 nmap <silent> <leader>s :set list!<CR>
 
@@ -116,6 +117,17 @@ nmap <silent> <leader>gp :Git push<CR>
 
 nnoremap <leader>u :GundoToggle<CR>
 
+" Toggle relative/absolute numbers
+function! NumberToggle()
+  if(&relativenumber == 1)
+    set number
+  else
+    set relativenumber
+  endif
+endfunc
+
+nnoremap <silent> <C-n> :call NumberToggle()<cr>
+
 " Custom commands
 command! W :w