Trix & Graphix

Forcing vim to remember the cursor position

In some VIM installations this awesome editor does not remember the last cursor position in the former edition of a file. Of course, this can be a pain. Here is a small tip to solve this problem. You only need to copy this code into your .vimrc file


" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")

\| exe "normal g'\"" | endif
endif


2 Comments:

piponazo said...

Amazing! :D.

Anonymous said...

Nice article, sweetie! Keep it up! Almost forgot, I suggest you should make your website a bit more social.


Barbara Tremblay
dominos coupon codes