commit b41a56150a49103c89382e74e46f6d695fee568e (patch)
parent 441d4ebdb173b74d8b03c93ecf8cbe5a23ede13b
Author: Alexander Karle <akarle@umass.edu>
Date: Thu, 24 May 2018 16:04:05 -0400
Add optional install of git-completion for bash
Diffstat:
2 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/bash/bashrc b/bash/bashrc
@@ -24,3 +24,9 @@ HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
+
+# Added by fzf
+[ -f ~/.fzf.bash ] && source ~/.fzf.bash
+
+# Git Completion
+[ -f ~/.bash/git-completion.bash ] && source ~/.git-completion.bash
diff --git a/install.sh b/install.sh
@@ -98,6 +98,24 @@ try_ln() {
fi
}
+install_via_curl() {
+ echo "Would you like to install $1 (via curl)"
+ select opt in "Yes" "No"; do
+ case $opt in
+ "Yes" )
+ curl -fLo "$3" --create-dirs "$2"
+ break
+ ;;
+ "No" )
+ echo "Not installing $1"
+ break
+ ;;
+ esac
+ done
+ echo ""
+ echo ""
+}
+
# First, backup old copies
if [ -d $HOMEDOTS ]; then
BACKUP="${HOMEDOTS}_backup_$(date +%s)"
@@ -115,6 +133,7 @@ success_msg "Clone successful! Putting you on your own branch '$(whoami)' so you
try_ln $DOTSVIM/vimrc $HOME/.vimrc
try_ln $HOMEDOTS/tmux.conf $HOME/.tmux.conf
try_ln $HOMEDOTS/zsh/zshrc $HOME/.zshrc
+try_ln $HOMEDOTS/inputrc $HOME/.inputrc
for file in $HOMEDOTS/bash/*; do
[ -e "$file" ] || continue
@@ -129,22 +148,22 @@ try_ln $HOMEDOTS/vim $VIMHOME
try_mkdir $VIMHOME/undo
try_mkdir $VIMHOME/swp
-# Optional install of vim-plug:
printf "\n\n"
-echo "Would you like to install vim-plug (via curl)"
-select opt in "Yes" "No"; do
- case $opt in
- "Yes" )
- curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
- https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- break
- ;;
- "No" )
- echo "Not installing vim-plug"
- break
- ;;
- esac
-done
+
+# Optional installs via curl:
+if [ -x "$(command -v curl)" ]; then
+ # vim-plug
+ install_via_curl \
+ "vim-plug" \
+ "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" \
+ "$HOME/.vim/autoload/plug.vim"
+
+ # git bash/zsh completion
+ install_via_curl \
+ "bash completion" \
+ "https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" \
+ "$HOME/.bash/git-completion.bash"
+fi
# Logo a la oh-my-zsh (for funsies)
printf ${MAGENTA}