From 9d066d71b75617400058c98d6baae82b85d1a388 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 17 Nov 2021 17:43:09 +0800 Subject: [PATCH] feat: upgrade tmux to 3.2a --- cli/tmux.sh | 58 +++++++++++++++++++++++------------------------- cli/vim/init.vim | 1 + 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/cli/tmux.sh b/cli/tmux.sh index fcfb098..6a74c16 100755 --- a/cli/tmux.sh +++ b/cli/tmux.sh @@ -6,37 +6,35 @@ DIR=$(dirname "$(readlink -f "$0")") log 'Setting up tmux' -if ! has_cmd tmux; then - case "$PM" in - apt) - TMUX_VER=3.2 - if ! has_cmd tmux || [ "$(tmux -V)" != "tmux $TMUX_VER" ]; then - 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 - #if in_china; then - #TMUX_SRC_URL="https://gitee.com/klesh/tmux/repository/archive/$TMUX_VER?format=tar.gz" - #fi - if [ ! -f /tmp/tmux.tar.gz ]; then - 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 +case "$PM" in + apt) + TMUX_VER=3.2a + if ! has_cmd tmux || [ "$(tmux -V)" != "tmux $TMUX_VER" ]; then + 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 + #if in_china; then + #TMUX_SRC_URL="https://gitee.com/klesh/tmux/repository/archive/$TMUX_VER?format=tar.gz" + #fi + if [ ! -f /tmp/tmux.tar.gz ]; then + curl -L "$TMUX_SRC_URL" -o /tmp/tmux.tar.gz fi - ;; - pacman) - sudo pacman -S --noconfirm --needed tmux bc - ;; - esac -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 + ;; + pacman) + sudo pacman -S --noconfirm --needed tmux bc + ;; +esac # symlink configuration lnsf "$DIR/tmux/tmux.conf" "$HOME/.tmux.conf" diff --git a/cli/vim/init.vim b/cli/vim/init.vim index 222673a..21da971 100644 --- a/cli/vim/init.vim +++ b/cli/vim/init.vim @@ -72,6 +72,7 @@ nnoremap l l nnoremap oo o nnoremap q q nnoremap x :!chmod +x % +nnoremap scb :set scrollbind!:set cursorbind! function! GetXCopyCmd()