With this in vimrc, invoking Vim without arguments will open the last file (it will get the last file and position from .viminfo). " Go to last file if invoked without arguments. autocmd VimEnter * nested if \ argc() == 0 && \ bufname("%") == "" && \ bufname("2" + 0) != "" | \ exe "normal! `0" | \ endif " From vimrc_example.vim distributed with Vim 7. " 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("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif
Attributes | Values |
---|---|
rdfs:label |
|
rdfs:comment |
|
Version |
|
dbkwik:vim/property/wikiPageUsesTemplate | |
Previous |
|
Author |
|
Complexity |
|
Created |
|
ID |
|
NEXT |
|
Rating |
|
abstract |
|