Good: it annoyed me too. I have a team (Arch Linux: Krusader file manager)
vim --remote
which allows me to right-click a file in Krusader and open that file in Vim. I also save Vim sessions through my ~ / .vimrc:
" Save session on quitting Vim: autocmd! VimLeave * mksession! ~/.vim/vim_session.vim " mksession! overwrites old session " Restore session on starting Vim: autocmd! VimEnter * source ~/.vim/vim_session.vim
However, the files that I open externally through "vim -remote", for example,
/mnt/Vancouver/Programming/scripts/chunk.sh
persistently persist between sessions, even after doing the usual: BD,: bw, bw: bw! commands and / or deleting a vim session file.
Looking at the vim_session.vim file, I noticed the line "argadd" with an abusive, persistent file:
argadd /mnt/Vancouver/Programming/scripts/chunk.sh
So,
:help arglist :argd /mnt/Vancouver/Programming/scripts/chunk.sh
removes this argument.
Finally, after deleting this file from the buffer list (: bd) and restarting Vim, the previous session will be restored, minus this file.
Edit: if you don't want to enter long paths when executing the ": argd" command, and you don't need anything that is specified in ": arg", just do
:argd*
Victoria stuart
source share