From ac39ce2bf9a85c78492ebe47270eb83e5bd75875 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 2 Feb 2012 22:47:30 -0500 Subject: Add mapping to toggle relative/absolute numbering --- .vimrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.vimrc b/.vimrc index eb214fe1..5d5e517c 100644 --- a/.vimrc +++ b/.vimrc @@ -92,6 +92,7 @@ nnoremap ` ' " Clear search highlights nmap n :silent :nohlsearch + " Toggle visible whitespace nmap s :set list! @@ -116,6 +117,17 @@ nmap gp :Git push nnoremap u :GundoToggle +" Toggle relative/absolute numbers +function! NumberToggle() + if(&relativenumber == 1) + set number + else + set relativenumber + endif +endfunc + +nnoremap :call NumberToggle() + " Custom commands command! W :w -- cgit 1.4.1