服务器的一些实用的配置技巧
SSH连接后自动实用Tmux
SSH在使用过程中可能会遇到网络不稳定,或者连接超时等情况,致使连接中断,这个时候,使用Tmux或者Screen就很有必要了。
# start tmux if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then tmux attach || tmux new fi
## /etc/profile export TERM=xterm if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then tmux has 2> /dev/null || tmux new-session -s new_ssh_tmux && tmux attach or #test -z "$TMUX" && (tmux attach || tmux new-session) fi
更改TMUX的
perfix_key
,下面的配置将`
作为perfix_key
# ~/.tmux.conf set -g prefix ` unbind C-b bind ` send-prefix
VIM配置
set nu set cul set fileencodings=utf-8 set termencoding=utf-8 set encoding=utf-8 set listchars=tab:>-,trail:- set t_Co=256 set tabstop=2 set autoindent set shiftwidth=4 set softtabstop=2 set relativenumber set textwidth=80 set nowrap set scrolloff=5 set sidescrolloff=15 set incsearch set showmatch set hlsearch set smartcase set undofile set spell spelllang=en_us set backupdir=~/.vim/.backup// set directory=~/.vim/.swp// set undodir=~/.vim/.undo// set noerrorbells set visualbell set history=1000 set autoread syntax on filetype indent on