* .vimrc2; tmux disable mouse default

* use vundle; vundle and tpm autoinstall&config

* move tpm&vundle install to install.sh

* minor color fixes in install.sh
This commit is contained in:
Dict Xiong 2022-05-21 01:59:56 +08:00 committed by GitHub
parent ada575bb9b
commit e247588a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 12 deletions

View File

@ -1,5 +1,7 @@
set -g prefix ^a
set -g mouse off
set -g default-terminal "xterm-256color"
set -g history-limit 10000
# plugins
set -g @plugin 'https://hub.fastgit.xyz/thewtex/tmux-mem-cpu-load'
@ -45,4 +47,4 @@ set -g window-status-bell-style fg=colour237,bg=colour214
# panes and windows
set -g pane-active-border-style fg=brightblue
set -g window-style fg=colour248
set -g window-active-style fg=white
set -g window-active-style fg=white

33
.vimrc2 Normal file
View File

@ -0,0 +1,33 @@
" vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'https://hub.fastgit.xyz/VundleVim/Vundle.vim'
Plugin 'https://hub.fastgit.xyz/joshdick/onedark.vim'
call vundle#end()
filetype plugin indent on
" end vundle
colorscheme onedark
set cursorline
set syntax=on
set autoindent
set smartindent
set tabstop=4
set expandtab "spaces instead of tabs
set number "line numbers
set history=1000
set ignorecase "when searching
set smartcase "but not when containing upper case chars
set linebreak
"set termguicolors "true color
set completeopt=preview,menu "auto complete
set laststatus=2 "always show statusline
hi User1 ctermfg=14 ctermbg=236
hi User2 ctermfg=237 ctermbg=214
hi User3 ctermfg=15 ctermbg=2
au InsertEnter * hi User3 ctermfg=15 ctermbg=5
au InsertLeave * hi User3 ctermfg=15 ctermbg=2
set statusline=%3*\ %{mode()}\ %*[%n][%F](%{\"\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\"+\":\"\").\"\"},%{&ff},%Y)%2*%r%1*%m%*%<%=\'0x%B\'\ [Line:%l/%L,Col:%c][%p%%]

View File

@ -61,15 +61,6 @@ antigen theme ${ZSH_THEME:-ys}
antigen apply
# end of antigen config
# install tmux tpm
TMUX_TPM="$HOME/.tmux/plugins/tpm"
command -v tmux > /dev/null 2>&1
if [[ $? == 0 && ! -d "$TMUX_TPM" ]]; then
git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM"
fi
# end of tpm
# functions
export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
dfs()

View File

@ -173,7 +173,6 @@ delete_link_if_match()
fi
}
install_crontab(){
fmt_note "installing \"$crontab_job\" to crontab ..."
( crontab -l | grep -vxF "${crontab_job}" | grep -v "no crontab for"; echo "$crontab_job" ) | crontab -
@ -184,11 +183,42 @@ uninstall_crontab(){
( crontab -l | grep -vxF "$crontab_job" ) | crontab -
}
install_tmux_tpm(){
TMUX_TPM="$HOME/.tmux/plugins/tpm"
command -v tmux > /dev/null 2>&1
if [[ $? == 0 && ! -d "$TMUX_TPM" ]]; then
fmt_note "installing tmux tpm ..."
git clone https://hub.fastgit.xyz/tmux-plugins/tpm "$TMUX_TPM"
command -v g++ > /dev/null 2>&1
if [[ $? == 0 ]]; then
fmt_note "initializing tmux plugins ..."
~/.tmux/plugins/tpm/bin/install_plugins
else
fmt_warning "pls install g++ and init tmux plugins by <prefix + I>"
fi
fi
}
install_vim_vundle(){
VIM_VUNDLE="$HOME/.vim/bundle/Vundle.vim"
command -v vim > /dev/null 2>&1
if [[ $? == 0 && ! -d "$VIM_VUNDLE" ]]; then
fmt_note "installing vim vundle ..."
git clone https://hub.fastgit.xyz/gmarik/Vundle.vim.git "$VIM_VUNDLE"
fmt_note "initializing vim plugins ..."
vim +PluginInstall +qall
fi
}
install(){
install_crontab
insert_if_not_exist "${HOME}/.zshrc" "source ${dotfile_home_path}/.zshrc2"
insert_if_not_exist "${HOME}/.tmux.conf" "source-file ${dotfile_home_path}/.tmux.conf2"
insert_if_not_exist "${HOME}/.vimrc" "source ${dotfile_home_path}/.vimrc2"
create_symlink "${dotfile_path}/.ssh/authorized_keys2" "${HOME}/.ssh/authorized_keys2"
# those that won't be uninstalled in the future
install_tmux_tpm
install_vim_vundle
fmt_note "done installing!"
}
@ -198,6 +228,7 @@ uninstall(){
uninstall_crontab
delete_if_exist "${HOME}/.zshrc" "source ${dotfile_home_path}/.zshrc2"
delete_if_exist "${HOME}/.tmux.conf" "source-file ${dotfile_home_path}/.tmux.conf2"
delete_if_exist "${HOME}/.vimrc" "source ${dotfile_home_path}/.vimrc2"
delete_link_if_match "${dotfile_path}/.ssh/authorized_keys2" "${HOME}/.ssh/authorized_keys2"
fmt_note "done uninstalling!"
fi
@ -207,5 +238,5 @@ setup_color
case $1 in
""|-i ) install ;;
-r ) uninstall ;;
* ) echo "unknown command \"$1\". available: -i, -r" ;;
* ) fmt_warning "unknown command \"$1\". available: -i, -r" ;;
esac