Yakov Lerner wrote:
I suggest new flag for 'viminfo'; flag to turn on the *last-position-jump*
functionality (say, letter j). Such it will be much easier method to
turn on the last-position-jump functionality. With new flag, it will be
mere:
:set viminfo='20,<50,s10,j
or
:set viminfo+=j
-- as easy as addding flag j to 'viminfo'.
Currently, the magic sequence to turn on the *last-position-jump*
:set viminfo='20,<50,s10
augroup lastPositionJump
au!
autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <=
line("$") |
\ exe "normal g`\"" |endif
augroup END
This proves difficult for novice vim user to figure out even with the
help of vimhelp.
It's demanded and requested features, why not to make it easier to turn
on ?
I mean that internally, new flag would add/remove that same autocmd.
It's not difficult to implement, right ? And it's backward-compatible.
Can I make a patch ?
Yakov
The viminfo includes all the necessary information accordig to the '
suboption. What you suggest is adding a flag to the 'viminfo' option, which
would change nothing in the viminfo file contents, but define or undefine an
autocommand.
The required autocommand can be included as follows (which is what I
recommend, and should not be hard to figure even for a beginner):
Near the top of your vimrc, include either
source $VIMRUNTIME/vimrc_example.vim
or
runtime vimrc_example.vim
(Both lines do the same thing.)
The vimrc_example sets a lot of useful settings (such as setting up filetype
detection, syntax highlighting, and, in gvim, defining the menus). Any setting
it sets can be tweaked or overridden by vimrc lines placed after the line
which invokes the vimrc_example, or, in rare cases (such as the language of
messages and menus) before it.
Best regards,
Tony.