From: short <> Date: Thu, 19 May 2005 06:25:54 +0000 (+0000) Subject: +Restore the cursor position after the file got opened. X-Git-Url: http://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=bd39f9f2114f1c5d7b19834fa82ce060441b20a7 +Restore the cursor position after the file got opened. - From Red Hat: vimrc --- diff --git a/.vimrc b/.vimrc index ed7d998..4fc1e2f 100644 --- a/.vimrc +++ b/.vimrc @@ -33,6 +33,13 @@ function BufEnter() runtime! ./../../../../../../../../../../../.vimrc ./../../../../../../../../../../.vimrc ./../../../../../../../../../.vimrc ./../../../../../../../../.vimrc ./../../../../../../../.vimrc ./../../../../../../.vimrc ./../../../../../.vimrc ./../../../../.vimrc ./../../../.vimrc ./../../.vimrc ./../.vimrc ./.vimrc endif endfunction +" From Red Hat vimrc - restore the cursor position after the file got opened: +autocmd BufReadPost * call BufReadPost() +function BufReadPost() + if line("'\"") > 0 && line ("'\"") <= line("$") + exe "normal! g'\"" + endif +endfunction set encoding=utf-8 set termencoding=utf-8