From 3f7f2009a38e64f1f4ef8a0104f3528fa4d13026 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 20 Jan 2022 13:09:28 +0100 Subject: Smart vim ruler hybrid mode --- .config/nvim/init.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '.config') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index b152723..194624a 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -40,9 +40,16 @@ nnoremap let mapleader=" " set shiftwidth=2 -set number set mouse=a +" ruler +set relativenumber number +augroup numbertoggle + autocmd! + autocmd BufEnter,WinEnter * if &nu && mode() != 'i' | set relativenumber | endif + autocmd BufLeave,WinLeave * if &nu | set norelativenumber | endif +augroup END + colorscheme darcula hi Normal guibg=NONE ctermbg=NONE -- cgit v1.2.3