core: Install bat/delta
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ emacs.d/auto-save-list
|
||||
emacs.d/history
|
||||
emacs.d/recentf
|
||||
bin/delta*
|
||||
bin/bat*
|
||||
|
||||
25
install
25
install
@@ -3,12 +3,12 @@
|
||||
# Adapted from Junegunn Choi (junegunn.c@gmail.com)
|
||||
# https://github.com/junegunn/dotfiles/blob/master/install
|
||||
|
||||
# RC files
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
|
||||
|
||||
BASE=$(pwd)
|
||||
# touch bashrc-extra
|
||||
EXA_VER=
|
||||
|
||||
# RC files
|
||||
|
||||
mkdir -pv bak
|
||||
for rc in *rc *profile tmux.conf bashrc.d mutt ; do
|
||||
@@ -22,16 +22,12 @@ for rc in *rc *profile tmux.conf bashrc.d mutt ; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Delta
|
||||
DELTA_VER=0.4.1
|
||||
if [ "$(uname -s)" == 'Darwin' ]; then
|
||||
DELTA_PATH=delta-${DELTA_VER}-x86_64-apple-darwin
|
||||
elif [ "$(uname -s)" == 'Linux' ] ; then
|
||||
DELTA_PATH=delta-${DELTA_VER}-x86_64-unknown-linux-gnu
|
||||
fi
|
||||
DELTA_URL=https://github.com/dandavison/delta/releases/download/${DELTA_VER}/${DELTA_PATH}.tar.gz
|
||||
echo "Installing Delta $DELTA_PATH"
|
||||
(curl -L ${DELTA_URL} | tar xzf - "${DELTA_PATH}/delta") && mv ${DELTA_PATH}/delta $BASE/bin/delta-${DELTA_VER} && ln -s $BASE/bin/delta-${DELTA_VER} $BASE/bin/delta && rm -r ${DELTA_PATH}
|
||||
for s in install_*.bash ; do
|
||||
source $s
|
||||
done
|
||||
|
||||
install_delta
|
||||
install_bat
|
||||
|
||||
# git-prompt
|
||||
# if [ ! -e ~/.git-prompt.sh ]; then
|
||||
@@ -80,8 +76,11 @@ fi
|
||||
|
||||
git config --global user.email "paul@blacksun.org.uk"
|
||||
git config --global user.name "Paul Walker"
|
||||
|
||||
git config --global core.pager "delta --line-numbers --dark"
|
||||
git config --global delta.side-by-side true
|
||||
# git config --global delta.syntax-theme Dracula
|
||||
git config --global delta.syntax-theme "Solarized (dark)"
|
||||
# git config --global user.signingKey FEF9C627
|
||||
# git config --global commit.gpgsign true
|
||||
|
||||
|
||||
11
install_bat.bash
Normal file
11
install_bat.bash
Normal file
@@ -0,0 +1,11 @@
|
||||
BAT_VER=v0.15.4
|
||||
install_bat() {
|
||||
if [ "$(uname -s)" == 'Darwin' ]; then
|
||||
bat_PATH=bat-${BAT_VER}-x86_64-apple-darwin
|
||||
elif [ "$(uname -s)" == 'Linux' ] ; then
|
||||
bat_PATH=bat-${BAT_VER}-x86_64-unknown-linux-gnu
|
||||
fi
|
||||
bat_URL=https://github.com/sharkdp/bat/releases/download/${BAT_VER}/${bat_PATH}.tar.gz
|
||||
echo "Installing bat $bat_PATH"
|
||||
((curl -L ${bat_URL} | tar xzf - "${bat_PATH}/bat") && mv ${bat_PATH}/bat $BASE/bin/bat-${BAT_VER} && ln -sf $BASE/bin/bat-${BAT_VER} $BASE/bin/bat && rm -r ${bat_PATH}) || exit 1
|
||||
}
|
||||
11
install_delta.bash
Normal file
11
install_delta.bash
Normal file
@@ -0,0 +1,11 @@
|
||||
DELTA_VER=0.4.1
|
||||
install_delta() {
|
||||
if [ "$(uname -s)" == 'Darwin' ]; then
|
||||
DELTA_PATH=delta-${DELTA_VER}-x86_64-apple-darwin
|
||||
elif [ "$(uname -s)" == 'Linux' ] ; then
|
||||
DELTA_PATH=delta-${DELTA_VER}-x86_64-unknown-linux-gnu
|
||||
fi
|
||||
DELTA_URL=https://github.com/dandavison/delta/releases/download/${DELTA_VER}/${DELTA_PATH}.tar.gz
|
||||
echo "Installing Delta $DELTA_PATH"
|
||||
((curl -L ${DELTA_URL} | tar xzf - "${DELTA_PATH}/delta") && mv ${DELTA_PATH}/delta $BASE/bin/delta-${DELTA_VER} && ln -sf $BASE/bin/delta-${DELTA_VER} $BASE/bin/delta && rm -r ${DELTA_PATH}) || exit 1
|
||||
}
|
||||
11
install_exa.bash
Normal file
11
install_exa.bash
Normal file
@@ -0,0 +1,11 @@
|
||||
EXA_VER=v0.9.0
|
||||
install_exa() {
|
||||
if [ "$(uname -s)" == 'Darwin' ]; then
|
||||
EXA_PATH=exa-${EXA_VER}-x86_64-apple-darwin
|
||||
elif [ "$(uname -s)" == 'Linux' ] ; then
|
||||
EXA_PATH=exa-${EXA_VER}-x86_64-unknown-linux-gnu
|
||||
fi
|
||||
EXA_URL=https://github.com/ogham/exa/releases/download/${EXA_VER}/${EXA_PATH}.zip
|
||||
echo "Installing exa $EXA_PATH"
|
||||
((curl -L ${EXA_URL} | tar xzf - "${EXA_PATH}/exa") && mv ${EXA_PATH}/exa $BASE/bin/exa-${EXA_VER} && ln -sf $BASE/bin/exa-${EXA_VER} $BASE/bin/exa && rm -r ${EXA_PATH}) || exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user