commit e28188059622663f2876bd4573ffb5413362041e
parent d9ae85362b499ff63e67fea8597bd8ebb87a05ae
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Thu, 6 Aug 2020 23:07:37 +0200
vim: simplify number toggling
Former-commit-id: 199dd211cc5184b5efa8e19c8a76c781ac57864f
Diffstat:
3 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/vim/autoload/toggle_number.vim b/vim/autoload/toggle_number.vim
@@ -1,8 +0,0 @@
-function! toggle_number#ToggleNumber() abort
- if(&relativenumber == 1)
- set norelativenumber
- set number
- else
- set relativenumber
- endif
-endfunction
diff --git a/vim/plugin/toggle_number.vim b/vim/plugin/toggle_number.vim
@@ -1,7 +0,0 @@
-if exists("g:loaded_toggle_number") || &cp
- finish
-endif
-let g:loaded_toggle_number = 1
-
-" Switch between relative and absolute line num
-nnoremap <Plug>ToggleNumber :call toggle_number#ToggleNumber()<CR>
diff --git a/vim/vimrc b/vim/vimrc
@@ -646,7 +646,7 @@ set complete=.,w,b,u,t,i,kspell
" a match, don't select anything automatically.
set completeopt=menu,menuone,preview
-nmap <leader># <Plug>ToggleNumber
+nnoremap <silent><expr> <leader># ":set ".(&relativenumber?'norelativenumber number':'relativenumber number')."<CR>"
set omnifunc=syntaxcomplete#Complete