You are not logged in.
Offline
It's working here now ...
Offline
Mine only remembers the line I was last on, not the exact position. Unfortunately I have absolutely no idea where in the .vimrc this is explicitly stated.
Offline
Offline
" 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
Note that the normal command uses the backquote instead of the single quote, which goes to the line and column. Changing it to a single quote will just go to the line.
This code should already be in your /etc/vimrc unless it was modified.
Offline
Strange, it's working on one box (using testing repo), but not on another (not testing).
Same vim version on both, same config
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Strange it is in my /etc/vimrc
It works for root!
I wonder why my profile is ignoring it?
On another note, must be related. When I log into tty1-6 my .bashrc does not get applied, opening urxvt it does. Didn't worry about it to much until now, but now I think both problems are more than coincedence
Bizarre!
Anyone?
Offline
On another note, must be related. When I log into tty1-6 my .bashrc does not get applied, opening urxvt it does. Didn't worry about it to much until now, but now I think both problems are more than coincedence
I believe that's expected.
tty1-6 == login shells -> .bash_profile
urxvt == non login shell -> .bashrc
Though it's also possible to enable login shell mode for most terminals
IIRC, for xterm and urxvt, there is a loginShell option which can be put in .Xdefaults
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
I think (haven't checked -- using win32 at work,) I think that ~/.vimrc overrides /etc/vimrc.
Offline
@shining
Doh - Silly me at sometime I had deleted my .bash_profile. I had read about that in tty's before somewhere, but had obvioulsy forgot it. Don't think I will again Thanks for that shining
@peets
I have removed my .vimrc but the problem still occurs. I have also tried copying /etc/virc to ~/.virc and ~/.vimrc it still won't work. Thank you tho good suggestion. It's like vi is completely ignoring any configs. Wierd!!
Offline
Let me revive this..
I've found a workaround:
It looks like ~/.viminfo only gets created by root, and you will have one in your user's dir when you use sudo. Changing the ownership and group will resume normal behaviour (cursor position remembered).
But one question:
Why doesn't ~/.viminfo get created for a non-root user?
I need real, proper pen and paper for this.
Offline