In my bash profile I create a variable called SCRIPTS to use in the future and I add it to my PATH variable like this:
SCRIPTS="~/Code/Scripts"
PATH="${PATH}:${SCRIPTS}"
export PATH
export SCRIPTS
I have a file in the directory ~/Code/Scripts called CA.sh, if I type
vim ~/Code/Scripts/CA.sh
I can open that file but and edit it through vim, but if I type
vim $SCRIPTS/CA.sh
or
vim ${SCRIPTS}/CA.sh
it opens an empty vim window so it looks like a new file and at the very bottom, it says "~/Code/Scripts/CA.sh" [New DIRECTORY] and I can not write to file because vim says E212: Can't open file for writing. How do I make it so that vim opens the existing file I want it to and why is using a variable from bash making vim act this way?