1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:40:06 +08:00

Change: enable relativenumber only in current win (#2771)

* Change: enable relativenumber only in current win

* Implement feature

* Only use bufenter and winenter autocmd
This commit is contained in:
Wang Shidong 2019-04-26 21:43:46 +08:00 committed by GitHub
parent 05852f87f3
commit 53a20b8549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -73,7 +73,7 @@ let g:spacevim_expand_tab = 1
" <
""
" Enable/Disable relativenumber, by default it is enabled.
" Enable/Disable relativenumber in current windows, by default it is enabled.
let g:spacevim_relativenumber = 1
@ -888,12 +888,6 @@ function! SpaceVim#end() abort
call SpaceVim#layers#core#statusline#init()
endif
if !g:spacevim_relativenumber
set norelativenumber
else
set relativenumber
endif
" tab options:
set smarttab
let &expandtab = g:spacevim_expand_tab

View File

@ -22,6 +22,10 @@ function! SpaceVim#autocmds#init() abort
\ q | endif
autocmd QuitPre * call SpaceVim#plugins#windowsmanager#UpdateRestoreWinInfo()
autocmd WinEnter * call SpaceVim#plugins#windowsmanager#MarkBaseWin()
if g:spacevim_relativenumber
autocmd BufEnter,WinEnter * if &nu | set rnu | endif
autocmd BufLeave,WinLeave * if &nu | set nornu | endif
endif
autocmd BufRead,BufNewFile *.pp setfiletype puppet
if g:spacevim_enable_cursorline == 1
autocmd BufEnter,WinEnter,InsertLeave * call s:enable_cursorline()

View File

@ -321,7 +321,7 @@ Change the default indentation of SpaceVim. Default is 2.
In Insert mode: Use the appropriate number of spaces to insert a <Tab>
*g:spacevim_relativenumber*
Enable/Disable relativenumber, by default it is enabled.
Enable/Disable relativenumber in current windows, by default it is enabled.
*g:spacevim_enable_bepo_layout*
Enable/Disable bepo layout, by default it is disabled.