# Script for installing tmux on systems where you don't have root access. # tmux will be installed in $HOME/local/bin. # It's assumed that wget and a C/C++ compiler are installed.
# download source files for tmux wget -O tmux-${TMUX_VERSION}.tar.gz https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
# download source files for libevent and ncurses (这个 libevent 的下载链接是 https 的,如果不能下载的话就用本地机器下载后上传,或者自己想办法) wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
# extract files, configure, and compile
############ # libevent # ############ tar xvzf libevent-2.0.19-stable.tar.gz cd libevent-2.0.19-stable ./configure --prefix=$HOME/local --disable-shared make make install cd ..
############ # ncurses # ############ tar xvzf ncurses-5.9.tar.gz cd ncurses-5.9 ./configure --prefix=$HOME/local make make install cd ..
############ # tmux # ############ tar xvzf tmux-${TMUX_VERSION}.tar.gz cd tmux-${TMUX_VERSION} ./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include" CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make cp tmux $HOME/local/bin cd ..
# cleanup rm -rf $HOME/tmux_tmp
echo"$HOME/local/bin/tmux is now available. You can optionally add $HOME/local/bin to your PATH."
set ts=4 set expandtab autocmd BufWritePost $MYVIMRCsource$MYVIMRC set nocompatible "去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限 """""""""""""""""""""""""""""""""""""""""""""""""""" "set theme syntax enable set background=dark
"colorscheme solarized "colorscheme molokai set t_Co=256 colorscheme desert
"""""""""""""""""""""""""""""""""""""""""""""""""""" set cul "高亮光标所在行 autocmd InsertLeave * se cul " 用浅色高亮当前行 autocmd InsertEnter * se nocul " 用浅色高亮当前行 set cuc autocmd InsertLeave * se cuc " 用浅色高亮当前列 autocmd InsertEnter * se nocuc " 用浅色高亮当前列 " 设置标记一列的背景颜色和数字一行颜色一致 hi! link SignColumn LineNr hi! link ShowMarksHLl DiffAdd hi! link ShowMarksHLu DiffChange
"""""""""""""""""""""""""""""""""""""""""""""""""""" " 相对行号: 行号变成相对,可以用 nj/nk 进行跳转 set relativenumber number au FocusLost * :set norelativenumber number au FocusGained * :set relativenumber " 插入模式下用绝对行号, 普通模式下用相对 autocmd InsertEnter * :set norelativenumber number autocmd InsertLeave * :set relativenumber function! NumberToggle() if(&relativenumber == 1) set norelativenumber number else set relativenumber endif endfunc nnoremap <C-n> :call NumberToggle()<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""" "显示行数,设置软回车和缩进还有语法 set shiftwidth=4 set softtabstop=4 nnoremap ; : " 检测文件类型 filetype on " 针对不同的文件类型采用不同的缩进格式 filetype indent on " 允许插件 filetype plugin on " 启动自动补全 filetype plugin indent on set smartindent set autoindent set smarttab "syntax on """""""""""""""""""""""""""""""""""""""""""""""""""" "一旦一行的字符超出80个的话就把那些字符的背景设为红色 highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.\+/
"""""""""""""""""""""""""""""""""""""""""""""""""""" "<F5>自动运行python nnoremap <buffer> <F5> :exec '!python' shellescape(@%, 1)<cr> """""""""""""""""""""""""""""""""""""""""""""""""""" " 设置 退出vim后,内容显示在终端屏幕, 可以用于查看和复制, 不需要可以去掉 " 好处:误删什么的,如果以前屏幕打开,可以找回 set t_ti= t_te= """""""""""""""""""""""""""""""""""""""""""""""""""" " change the terminal's title set title """""""""""""""""""""""""""""""""""""""""""""""""""" " 设置文内智能搜索提示 " 高亮search命中的文本 set hlsearch " 打开增量搜索模式,随着键入即时搜索 set incsearch " 搜索时忽略大小写 set ignorecase " 有一个或以上大写字母时仍大小写敏感 set smartcase """""""""""""""""""""""""""""""""""""""""""""""""""" " 显示当前的行号列号 set ruler " 在状态栏显示正在输入的命令 set showcmd " 左下角显示当前vim模式 set showmode " 在上下移动光标时,光标的上方或下方至少会保留显示的行数 set scrolloff=7 " set winwidth=79 " 命令行(在状态行下)的高度,默认为1,这里是2 " set statusline=%<%f%h%m%r%=%k[%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",BOM\":\"\")}]%-14.(%l,%c%V%)\ %P set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%y/%m/%d\ -\ %H:%M\")} "状态行显示的内容 " Always show the status line - use 2 lines for the status bar set laststatus=2 """""""""""""""""""""""""""""""""""""""""""""""""""" set pastetoggle=<F7> " when in insert mode, press <F7> to go to " paste mode, where you can paste mass data " that won't be autoindented
" disbale paste mode when leaving insert mode au InsertLeave * set nopaste " F7 setpaste问题已解决, 粘贴代码前不需要按F7了 " F7 粘贴模式paste_mode开关,用于有格式的代码粘贴 " Automatically setpaste mode in Vim when pasting in insert mode function! XTermPasteBegin() set pastetoggle=<Esc>[201~ setpaste return"" endfunction inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
"""""""""""""""""""""""""""""""""""""""""""""""""""" " F1 废弃这个键,防止调出系统帮助 " I can type :help on my own, thanks. Protect your fat fingers from the evils of <F1> noremap <F1> <Esc>" " F2 行号开关,用于鼠标复制代码用 " 为方便复制,用<F2>开启/关闭行号显示: function! HideNumber() if(&relativenumber == &number) set relativenumber! number! elseif(&number) set number! else set relativenumber! endif set number? endfunc nnoremap <F2> :call HideNumber()<CR> " F3 显示可打印字符开关 nnoremap <F3> :set list! list?<CR> " F4 换行开关 nnoremap <F4> :set wrap! wrap?<CR> " F6 语法开关,关闭语法可以加快大文件的展示 nnoremap <F6> :exec exists('syntax_on') ? 'syn off' : 'syn on'<CR>