Daily Shaarli

All links of one day in a single page.

May 17, 2022

Preserve last editing position in VIM

Edit ~/.vimrc or /etc/vim/vimrc:

" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
     \ if line("'\"") > 0 && line("'\"") <= line("$") |
     \   exe "normal! g`\"" |
     \ endif