views:

164

answers:

1

Problem 1: my Vim makes backups with the extension ~ to my root

I have the following line in my .vimrc

set backup backupdir=~/tmp/vim//,~/tmp//,.//,/var/tmp//,/tmp//$

However, I cannot see a root directory in the line.

Why does my Vim make backups of my shell scripts with the extension ~ to my root?


Problem 2: my Zsh run my shell scripts at login which I have in my PATH. For instance, my "replaceUp" shell-script started at my root at login. I keep it at ~/bin/shells/apps by default.

Why does Zsh run shell scripts which are in my PATH at login?

+5  A: 

The files ending with ~ are swap files used by vim while editing files. You can try setting the backupdir and directory variables

set backupdir=~/tmp/vim//,~/tmp//,.//,/var/tmp//,/tmp//
set directory=~/tmp/vim//,~/tmp//,.//,/var/tmp//,/tmp//
shyam
Why do you write double slashes after directory names (does it mean something?) What does the $-sign do? I would just write "set backupdir=~/tmp/vim,~/tmp,.,/var/tmp,/tmp"
hcs42
@hcs42: Thank you for pointing that out! The dollars caused me some unexpected problems.
Masi