Switch to hybrid relative number in vim
This commit is contained in:
parent
7f88c72e3b
commit
b1cc6e8075
1 changed files with 10 additions and 0 deletions
10
vimrc
10
vimrc
|
@ -282,6 +282,7 @@ set textwidth=0
|
||||||
"[Settings of line numbers]"
|
"[Settings of line numbers]"
|
||||||
set number
|
set number
|
||||||
set numberwidth=2
|
set numberwidth=2
|
||||||
|
set relativenumber
|
||||||
"[Don't show current position]"
|
"[Don't show current position]"
|
||||||
set ruler
|
set ruler
|
||||||
"[For regular expressions turn magic on]"
|
"[For regular expressions turn magic on]"
|
||||||
|
@ -452,3 +453,12 @@ function! ShowModeInStatusLine()
|
||||||
endif
|
endif
|
||||||
return g:showMode
|
return g:showMode
|
||||||
endfunction
|
endfunction
|
||||||
|
"[Toggle relativenumber between normal & insert mode]"
|
||||||
|
"[Credit: https://jeffkreeftmeijer.com/vim-number/#relative-line-numbers ]"
|
||||||
|
if has("autocmd")
|
||||||
|
augroup numbertoggle
|
||||||
|
autocmd!
|
||||||
|
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
|
||||||
|
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
|
|
Loading…
Reference in a new issue