2019-10-13 17:19:43 +02:00
|
|
|
" Idea for toggling taken from jeffkreeftmeijer
|
|
|
|
|
|
|
|
" Show line numbers
|
|
|
|
set number
|
|
|
|
|
|
|
|
augroup numbertoggle
|
|
|
|
autocmd!
|
|
|
|
" Toggle numbers between relative and absolute when changing buffers
|
|
|
|
autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif
|
|
|
|
autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
|
2019-10-13 17:21:02 +02:00
|
|
|
" Disable line numbers and relative line numbers in terminal
|
2020-10-14 16:43:18 +02:00
|
|
|
if exists('##TerminalOpen')
|
|
|
|
autocmd TerminalOpen * setlocal nonu nornu
|
|
|
|
elseif has('nvim')
|
|
|
|
autocmd TermOpen * setlocal nonu nornu
|
|
|
|
endif
|
2019-10-13 17:19:43 +02:00
|
|
|
augroup END
|