From 4b61a89c7a578edd687b052e83c8ebf2baaea638 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Fri, 1 Jul 2022 20:19:53 +0800 Subject: [PATCH] vim: add cursor position remembering for nvim --- .config/vim/vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 01e6814..48e3c1d 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -41,3 +41,9 @@ autocmd User ALELintPost let tmp=ale#statusline#Count(bufnr(''))['total'] | set autocmd InsertEnter * silent !echo -en "\e[?737769h" autocmd InsertLeave * silent !echo -en "\e[?737769l" autocmd VimLeave * silent !echo -en "\e[?737769h" +if has('nvim') + autocmd BufReadPost * + \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' + \ | exe "normal! g`\"" + \ | endif +endif -- 2.45.2