Adds files to make vim USB-portable
This commit is contained in:
parent
9b714a32bb
commit
4e5f3f8846
22 changed files with 351 additions and 0 deletions
36
usbify/vim/vim_point_to_usb.sh
Executable file
36
usbify/vim/vim_point_to_usb.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script points the .vim directory to a USB to increase portability
|
||||
# it will toggle between modes
|
||||
|
||||
if [ -L "$HOME/.vim" ]; then
|
||||
echo "Already pointing to USB. Toggling back..."
|
||||
|
||||
# remove the symlink and .vimrc
|
||||
rm "$HOME/.vim"
|
||||
|
||||
# remove the USB's version of the .vimrc and use the backed-up copy
|
||||
rm "$HOME/.vimrc"
|
||||
mv "$HOME/.vimrc.bak" "$HOME/.vimrc"
|
||||
|
||||
# rename the .vim.bak directory
|
||||
mv "$HOME/.vim.bak" "$HOME/.vim"
|
||||
|
||||
echo ".vim now points to $HOME/.vim"
|
||||
else
|
||||
echo "Not pointing to USB. Getting to work..."
|
||||
|
||||
# rename the current .vim directory and .vimrc
|
||||
mv "$HOME/.vim" "$HOME/.vim.bak"
|
||||
mv "$HOME/.vimrc" "$HOME/.vimrc.bak"
|
||||
|
||||
# point the $HOME/.vim name to the USB for source routing
|
||||
# use the USB drive's copy of .vimrc
|
||||
ln -s /Volumes/Untitled\ 1/.vim "$HOME/.vim"
|
||||
cp /Volumes/Untitled\ 1/.vimrc "$HOME/"
|
||||
|
||||
echo ".vim now points to /Volumes/Untitled\ 1/.vim"
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue