From bd39f9f2114f1c5d7b19834fa82ce060441b20a7 Mon Sep 17 00:00:00 2001 From: short <> Date: Thu, 19 May 2005 06:25:54 +0000 Subject: [PATCH] +Restore the cursor position after the file got opened. - From Red Hat: vimrc --- .vimrc | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 1.8.3.1