From a0cbe6587235e01a5ac368fbd5acf3044d71b127 Mon Sep 17 00:00:00 2001 From: zeekling Date: Fri, 17 Jul 2020 19:11:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dvimrc=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=94=99=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vim/vimrc | 130 ------------------------ install.sh | 31 +++--- {.vim => vim}/colors/gruvbox.vim | 0 {.vim => vim}/colors/space-vim-dark.vim | 0 {.vim => vim}/conf/base.vim | 16 ++- {.vim => vim}/conf/c.vim | 0 {.vim => vim}/conf/html.vim | 0 {.vim => vim}/conf/init.vim | 0 {.vim => vim}/conf/java.vim | 0 {.vim => vim}/conf/load.vim | 0 {.vim => vim}/conf/markdown.vim | 0 {.vim => vim}/conf/python.vim | 0 {.vim => vim}/conf/script/vim_utils.py | 0 {.vim => vim}/conf/sql.vim | 0 {.vim => vim}/custom/functions.vim | 0 .vimrc => vim/vimrc | 18 ++-- vimrc | 97 ++++++++++++++++++ 17 files changed, 125 insertions(+), 167 deletions(-) delete mode 100644 .vim/vimrc rename {.vim => vim}/colors/gruvbox.vim (100%) rename {.vim => vim}/colors/space-vim-dark.vim (100%) rename {.vim => vim}/conf/base.vim (90%) rename {.vim => vim}/conf/c.vim (100%) rename {.vim => vim}/conf/html.vim (100%) rename {.vim => vim}/conf/init.vim (100%) rename {.vim => vim}/conf/java.vim (100%) rename {.vim => vim}/conf/load.vim (100%) rename {.vim => vim}/conf/markdown.vim (100%) rename {.vim => vim}/conf/python.vim (100%) rename {.vim => vim}/conf/script/vim_utils.py (100%) rename {.vim => vim}/conf/sql.vim (100%) rename {.vim => vim}/custom/functions.vim (100%) rename .vimrc => vim/vimrc (90%) create mode 100644 vimrc diff --git a/.vim/vimrc b/.vim/vimrc deleted file mode 100644 index f2cfee8..0000000 --- a/.vim/vimrc +++ /dev/null @@ -1,130 +0,0 @@ -" ____________ __ -" / ____/ ____/ / /_ -" _____ / /___/ /_____ / /_/ __ _______ -" /__ / / ____/ ____/ /___/ / /\ / / __ / -" / /__/ /___/ /___/ / __/ / /\ \ / / /_/ / / -" /____/_____/_____/_/\_\/_/_/ \_\/_/\____/ / -" _____/ / -" /______/ -" @author:zeekling -" - -" 插件 -filetype off " required! -filetype indent on -call plug#begin('~/.vim/plugged') -Plug 'tpope/vim-fugitive', {'on': 'LoadPlugs'} -Plug 'ascenator/L9', {'name': 'newL9','for':'vim'} -Plug 'scrooloose/nerdtree' -Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'LoadPlugs'} -Plug 'majutsushi/tagbar',{'for':['java','sql','python','c','html','css','javascript','go']} -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'bling/vim-bufferline' -" Plug 'terryma/vim-multiple-cursors' -" Plug 'powerline/fonts' -if v:version < 800 - Plug 'scrooloose/syntastic',{'for':['java','sql','python','c','html','css','javascript']} -else - Plug 'w0rp/ale',{'for':['java','sql','python','c','html','css','javascript','go','sh','shell'], 'merged' : 0, 'loadconf_before' : 1} " 语法检测 -endif -Plug 'godlygeek/tabular' ,{'on':'Tabbar'} " 代码美化工具 -Plug 'jiangmiao/auto-pairs' -" Plug 'kien/rainbow_parentheses.vim' -" Plug 'roxma/vim-paste-easy' " Easy paste -"Plug 'ctrlpvim/ctrlp.vim' -Plug 'tacahiroy/ctrlp-funky' -" Plug 'rking/ag.vim' -Plug 'haya14busa/incsearch.vim' -" Plug 'Raimondi/delimitMate' -" Plug 'morhetz/gruvbox' -Plug 'mhinz/vim-signify' -Plug 'terryma/vim-smooth-scroll' -Plug 'mhinz/vim-startify' -" Plug 'rodjek/vim-puppet' -Plug 'tpope/vim-fugitive', {'on': 'LoadPlugs'} -Plug 'will133/vim-dirdiff',{'on':['DirDiff']} -Plug 'Chiel92/vim-autoformat', {'on': 'Autoformat'} -"Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' ,{'for':['java','sql','python','c','html','css','javascript']} -" Plug 'godlygeek/tabular' -" Plug 'mbbill/undotree' -" Plug 'romainl/vim-cool' -Plug 'liuchengxu/space-vim-dark' -Plug 'ryanoasis/vim-devicons' -" Plug 'Raimondi/delimitMate' -Plug 'tiagofumo/vim-nerdtree-syntax-highlight' -Plug 'Yggdroot/LeaderF', { 'do': './install.sh' } -" 自动补全html/xml标签 -Plug 'docunext/closetag.vim', { 'for': ['html', 'xml'] } -Plug 'mattn/emmet-vim',{'for':['html','xml']} -Plug 'gko/vim-coloresque' ,{'for':['html','xml','css',]} -Plug 'pangloss/vim-javascript',{'for':['html','css','javascript']} -Plug 'hail2u/vim-css3-syntax',{'for':['html','css','javascript']} -" 快速赋值语句对齐 -Plug 'junegunn/vim-easy-align',{'for':['java','c','python','markdown','sh','shell','c++','sql']} -" quickrun -Plug 'thinca/vim-quickrun',{'for':['java','c','python','sh','shell','c++']} - -Plug 'chrisbra/changesPlugin' - -" auto complete -"Plug 'SirVer/ultisnips',{'for':['java','sql','vim','python','c','html','css','javascript','sh','shell']} -"Plug 'honza/vim-snippets',{'for':['java','sql','vim','python','c','html','css','javascript','sh','shell']} -Plug 'ycm-core/YouCompleteMe',{'do':'./install.py --clang-completer --java-completer','for':['java','sql','vim','python','c','html','css','javascript','sh','shell']} -" Plug 'maralla/completor.vim',{'for':['java','sql','vim','python','c','html','css','javascript','sh','shell']} -Plug 'shougo/neocomplete.vim',{'for':['java','sql','vim','python','c','html','css','javascript','sh','shell']} -" java -Plug 'artur-shaik/vim-javacomplete2', {'for':'java'} -Plug 'mrtazz/DoxygenToolkit.vim', {'for':['java','c','c++']} -Plug 'airblade/vim-rooter', {'for':'java'} - -" c -Plug 'vim-scripts/a.vim', {'for':['c','c++']} -Plug 'vim-scripts/c.vim', {'for':['c','c++']} - -" markdown -Plug 'plasticboy/vim-markdown', { 'for': 'markdown' } -Plug 'iamcco/mathjax-support-for-mkdp', { 'for': 'markdown' } -Plug 'iamcco/markdown-preview.vim', { 'for': 'markdown' } - -" python -" Plug 'rkulla/pydiction', { 'for': 'python' } -" Plug 'hdima/python-syntax', { 'for': 'python' } -" Plug 'hynek/vim-python-pep8-indent', { 'for': 'python' } -" Plug 'Glench/Vim-Jinja2-Syntax', { 'for': 'python' } -"Plug 'davidhalter/jedi-vim', { 'for': 'python' } -Plug 'python-mode/python-mode', { 'for': 'python','branch': 'develop' } -Plug 'tell-k/vim-autopep8', {'for': 'python'} -" Plug 'fisadev/vim-isort',{'for':'python'} -" sql -" Plug 'joereynolds/SQHell.vim',{'for':'sql'} - -" on 语句不起作用 -Plug 'mattn/vim-sqlfmt',{'on':'SQLfmt'} -" bash -Plug 'vim-scripts/bash-support.vim',{'for':['sh','bash']} - -Plug 'chxuan/prepare-code' -call plug#end() - -autocmd FileType java source ~/.vim/conf/java.vim -autocmd FileType c source ~/.vim/conf/c.vim -autocmd FileType python source ~/.vim/conf/python.vim -autocmd BufNewFile,BufRead *.md,*.markdown,*.mkd source ~/.vim/conf/markdown.vim -autocmd FileType sql source ~/.vim/conf/sql.vim -autocmd FileType html,css,javascript source ~/.vim/conf/html.vim - -if filereadable(expand("~/.vim/conf/load.vim")) - source ~/.vim/conf/load.vim -endif - -if filereadable(expand('~/.vim/conf/base.vim')) - source ~/.vim/conf/base.vim -endif - -filetype plugin indent on - - -if filereadable(expand('~/.vim/custom/functions.vim')) - source ~/.vim/custom/functions.vim -endif diff --git a/install.sh b/install.sh index 0d261fc..605c109 100755 --- a/install.sh +++ b/install.sh @@ -1,25 +1,22 @@ #!/usr/bin/env bash - -echo " ____________ __ " -echo " / ____/ ____/ / /_ " -echo " _____ / /___/ /_____ / /_/ __ _______ " -echo " /__ / / ____/ ____/ /___/ / /\ / / __ / " -echo " / /__/ /___/ /___/ / __/ / /\ \ / / /_/ / / " -echo " /____/_____/_____/_/\_\/_/_/ \_\/_/\____/ / " -echo " _____/ / " -echo " /______/ " -echo " @author:zeekling " +echo " " +echo " ________ _______ _______ __ ___ __ __ .__ __. _______ " +echo " | / | ____|| ____|| |/ / | | | | | \ | | / _____| " +echo " ---/ / | |__ | |__ | / | | | | | \| | | | __ " +echo " / / | __| | __| | < | | | | | . | | | |_ | " +echo " / /----.| |____ | |____ | . \ | ----.| | | |\ | | |__| | " +echo " /________||_______||_______||__|\__\ |_______||__| |__| \__| \______| " +echo " " +echo " @author:zeekling " echo " " -if [ ! -d '~/.vim/autoload/plug.vim' ];then - echo "开始安装vim-plug" - curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - echo "安装vim-plug完成" -fi +echo "开始安装vim-plug" +curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +echo "安装vim-plug完成" -PLUG_FILE="~/.vim/plugged" +PLUG_FILE="${HOME}/.vim/plugged" if [ ! -f ${PLUG_FILE} ]; then mkdir ${PLUG_FILE} -p fi echo "拷贝配置文件" -cp .vimrc ~/.vimrc && cp -rf .vim/* ~/.vim/ +cp vimrc ~/.vimrc && cp -rf vim/* ~/.vim/ echo "拷贝完成,打开vim" diff --git a/.vim/colors/gruvbox.vim b/vim/colors/gruvbox.vim similarity index 100% rename from .vim/colors/gruvbox.vim rename to vim/colors/gruvbox.vim diff --git a/.vim/colors/space-vim-dark.vim b/vim/colors/space-vim-dark.vim similarity index 100% rename from .vim/colors/space-vim-dark.vim rename to vim/colors/space-vim-dark.vim diff --git a/.vim/conf/base.vim b/vim/conf/base.vim similarity index 90% rename from .vim/conf/base.vim rename to vim/conf/base.vim index 34ae43d..5942153 100644 --- a/.vim/conf/base.vim +++ b/vim/conf/base.vim @@ -177,16 +177,12 @@ map :QuickRun " mhinz/vim-startify let g:startify_custom_header=[ - \' ____________ __ ', - \' / ____/ ____/ / /_ ', - \' _____ / /___/ /_____ / /_/ __ _______ ', - \' /__ / / ____/ ____/ /___/ / /\ / / __ / ', - \' / /__/ /___/ /___/ / __/ / /\ \ / / /_/ / / ', - \' /____/_____/_____/_/\_\/_/_/ \_\/_/\____/ / ', - \' _____/ / ', - \' /______/ ', - \' @author:zeekling ', - \' '] + \' ________ _______ _______ __ ___ __ __ .__ __. _______', + \' | / | ____|| ____|| |/ / | | | | | \ | | / _____|', + \' ---/ / | |__ | |__ | / | | | | | \| | | | __', + \' / / | __| | __| | < | | | | | . | | | |_ |', + \' / /----.| |____ | |____ | . \ | `----.| | | |\ | | |__| |', + \' /________||_______||_______||__|\__\ |_______||__| |__| \__| \______|'] let g:startify_custom_footer=['结尾', ' 不想看到你'] " ryanoasis/vim-devicons let g:webdevicons_enable_nerdtree = 1 " 我的电脑上显示有点问题 diff --git a/.vim/conf/c.vim b/vim/conf/c.vim similarity index 100% rename from .vim/conf/c.vim rename to vim/conf/c.vim diff --git a/.vim/conf/html.vim b/vim/conf/html.vim similarity index 100% rename from .vim/conf/html.vim rename to vim/conf/html.vim diff --git a/.vim/conf/init.vim b/vim/conf/init.vim similarity index 100% rename from .vim/conf/init.vim rename to vim/conf/init.vim diff --git a/.vim/conf/java.vim b/vim/conf/java.vim similarity index 100% rename from .vim/conf/java.vim rename to vim/conf/java.vim diff --git a/.vim/conf/load.vim b/vim/conf/load.vim similarity index 100% rename from .vim/conf/load.vim rename to vim/conf/load.vim diff --git a/.vim/conf/markdown.vim b/vim/conf/markdown.vim similarity index 100% rename from .vim/conf/markdown.vim rename to vim/conf/markdown.vim diff --git a/.vim/conf/python.vim b/vim/conf/python.vim similarity index 100% rename from .vim/conf/python.vim rename to vim/conf/python.vim diff --git a/.vim/conf/script/vim_utils.py b/vim/conf/script/vim_utils.py similarity index 100% rename from .vim/conf/script/vim_utils.py rename to vim/conf/script/vim_utils.py diff --git a/.vim/conf/sql.vim b/vim/conf/sql.vim similarity index 100% rename from .vim/conf/sql.vim rename to vim/conf/sql.vim diff --git a/.vim/custom/functions.vim b/vim/custom/functions.vim similarity index 100% rename from .vim/custom/functions.vim rename to vim/custom/functions.vim diff --git a/.vimrc b/vim/vimrc similarity index 90% rename from .vimrc rename to vim/vimrc index 13a18c3..e5c71af 100644 --- a/.vimrc +++ b/vim/vimrc @@ -1,14 +1,12 @@ -" ____________ __ -" / ____/ ____/ / /_ -" _____ / /___/ /_____ / /_/ __ _______ -" /__ / / ____/ ____/ /___/ / /\ / / __ / -" / /__/ /___/ /___/ / __/ / /\ \ / / /_/ / / -" /____/_____/_____/_/\_\/_/_/ \_\/_/\____/ / -" _____/ / -" /______/ -" @author:zeekling +" ________ _______ _______ __ ___ __ __ .__ __. _______ +" | / | ____|| ____|| |/ / | | | | | \ | | / _____| +" `---/ / | |__ | |__ | ' / | | | | | \| | | | __ +" / / | __| | __| | < | | | | | . ` | | | |_ | +" / /----.| |____ | |____ | . \ | `----.| | | |\ | | |__| | +" /________||_______||_______||__|\__\ |_______||__| |__| \__| \______| +" +" @author:zeekling " - " 插件 filetype off " required! filetype indent on diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..ea81899 --- /dev/null +++ b/vimrc @@ -0,0 +1,97 @@ +" ____________ __ +" / ____/ ____/ / /_ +" _____ / /___/ /_____ / /_/ __ _______ +" /__ / / ____/ ____/ /___/ / /\ / / __ / +" / /__/ /___/ /___/ / __/ / /\ \ / / /_/ / / +" /____/_____/_____/_/\_\/_/_/ \_\/_/\____/ / +" _____/ / +" /______/ +" @author:zeekling +" +set ruler +autocmd BufWritePre * :%s/\s\+$//e " 自动清除末行空格 +set magic " 设置魔术 +set backspace=indent,eol,start +set nocompatible +syntax on +set foldmethod=indent +set foldlevelstart=99 +nnoremap za +" begin 20171129 mod +"colorscheme gruvbox +colorscheme space-vim-dark +set background=dark +"colorscheme molokai +" end 20171129 mod +set smartindent shiftwidth=4 +set shiftwidth=4 "缩进宽度4 +set tabstop=4 "tab键宽度4 +set softtabstop=4 "制表符宽度4 +set cursorline +set nocursorcolumn +set fencs=utf-8,gb18030 +set guifont=DroidSansMono\ Nerd\ Font\ 11 +set encoding=utf8 +set laststatus=2 " 显示光标当前位置 +set number +set cursorline +set cursorcolumn +set hlsearch +highlight LeaderTab guifg=#666666 +set nobackup +set noswapfile +match LeaderTab /^\t/ +set wildmenu +set cursorline +" vim 透明 +hi Normal ctermfg=252 ctermbg=none +set autoindent +set smartindent +set noeb vb t_vb= +setlocal textwidth=120 + +" 设置加密方式 +setlocal cm=blowfish2 +let mapleader=',' +let leader=',' +let g:mapleader=',' +let g:leader=',' +" tab切换 +map th :tabfirst +map tl :tablast +map tj :tabnext +map tk :tabprev +map tn :tabnext +map tp :tabprev +map te :tabedit +map td :tabclose +map tm :tabm + +"buffer 切换 +map bf :bf +map bn :bn +map bl :bl +map bf :bf +map bp :bp + +" 快速关闭 +map q :q +map wq :wq +map w :w +map mdp :MarkdownPreview +map s :shell + +set wildignore=*.swp,*.bak,*.pyc,*.class,.svn,.git,*.o,*~ +"在执行宏命令时,不进行显示重绘;在宏命令执行完成后,一次性重绘,以便提高性能。 +set lazyredraw + +if filereadable(expand('~/.vim/conf/init.vim')) + source ~/.vim/conf/init.vim +endif + +set nocompatible +if filereadable(expand("~/.vim/vimrc")) + source ~/.vim/vimrc +endif + +set cc=120