From 3e315db0beb608519e616cd3df016a23c5643923 Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Thu, 19 Oct 2017 13:28:37 +0800 Subject: [PATCH] Fix leader config error Signed-off-by: Ein Verne --- .vim/startup/vundle_vimrc | 1 + .vimrc | 67 ++++++++++++++++++++++++++++----------- README.md | 29 ++++++++++++++--- install.sh | 16 ++++++---- 4 files changed, 84 insertions(+), 29 deletions(-) diff --git a/.vim/startup/vundle_vimrc b/.vim/startup/vundle_vimrc index 69c4055..4260301 100644 --- a/.vim/startup/vundle_vimrc +++ b/.vim/startup/vundle_vimrc @@ -39,6 +39,7 @@ Plugin 'WolfgangMehner/vim-plugins' Plugin 'L9' Plugin 'perl-support.vim' Plugin 'christoomey/vim-tmux-navigator' +Plugin 'tpope/vim-surround' " Git plugin not hosted on GitHub Plugin 'git://git.wincent.com/command-t.git' diff --git a/.vimrc b/.vimrc index b4fd430..d84c41e 100644 --- a/.vimrc +++ b/.vimrc @@ -9,22 +9,6 @@ else let g:isGUI = 0 endif - -" 引用vundle_vimrc -" 引用python_vimrc配置文件 -if g:iswindows - source $VIM/vundle_vimrc - source $VIM/python_vimrc -else - source $HOME/.vim/startup/vundle_vimrc - source $HOME/.vim/startup/python_vimrc - source $HOME/.vim/startup/map_vimrc - source $HOME/.vim/startup/plugin_vimrc -endif - -" source $VIMRUNTIME/vimrc_example.vim -" source $VIMRUNTIME/mswin.vim - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -63,8 +47,8 @@ endif " 如下命令使鼠标用起来象微软 Windows " behave mswin -" 高亮整行 -set cursorline +" 高亮整行 只在普通模式下开启 +set cursorline " always show current position set ruler @@ -219,6 +203,35 @@ set statusline+=%3*%c, "column set statusline+=%l/%L "line no/all line" set statusline+=\ %P +" 在普通模式下用块状光标,在插入模式下用条状光标(形状类似英文 "I" +" 的样子),然后在替换模式中使用下划线形状的光标。 +if empty($TMUX) + let &t_SI = "\]50;CursorShape=1\x7" + let &t_EI = "\]50;CursorShape=0\x7" + if v:version >= 800 + let &t_SR = "\]50;CursorShape=2\x7" + endif +else + let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" + let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" + if v:version >= 800 + let &t_SR = "\Ptmux;\\]50;CursorShape=2\x7\\\" + endif +endif + +if &term =~ "xterm\\|rxvt" + " use an orange cursor in insert mode + let &t_SI = "\]12;orange\x7" + " use a red cursor otherwise + let &t_EI = "\]12;gray\x7" + silent !echo -ne "\033]12;gray\007" + " reset cursor when vim exits + autocmd VimLeave * silent !echo -ne "\033]112\007" + " use \003]12;gray\007 for gnome-terminal and rxvt up to version 9.21 +endif + +autocmd InsertLeave,WinEnter * set cursorline +autocmd InsertEnter,WinLeave * set nocursorline @@ -269,3 +282,21 @@ function! MyDiff() endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction + +" 依据 https://stackoverflow.com/a/8218188/1820217 将 Plugin map +" 移到最后,使得 leader 生效 +" 引用vundle_vimrc +" 引用python_vimrc配置文件 +if g:iswindows + source $VIM/vundle_vimrc + source $VIM/python_vimrc +else + source $HOME/.vim/startup/vundle_vimrc + source $HOME/.vim/startup/python_vimrc + source $HOME/.vim/startup/map_vimrc + source $HOME/.vim/startup/plugin_vimrc +endif + +" source $VIMRUNTIME/vimrc_example.vim +" source $VIMRUNTIME/mswin.vim + diff --git a/README.md b/README.md index ecd651f..e2c7097 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ This is my vim conf file. vundle相关配置在vundle_vimrc中,用vundle管理插件,插件列表`:PluginList`查看 + python相关配置在python_vimrc中 ## Instruction under Linux Just run `./install.sh`, everything is done. Then Enter the vim run `:PluginInstall` to install all plugins. +### install manually Or, you can do it manually follow the step: -Install Vundle to `~/.vim/` directory. +1. Install Vundle to `~/.vim/` directory. git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim -Enter vim, run `:PluginInstall`, after install all plugin, you will meet an error, +2. Enter vim, run `:PluginInstall`, after install all plugin, you will meet an error, > Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded. -I find a solution on [StackOverflow](http://stackoverflow.com/questions/7454796/taglist-exuberant-ctags-not-found-in-path) - For Ubuntu and derivatives: sudo apt-get install exuberant-ctags @@ -27,3 +27,24 @@ with yum: sudo yum install ctags-etags +## Plugin + + Plugin 'VundleVim/Vundle.vim' + Plugin 'tpope/vim-fugitive' + Plugin 'godlygeek/tabular' + Plugin 'plasticboy/vim-markdown' + Plugin 'scrooloose/nerdtree' + Plugin 'davidhalter/jedi-vim' + Plugin 'ervandew/supertab' + Plugin 'Raimondi/delimitMate' + Plugin 'tomasr/molokai' + Plugin 'nathanaelkane/vim-indent-guides' + Plugin 'vim-scripts/taglist.vim' + Plugin 'WolfgangMehner/vim-plugins' + Plugin 'L9' + Plugin 'perl-support.vim' + Plugin 'christoomey/vim-tmux-navigator' + Plugin 'tpope/vim-surround' + Plugin 'git://git.wincent.com/command-t.git' + + diff --git a/install.sh b/install.sh index 74947d5..3b0cc8f 100755 --- a/install.sh +++ b/install.sh @@ -14,19 +14,21 @@ if [ "$use_vim_configs" == "Y" ] || [ "$use_vim_configs" == "y" ]; then mv $VIMDIR/.vimrc $VIMDIR/.vimrc.old echo "origin .vimrc has been moved to .vimrc.old" fi - ln -s $PWD/.vim $VIMDIR/.vim 2> /dev/null - ln -s $PWD/.vimrc $VIMDIR/.vimrc 2> /dev/null + ln -rsf $PWD/.vim $VIMDIR/.vim 2> /dev/null + ln -rsf $PWD/.vimrc $VIMDIR/.vimrc 2> /dev/null if [ -f "$VIMDIR/.tmux.conf" ]; then mv $VIMDIR/.tmux.conf $VIMDIR/.tmux.conf.old echo "origin .tmux.conf has been moved to .tmux.conf.old" fi - ln -s $PWD/tmux/.tmux.conf $VIMDIR/.tmux.conf 2> /dev/null - ln -s $PWD/tmux/.tmux.conf.local $VIMDIR/.tmux.conf.local 2> /dev/null + ln -rsf $PWD/tmux/.tmux.conf $VIMDIR/.tmux.conf 2> /dev/null + ln -rsf $PWD/tmux/.tmux.conf.local $VIMDIR/.tmux.conf.local 2> /dev/null fi +sudo apt-get install -y git git submodule init && git submodule update # install ctags to solve "Exuberant ctags not found in PATH" error -sudo apt-get install exuberant-ctags -sudo apt-get install vim -sudo apt-get install tmux +sudo apt-get install -y exuberant-ctags +sudo apt-get install -y vim +sudo apt-get install -y tmux +