feat: upgrade tmux to 3.2a

This commit is contained in:
Klesh Wong 2021-11-17 17:43:09 +08:00
parent 20fc2e210a
commit 9d066d71b7
2 changed files with 29 additions and 30 deletions

View File

@ -6,37 +6,35 @@ DIR=$(dirname "$(readlink -f "$0")")
log 'Setting up tmux' log 'Setting up tmux'
if ! has_cmd tmux; then case "$PM" in
case "$PM" in apt)
apt) TMUX_VER=3.2a
TMUX_VER=3.2 if ! has_cmd tmux || [ "$(tmux -V)" != "tmux $TMUX_VER" ]; then
if ! has_cmd tmux || [ "$(tmux -V)" != "tmux $TMUX_VER" ]; then sudo apt install libevent-dev libncurses5-dev bison autoconf bc -y
sudo apt install libevent-dev libncurses5-dev bison autoconf bc -y TMUX_SRC_URL=https://github.com/tmux/tmux/releases/download/$TMUX_VER/tmux-$TMUX_VER.tar.gz
TMUX_SRC_URL=https://github.com/tmux/tmux/releases/download/$TMUX_VER/tmux-$TMUX_VER.tar.gz #if in_china; then
#if in_china; then #TMUX_SRC_URL="https://gitee.com/klesh/tmux/repository/archive/$TMUX_VER?format=tar.gz"
#TMUX_SRC_URL="https://gitee.com/klesh/tmux/repository/archive/$TMUX_VER?format=tar.gz" #fi
#fi if [ ! -f /tmp/tmux.tar.gz ]; then
if [ ! -f /tmp/tmux.tar.gz ]; then curl -L "$TMUX_SRC_URL" -o /tmp/tmux.tar.gz
curl -L "$TMUX_SRC_URL" -o /tmp/tmux.tar.gz
fi
rm -rf /tmp/tmux
mkdir -p /tmp/tmux
tar zxvf /tmp/tmux.tar.gz -C /tmp/tmux --strip 1
cd /tmp/tmux
if [ -f autogen.sh ]; then
sh autogen.sh
fi
./configure && make
sudo make install
cd -
rm -rf /tmp/tmux
fi fi
;; rm -rf /tmp/tmux
pacman) mkdir -p /tmp/tmux
sudo pacman -S --noconfirm --needed tmux bc tar zxvf /tmp/tmux.tar.gz -C /tmp/tmux --strip 1
;; cd /tmp/tmux
esac if [ -f autogen.sh ]; then
fi sh autogen.sh
fi
./configure && make
sudo make install
cd -
rm -rf /tmp/tmux
fi
;;
pacman)
sudo pacman -S --noconfirm --needed tmux bc
;;
esac
# symlink configuration # symlink configuration
lnsf "$DIR/tmux/tmux.conf" "$HOME/.tmux.conf" lnsf "$DIR/tmux/tmux.conf" "$HOME/.tmux.conf"

View File

@ -72,6 +72,7 @@ nnoremap <leader>l <C-w>l
nnoremap <leader>oo <C-w>o nnoremap <leader>oo <C-w>o
nnoremap <leader>q <C-w>q nnoremap <leader>q <C-w>q
nnoremap <leader>x :!chmod +x %<Cr> nnoremap <leader>x :!chmod +x %<Cr>
nnoremap <leader>scb :set scrollbind!<Cr>:set cursorbind!<Cr>
function! GetXCopyCmd() function! GetXCopyCmd()