Skip to content

Commit

Permalink
Update the ways things are installed
Browse files Browse the repository at this point in the history
Put vim's swp files into a separate dir so that they don't end up in the
git repo.

Link all files and directories explicitly to avoid accidentally linking
stuff like .gitignore.

Handle .ssh/config specially, because it does not live at the top level.
  • Loading branch information
ccg committed Oct 10, 2022
1 parent 4c7f811 commit 894ef66
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ set showcmd
syntax on

" Keep all those pesky .swp files in one place.
set directory=~/.vim/tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vimtmp,~/tmp,/var/tmp,/tmp

" Only use one space between sentences when joining lines or
" reformatting paragraphs.
Expand Down
31 changes: 13 additions & 18 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh

# First, make sure all the submodules are checked out
git submodule update --init --recursive
# TODO: Delete this if no longer needed.
#git submodule update --init --recursive

link() {
src="$1"
Expand All @@ -23,25 +24,19 @@ link() {
fi
}

# dot files (not directories)
for i in .*
do
if [ ! -d "$i" ]
then
link "$PWD/$i" "$HOME/$i"
fi
done
SSH_DIR="$HOME/.ssh"

# dot directories
# required directories
mkdir -p "$SSH_DIR"
mkdir -p "$HOME/.nvm"
mkdir -p "$HOME/.vimtmp"

# dot files and directories
# by inclusion, so things like '..' and '.git' don't get in there accidentally
for i in .vim
for i in .vim .vimrc .zshrc
do
[ -d "$i" ] && link "$PWD/$i" "$HOME/$i"
link "$PWD/$i" "$HOME/$i"
done

# special cases
SSH_DIR="$HOME/.ssh"
mkdir -p "$SSH_DIR"
link .ssh/config "${SSH_DIR}/config"

mkdir -p "$HOME/.vim/tmp/"
# files not at the top level
link "${PWD}/.ssh/config" "${SSH_DIR}/config"

0 comments on commit 894ef66

Please sign in to comment.