On 10/7/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
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 ? I think finding the "j" flag in the 'viminfo' option is much harder than finding the hint to source the $VIMRUNTIME/vimrc_example.vim script. Also keep in mind that sometimes jumping to some position is undesired, thus we would also need a mechanism to disable it.
Of course, 'set viminfo-j' would remove the autocommand (like augroup lastPositionJump|au!|augroup END). But maybe 'set autojump' then ? (With 'noautojump' removing the autocommand ? Every time I look at the {autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g`\"" |endif} sequence , I get a feeling like the switch which would need to be acessible and reachable inside the car near the driver seat, was palced under the hood near the engine, and when one needs to access it, you need to get out of the car and open the hood. Yakov