switch to absolute line numbers in insert mode (#702)

* switch to absolute line numbers in insert mode

* made aucmd respect cursorline setting
This commit is contained in:
Robin Kautz 2021-07-05 20:37:01 +02:00 committed by GitHub
parent a0e2823f7f
commit cea4976066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,4 +292,11 @@ require("lv-utils").define_augroups {
-- will cause split windows to be resized evenly if main window is resized
{'VimResized ', '*', 'wincmd ='},
},
_mode_switching = {
-- will switch between absolute and relative line numbers depending on mode
{'InsertEnter', '*', 'if &relativenumber | let g:ms_relativenumberoff = 1 | setlocal number norelativenumber | endif'},
{'InsertLeave', '*', 'if exists("g:ms_relativenumberoff") | setlocal relativenumber | endif'},
{'InsertEnter', '*', 'if &cursorline | let g:ms_cursorlineoff = 1 | setlocal nocursorline | endif'},
{'InsertLeave', '*', 'if exists("g:ms_cursorlineoff") | setlocal cursorline | endif'},
},
}