SHA256
1
0
forked from pool/vim

- Update suse.vimrc to stop remembering file positions for git

commit cases. This fixes bnc#538369 and based on msys commits
  1ef258e and 65ffc90.

OBS-URL: https://build.opensuse.org/package/show/editors/vim?expand=0&rev=251
This commit is contained in:
Ismail Dönmez
2015-01-29 10:47:21 +00:00
committed by Git OBS Bridge
parent b4f1603c9e
commit cc4df34c0a
3 changed files with 19 additions and 11 deletions

View File

@@ -265,16 +265,17 @@ endif
map! <Esc>[3~ <Delete>
map <ESC>[3~ x
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
"Remember the positions in files with some git-specific exceptions"
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$")
\ && expand("%") !~ "COMMIT_EDITMSG"
\ && expand("%") !~ "ADD_EDIT.patch"
\ && expand("%") !~ "addp-hunk-edit.diff"
\ && expand("%") !~ "git-rebase-todo" |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
" Changed default required by SuSE security team--be aware if enabling this