From 4b9e5cd03c52c2a9eec477abd4d9ffc6adf31bf3 Mon Sep 17 00:00:00 2001 From: shaoying Date: Wed, 19 Sep 2018 22:56:36 +0800 Subject: [PATCH] tce add vim --- etc/dotsfile/.tmux.conf | 31 ++++++++++++++++++------------- etc/dotsfile/.vimrc | 33 ++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/etc/dotsfile/.tmux.conf b/etc/dotsfile/.tmux.conf index ac7e0b53..f7047c57 100644 --- a/etc/dotsfile/.tmux.conf +++ b/etc/dotsfile/.tmux.conf @@ -1,4 +1,4 @@ -# 配置管理 +# 配置管理{{{ set -g prefix C-s set -g base-index 1 @@ -9,12 +9,18 @@ setw -g pane-base-index 1 set -g mode-keys vi set -g history-limit 50000 -bind Space command-prompt +set -g allow-rename off +set -g renumber-windows on -# 窗口管理 +bind Space command-prompt +# }}} +# 窗口管理{{{ bind w choose-window bind q confirm-before kill-window +bind f command-prompt -p "find window:" "find-window -N '%%'" +bind e command-prompt -p "window new name:" "rename-window '%%'" + bind c new-window bind o last-window @@ -29,8 +35,8 @@ bind 3 select-window -t :3 bind 4 select-window -t :4 bind 5 select-window -t :5 bind 6 select-window -t :6 - -# 面板管理 +# }}} +# 面板管理{{{ bind i display-panes bind x confirm-before -p "kill-pane #P? (y/n)" kill-pane @@ -48,16 +54,16 @@ bind C-l command-prompt -p "size:" "resize-pane -R %%" bind C-j command-prompt -p "size:" "resize-pane -D %%" bind C-k command-prompt -p "size:" "resize-pane -U %%" bind C-m command-prompt -p "move pane from:,to:" "swap-pane -s %% -t %%" - -# 缓存管理 +# }}} +# 缓存管理{{{ bind C-s copy-mode bind C-d clear-history bind a choose-buffer bind z paste-buffer +# }}} - -# tmux 1.x +# tmux 1.x{{{ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -lt '2' ]" "\ bind -t vi-copy e scroll-down; \ bind -t vi-copy y scroll-up; \ @@ -73,9 +79,8 @@ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -lt '2' ]" "\ set -g mouse-select-window on; \ set -g mouse-select-pane on; \ set -g mouse-resize-pane on; \ - " - -# tmux 2.x + "# }}} +# tmux 2.x{{{ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -gt '1' ]" "\ bind -T copy-mode-vi y send-keys -X scroll-down; \ bind -T copy-mode-vi e send-keys -X scroll-up; \ @@ -87,4 +92,4 @@ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -gt '1' ]" "\ bind -T copy-mode-vi c send-keys -X copy-selection; \ set -g mouse on; \ " - +# }}} diff --git a/etc/dotsfile/.vimrc b/etc/dotsfile/.vimrc index 3bb204e3..3b740c7b 100644 --- a/etc/dotsfile/.vimrc +++ b/etc/dotsfile/.vimrc @@ -1,7 +1,15 @@ +"安装plug-vim {{{ +"$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +" +"安装vim各种插件 +":PlugInstall +" +"}}} "加载插件"{{{ call plug#begin() Plug 'vim-scripts/tComment' Plug 'tpope/vim-fugitive' +Plug 'airblade/vim-gitgutter' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'ntpeters/vim-better-whitespace' @@ -35,17 +43,28 @@ Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' Plug 'vim-scripts/python.vim' +Plug 'mbbill/echofunc' Plug 'vim-syntastic/syntastic' +let g:syntastic_quiet_messages = { "regex": [ + \ "Missing module docstring", + \ "Missing class docstring", + \ "Missing function docstring", + \ "Wrong continued indentation", + \ "Line Too Long", + \ "defined outside __init__", + \ ] } + Plug 'Valloric/YouCompleteMe' +let g:syntastic_enable_signs = 1 let g:ycm_confirm_extra_conf=0 nnoremap gd :YcmCompleter GoToDeclaration Plug 'benmills/vimux' let mapleader=";" -nnoremap vp :VimuxPromptCommand -nnoremap vl :VimuxRunLastCommand -nnoremap vx :VimuxInterruptRunner -nnoremap vz :VimuxZoomRunner +nnoremap ; :VimuxPromptCommand +" nnoremap j :VimuxZoomRunner +" nnoremap l :VimuxRunLastCommand +" nnoremap vx :VimuxInterruptRunner Plug 'vim-scripts/matrix.vim--Yang' call plug#end() @@ -66,6 +85,7 @@ set tabstop=4 set shiftwidth=4 set cindent set expandtab +set backspace=indent,eol,start set showmatch set matchtime=2 @@ -103,9 +123,12 @@ cnoremap jk "}}} " 编程配置{{{ set keywordprg=man\ -a -command! RR wa | source ~/.vimrc |e autocmd BufNewFile,BufReadPost *.shy set filetype=shy autocmd BufNewFile,BufReadPost *.shy set commentstring=#%s autocmd BufNewFile,BufReadPost *.conf set filetype=nginx + +command! RR wa | source ~/.vimrc |e + +source ~/.vim_local "}}}