From 8910f15a427a58ba0151cb7c0dc6846143743b51 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 22 Jul 2016 19:41:54 +0800 Subject: [PATCH 001/160] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b46848d..e30ba85 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # vim .vim directory +----------------------------------2016-07-22----------------------------------- +Going use YouCompleteMe plugins. +Backup old vim configure at this branch. +May be using in the future, may be others. + +----------------------------------bamboo---------------------------------------- + + From 93e2989ee04005ceb3367959949206960d2eb4ee Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 22 Jul 2016 19:42:28 +0800 Subject: [PATCH 002/160] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e30ba85..db9f736 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # vim .vim directory + +: ----------------------------------2016-07-22----------------------------------- Going use YouCompleteMe plugins. Backup old vim configure at this branch. From 175397867d0c9612af21b4bfada1725a451848cf Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 22 Jul 2016 19:43:02 +0800 Subject: [PATCH 003/160] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db9f736..28c449e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # vim .vim directory -: + ----------------------------------2016-07-22----------------------------------- + Going use YouCompleteMe plugins. Backup old vim configure at this branch. May be using in the future, may be others. From 627b2bacd8ea2aa852ccaccab3e7754935737ca4 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 14 Aug 2016 16:12:55 +0800 Subject: [PATCH 004/160] Delete powerline --- .gitmodules | 3 - .netrwhist | 3 + .vimrc | 407 ++++++++++++++++++++++++------------------- .vimrc.swp | Bin 0 -> 53248 bytes bundle/YouCompleteMe | 1 + bundle/markdown | 1 + bundle/nerdcommenter | 2 +- bundle/powerline | 1 - bundle/syntastic | 2 +- 9 files changed, 232 insertions(+), 188 deletions(-) create mode 100644 .netrwhist create mode 100644 .vimrc.swp create mode 160000 bundle/YouCompleteMe create mode 160000 bundle/markdown delete mode 160000 bundle/powerline diff --git a/.gitmodules b/.gitmodules index bf1f14c..7c2665a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "bundle/nerdcommenter"] path = bundle/nerdcommenter url = https://github.com/scrooloose/nerdcommenter.git -[submodule "bundle/powerline"] - path = bundle/powerline - url = https://github.com/powerline/powerline.git [submodule "taglist"] path = taglist url = https://github.com/vim-scripts/taglist.vim.git diff --git a/.netrwhist b/.netrwhist new file mode 100644 index 0000000..06aae74 --- /dev/null +++ b/.netrwhist @@ -0,0 +1,3 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =1 +let g:netrw_dirhist_1='/home/bamboo/.vim' diff --git a/.vimrc b/.vimrc index cb8d441..021107b 100644 --- a/.vimrc +++ b/.vimrc @@ -126,29 +126,6 @@ let g:javascript_conceal_super = "Ω" let g:javascript_conceal_arrow_function = "⇒" -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> nerdtree 配置 -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" nerdtree 子窗口中不显示冗余帮助信息 -let NERDTreeMinimalUI=1 -" 删除文件时自动删除文件对应 buffer -let NERDTreeAutoDeleteBuffer=1 - - -""""""""""""""""""""""""""""""""""""""" -"---->>>>powerline状态栏插件 -""""""""""""""""""""""""""""""""""""""" -" set rtp+=~/.local/lib/python2.7/site-packages/powerline/bindings/vim/ -set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim -" 添加新的字体 -set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9 -set laststatus=2 -" 保证xshell或者putty能够正常显示颜色 -" set t_Co=256 -" 主题风格 -let g:Powerline_colorscheme='solarized256' - - """""""""""""""""""""""""""""""""""""""""""""""""""""""" " bash 支持设置 " 1,函数注释快捷键:\cfu @@ -291,60 +268,6 @@ nmap py :Pydocstring " for c++ style, change the '@' to '\' -"""""""""""""""""""""""""""""""""""""""" -" --->>> lookupfile配置 -" 1,开启窗口,输入bamboo.c + Enter,之后使用,选择 -" 2,LUBufs:缓冲区浏览,在所有的缓冲区中寻找某个函数等,类似cscope -" 3,LUWalk:目录浏览 -" 4,忽略大小写查找:\c或者\C -" PS:依赖genutils插件 -" -""""""""""""""""""""""""""""""""""""""""""""""""""""" -" 生成filenametags文件,注意tf和:中间的空格就正常的空格哦 -nmap ft :!bash - \ /home/bamboo/.local/bin/filenametags - \:source ~/.vimrc -" 加载指定的tags文件,而不是默认的tags文件 -if filereadable("./filenametags") - let g:LookupFile_TagExpr = '"./filenametags"' -endif -" 最少输入字符位数才开始查找 -let g:LookupFile_MinPatLength = 3 -" 不保存上次查找的字符串 -let g:LookupFile_PreserveLastPattern = 0 -" 保存查找历史 -let g:LookupFile_PreservePatternHistory = 1 -" 回车打开第一个匹配项目 -let g:LookupFile_AlwaysAcceptFirst = 1 -" 不允许创建不存在的文件 -let g:LookupFile_AllowNewFiles = 0 -" 映射LookupFile为,lk -nmap luk :LUTags -" 映射LUBufs为,ll -nmap lul :LUBufs -" 映射LUWalk为,lw -nmap luw :LUWalk -" 默认设置忽略大小写查找, 重写该函数 -function! LookupFile_IgnoreCaseFunc(pattern) - let _tags = &tags - try - let &tags = eval(g:LookupFile_TagExpr) - let newpattern = '\c' . a:pattern - let tags = taglist(newpattern) - catch - echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE - return "" - finally - let &tags = _tags - endtry - - " Show the matches for what is typed so far. - let files = map(tags, 'v:val["filename"]') - return files -endfunction -let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' - - """"""""""""""""""""""""""""""""""""""""" " ---> taglist的配置:vim跟随缓冲区退出,这里的文件数目不是根据窗口数哦,比如 " 打开vim(没有跟随文件)此时主编辑区不算是一个文件。 @@ -362,61 +285,6 @@ let Tlist_File_Fold_Auto_Close=0 " 自动加载 autocmd BufWritePost *.* :TlistUpdate -""""""""""""""""""""""""""""""""""""""" -" BufExplorer介绍:快速浏览所有文件的buf插件,小型的文件 -" 缓存管理 -" 按键介绍: -" 1)在光标指定到BufExplorer时(忽略) -" 2)命令模式下: -" bn 打开下一个buffer文件 -" bp 打开上一个buffer文件 -" b num 打开指定号码的文件 -" num1,num2bd 删除num1到num2之间的缓存 -" 3)普通模式下: -" \bv 垂直打开一个窗口浏览所有的文件缓存 -" \bs 水平打开(这是bufExplore的功能) -" 4) 关闭bufExplorer(前提是进入该窗口): -" d 删除单个缓冲文件 -" bd 删除所有缓冲文件 -" 在会话保存中会用到(关闭所有动态窗口) -""""""""""""""""""""""""""""""""""""""" -" Do not show default help. -let g:bufExplorerDefaultHelp=0 -" Show relative paths. -let g:bufExplorerShowRelativePath=1 -" Sort by most recently used. -let g:bufExplorerSortBy='mru' -" Split left. -let g:bufExplorerSplitRight=0 -" Split vertically. -let g:bufExplorerSplitVertical=1 -" Split width -let g:bufExplorerSplitVertSize = 30 -" Open in new window. -let g:bufExplorerUseCurrentWindow=1 -autocmd BufWinEnter \[Buf\ List\] setl nonumber - - -"""""""""""""""""""""""""""""""""""""""""""""" -" ---> winmanager的配置: 界面分隔,是否自动打开winmanager,设置winmanger高度 -" 快捷键开启,设置自动开启变量在winmanager.vim中设置 -"""""""""""""""""""""""""""""""""""""""""""""" -" 设置显示方式或者界面分隔 -" 或者'TagList|FileExplorer, BufExplorer' -let g:winManagerWindowLayout = "BufExplorer,FileExplorer|TagList" -let g:defaultExplorer = 0 -" 自动打开winmanager -let g:AutoOpenWinManager=0 -" 设置宽度 -let g:winMaagerWidth=30 -" goto first explorer window -map ff :FirstExplorerWindow -" goto bottom explorer window -map bb :BottomExplorerWindow -" reload -nmap :WMToggle - - """"""""""""""""""""""""""""""""""""""" " ---> DoxygenToolkit注释文档配置: " @@ -441,21 +309,6 @@ let g:DoxygenToolkit_maxFunctionProtoLines = 30 let g:doxygen_enhanced_color=1 -"#######################################个人vim设置########################## -""""""""""""""""""""""""""""""""""""""" -" ---> 重新载入vimrc配置: -" ss为映射,生效时将leader替换为变量mapleader, -" 即ss变为",ss"快捷键 -" ee ---- ",ee"快捷键,打开配置 -""""""""""""""""""""""""""""""""""""""" -" Fast reloading of the .vimrc -map ss :source ~/.vimrc -" Fast editing of .vimrc -map ee :e ~/.vimrc -" When .vimrc is edited, reload it -autocmd! bufwritepost .vimrc source ~/.vimrc - - """""""""""""""""""""""""""""""""""""""""""""" " ---> ctags的配置: " 基本按键命令: @@ -544,25 +397,6 @@ nmap i :cs find i ^=expand("")$ nmap d :cs find d =expand("") -""""""""""""""""""""""""""""""""""""""" -" ---> 窗口切割映射键和跳转快捷键 -" -""""""""""""""""""""""""""""""""""""""" -" 切割 -nmap vs :vs -nmap sp :sp -" 左边窗口 -nmap hw h -" 右边窗口 -nmap lw l -" 上边窗口 -nmap kw k -" 下边窗口 -nmap jw j -" 移动窗口,左右移动 -nmap rw - - """"""""""""""""""""""""""""""""""""""" " ---> 宏快捷键 " @a寄存器 ---》 h寄存器 @@ -615,25 +449,42 @@ set hlsearch """""""""""""""""""""""""""""""""""""""""""""""""""""" -"----> molokai配色步骤: +"----> 配色配置1 +" molokai配色步骤: " 1,molokai.vim放入colors/目录下面 " 2,molokai默认没有给对应元素配色 " 3,配置都是自定义的,可以删除 " -"--->>solarized配色步骤: +"""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 配色主题 +colorscheme molokai +" 原始的monokai背景色 +let g:molokai_original=1 +" 256支持 +let g:rehash256=1 + +"""""""""""""""""""""""""""""""""""""""""""""""""""""" +"--->>配色配置2 +" solarized配色步骤: " 1,vim-colors-solarized存入bundle目录下 " 2,设置配色方案 """"""""""""""""""""""""""""""""""""""""""""""""""""""" -" 背景颜色(dark/light) -set background=dark -"" 设置终端支持的颜色是256颜色 -set t_Co=256 +"" 背景(dark/light) +"if has('gui_running') + "set background=dark +"else + "set background=light +"endif +"" 256支持 +"let g:solarized_termcolors=256 +"" 选择颜色主题solarized +"colorscheme solarized -" 选择颜色主题--molokai 或者 solarized -" colorscheme solarized -" let g:solarized_termcolors=256 -colorscheme molokai +"""""""""""""""""""""""""""""""""""""""""""""""""""""" +"--->>配色配置3 +" 其他通用配置 +""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 匹配函数名,为函数名定义颜色做准备 autocmd BufNewFile,BufRead * :syntax match cfunctions \"\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2 @@ -652,11 +503,21 @@ set cursorline """"""""""""""""""""""""""""""""""""""" -"---->>>>Tmux +"--->>配色配置4 +" powerline状态栏插件 +" 结合terminal的状态栏设置,涉及字体等信息, +" 见印象笔记->vim->powerline安装 +" PS: +" 后期一键自动化安装的时候容易,现在配置很麻烦 """"""""""""""""""""""""""""""""""""""" -if exists('$TMUX') - set term=screen-256color -endif +" 找到powerline插件位置,当然也可以放在vim目录下面 +set rtp+=~/.local/lib/python2.7/site-packages/powerline/bindings/vim/ +" 添加新的字体 +set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9 +set laststatus=2 +" 主题风格 +let g:Powerline_colorscheme='solarized256' + """"""""""""""""""""""""""""""""""""""" @@ -752,6 +613,190 @@ set completeopt=longest,menu " 快捷键设置暂时没有 + +"""""""""""""""""""""""""""""""""""""""文件缓冲区窗口模块""""""""""""""""""""""""""""""" +""""""""""""""""""""""""""""""""""""""" +" ---> 文件缓冲区窗口插件1 +" BufExplorer介绍:快速浏览所有文件的buf插件,小型的文件 +" 缓存管理 +" 按键介绍: +" 1)在光标指定到BufExplorer时(忽略) +" 2)命令模式下: +" bn 打开下一个buffer文件 +" bp 打开上一个buffer文件 +" b num 打开指定号码的文件 +" num1,num2bd 删除num1到num2之间的缓存 +" 3)普通模式下: +" \bv 垂直打开一个窗口浏览所有的文件缓存 +" \bs 水平打开(这是bufExplore的功能) +" 4) 关闭bufExplorer(前提是进入该窗口): +" d 删除单个缓冲文件 +" bd 删除所有缓冲文件 +" 在会话保存中会用到(关闭所有动态窗口) +""""""""""""""""""""""""""""""""""""""" +" Do not show default help. +let g:bufExplorerDefaultHelp=0 +" Show relative paths. +let g:bufExplorerShowRelativePath=1 +" Sort by most recently used. +let g:bufExplorerSortBy='mru' +" Split left. +let g:bufExplorerSplitRight=0 +" Split vertically. +let g:bufExplorerSplitVertical=1 +" Split width +let g:bufExplorerSplitVertSize = 30 +" Open in new window. +let g:bufExplorerUseCurrentWindow=1 +autocmd BufWinEnter \[Buf\ List\] setl nonumber + + +"""""""""""""""""""""""""""""""""""""""""""""" +" ---> 文件缓冲区窗口插件2 +" winmanager的配置: 界面分隔,是否自动打开winmanager, +" 设置winmanger高度 +"""""""""""""""""""""""""""""""""""""""""""""" +" 设置显示方式或者界面分隔,左上角BE/FE共用一个窗口,右下角为taglist +" 其中左上角BufExporer和FP的切换使用Ctrl + N +let g:winManagerWindowLayout = "BufExplorer,FileExplorer|TagList" +let g:defaultExplorer = 0 +" 自动打开winmanager +let g:AutoOpenWinManager=0 +" 设置宽度 +let g:winMaagerWidth=30 +" goto first explorer window +map ff :FirstExplorerWindow +" goto bottom explorer window +map bb :BottomExplorerWindow +" reload +nmap :WMToggle + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> 文件缓冲区窗口插件3 +" nerdtree 配置 +" 显示当前目录下的树形目录树,有时候有用 +" PS: 建议结合lookupfile来使用 +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 是否在vim启动的时候默认开启NERDTree +"autocmd VimEnter * NERDTree +" 窗口显示的位置,默认为左边 +"let NERDTreeWinPos='right' +" 是否自动显示BookMarks +let NERDTreeShowBookmarks=1 +" nerdtree 子窗口中不显示冗余帮助信息 +let NERDTreeMinimalUI=1 +" 删除文件时自动删除文件对应 buffer +let NERDTreeAutoDeleteBuffer=1 +" 启动或者隐藏NERDTree +nmap :NERDTreeToggle + + +"""""""""""""""""""""""""""""""""""""""" +" ---> 文件缓冲区窗口插件4 +" lookupfile配置 +" 1,开启窗口,输入bamboo.c + Enter,之后使用,选择 +" 2,LUBufs:缓冲区浏览,在所有的缓冲区中寻找某个函数等,类似cscope +" 3,LUWalk:目录浏览 +" 4,忽略大小写查找:\c或者\C +" PS:依赖genutils插件 +" +""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 生成filenametags文件,注意tf和:中间的空格就正常的空格哦 +" 其中/home/bamboo/.local/bin/filenametags可执行文件见: +" +nmap ft :!bash + \ /home/bamboo/.local/bin/filenametags + \:source ~/.vimrc +" 加载指定的tags文件,而不是默认的tags文件,增加查找性能 +if filereadable("./filenametags") + let g:LookupFile_TagExpr = '"./filenametags"' +endif +" 最少输入字符位数才开始查找匹配 +let g:LookupFile_MinPatLength = 3 +" 不保存上次查找的字符串 +let g:LookupFile_PreserveLastPattern = 0 +" 保存查找历史 +let g:LookupFile_PreservePatternHistory = 1 +" 回车打开第一个匹配项目 +let g:LookupFile_AlwaysAcceptFirst = 1 +" 不允许创建不存在的文件 +let g:LookupFile_AllowNewFiles = 0 +" F5的功能,查找文件,映射LookupFile为,lk +nmap luk :LUTags +" 浏览缓冲区,列出缓冲区中所有文件,映射LUBufs为ll +nmap lul :LUBufs +" 浏览目录,查看该目录下所有文件,映射LUWalk为lw +nmap luw :LUWalk +" 默认设置忽略大小写查找, 重写该函数 +function! LookupFile_IgnoreCaseFunc(pattern) + let _tags = &tags + try + let &tags = eval(g:LookupFile_TagExpr) + let newpattern = '\c' . a:pattern + let tags = taglist(newpattern) + catch + echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE + return "" + finally + let &tags = _tags + endtry + + " Show the matches for what is typed so far. + let files = map(tags, 'v:val["filename"]') + return files +endfunction +let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' + + + + +"""""""""""""""""""""""""""""""""""""""自定义模块""""""""""""""""""""""""""""""" +""""""""""""""""""""""""""""""""""""""" +" ---> 重新载入vimrc配置: +" ss为映射,生效时将leader替换为变量mapleader, +" 即ss变为",ss"快捷键 +" ee ---- ",ee"快捷键,打开配置 +""""""""""""""""""""""""""""""""""""""" +" Fast reloading of the .vimrc +map ss :source ~/.vimrc +" Fast editing of .vimrc +map ee :e ~/.vimrc +" When .vimrc is edited, reload it +autocmd! bufwritepost .vimrc source ~/.vimrc + + +""""""""""""""""""""""""""""""""""""""" +" ---> 窗口切割映射键和跳转快捷键 +" +""""""""""""""""""""""""""""""""""""""" +" 切割 +nmap vs :vs +nmap sp :sp +" 左边窗口 +nmap hw h +" 右边窗口 +nmap lw l +" 上边窗口 +nmap kw k +" 下边窗口 +nmap jw j +" 移动窗口,左右移动 +nmap rw + + +""""""""""""""""""""""""""""""""""""""" +"---->>>>Tmux +" PS:放在最末尾 +""""""""""""""""""""""""""""""""""""""" +" 设置终端支持的颜色是256颜色 +set t_Co=256 +" tmux设置 +if exists('$TMUX') + set term=screen-256color +endif + + """""""""""""""""""""""""""""""""""""""""""""" " --->>> bamboo.vim的配置(建议放在最后) " 1,设置tags的加载,不同的语言加载不同的tags @@ -766,5 +811,3 @@ set completeopt=longest,menu if filereadable("bamboo.vim") source bamboo.vim endif - - diff --git a/.vimrc.swp b/.vimrc.swp new file mode 100644 index 0000000000000000000000000000000000000000..86fbd52134e0b96cc4d4af680da72a451b633ef6 GIT binary patch literal 53248 zcmeI533yy*dG7^X1BF89a!V=qL?OtFme>hdgr(T=QUbQ)>m><9ju?$b(%7S!VP<4m z2>~UxY{{GCeUF!TOJYmP=1pFDA*Db|fwH!}PYXe3G`c*j?d3v%a)0mle&@`LBs;Q8 z@4bDVIgkFDnRC8jU@AbM7p^y@=~=MMZyB(*I!FJ9ibm@_12EU7)!x7Lx~8 zzs4Kx6B@9hd_}l95xjbug{OrUD73(@u?1RE4P|%TP;}eWDYr_hHy7XJyyM0tzs3v- zNflb4&;o@PD6~MK1qv-tXn{ft6k4Fr0{_3aKq~&`qEAxDH`;a6# z{zLZjH*JNz{BN-LAGV)?5zpUb?}zQ@g%Qtx!`}DGd5gW_rEeb>J_;>RXn{ft6k4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(V6riG z162WtpWzD!>6jd;f~Vz=UVk7Mt8AK@qj+WX%AsT+XmN^bQsP|?zFQXF#51&C)Z<|) z!qgO@r*XKd0S&V*2(yk{^}etyM>wRFHV~zcU^5Ehh@G-p>PFX4=q281iPN%lYXn_naD$Z5egH99Iy%ZPziY;!QQG=&YrkN1j6x5gkYC4*NxhtMQtiLAp$7E$L z!vmX9c=voTZGdx->3hQ6ye@O<7&IVWWhka_XP?>!_3R!wpzls3`OM~>CgEIFdfo;M zBWOe&imVlwupJ6E9oBVr!KOp><(%xxH?k9@dy8?YY=oF_^?m&p{mgav0 zpZ@@@e-Vh!zX7lXRDvHu>wg8D1lz!!K>YcMF2DoeC$zJ)^^4Npg{#m4*WLnn0?fS% zoSgz^XOA3=3SJ%xULK4aiGr7h^(vKtA}Dxy7=soqaCW>6w7}UZczO8G;pL&g+4;}U z*>Pe~%i}?R%sL5D*Cy6^@fd6MShrAp5$!`XbE|#50vrbo9cs6HvauqKanC6#`akPY Bk>>ya literal 0 HcmV?d00001 diff --git a/bundle/YouCompleteMe b/bundle/YouCompleteMe new file mode 160000 index 0000000..c1047be --- /dev/null +++ b/bundle/YouCompleteMe @@ -0,0 +1 @@ +Subproject commit c1047bee9aa68292ab267a0a4a2d7bfb8d3ce1eb diff --git a/bundle/markdown b/bundle/markdown new file mode 160000 index 0000000..e45d610 --- /dev/null +++ b/bundle/markdown @@ -0,0 +1 @@ +Subproject commit e45d6108433274e82649afa269b2d7adf606e4be diff --git a/bundle/nerdcommenter b/bundle/nerdcommenter index c3d6a20..e2d47be 160000 --- a/bundle/nerdcommenter +++ b/bundle/nerdcommenter @@ -1 +1 @@ -Subproject commit c3d6a2069bb0286c9633fbbffb4983797f7b8822 +Subproject commit e2d47bec2662d5fcd324d17e22dc37f38c97bf2d diff --git a/bundle/powerline b/bundle/powerline deleted file mode 160000 index 6e2e0b2..0000000 --- a/bundle/powerline +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6e2e0b2f9221fbff117be3d190f9293b40ba64cd diff --git a/bundle/syntastic b/bundle/syntastic index ddfa6a8..cee74e0 160000 --- a/bundle/syntastic +++ b/bundle/syntastic @@ -1 +1 @@ -Subproject commit ddfa6a88350cd1fbf50e1b90f99d16f9ca982a39 +Subproject commit cee74e0c1af934065fd1b3046e53cda76574f703 From 99f93fca546eaea79d863b1687224c77d99417a1 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 16 Aug 2016 19:20:56 +0800 Subject: [PATCH 005/160] Add some plugins --- .gitmodules | 12 + .vimrc | 575 ++++++++++++++++++---------------------- .vimrc.swp | Bin 53248 -> 0 bytes bundle/a.vim | 1 + bundle/calendar | 1 + bundle/tagbar | 1 + bundle/vim-gitgutter | 1 + ftplugin/README.md | 8 + ftplugin/lookupfile.vim | 3 + 9 files changed, 280 insertions(+), 322 deletions(-) delete mode 100644 .vimrc.swp create mode 160000 bundle/a.vim create mode 160000 bundle/calendar create mode 160000 bundle/tagbar create mode 160000 bundle/vim-gitgutter create mode 100644 ftplugin/README.md create mode 100644 ftplugin/lookupfile.vim diff --git a/.gitmodules b/.gitmodules index 7c2665a..deecd0c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -70,3 +70,15 @@ [submodule "bundle/webapi-vim"] path = bundle/webapi-vim url = https://github.com/mattn/webapi-vim.git +[submodule "bundle/tagbar"] + path = bundle/tagbar + url = https://github.com/majutsushi/tagbar.git +[submodule "bundle/calendar"] + path = bundle/calendar + url = https://github.com/itchyny/calendar.vim.git +[submodule "bundle/a.vim"] + path = bundle/a.vim + url = https://github.com/vim-scripts/a.vim.git +[submodule "bundle/vim-gitgutter"] + path = bundle/vim-gitgutter + url = git://github.com/airblade/vim-gitgutter.git diff --git a/.vimrc b/.vimrc index 021107b..3345de6 100644 --- a/.vimrc +++ b/.vimrc @@ -14,16 +14,17 @@ let mapleader = "," runtime bundle/vim-pathogen/autoload/pathogen.vim " 首先关闭文件检测 filetype off -" 可以通过execute pathogen#infect('bundle/{}', -" '~/src/vim/bundle/{}')来指定 -" vim插件的存放位置,默认为.vim/bundle + +" vim插件的存放位置,默认为.vim/bundle,可以不设置该项 execute pathogen#infect() -"call pathogen#infect() -"" 生成各个插件的文档 -"call pathogen#helptags() -" 自动检测文件类型 -filetype plugin indent on +" 执行pathogen,虽然通过git来安装,但是还是需要pathogen管理 +call pathogen#infect() +" 生成各个插件的文档(很重要) +call pathogen#helptags() + +" 自动检测文件类型,见印象笔记中说明 syntax on +filetype plugin indent on """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -83,12 +84,6 @@ let g:user_emmet_leader_key='' """"""""""""""""""""""""""""""""""""""""""""""""""""""" -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> vim-signify,自动比较当前文件和最新版本中的区别 -" 一旦出现差异,会在左边提示相关信息 -""""""""""""""""""""""""""""""""""""""""""""""""""""""" - - """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> vim-ag,内容搜索,替代ack.vim " requirement:安装the_silver_searcher工具 @@ -138,12 +133,6 @@ let g:BASH_Company = 'BigUniverse' """"""""""""""""""""""""""""""""""""""" -"---->>>>>python相关配置 -""""""""""""""""""""""""""""""""""""""" -" 关闭smartindent -"au! FileType python setl nosmartindent - - """"""""""""""""""""""""""""""""""""""" "---->>>>>python自动补全插件 jedi vim """"""""""""""""""""""""""""""""""""""" @@ -163,31 +152,23 @@ let g:jedi#completions_command = "" """"""""""""""""""""""""""""""""""""""" "---->>>>python-mode配置(python2.7) " K 显示python文档 -" Rope autocomplete -" g Rope goto definition -" d Rope show documentation -" f Rope find occurrences " b Set, unset breakpoint " [[ Jump on previous class or function " ]] Jump on next class or function " [M Jump on previous class or method " ]M Jump on next class or method +" PS:考虑到和syntastic语法检查冲突,关闭pylint检查 " """"""""""""""""""""""""""""""""""""""" " 避免和jedi vim冲突 let g:pymode_rope=0 +" Linting, disable if exists syntastic +let g:pymode_lint=0 + +" doc let g:pymode_doc=1 " 查看文档快捷键 let g:pymode_doc_key='K' -" Linting,python2.7 -let g:pymode_lint=1 -let g:pymode_lint_checker="pyflakes,pep8" -" ignore some special errors -let g:pymode_lint_ignore = "E402,W0611" -" auto open window if any errors have been found -let g:pymode_lint_cwindow = 1 -" auto check on save -let g:pymode_lint_write = 1 " support virtualenv let g:pymode_virtualenv = 1 " Enable breakpoints plugin @@ -198,49 +179,83 @@ let g:pymode_syntax = 1 let g:pymode_syntax_all = 1 let g:pymode_syntax_indent_errors = g:pymode_syntax_all let g:pymode_syntax_space_errors = g:pymode_syntax_all -" signs -let g:pymode_lint_signs = 1 -let g:pymode_lint_todo_symbol = "WW" -let g:pymode_lint_comment_symbol = "CC" " Don't autofold code let g:pymode_folding = 0 " 关闭pyflakes插件的语法检查 -"let g:pyflakes_use_quickfix = 0 +" let g:pyflakes_use_quickfix = 0 " 缓存中的跳转映射--python-mode中的CodeCheck代码检查 map ln :lnext map lp :lprev + +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> 版本控制-1-vim-signify +" 用于所有的版本控制 +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 没有特别的配置 + +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> 版本控制-2-vim-gitgutter +" 用于git,功能待挖掘 +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 关闭或者启动gitgutter,默认开启 +map gg :GitGutterToggle +" 关闭或者启动gitgutter signs,默认开启 +map gs :GitGutterSignsToggle +" 关闭或者启动高亮,默认开启 +map gh :GitGutterLineHighlightsToggle +" 设置文件发生更改后出现提示的延时时间(定时器),默认为4s,设置为250ms +set updatetime=250 +" To keep your Vim snappy(短小精悍),最大更改为500,默认值 +let g:gitgutter_max_signs = 500 + +" 跳到下一个或者上一个hunk +nmap nh GitGutterNextHunk +nmap ph GitGutterPrevHunk +" stage或者undo hunk,取消修改 +" hs +" hu +" 其他命令,哎,git + + + + +""""""""""""""""""""""""""""""""""""""" +" vim-surround配置 +" 见印象笔记中的说明 +""""""""""""""""""""""""""""""""""""""" +" 没有特殊的配置,不要文档中的custom configure + """"""""""""""""""""""""""""""""""""""" " --->语法检查,syntastic的配置参数 " 获取错误信息:Errors或者lopen " 错误间跳转:lne或者lp +" PS:关于c/c++/python等配置见印象笔记或者github wiki、帮助文档 +" 每一个目录都有一份独有的bamboo.vim配置当前项目的语言配置 " """"""""""""""""""""""""""""""""""""""" -" Conflicts withs powerline -"set statusline+=%#warningmsg# -"set statusline+=%{SyntasticStatuslineFlag()} -"set statusline+=%* +" 必要配置1 +" Conflicts withs powerline,so close +" set statusline+=%#warningmsg# +" set statusline+=%{SyntasticStatuslineFlag()} +" set statusline+=%* +" 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) +let g:syntastic_error_symbol = 'EE' +let g:syntastic_style_error_symbol = 'E>' +let g:syntastic_warning_symbol = 'WW' +let g:syntastic_style_warning_symbol = 'W>' let g:syntastic_always_populate_loc_list = 1 -" 自动拉起或者关闭错误窗口 -let g:syntastic_auto_loc_list = 0 -" 打开文件时检测 +" 必要配置3 +" 不需要手动调用 SyntasticSetTocList. 默认1 +let g:syntastic_always_populate_loc_list = 1 +" 自动拉起关闭错误窗口. +" 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 +let g:syntastic_auto_loc_list = 1 +" 打开文件时做语法检查, 默认 0 let g:syntastic_check_on_open = 1 -" 每次保存时检测 -let g:syntastic_check_on_wq = 1 -" gcc/g++ 语句支持,被bamboo.vim覆盖 -" auto check my headers files. -" add search path, look bamboo.vim file. -let g:syntastic_c_include_dirs = ['include', - \] -let g:syntastic_cpp_include_dirs = ['include', - \] -let g:syntastic_c_check_header = 1 -let g:syntastic_cpp_check_header = 1 -" check when compile code? -let b:syntastic_c_cflags = '-I/usr/include -I/include' -let b:syntastic_cpp_cflags = '-I/usr/include -I/include' -let g:syntastic_cpp_compiler_options = '-std=c++11' +" 报错时做语法检查, 默认 1 +let g:syntastic_check_on_wq = 0 """"""""""""""""""""""""""""""""""""""" @@ -253,79 +268,65 @@ autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 nmap py :Pydocstring -""""""""""""""""""""""""""""""""""""""" -" ---> NERD_comment注释插件配置: -" cc:添加注释 -" cu: 取消注释 -" ca:在可选的注释之间进行切换,例如/**/和// -" cs:性感的方式注释: -" /* -" * -" */ -" numcc:光标以下num行注释(包括当前行) -" numcm:光标以下num块注释(包括当前行) -""""""""""""""""""""""""""""""""""""""" -" for c++ style, change the '@' to '\' - -""""""""""""""""""""""""""""""""""""""""" -" ---> taglist的配置:vim跟随缓冲区退出,这里的文件数目不是根据窗口数哦,比如 -" 打开vim(没有跟随文件)此时主编辑区不算是一个文件。 -" 2014年 09月 17日 星期三 21:16:07 CST taglist的设置 -" PS:为了退出缓冲区时退出vim,在taglist.vim中设置winbufnr的值 -""""""""""""""""""""""""""""""""""""""" -" 在剩余多少窗口时退出缓存 -let Tlist_Exit_OnlyWindow=1 -" 单一窗口显示的文件数 -let Tlist_Show_One_File=1 -" 窗口显示在右边或者左边,1为右边 -let Tlist_Use_Right_Window=0 -" 非当前文件,函数列表折叠隐藏,1为隐藏 -let Tlist_File_Fold_Auto_Close=0 -" 自动加载 -autocmd BufWritePost *.* :TlistUpdate +""""""""""""""""""""""""""""""""""GCC模块""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""" -" ---> DoxygenToolkit注释文档配置: +" ---> GCC模块1 +" DoxygenToolkit注释文档配置: +" 详细的信息见DoxygenToolkit.vim插件 " """"""""""""""""""""""""""""""""""""""" " 函数和类注释,进行键的映射(输入,fg,即输出如下的字段) -nmap fg : Dox +nmap fg :Dox " 插入文件名,作者时间 -nmap fa : DoxAuthor +nmap fa :DoxAuthor " 插件license注释 -nmap fl : DoxLic -" 格式 -let g:DoxygenToolkit_authorName="unlessbamboo" -let g:DoxygenToolkit_licenseTag="哇哈哈\" -let g:DoxygenToolkit_undocTag="DOXIGEN_SKIP_BLOCK" -let g:DoxygenToolkit_briefTag_pre = "@brief\t" -let g:DoxygenToolkit_paramTag_pre = "@param\t" -let g:DoxygenToolkit_returnTag = "@return\t" -" 是否在brief中写入函数名 -let g:DoxygenToolkit_briefTag_funcName = "yes" -let g:DoxygenToolkit_maxFunctionProtoLines = 30 -" 高亮显示 -let g:doxygen_enhanced_color=1 +nmap fl :DoxLic +" 跳过文档的编写,不知道干什么的 +" nmap fu :DoxUndoc +" 块注释 +nmap fb :DoxBlock +" c/c++语言风格见不同目录下的配置 + +""""""""""""""""""""""""""""""""""""""" +" ---> GCC模块2 +""""""""""""""""""""""""""""""""""""""" +nmap as :A +nmap ass :AS +nmap asv :AV + +"""""""""""""""""""""""""""""""""""""""注释模块""""""""""""""""""""""""""""""" +""""""""""""""""""""""""""""""""""""""" +" --->> 注释模块1——nerdcommenter +""""""""""""""""""""""""""""""""""""""" +" for c++ style, change the '@' to '\' +" Add space delims when comment +let g:NERDSpaceDelims=1 +" User compact syntax for prettified multi-line comments +let g:NERDCompactSexyComs=1 +" Align line-wise comment delimiters flush left instead of +" following code indentation +" 终于找到这个了,还是得看官网---2016年 08月 15日 星期一 10:09:31 CST +let g:NERDDefaultAlign='left' +" set a language to use its alternate delimiters by default +let g:NERDAltDelims_java=1 +" Add your own custom formats or override the defaults +let g:NERDCustomDelimiters={ 'c': { 'left': '/**', 'right':'*/'} } +" Allow commenting and inverting(反转) empty lines +" (userful when commenting a region),注释空行 +let g:NERDCommentEmptyLines=1 +" Enable trimming of trailing whitespace when uncommenting +let g:NERDTrimTrailingWhitespace=1 + + + + +""""""""""""""""""""""""""""""""""标签模块""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""" -" ---> ctags的配置: -" 基本按键命令: -" ctags -R * 生成简单但是冗余的tags文件(宏,枚举变量,函数, -" 类型定义,变量,类等) -" 到定义处 -" 或者 返回前面的堆栈处 -" 生成ctags的命令: -" ctags -R –c++-kinds=+px –fields=+iaS –extra=+q . 或者 -" ctags -R --c++-kinds=+px --fields=+iaS --extra=+q -L src.files -" 前者指定当前目录下面的所有文件 -" 后者通过src.files文件列表指定,操作的源代码变为src.files -" 源文件。 -" -c++kinds=+px 记录c++文件中的函数声明和各种外部和前向声明 -" –fields=+iaS 要求描述的信息 -" –extra=+q 强制要求ctags保证多个同名函数可以用不同路径 -" 区分 +" ---> 标签配置1——tags的配置 """""""""""""""""""""""""""""""""""""""""""""" " 生成tags的命令 map :!ctags --exclude=jj @@ -337,31 +338,7 @@ imap :!ctags --languages=c,c++,python,java,php,sh,js -R \ :TlistUpdate """"""""""""""""""""""""""""""""""""""""""""" -" ---> cscope生成选项: -" -R 生成---搜索子目录中的代码 -" -b 生成---cscope.in.out和cscope.po.out,加快索引 -" -k 生成---不搜索/usr/incude目录 -" -i 生成---指定并非cscope.files的源文件列表 -" -l dir 生成---在dir中查找头文件 -" -u 生成---扫描所有文件,重新生成交叉索引文件 -" -C 生成---搜索时忽略大小写 -" 添加选项(cs add path/cscope.out path): -" -P path 添加---添加cscope.out时,设置绝对路径 -" 寻找选项: -" s 查找c语言符号出现的地方 -" g 查找定义的位置,类型ctags -" d 查找本函数调用的函数 -" c 查找调用本函数的函数 -" t 查找指定的字符串 -" e egrep模式 -" f 查找并打开文件,vim中的find -" i 查找包含本文件的文件 -" PS:关于-P选项,也可以在cscopes.files中添加, 将.换成`pwd` -" find PATH[.,pwd] -name "*.h" -o -name "*.c" -o -name "*.cpp" -" -o -name "*.java" >cscope.files -" find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" -" \ -o -name "*.java" -o -name "*.py" >cscope.files -" cscope -Rbq +" ---> 标签配置2——cscope """"""""""""""""""""""""""""""""""""""""""""" map :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" -o \ -name "*.java" -o -name "*.py" @@ -396,58 +373,29 @@ nmap f :cs find f =expand("") nmap i :cs find i ^=expand("")$ nmap d :cs find d =expand("") - -""""""""""""""""""""""""""""""""""""""" -" ---> 宏快捷键 -" @a寄存器 ---》 h寄存器 -" -""""""""""""""""""""""""""""""""""""""" -nmap h @ - - -""""""""""""""""""""""""""""""""""""""" -" ---> 保存映射 -" +""""""""""""""""""""""""""""""""""""""""" +" ---> 标签配置3 +" taglist的配置:vim跟随缓冲区退出,这里的文件数目不是根据窗口数哦,比如 +" 打开vim(没有跟随文件)此时主编辑区不算是一个文件。 +" 2014年 09月 17日 星期三 21:16:07 CST taglist的设置 """"""""""""""""""""""""""""""""""""""" -" 保存所有文件 -nmap :wa - - -""""""""""""""""""""""""""""""""""""""" -"--->>>制表符(tabstop)的操作: -" autoindent 自动缩进 -" shiftwidth 左缩进的字节 -" tabstop 制表位的字节长度 -" expandtab 制表位转为空格 -"--->>>退格键删除字符 -" backspace设置 -" eol 插入模式下输入backspace合并两行 -" start 删除此时插入前的操作 -" whichwrap行间移动 -" b backspace回退到上一行 -" s spcace到下一行 -""""""""""""""""""""""""""""""""""""""" -set autoindent -set shiftwidth=4 -set tabstop=4 -set expandtab -set backspace=indent,eol,start -set whichwrap=b,s,<,> +" 在剩余多少窗口时退出缓存 +let Tlist_Exit_OnlyWindow=1 +" 单一窗口显示的文件数 +let Tlist_Show_One_File=1 +" 窗口显示在右边或者左边,1为右边 +let Tlist_Use_Right_Window=0 +" 非当前文件,函数列表折叠隐藏,1为隐藏 +let Tlist_File_Fold_Auto_Close=0 +" 打开/关闭taglist窗口,不过被winmanager替代,见文件缓冲区插件2说明 +" map :TlistToggle +" 自动加载 +autocmd BufWritePost *.* :TlistUpdate -""""""""""""""""""""""""""""""""""""""" -" ---> 临时取消高亮显示的开关按钮 -" -""""""""""""""""""""""""""""""""""""""" -noremap :nohlsearch:echo -" 高亮命中的文本 -set hlsearch -" 彻底关闭高亮 -"set nohlsearch -" 临时关闭 -"nohlsearch +"""""""""""""""""""""""""""配色模块""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""" "----> 配色配置1 " molokai配色步骤: @@ -480,7 +428,6 @@ let g:rehash256=1 "" 选择颜色主题solarized "colorscheme solarized - """""""""""""""""""""""""""""""""""""""""""""""""""""" "--->>配色配置3 " 其他通用配置 @@ -501,7 +448,6 @@ hi PreCondit ctermfg=161 cterm=bold " 当前行的底色 set cursorline - """"""""""""""""""""""""""""""""""""""" "--->>配色配置4 " powerline状态栏插件 @@ -520,119 +466,27 @@ let g:Powerline_colorscheme='solarized256' -""""""""""""""""""""""""""""""""""""""" -"---->>>>正常的基础命令 -""""""""""""""""""""""""""""""""""""""" -" 语法高亮 -syntax enable -syntax on -"突出显示当前行 -set cursorline -" 设置黑色背景,保证告警文本的效果能够更加显著 -set background=dark -" 显示行号 -set nu -" 设置状态行 -set laststatus=2 -"显示当前行号和列号 -set ruler -"在状态栏显示正在输入的命令 -set showcmd -" 搜索时忽略大小写 -set ignorecase -" 随着键入即时搜索 -set incsearch -" 设置字体和字号 -set guifont=Monaco:h20 -" 鼠标设置 -set mouse=a -noremap :let &mouse = (&mouse == 'a' ? 'v' : 'a') -" paste设置 -set pastetoggle= - - -"""""""""""""""""""""""""""""""""""""""""""""" -" ---> 折叠配置 -" 折叠的组合: -" manual 手动设置 -" indent 缩进来折叠 -" syntax 语法来折叠 -" expr 表达式定义来折叠 -" marker 用标志折叠 -" 所有折叠的相同命令: -" zm 关闭折叠 -" zM 关闭所有折叠 -" zr 打开当前 -" zR 打开所有 -" zc 折叠当前行 -" zo 打开当前折叠 -" zO 打开当前所有嵌套折叠 -" zf 创建折叠(marker模式) -" zd 删除折叠(manual和marker模式) -" zD 删除所有折叠 -" -" -"""""""""""""""""""""""""""""""""""""""""""""" -" 基于缩进的代码折叠 -"set foldmethod=indent -" 基于语法的代码折叠 -set foldmethod=syntax -" 启动时关闭代码折叠 -set nofoldenable - """"""""""""""""""""""""""""""""""""""" -" 自动补全分析:需要用到检测文件和智能补全预览窗口,tags文件 -" 按键介绍: -" 关键字补全 默认不用按ctrl+x -" 整行补全 先按ctrl+x 再按ctrl+l -" 文件名补全 同上(必须对文件所在目录有访问权限) -" 字典补全 ??? -" 全能补全 ??? -" PS:该插件名称为:omnicppcomplete +" ---> 日常模块1——quickfix分析 """"""""""""""""""""""""""""""""""""""" -" 关闭智能补全时的预览窗口 -set completeopt=longest,menu +" 快捷键设置暂时没有 """"""""""""""""""""""""""""""""""""""" -" ---> quickfix分析:将编译过程中的错误信息保存到制定的缓存中, -" vim利用这些信息跳转到源文件的位置,进行 -" 错误修改 -" 查看make选项:set makeprg -" 按键介绍: -" cc 显示详细的错误信息,在vim状态栏中显示错误信息 -" cp 跳到上一个错误处,每一次都是显示cc的详细信息 -" cn 同cp相反 -" cw 如果存在错误列表,则打开一个窗口,默认行数为10 -" copen NUM 有时候和cw不同,比如ld错误的时候,cw没有任何信息 -" cclose 关闭上面两个命令打开的窗口 -" cnew 到后一个新的文件列表 -" 具体截图请看:quickfix-screenshot/文件中的截图 +" ---> 日常模块2——Calendar: """"""""""""""""""""""""""""""""""""""" -" 快捷键设置暂时没有 - +" 日期分隔符 +let g:calendar_date_separator = "-" +" 打开日历时的视图 +let g:calendar_view = "day" +" view布局,用于>切换时的布局 +let g:calendar_views = ['year', 'day', 'month', 'week', 'clock', 'days'] -"""""""""""""""""""""""""""""""""""""""文件缓冲区窗口模块""""""""""""""""""""""""""""""" +""""""""""""""""""""""""文件缓冲区窗口模块"""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""" -" ---> 文件缓冲区窗口插件1 -" BufExplorer介绍:快速浏览所有文件的buf插件,小型的文件 -" 缓存管理 -" 按键介绍: -" 1)在光标指定到BufExplorer时(忽略) -" 2)命令模式下: -" bn 打开下一个buffer文件 -" bp 打开上一个buffer文件 -" b num 打开指定号码的文件 -" num1,num2bd 删除num1到num2之间的缓存 -" 3)普通模式下: -" \bv 垂直打开一个窗口浏览所有的文件缓存 -" \bs 水平打开(这是bufExplore的功能) -" 4) 关闭bufExplorer(前提是进入该窗口): -" d 删除单个缓冲文件 -" bd 删除所有缓冲文件 -" 在会话保存中会用到(关闭所有动态窗口) +" ---> 文件缓冲区窗口插件1——BufExplorer """"""""""""""""""""""""""""""""""""""" " Do not show default help. let g:bufExplorerDefaultHelp=0 @@ -650,7 +504,6 @@ let g:bufExplorerSplitVertSize = 30 let g:bufExplorerUseCurrentWindow=1 autocmd BufWinEnter \[Buf\ List\] setl nonumber - """""""""""""""""""""""""""""""""""""""""""""" " ---> 文件缓冲区窗口插件2 " winmanager的配置: 界面分隔,是否自动打开winmanager, @@ -671,7 +524,6 @@ map bb :BottomExplorerWindow " reload nmap :WMToggle - """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> 文件缓冲区窗口插件3 " nerdtree 配置 @@ -679,9 +531,9 @@ nmap :WMToggle " PS: 建议结合lookupfile来使用 """"""""""""""""""""""""""""""""""""""""""""""""""""""" " 是否在vim启动的时候默认开启NERDTree -"autocmd VimEnter * NERDTree +" autocmd VimEnter * NERDTree " 窗口显示的位置,默认为左边 -"let NERDTreeWinPos='right' +" let NERDTreeWinPos='right' " 是否自动显示BookMarks let NERDTreeShowBookmarks=1 " nerdtree 子窗口中不显示冗余帮助信息 @@ -750,14 +602,64 @@ let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' +""""""""""""""""""""""""""""""""""""""" +"---->>>>正常的基础命令 +""""""""""""""""""""""""""""""""""""""" +" 语法高亮 +syntax enable +syntax on +" 高亮命中的文本或者set nohlsearch +set hlsearch +" 临时取消高亮显示的开关按钮 +noremap :nohlsearch:echo +"突出高亮显示当前行 +set cursorline -"""""""""""""""""""""""""""""""""""""""自定义模块""""""""""""""""""""""""""""""" -""""""""""""""""""""""""""""""""""""""" -" ---> 重新载入vimrc配置: -" ss为映射,生效时将leader替换为变量mapleader, -" 即ss变为",ss"快捷键 -" ee ---- ",ee"快捷键,打开配置 -""""""""""""""""""""""""""""""""""""""" +" 设置黑色背景,保证告警文本的效果能够更加显著 +set background=dark +" 显示行号 +set nu +" 设置状态行 +set laststatus=2 +"显示当前行号和列号 +set ruler +"在状态栏显示正在输入的命令 +set showcmd +" 搜索时忽略大小写 +set ignorecase +" 随着键入即时搜索 +set incsearch +" 设置字体和字号 +set guifont=Monaco:h20 +" 鼠标设置 +set mouse=a +noremap :let &mouse = (&mouse == 'a' ? 'v' : 'a') +" paste设置 +set pastetoggle= +" 保存所有文件 +nmap wa :wa +" 仅仅在下拉菜单中显示匹配项目,自动插入所有匹配项目的相同文本 +set completeopt=longest,menu + +"""""""""""""""""""""""""""""""""""""""""""""" +" ---> 折叠配置 +"""""""""""""""""""""""""""""""""""""""""""""" +" 基于缩进的代码折叠 +" set foldmethod=indent +" 基于语法的代码折叠 +set foldmethod=syntax +" 启动时关闭代码折叠 +set nofoldenable + +""""""""""""""""""""""""""""""""""""""" +"--->>>寄存器 +""""""""""""""""""""""""""""""""""""""" +" 宏快捷键:@a寄存器变为h寄存器 +nmap h @ + +""""""""""""""""""""""""""""""""""""""" +"--->>>vimrc的重载 +""""""""""""""""""""""""""""""""""""""" " Fast reloading of the .vimrc map ss :source ~/.vimrc " Fast editing of .vimrc @@ -765,10 +667,39 @@ map ee :e ~/.vimrc " When .vimrc is edited, reload it autocmd! bufwritepost .vimrc source ~/.vimrc +""""""""""""""""""""""""""""""""""""""" +"--->>>制表符(tabstop)的操作: +""""""""""""""""""""""""""""""""""""""" +" 自动缩进 +set autoindent +" 左缩进 +set shiftwidth=4 +" 制表符位数 +set tabstop=4 +" 制表位转为空格 +set expandtab +" backspace设置 +" eol 插入模式下输入backspace合并两行 +" start 删除此时插入前的操作 +set backspace=indent,eol,start +" whichwrap行间移动 +" b backspace是否需能够回退到上一行 +" s spcace是够能够继续到下一行 +set whichwrap=b,s,<,> + +""""""""""""""""""""""""""""""""""""""" +"---->>>>Tmux +" PS:放在最末尾 +""""""""""""""""""""""""""""""""""""""" +" 设置终端支持的颜色是256颜色 +set t_Co=256 +" tmux设置 +if exists('$TMUX') + set term=screen-256color +endif """"""""""""""""""""""""""""""""""""""" -" ---> 窗口切割映射键和跳转快捷键 -" +" --->>>窗口切割映射键和跳转快捷键 """"""""""""""""""""""""""""""""""""""" " 切割 nmap vs :vs @@ -784,17 +715,17 @@ nmap jw j " 移动窗口,左右移动 nmap rw +""""""""""""""""""""""""""""""""""""""" +" --->>> session的保存和读取 +""""""""""""""""""""""""""""""""""""""" +" 不在session文件中保存当前路径 +set sessionoptions-=curdir +set sessionoptions+=sesdir +" 保存/读取session和viminfo +map wsv :mksession! :wviminfo vim.viminfo +map rsv :source ./Session.vim :rviminfo vim.viminfo + -""""""""""""""""""""""""""""""""""""""" -"---->>>>Tmux -" PS:放在最末尾 -""""""""""""""""""""""""""""""""""""""" -" 设置终端支持的颜色是256颜色 -set t_Co=256 -" tmux设置 -if exists('$TMUX') - set term=screen-256color -endif """""""""""""""""""""""""""""""""""""""""""""" diff --git a/.vimrc.swp b/.vimrc.swp deleted file mode 100644 index 86fbd52134e0b96cc4d4af680da72a451b633ef6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53248 zcmeI533yy*dG7^X1BF89a!V=qL?OtFme>hdgr(T=QUbQ)>m><9ju?$b(%7S!VP<4m z2>~UxY{{GCeUF!TOJYmP=1pFDA*Db|fwH!}PYXe3G`c*j?d3v%a)0mle&@`LBs;Q8 z@4bDVIgkFDnRC8jU@AbM7p^y@=~=MMZyB(*I!FJ9ibm@_12EU7)!x7Lx~8 zzs4Kx6B@9hd_}l95xjbug{OrUD73(@u?1RE4P|%TP;}eWDYr_hHy7XJyyM0tzs3v- zNflb4&;o@PD6~MK1qv-tXn{ft6k4Fr0{_3aKq~&`qEAxDH`;a6# z{zLZjH*JNz{BN-LAGV)?5zpUb?}zQ@g%Qtx!`}DGd5gW_rEeb>J_;>RXn{ft6k4Fr z0)-YRv_PQ+3N27*fkF!uTAb&&^`kWg3aI);Bn9l zJ`5fL4}x;=d*C~7Eh>5*>;PS03AhRT;4MW(UjrAxQ(!d+gZsg3Fbm8CZw9YWkPTox zSO*q@67YS9`-@-$SPb3^ehESTRq!&{0%BkRcsKYh@O=pS&w&@f7Vr?b2TTArf}caE ze*v5ZD?kcN12=(R!i@Mj=mYD)LU0rKB}|OJ2A9A^&;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VWWhka_XP?>!_3R!wpzls3`OM~>CgEIFdfo;M zBWOe&imVlwupJ6E9oBVr!KOp><(%xxH?k9@dy8?YY=oF_^?m&p{mgav0 zpZ@@@e-Vh!zX7lXRDvHu>wg8D1lz!!K>YcMF2DoeC$zJ)^^4Npg{#m4*WLnn0?fS% zoSgz^XOA3=3SJ%xULK4aiGr7h^(vKtA}Dxy7=soqaCW>6w7}UZczO8G;pL&g+4;}U z*>Pe~%i}?R%sL5D*Cy6^@fd6MShrAp5$!`XbE|#50vrbo9cs6HvauqKanC6#`akPY Bk>>ya diff --git a/bundle/a.vim b/bundle/a.vim new file mode 160000 index 0000000..2cbe946 --- /dev/null +++ b/bundle/a.vim @@ -0,0 +1 @@ +Subproject commit 2cbe946206ec622d9d8cf2c99317f204c4d41885 diff --git a/bundle/calendar b/bundle/calendar new file mode 160000 index 0000000..a61af2b --- /dev/null +++ b/bundle/calendar @@ -0,0 +1 @@ +Subproject commit a61af2bf6d8919d75e9ab48776316f1b3e11c336 diff --git a/bundle/tagbar b/bundle/tagbar new file mode 160000 index 0000000..7b36c46 --- /dev/null +++ b/bundle/tagbar @@ -0,0 +1 @@ +Subproject commit 7b36c46d17d57db34fdb0adac9ba6382d0bb5e66 diff --git a/bundle/vim-gitgutter b/bundle/vim-gitgutter new file mode 160000 index 0000000..26c6b54 --- /dev/null +++ b/bundle/vim-gitgutter @@ -0,0 +1 @@ +Subproject commit 26c6b549f287b8ae348eda083e7c77f79f4de28b diff --git a/ftplugin/README.md b/ftplugin/README.md new file mode 100644 index 0000000..0992c87 --- /dev/null +++ b/ftplugin/README.md @@ -0,0 +1,8 @@ +--- +自定义的文件类型检测 +--- + + +## lookupfile +功能:lookupfile的文件类型检测操作,通过ESC两次按键关闭缓冲区 +文件:lookupfile.vim diff --git a/ftplugin/lookupfile.vim b/ftplugin/lookupfile.vim new file mode 100644 index 0000000..6d8b7ff --- /dev/null +++ b/ftplugin/lookupfile.vim @@ -0,0 +1,3 @@ +" close lookupfile window by two Esc +nnoremap q +inoremap q From b3f40374905058c78851a74c843f7d4063646878 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 16 Aug 2016 20:27:09 +0800 Subject: [PATCH 006/160] Delete vim-pyenv --- .gitmodules | 3 --- .vimrc | 22 ++++------------------ .vimrc.swp | Bin 0 -> 40960 bytes bundle/vim-pyenv | 1 - 4 files changed, 4 insertions(+), 22 deletions(-) create mode 100644 .vimrc.swp delete mode 160000 bundle/vim-pyenv diff --git a/.gitmodules b/.gitmodules index deecd0c..8f2e4b1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,9 +40,6 @@ [submodule "bundle/vim-colors-solarized"] path = bundle/vim-colors-solarized url = https://github.com/altercation/vim-colors-solarized.git -[submodule "bundle/vim-pyenv"] - path = bundle/vim-pyenv - url = https://github.com/lambdalisue/vim-pyenv.git [submodule "bundle/taglist"] path = bundle/taglist url = https://github.com/vim-scripts/taglist.vim.git diff --git a/.vimrc b/.vimrc index 3345de6..bbe590b 100644 --- a/.vimrc +++ b/.vimrc @@ -27,11 +27,6 @@ syntax on filetype plugin indent on -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> vim-pyenv 用于保证pyenv和vim的兼容运行,好像没用 -""""""""""""""""""""""""""""""""""""""""""""""""""""""" - - """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> emmet-vim,用于html,css的编写 " 展开缩略词:div>p#foo$*3>a + + , @@ -525,8 +520,7 @@ map bb :BottomExplorerWindow nmap :WMToggle """"""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> 文件缓冲区窗口插件3 -" nerdtree 配置 +" ---> 文件缓冲区窗口插件-3-nerdtree 配置 " 显示当前目录下的树形目录树,有时候有用 " PS: 建议结合lookupfile来使用 """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -545,18 +539,10 @@ nmap :NERDTreeToggle """""""""""""""""""""""""""""""""""""""" -" ---> 文件缓冲区窗口插件4 -" lookupfile配置 -" 1,开启窗口,输入bamboo.c + Enter,之后使用,选择 -" 2,LUBufs:缓冲区浏览,在所有的缓冲区中寻找某个函数等,类似cscope -" 3,LUWalk:目录浏览 -" 4,忽略大小写查找:\c或者\C -" PS:依赖genutils插件 -" +" ---> 文件缓冲区窗口插件-4-lookupfile配置 """"""""""""""""""""""""""""""""""""""""""""""""""""" -" 生成filenametags文件,注意tf和:中间的空格就正常的空格哦 -" 其中/home/bamboo/.local/bin/filenametags可执行文件见: -" +" 可执行文件: +" nmap ft :!bash \ /home/bamboo/.local/bin/filenametags \:source ~/.vimrc diff --git a/.vimrc.swp b/.vimrc.swp new file mode 100644 index 0000000000000000000000000000000000000000..50ea1fe0ec0e0776d873ef40fcf2bb0fc36e788f GIT binary patch literal 40960 zcmeI533Oanndb`#Js9X_2|dlEo8d(ck!-6ZFG)y*C1N{v60n`%B@V~^eCjaeYd{ZV*nkZDq zmfdJw|KWwd#{x!4jkdsO3yikFXbX(Cz-SAMw!ml$jJCjN3;f^S0_ntid|#%L?=%%{ zGJoGO=j z`Nx>&kDI@tLC@c1?z{E)>7eK4@#vq?78q@T(H0nOfzcKiZGq7i7;S;k78q@T(H0nO zfzcND|FQ)FjXvMs@@DHr9>)If%KyLkfX{at>;s#?li&%^0zMBO1dBiwct3dak9@wD z!FJFIIzSz`3H;y>eZC7|8~74<9Lxlt0yhE+d>rK7@AI7pE5JN(BN%v}&({k!g9!Kx zC1(c4nN_%^g{+6-iF70$OFe8oPUX^eGWLY^(BqAfq#aDhlWk8t zOyT;SnC{qiq;H-EPuo*H^j;afS8TDS&eUdxU>#RBIbetI2)1E)PJp1a=fz@kryPwYP zTb(<8!8v$xV8v0gP7V6o>Xz_94?msE*}Tr_+MYetQ9^aHytyJ%a(j|wW{|8onmtXC z`=rdhFMAE3ylkIHJu3K%=TwFP@zt=gw)7f*>Bk5dxDZBpkz}9Zv z-{EvRk*cY#P6k@5LXmVh(~wEo$zVK|rYEa{@s{cq22ZToZfUX8GH&^vVlY)NSh(Q6 zdG}76T_D``RK9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w5w?0j%NYp7C1S$jZzIr|Yz$6p00O*m9w@yDRssC{2Zz zuYXmv0)gX^%bjIJptFttgOK-C2KP-_5fZX82o z#Ytue_3tYyj-|+wKrN-Zgz7cbEm3v5=2BgVtRO;3jSWplQ&4w{^f_8zWA+3Cy_--P zxH_73bZfq6xwC0a{`g@%7N}-+TL-^Ts~1uo&;s)LO*_m8Ez+nGng}=B;vnyyiq-eO E0juUz%K!iX literal 0 HcmV?d00001 diff --git a/bundle/vim-pyenv b/bundle/vim-pyenv deleted file mode 160000 index bed0d8b..0000000 --- a/bundle/vim-pyenv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bed0d8bc809096cfc6a1e649a4d57a1f375960ff From f05e43af3c4133f0dd800c4d5c427fb4ffd78742 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 16 Aug 2016 23:14:53 +0800 Subject: [PATCH 007/160] Update python --- .gitmodules | 3 --- .vimrc | 54 ++++++++++++++++++++++----------------------- .vimrc.swp | Bin 40960 -> 0 bytes bundle/python-mode | 1 - 4 files changed, 27 insertions(+), 31 deletions(-) delete mode 100644 .vimrc.swp delete mode 160000 bundle/python-mode diff --git a/.gitmodules b/.gitmodules index 8f2e4b1..85c52c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,9 +34,6 @@ [submodule "bundle/vim-pydocstring"] path = bundle/vim-pydocstring url = https://github.com/heavenshell/vim-pydocstring.git -[submodule "bundle/python-mode"] - path = bundle/python-mode - url = https://github.com/klen/python-mode.git [submodule "bundle/vim-colors-solarized"] path = bundle/vim-colors-solarized url = https://github.com/altercation/vim-colors-solarized.git diff --git a/.vimrc b/.vimrc index bbe590b..7be1e30 100644 --- a/.vimrc +++ b/.vimrc @@ -127,23 +127,7 @@ let g:BASH_Email = 'unlessbamboo@gmail.com' let g:BASH_Company = 'BigUniverse' -""""""""""""""""""""""""""""""""""""""" -""""""""""""""""""""""""""""""""""""""" -"---->>>>>python自动补全插件 jedi vim -""""""""""""""""""""""""""""""""""""""" -" 在跳转的同时进行切割,可选项有left/right/top/bottom/winwidth -"let g:jedi#use_splits_not_buffers = "left" -let g:jedi#show_call_signatures = "1" -" 跳转,类似,其中返回为 -let g:jedi#goto_command = "d" -let g:jedi#goto_assignments_command = "g" -let g:jedi#goto_definitions_command = "" -let g:jedi#documentation_command = "K" -let g:jedi#usages_command = "n" -let g:jedi#rename_command = "r" -let g:jedi#completions_command = "" - - +"""""""""""""""""""""""""""""""python开发""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""" "---->>>>python-mode配置(python2.7) " K 显示python文档 @@ -183,6 +167,32 @@ map ln :lnext map lp :lprev +""""""""""""""""""""""""""""""""""""""" +"---->>>>>python自动补全插件 jedi vim +""""""""""""""""""""""""""""""""""""""" +" 跳转并进行切割,可选项:left/right/top/bottom/winwidth +"let g:jedi#use_splits_not_buffers = "left" +let g:jedi#show_call_signatures = "1" +" 跳转,类似,其中返回为 +let g:jedi#goto_command = "d" +let g:jedi#goto_assignments_command = "g" +let g:jedi#goto_definitions_command = "" +let g:jedi#documentation_command = "K" +let g:jedi#usages_command = "n" +let g:jedi#rename_command = "r" +let g:jedi#completions_command = "" + + +""""""""""""""""""""""""""""""""""""""" +" docstring的配置参数 +" 自动插入docstring字符串 +""""""""""""""""""""""""""""""""""""""" +" 设置拓展 +autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 +"nmap (pydocstring) +nmap py :Pydocstring + + """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> 版本控制-1-vim-signify @@ -253,16 +263,6 @@ let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 -""""""""""""""""""""""""""""""""""""""" -" docstring的配置参数 -" 自动插入docstring字符串 -""""""""""""""""""""""""""""""""""""""" -" 设置拓展 -autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 -"nmap (pydocstring) -nmap py :Pydocstring - - """"""""""""""""""""""""""""""""""GCC模块""""""""""""""""""""""""""" diff --git a/.vimrc.swp b/.vimrc.swp deleted file mode 100644 index 50ea1fe0ec0e0776d873ef40fcf2bb0fc36e788f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40960 zcmeI533Oanndb`#Js9X_2|dlEo8d(ck!-6ZFG)y*C1N{v60n`%B@V~^eCjaeYd{ZV*nkZDq zmfdJw|KWwd#{x!4jkdsO3yikFXbX(Cz-SAMw!ml$jJCjN3;f^S0_ntid|#%L?=%%{ zGJoGO=j z`Nx>&kDI@tLC@c1?z{E)>7eK4@#vq?78q@T(H0nOfzcKiZGq7i7;S;k78q@T(H0nO zfzcND|FQ)FjXvMs@@DHr9>)If%KyLkfX{at>;s#?li&%^0zMBO1dBiwct3dak9@wD z!FJFIIzSz`3H;y>eZC7|8~74<9Lxlt0yhE+d>rK7@AI7pE5JN(BN%v}&({k!g9!Kx zC1(c4nN_%^g{+6-iF70$OFe8oPUX^eGWLY^(BqAfq#aDhlWk8t zOyT;SnC{qiq;H-EPuo*H^j;afS8TDS&eUdxU>#RBIbetI2)1E)PJp1a=fz@kryPwYP zTb(<8!8v$xV8v0gP7V6o>Xz_94?msE*}Tr_+MYetQ9^aHytyJ%a(j|wW{|8onmtXC z`=rdhFMAE3ylkIHJu3K%=TwFP@zt=gw)7f*>Bk5dxDZBpkz}9Zv z-{EvRk*cY#P6k@5LXmVh(~wEo$zVK|rYEa{@s{cq22ZToZfUX8GH&^vVlY)NSh(Q6 zdG}76T_D``RK9(MrmA|k)outRB9e#NO^aC(XeOHiLEB2ltwl4ZThs2pH+Aj3>vn|v z^%Z|9TU`ERbyX@BNhIuasy>)WrQNjws(NZNtMrbyJT zu$LtQvBnB__DYM?s|H{kr_)ULlvQi#*BdKz$2QtQral?0X^oARF41ypV6}#AdHYm4 z5RFPUKh0t_#gmrTsD_^u6%?f|l-g{!)s|0P5NN0?hxk0ZG13%?(SXTFC}bxs9@Dms zc2gh|O}%eCAtS9hl=vhJ zAiL*SNovWZhy+S*>s$j{hjK-gxVj{<)3G|c{=h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 /dev/null @@ -1 +0,0 @@ -Subproject commit 4bda3035ce9523a6d31792bc6c22ce2b9e0ae9a3 From 49b45a639c549266e59164fbfcb4125d6d5cfac8 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 17 Aug 2016 10:03:46 +0800 Subject: [PATCH 008/160] Delete YouCompleteMe --- .gitmodules | 3 +++ .vimrc | 55 ++++++++++++++++++++++--------------------- bundle/YouCompleteMe | 1 - bundle/bufexplorer | 2 +- bundle/emmet-vim | 2 +- bundle/jedi-vim | 2 +- bundle/nerdcommenter | 2 +- bundle/python-mode | 1 + bundle/syntastic | 2 +- bundle/vim-javascript | 2 +- bundle/vim-signify | 2 +- 11 files changed, 39 insertions(+), 35 deletions(-) delete mode 160000 bundle/YouCompleteMe create mode 160000 bundle/python-mode diff --git a/.gitmodules b/.gitmodules index 85c52c7..3ba3119 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,3 +76,6 @@ [submodule "bundle/vim-gitgutter"] path = bundle/vim-gitgutter url = git://github.com/airblade/vim-gitgutter.git +[submodule "bundle/python-mode"] + path = bundle/python-mode + url = https://github.com/klen/python-mode.git diff --git a/.vimrc b/.vimrc index 7be1e30..a379193 100644 --- a/.vimrc +++ b/.vimrc @@ -139,32 +139,32 @@ let g:BASH_Company = 'BigUniverse' " PS:考虑到和syntastic语法检查冲突,关闭pylint检查 " """"""""""""""""""""""""""""""""""""""" -" 避免和jedi vim冲突 -let g:pymode_rope=0 -" Linting, disable if exists syntastic -let g:pymode_lint=0 - -" doc -let g:pymode_doc=1 -" 查看文档快捷键 -let g:pymode_doc_key='K' -" support virtualenv -let g:pymode_virtualenv = 1 -" Enable breakpoints plugin -let g:pymode_breakpoint = 1 -let g:pymode_breakpoint_bind = 'b' -" syntax highlighting -let g:pymode_syntax = 1 -let g:pymode_syntax_all = 1 -let g:pymode_syntax_indent_errors = g:pymode_syntax_all -let g:pymode_syntax_space_errors = g:pymode_syntax_all -" Don't autofold code -let g:pymode_folding = 0 -" 关闭pyflakes插件的语法检查 -" let g:pyflakes_use_quickfix = 0 -" 缓存中的跳转映射--python-mode中的CodeCheck代码检查 -map ln :lnext -map lp :lprev +" " 避免和jedi vim冲突 +" let g:pymode_rope=0 +" " Linting, disable if exists syntastic +" let g:pymode_lint=0 +" +" " doc +" let g:pymode_doc=1 +" " 查看文档快捷键 +" let g:pymode_doc_key='K' +" " support virtualenv +" let g:pymode_virtualenv = 1 +" " Enable breakpoints plugin +" let g:pymode_breakpoint = 1 +" let g:pymode_breakpoint_bind = 'b' +" " syntax highlighting +" let g:pymode_syntax = 1 +" let g:pymode_syntax_all = 1 +" let g:pymode_syntax_indent_errors = g:pymode_syntax_all +" let g:pymode_syntax_space_errors = g:pymode_syntax_all +" " Don't autofold code +" let g:pymode_folding = 0 +" " 关闭pyflakes插件的语法检查 +" " let g:pyflakes_use_quickfix = 0 +" " 缓存中的跳转映射--python-mode中的CodeCheck代码检查 +" map ln :lnext +" map lp :lprev """"""""""""""""""""""""""""""""""""""" @@ -452,7 +452,8 @@ set cursorline " 后期一键自动化安装的时候容易,现在配置很麻烦 """"""""""""""""""""""""""""""""""""""" " 找到powerline插件位置,当然也可以放在vim目录下面 -set rtp+=~/.local/lib/python2.7/site-packages/powerline/bindings/vim/ +" set rtp+=~/.local/lib/python2.7/site-packages/powerline/bindings/vim/ +set rtp+=~/.local/lib/python3.4/site-packages/powerline/bindings/vim/ " 添加新的字体 set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9 set laststatus=2 diff --git a/bundle/YouCompleteMe b/bundle/YouCompleteMe deleted file mode 160000 index c1047be..0000000 --- a/bundle/YouCompleteMe +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c1047bee9aa68292ab267a0a4a2d7bfb8d3ce1eb diff --git a/bundle/bufexplorer b/bundle/bufexplorer index 937eb53..db910fb 160000 --- a/bundle/bufexplorer +++ b/bundle/bufexplorer @@ -1 +1 @@ -Subproject commit 937eb532e8896eb6fbe31dcbea2f5a6ff114b385 +Subproject commit db910fb2d54d5461f3641646b437b54186a5bb79 diff --git a/bundle/emmet-vim b/bundle/emmet-vim index 3654efd..f4b097a 160000 --- a/bundle/emmet-vim +++ b/bundle/emmet-vim @@ -1 +1 @@ -Subproject commit 3654efd3d18d73d654be7de45a892911c295b08b +Subproject commit f4b097af50833964e15f17192f2d1c336e34936e diff --git a/bundle/jedi-vim b/bundle/jedi-vim index 6b7dfe1..99132ec 160000 --- a/bundle/jedi-vim +++ b/bundle/jedi-vim @@ -1 +1 @@ -Subproject commit 6b7dfe1c1afa9f40df283b2223676ba32f9aa791 +Subproject commit 99132ec54560de15f84f656539dad3094865b222 diff --git a/bundle/nerdcommenter b/bundle/nerdcommenter index e2d47be..c3d6a20 160000 --- a/bundle/nerdcommenter +++ b/bundle/nerdcommenter @@ -1 +1 @@ -Subproject commit e2d47bec2662d5fcd324d17e22dc37f38c97bf2d +Subproject commit c3d6a2069bb0286c9633fbbffb4983797f7b8822 diff --git a/bundle/python-mode b/bundle/python-mode new file mode 160000 index 0000000..4bda303 --- /dev/null +++ b/bundle/python-mode @@ -0,0 +1 @@ +Subproject commit 4bda3035ce9523a6d31792bc6c22ce2b9e0ae9a3 diff --git a/bundle/syntastic b/bundle/syntastic index cee74e0..cdfb64d 160000 --- a/bundle/syntastic +++ b/bundle/syntastic @@ -1 +1 @@ -Subproject commit cee74e0c1af934065fd1b3046e53cda76574f703 +Subproject commit cdfb64db6711f8df6937d368cff75c7213505fe2 diff --git a/bundle/vim-javascript b/bundle/vim-javascript index 26c7330..8e3f589 160000 --- a/bundle/vim-javascript +++ b/bundle/vim-javascript @@ -1 +1 @@ -Subproject commit 26c7330de100eb1d1809858358c2ccd5b2a74078 +Subproject commit 8e3f5897728ab38aa28edbab02d18bda36241a1b diff --git a/bundle/vim-signify b/bundle/vim-signify index 76bde23..472668f 160000 --- a/bundle/vim-signify +++ b/bundle/vim-signify @@ -1 +1 @@ -Subproject commit 76bde232d163c99a8e72b517d8ef770b0d79849e +Subproject commit 472668fbd286c8f8f3db0024a02056d4c25524b1 From e781d9124edffa990c5aa6423fc15d070f676e1b Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 17 Aug 2016 11:53:03 +0800 Subject: [PATCH 009/160] Delete python-mode --- .gitmodules | 3 --- bundle/python-mode | 1 - 2 files changed, 4 deletions(-) delete mode 160000 bundle/python-mode diff --git a/.gitmodules b/.gitmodules index 3ba3119..85c52c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,6 +76,3 @@ [submodule "bundle/vim-gitgutter"] path = bundle/vim-gitgutter url = git://github.com/airblade/vim-gitgutter.git -[submodule "bundle/python-mode"] - path = bundle/python-mode - url = https://github.com/klen/python-mode.git diff --git a/bundle/python-mode b/bundle/python-mode deleted file mode 160000 index 4bda303..0000000 --- a/bundle/python-mode +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4bda3035ce9523a6d31792bc6c22ce2b9e0ae9a3 From 6a8d4c27f3766594f8c772179fdb49d62cbe12cc Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 18 Aug 2016 23:26:39 +0800 Subject: [PATCH 010/160] Delete markdown --- bundle/markdown | 1 - 1 file changed, 1 deletion(-) delete mode 160000 bundle/markdown diff --git a/bundle/markdown b/bundle/markdown deleted file mode 160000 index e45d610..0000000 --- a/bundle/markdown +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e45d6108433274e82649afa269b2d7adf606e4be From 98571187388ce61ff7580722f88f624ff369ba75 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 19 Aug 2016 14:20:44 +0800 Subject: [PATCH 011/160] Modify python working evnironmen --- .gitmodules | 46 +++-------- .vimrc | 185 ++++++++++-------------------------------- bundle/a.vim | 1 - bundle/emmet-vim | 1 - bundle/jedi-vim | 1 - bundle/syntastic | 1 - bundle/tagbar | 1 - bundle/vim-javascript | 1 - bundle/vim-signify | 1 - bundle/webapi-vim | 1 - 10 files changed, 53 insertions(+), 186 deletions(-) delete mode 160000 bundle/a.vim delete mode 160000 bundle/emmet-vim delete mode 160000 bundle/jedi-vim delete mode 160000 bundle/syntastic delete mode 160000 bundle/tagbar delete mode 160000 bundle/vim-javascript delete mode 160000 bundle/vim-signify delete mode 160000 bundle/webapi-vim diff --git a/.gitmodules b/.gitmodules index 85c52c7..0d6426b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,6 @@ -[submodule "bundle/bash-support"] - path = bundle/bash-support - url = https://github.com/vim-scripts/bash-support.vim.git [submodule "bundle/vim-pathogen"] path = bundle/vim-pathogen url = https://github.com/tpope/vim-pathogen.git -[submodule "bundle/DoxygenToolkit"] - path = bundle/DoxygenToolkit - url = https://github.com/vim-scripts/DoxygenToolkit.vim.git -[submodule "bundle/jedi-vim"] - path = bundle/jedi-vim - url = https://github.com/davidhalter/jedi-vim.git [submodule "bundle/nerdcommenter"] path = bundle/nerdcommenter url = https://github.com/scrooloose/nerdcommenter.git @@ -31,9 +22,6 @@ [submodule "bundle/nerdtree"] path = bundle/nerdtree url = https://github.com/scrooloose/nerdtree.git -[submodule "bundle/vim-pydocstring"] - path = bundle/vim-pydocstring - url = https://github.com/heavenshell/vim-pydocstring.git [submodule "bundle/vim-colors-solarized"] path = bundle/vim-colors-solarized url = https://github.com/altercation/vim-colors-solarized.git @@ -43,36 +31,22 @@ [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git -[submodule "bundle/syntastic"] - path = bundle/syntastic - url = https://github.com/scrooloose/syntastic.git -[submodule "bundle/vim-json"] - path = bundle/vim-json - url = https://github.com/helino/vim-json.git -[submodule "bundle/vim-javascript"] - path = bundle/vim-javascript - url = https://github.com/pangloss/vim-javascript.git [submodule "bundle/ag.vim"] path = bundle/ag.vim url = https://github.com/rking/ag.vim.git -[submodule "bundle/vim-signify"] - path = bundle/vim-signify - url = https://github.com/mhinz/vim-signify.git -[submodule "bundle/emmet-vim"] - path = bundle/emmet-vim - url = https://github.com/mattn/emmet-vim.git -[submodule "bundle/webapi-vim"] - path = bundle/webapi-vim - url = https://github.com/mattn/webapi-vim.git -[submodule "bundle/tagbar"] - path = bundle/tagbar - url = https://github.com/majutsushi/tagbar.git [submodule "bundle/calendar"] path = bundle/calendar url = https://github.com/itchyny/calendar.vim.git -[submodule "bundle/a.vim"] - path = bundle/a.vim - url = https://github.com/vim-scripts/a.vim.git [submodule "bundle/vim-gitgutter"] path = bundle/vim-gitgutter url = git://github.com/airblade/vim-gitgutter.git + +[submodule "bundle/bash-support"] + path = bundle/bash-support + url = https://github.com/vim-scripts/bash-support.vim.git +[submodule "bundle/vim-pydocstring"] + path = bundle/vim-pydocstring + url = https://github.com/heavenshell/vim-pydocstring.git +[submodule "bundle/vim-json"] + path = bundle/vim-json + url = https://github.com/helino/vim-json.git diff --git a/.vimrc b/.vimrc index a379193..ce82f21 100644 --- a/.vimrc +++ b/.vimrc @@ -23,60 +23,8 @@ call pathogen#infect() call pathogen#helptags() " 自动检测文件类型,见印象笔记中说明 -syntax on filetype plugin indent on - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> emmet-vim,用于html,css的编写 -" 展开缩略词:div>p#foo$*3>a + + , -" 包裹指定变为指定的标签: -" V+选取+, + (输入ul>li*) -" 其中后面的根据实际情况输入 -" 选中标签(插入模式): -" 整个标签(d) -" 标签内容(D) -" 编辑点跳转: -" 下一个:n -" 上一个:N -" 更新图片大小 -" i,图片必须真实存在 -" 合并多行 -" m -" 移除某一个标签对 -" k -" 分割/合并标签 -" 将标签从合并 -" 切换注释 -" / -" 生成锚 -" a -" 根据URL地址生成引用文本 -" A -" 注意:如果更改了快捷键,请修改上面的 -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Enable just for html/css -let g:user_emmet_install_global = 0 -autocmd FileType html,css EmmetInstall -" Redifine trigger key,default -let g:user_emmet_leader_key='' -" Add custom snippets when install web-api for emmet-vim -"let g:user_emmet_settings = webapi#json#decode( - "\join(readfile(expand( - "\'~/.snippets_custom.json')), "\n")) - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> webapi-vim,An interface to WEB APIs -" 参考: -" https://raw.githubusercontent.com/mattn/emmet-vim/master/TUTORIAL -" 快捷键: -" 1,自动添加图片大小,i,路径所指图片必须存在 -" 2,注释 -" 移动到需要注释的标签头部,j,进行注释和取消 -" 3,url -""""""""""""""""""""""""""""""""""""""""""""""""""""""" +syntax on """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -97,25 +45,6 @@ let g:ag_working_path_mode="r" """"""""""""""""""""""""""""""""""""""""""""""""""""""" -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> vim-javascript,配置js开发环境 -""""""""""""""""""""""""""""""""""""""""""""""""""""""" -let g:javascript_plugin_jsdoc = 1 -let g:javascript_plugin_ngdoc = 1 -let g:javascript_plugin_flow = 1 -" 自定义隐匿字符 -let g:javascript_conceal_function = "ƒ" -let g:javascript_conceal_null = "ø" -let g:javascript_conceal_this = "@" -let g:javascript_conceal_return = "⇚" -let g:javascript_conceal_undefined = "¿" -let g:javascript_conceal_NaN = "ℕ" -let g:javascript_conceal_prototype = "¶" -let g:javascript_conceal_static = "•" -let g:javascript_conceal_super = "Ω" -let g:javascript_conceal_arrow_function = "⇒" - - """""""""""""""""""""""""""""""""""""""""""""""""""""""" " bash 支持设置 " 1,函数注释快捷键:\cfu @@ -167,20 +96,20 @@ let g:BASH_Company = 'BigUniverse' " map lp :lprev -""""""""""""""""""""""""""""""""""""""" -"---->>>>>python自动补全插件 jedi vim -""""""""""""""""""""""""""""""""""""""" -" 跳转并进行切割,可选项:left/right/top/bottom/winwidth -"let g:jedi#use_splits_not_buffers = "left" -let g:jedi#show_call_signatures = "1" -" 跳转,类似,其中返回为 -let g:jedi#goto_command = "d" -let g:jedi#goto_assignments_command = "g" -let g:jedi#goto_definitions_command = "" -let g:jedi#documentation_command = "K" -let g:jedi#usages_command = "n" -let g:jedi#rename_command = "r" -let g:jedi#completions_command = "" +" """"""""""""""""""""""""""""""""""""""" +" "---->>>>>python自动补全插件 jedi vim +" """"""""""""""""""""""""""""""""""""""" +" " 跳转并进行切割,可选项:left/right/top/bottom/winwidth +" " let g:jedi#use_splits_not_buffers = "left" +" let g:jedi#show_call_signatures = "1" +" " 跳转,类似,其中返回为 +" let g:jedi#goto_command = "d" +" let g:jedi#goto_assignments_command = "g" +" let g:jedi#goto_definitions_command = "" +" let g:jedi#documentation_command = "K" +" let g:jedi#usages_command = "n" +" let g:jedi#rename_command = "r" +" let g:jedi#completions_command = "" """"""""""""""""""""""""""""""""""""""" @@ -194,6 +123,7 @@ nmap py :Pydocstring +"=======================版本控制========================= """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> 版本控制-1-vim-signify " 用于所有的版本控制 @@ -225,13 +155,6 @@ nmap ph GitGutterPrevHunk - -""""""""""""""""""""""""""""""""""""""" -" vim-surround配置 -" 见印象笔记中的说明 -""""""""""""""""""""""""""""""""""""""" -" 没有特殊的配置,不要文档中的custom configure - """"""""""""""""""""""""""""""""""""""" " --->语法检查,syntastic的配置参数 " 获取错误信息:Errors或者lopen @@ -240,56 +163,34 @@ nmap ph GitGutterPrevHunk " 每一个目录都有一份独有的bamboo.vim配置当前项目的语言配置 " """"""""""""""""""""""""""""""""""""""" -" 必要配置1 -" Conflicts withs powerline,so close -" set statusline+=%#warningmsg# -" set statusline+=%{SyntasticStatuslineFlag()} -" set statusline+=%* -" 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) -let g:syntastic_error_symbol = 'EE' -let g:syntastic_style_error_symbol = 'E>' -let g:syntastic_warning_symbol = 'WW' -let g:syntastic_style_warning_symbol = 'W>' -let g:syntastic_always_populate_loc_list = 1 -" 必要配置3 -" 不需要手动调用 SyntasticSetTocList. 默认1 -let g:syntastic_always_populate_loc_list = 1 -" 自动拉起关闭错误窗口. -" 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 1 -" 打开文件时做语法检查, 默认 0 -let g:syntastic_check_on_open = 1 -" 报错时做语法检查, 默认 1 -let g:syntastic_check_on_wq = 0 - - - - -""""""""""""""""""""""""""""""""""GCC模块""""""""""""""""""""""""""" -""""""""""""""""""""""""""""""""""""""" -" ---> GCC模块1 -" DoxygenToolkit注释文档配置: -" 详细的信息见DoxygenToolkit.vim插件 -" -""""""""""""""""""""""""""""""""""""""" -" 函数和类注释,进行键的映射(输入,fg,即输出如下的字段) -nmap fg :Dox -" 插入文件名,作者时间 -nmap fa :DoxAuthor -" 插件license注释 -nmap fl :DoxLic -" 跳过文档的编写,不知道干什么的 -" nmap fu :DoxUndoc -" 块注释 -nmap fb :DoxBlock -" c/c++语言风格见不同目录下的配置 +" " 必要配置1 +" " Conflicts withs powerline,so close +" " set statusline+=%#warningmsg# +" " set statusline+=%{SyntasticStatuslineFlag()} +" " set statusline+=%* +" " 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) +" let g:syntastic_error_symbol = 'EE' +" let g:syntastic_style_error_symbol = 'E>' +" let g:syntastic_warning_symbol = 'WW' +" let g:syntastic_style_warning_symbol = 'W>' +" let g:syntastic_always_populate_loc_list = 1 +" " 必要配置3 +" " 不需要手动调用 SyntasticSetTocList. 默认1 +" let g:syntastic_always_populate_loc_list = 1 +" " 自动拉起关闭错误窗口. +" " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 +" let g:syntastic_auto_loc_list = 1 +" " 打开文件时做语法检查, 默认 0 +" let g:syntastic_check_on_open = 1 +" " 报错时做语法检查, 默认 1 +" let g:syntastic_check_on_wq = 0 + +""""""""""""""""""""""""""""""""""""""" +" vim-surround配置 +" 见印象笔记中的说明 +""""""""""""""""""""""""""""""""""""""" +" 没有特殊的配置,不要文档中的custom configure -""""""""""""""""""""""""""""""""""""""" -" ---> GCC模块2 -""""""""""""""""""""""""""""""""""""""" -nmap as :A -nmap ass :AS -nmap asv :AV diff --git a/bundle/a.vim b/bundle/a.vim deleted file mode 160000 index 2cbe946..0000000 --- a/bundle/a.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2cbe946206ec622d9d8cf2c99317f204c4d41885 diff --git a/bundle/emmet-vim b/bundle/emmet-vim deleted file mode 160000 index f4b097a..0000000 --- a/bundle/emmet-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f4b097af50833964e15f17192f2d1c336e34936e diff --git a/bundle/jedi-vim b/bundle/jedi-vim deleted file mode 160000 index 99132ec..0000000 --- a/bundle/jedi-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99132ec54560de15f84f656539dad3094865b222 diff --git a/bundle/syntastic b/bundle/syntastic deleted file mode 160000 index cdfb64d..0000000 --- a/bundle/syntastic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cdfb64db6711f8df6937d368cff75c7213505fe2 diff --git a/bundle/tagbar b/bundle/tagbar deleted file mode 160000 index 7b36c46..0000000 --- a/bundle/tagbar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7b36c46d17d57db34fdb0adac9ba6382d0bb5e66 diff --git a/bundle/vim-javascript b/bundle/vim-javascript deleted file mode 160000 index 8e3f589..0000000 --- a/bundle/vim-javascript +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e3f5897728ab38aa28edbab02d18bda36241a1b diff --git a/bundle/vim-signify b/bundle/vim-signify deleted file mode 160000 index 472668f..0000000 --- a/bundle/vim-signify +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 472668fbd286c8f8f3db0024a02056d4c25524b1 diff --git a/bundle/webapi-vim b/bundle/webapi-vim deleted file mode 160000 index e3fa93f..0000000 --- a/bundle/webapi-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e3fa93f29a3a0754204002775e140d8a9acfd7fd From f31110282db186628caaefd0c58d325de823bec2 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 22 Aug 2016 12:24:42 +0800 Subject: [PATCH 012/160] Add vim-python env --- .gitmodules | 6 +++ .vimrc | 121 +++++++++++++++--------------------------- bundle/DoxygenToolkit | 1 - bundle/YouCompleteMe | 1 + bundle/syntastic | 1 + 5 files changed, 51 insertions(+), 79 deletions(-) delete mode 160000 bundle/DoxygenToolkit create mode 160000 bundle/YouCompleteMe create mode 160000 bundle/syntastic diff --git a/.gitmodules b/.gitmodules index 0d6426b..ea19cef 100644 --- a/.gitmodules +++ b/.gitmodules @@ -50,3 +50,9 @@ [submodule "bundle/vim-json"] path = bundle/vim-json url = https://github.com/helino/vim-json.git +[submodule "bundle/syntastic"] + path = bundle/syntastic + url = https://github.com/scrooloose/syntastic.git +[submodule "bundle/YouCompleteMe"] + path = bundle/YouCompleteMe + url = https://github.com/Valloric/YouCompleteMe.git diff --git a/.vimrc b/.vimrc index ce82f21..966a6ce 100644 --- a/.vimrc +++ b/.vimrc @@ -56,62 +56,6 @@ let g:BASH_Email = 'unlessbamboo@gmail.com' let g:BASH_Company = 'BigUniverse' -"""""""""""""""""""""""""""""""python开发""""""""""""""""""""""""" -""""""""""""""""""""""""""""""""""""""" -"---->>>>python-mode配置(python2.7) -" K 显示python文档 -" b Set, unset breakpoint -" [[ Jump on previous class or function -" ]] Jump on next class or function -" [M Jump on previous class or method -" ]M Jump on next class or method -" PS:考虑到和syntastic语法检查冲突,关闭pylint检查 -" -""""""""""""""""""""""""""""""""""""""" -" " 避免和jedi vim冲突 -" let g:pymode_rope=0 -" " Linting, disable if exists syntastic -" let g:pymode_lint=0 -" -" " doc -" let g:pymode_doc=1 -" " 查看文档快捷键 -" let g:pymode_doc_key='K' -" " support virtualenv -" let g:pymode_virtualenv = 1 -" " Enable breakpoints plugin -" let g:pymode_breakpoint = 1 -" let g:pymode_breakpoint_bind = 'b' -" " syntax highlighting -" let g:pymode_syntax = 1 -" let g:pymode_syntax_all = 1 -" let g:pymode_syntax_indent_errors = g:pymode_syntax_all -" let g:pymode_syntax_space_errors = g:pymode_syntax_all -" " Don't autofold code -" let g:pymode_folding = 0 -" " 关闭pyflakes插件的语法检查 -" " let g:pyflakes_use_quickfix = 0 -" " 缓存中的跳转映射--python-mode中的CodeCheck代码检查 -" map ln :lnext -" map lp :lprev - - -" """"""""""""""""""""""""""""""""""""""" -" "---->>>>>python自动补全插件 jedi vim -" """"""""""""""""""""""""""""""""""""""" -" " 跳转并进行切割,可选项:left/right/top/bottom/winwidth -" " let g:jedi#use_splits_not_buffers = "left" -" let g:jedi#show_call_signatures = "1" -" " 跳转,类似,其中返回为 -" let g:jedi#goto_command = "d" -" let g:jedi#goto_assignments_command = "g" -" let g:jedi#goto_definitions_command = "" -" let g:jedi#documentation_command = "K" -" let g:jedi#usages_command = "n" -" let g:jedi#rename_command = "r" -" let g:jedi#completions_command = "" - - """"""""""""""""""""""""""""""""""""""" " docstring的配置参数 " 自动插入docstring字符串 @@ -155,6 +99,18 @@ nmap ph GitGutterPrevHunk + +""""""""""""""""""""""""""""""""""""""" +" --->>> YCM configure +" +""""""""""""""""""""""""""""""""""""""" +" Default ycm config +let g:ycm_global_ycm_extra_conf = + \'~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' +" 设置python或者python3 +let g:ycm_python_binary_path="python" + + """"""""""""""""""""""""""""""""""""""" " --->语法检查,syntastic的配置参数 " 获取错误信息:Errors或者lopen @@ -163,27 +119,37 @@ nmap ph GitGutterPrevHunk " 每一个目录都有一份独有的bamboo.vim配置当前项目的语言配置 " """"""""""""""""""""""""""""""""""""""" -" " 必要配置1 -" " Conflicts withs powerline,so close -" " set statusline+=%#warningmsg# -" " set statusline+=%{SyntasticStatuslineFlag()} -" " set statusline+=%* -" " 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) -" let g:syntastic_error_symbol = 'EE' -" let g:syntastic_style_error_symbol = 'E>' -" let g:syntastic_warning_symbol = 'WW' -" let g:syntastic_style_warning_symbol = 'W>' -" let g:syntastic_always_populate_loc_list = 1 -" " 必要配置3 -" " 不需要手动调用 SyntasticSetTocList. 默认1 -" let g:syntastic_always_populate_loc_list = 1 -" " 自动拉起关闭错误窗口. -" " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -" let g:syntastic_auto_loc_list = 1 -" " 打开文件时做语法检查, 默认 0 -" let g:syntastic_check_on_open = 1 -" " 报错时做语法检查, 默认 1 -" let g:syntastic_check_on_wq = 0 +" 必要配置1,和powerline冲突,舍弃 +" Conflicts withs powerline,so close +" set statusline+=%#warningmsg# +" set statusline+=%{SyntasticStatuslineFlag()} +" set statusline+=%* +" 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) +let g:syntastic_error_symbol = 'EE' +let g:syntastic_style_error_symbol = 'E>' +let g:syntastic_warning_symbol = 'WW' +let g:syntastic_style_warning_symbol = 'W>' +" 必要配置3 +" 不需要手动调用 SyntasticSetTocList. 默认1 +let g:syntastic_always_populate_loc_list = 1 +" 自动拉起关闭错误窗口. +" 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 +let g:syntastic_auto_loc_list = 1 +" 打开文件时做语法检查, 默认 0 +let g:syntastic_check_on_open = 1 +" 报错时做语法检查, 默认 1 +let g:syntastic_check_on_wq = 0 + +let g:syntastic_python_checkers=['flake8', 'pylint'] +" 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) +let g:syntastic_python_flake8_args='--ignore=F401,E402,W291' +" pylint 格式(新增msg_id,以便进行相应的warning排除) +let g:syntastic_python_pylint_post_args = '--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' +let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303' + +" shellcheckers and sh +let g:syntastic_sh_checkers=['shellcheckers'] + """"""""""""""""""""""""""""""""""""""" " vim-surround配置 @@ -495,7 +461,6 @@ let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' """"""""""""""""""""""""""""""""""""""" " 语法高亮 syntax enable -syntax on " 高亮命中的文本或者set nohlsearch set hlsearch " 临时取消高亮显示的开关按钮 diff --git a/bundle/DoxygenToolkit b/bundle/DoxygenToolkit deleted file mode 160000 index afd8663..0000000 --- a/bundle/DoxygenToolkit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit afd8663d36d2ec19d26befdb10e89e912d26bbd3 diff --git a/bundle/YouCompleteMe b/bundle/YouCompleteMe new file mode 160000 index 0000000..b94fcb2 --- /dev/null +++ b/bundle/YouCompleteMe @@ -0,0 +1 @@ +Subproject commit b94fcb2c9e3fda7b6d9405432ac657c4beb0142e diff --git a/bundle/syntastic b/bundle/syntastic new file mode 160000 index 0000000..cdfb64d --- /dev/null +++ b/bundle/syntastic @@ -0,0 +1 @@ +Subproject commit cdfb64db6711f8df6937d368cff75c7213505fe2 From d7d8fc1f7847e4f77526e3af11df0066816c1136 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 22 Aug 2016 15:41:13 +0800 Subject: [PATCH 013/160] Complete plugin IDE --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 966a6ce..9215d20 100644 --- a/.vimrc +++ b/.vimrc @@ -36,7 +36,7 @@ syntax on """"""""""""""""""""""""""""""""""""""""""""""""""""""" " 自定义Ag路径 "let g:ag_prg="<...> --vimgrep" -" 查找 +" 查找,从项目根目录开始 let g:ag_working_path_mode="r" From ee4829bda03ec1159e412b7db5eb6242ab9f682d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 22 Aug 2016 16:29:53 +0800 Subject: [PATCH 014/160] Modify vimrc at python branch --- .vimrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/.vimrc b/.vimrc index 9215d20..0ac13e9 100644 --- a/.vimrc +++ b/.vimrc @@ -104,9 +104,6 @@ nmap ph GitGutterPrevHunk " --->>> YCM configure " """"""""""""""""""""""""""""""""""""""" -" Default ycm config -let g:ycm_global_ycm_extra_conf = - \'~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' " 设置python或者python3 let g:ycm_python_binary_path="python" From 1eae826848be15f28fb912933e02e47893c25ced Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 22 Aug 2016 21:11:31 +0800 Subject: [PATCH 015/160] Add markdown --- .gitmodules | 3 +++ .vimrc | 12 ++++++++++++ bundle/vim-instant-markdown | 1 + 3 files changed, 16 insertions(+) create mode 160000 bundle/vim-instant-markdown diff --git a/.gitmodules b/.gitmodules index ea19cef..8205c62 100644 --- a/.gitmodules +++ b/.gitmodules @@ -56,3 +56,6 @@ [submodule "bundle/YouCompleteMe"] path = bundle/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git +[submodule "bundle/vim-instant-markdown"] + path = bundle/vim-instant-markdown + url = https://github.com/suan/vim-instant-markdown.git diff --git a/.vimrc b/.vimrc index 0ac13e9..b0b3029 100644 --- a/.vimrc +++ b/.vimrc @@ -45,6 +45,18 @@ let g:ag_working_path_mode="r" """"""""""""""""""""""""""""""""""""""""""""""""""""""" +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> markdown +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"zshrc的配置 +set shell=bash\ -i +let g:instant_markdown_slow=1 +" 关闭自动开启浏览器的配置,使用命令:InstantMarkdownPreview +let g:instant_markdown_autostart=0 +" 映射快捷键 +map imp :InstantMarkdownPreview + + """""""""""""""""""""""""""""""""""""""""""""""""""""""" " bash 支持设置 " 1,函数注释快捷键:\cfu diff --git a/bundle/vim-instant-markdown b/bundle/vim-instant-markdown new file mode 160000 index 0000000..e45d610 --- /dev/null +++ b/bundle/vim-instant-markdown @@ -0,0 +1 @@ +Subproject commit e45d6108433274e82649afa269b2d7adf606e4be From 1e861a564d99bc70933d730e576e53f6b4815397 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 8 Dec 2016 18:30:46 +0800 Subject: [PATCH 016/160] Modify vimrc --- .vimrc | 4 ++-- bundle/DoxygenToolkit | 1 + bundle/a.vim | 1 + bundle/ctrlp.vim | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) create mode 160000 bundle/DoxygenToolkit create mode 160000 bundle/a.vim create mode 160000 bundle/ctrlp.vim diff --git a/.vimrc b/.vimrc index b0b3029..94fba7e 100644 --- a/.vimrc +++ b/.vimrc @@ -143,12 +143,12 @@ let g:syntastic_style_warning_symbol = 'W>' let g:syntastic_always_populate_loc_list = 1 " 自动拉起关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 1 +let g:syntastic_auto_loc_list = 2 " 打开文件时做语法检查, 默认 0 let g:syntastic_check_on_open = 1 " 报错时做语法检查, 默认 1 let g:syntastic_check_on_wq = 0 - +" 请提前安装pylint和flake8 let g:syntastic_python_checkers=['flake8', 'pylint'] " 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) let g:syntastic_python_flake8_args='--ignore=F401,E402,W291' diff --git a/bundle/DoxygenToolkit b/bundle/DoxygenToolkit new file mode 160000 index 0000000..afd8663 --- /dev/null +++ b/bundle/DoxygenToolkit @@ -0,0 +1 @@ +Subproject commit afd8663d36d2ec19d26befdb10e89e912d26bbd3 diff --git a/bundle/a.vim b/bundle/a.vim new file mode 160000 index 0000000..2cbe946 --- /dev/null +++ b/bundle/a.vim @@ -0,0 +1 @@ +Subproject commit 2cbe946206ec622d9d8cf2c99317f204c4d41885 diff --git a/bundle/ctrlp.vim b/bundle/ctrlp.vim new file mode 160000 index 0000000..564176f --- /dev/null +++ b/bundle/ctrlp.vim @@ -0,0 +1 @@ +Subproject commit 564176f01d7f3f7f8ab452ff4e1f5314de7b0981 From 568c2d57005a99837b3e81fab2806b6a0a82d897 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 15 Jan 2017 15:54:19 +0800 Subject: [PATCH 017/160] Commit some untracked submodule files. --- bundle/YouCompleteMe | 2 +- bundle/bash-support.vim | 1 + bundle/powerline | 1 + bundle/vim-gitgutter | 2 +- bundle/vim-signify | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) create mode 160000 bundle/bash-support.vim create mode 160000 bundle/powerline create mode 160000 bundle/vim-signify diff --git a/bundle/YouCompleteMe b/bundle/YouCompleteMe index b94fcb2..d02de4b 160000 --- a/bundle/YouCompleteMe +++ b/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit b94fcb2c9e3fda7b6d9405432ac657c4beb0142e +Subproject commit d02de4b399eec80f28142ce39481be585ef3627f diff --git a/bundle/bash-support.vim b/bundle/bash-support.vim new file mode 160000 index 0000000..309d6fe --- /dev/null +++ b/bundle/bash-support.vim @@ -0,0 +1 @@ +Subproject commit 309d6fe45859f2d30d0e8fe8016ca69f03b9f7d6 diff --git a/bundle/powerline b/bundle/powerline new file mode 160000 index 0000000..d77cc30 --- /dev/null +++ b/bundle/powerline @@ -0,0 +1 @@ +Subproject commit d77cc30a3be26cf34411af70c5e2b595eef2d46d diff --git a/bundle/vim-gitgutter b/bundle/vim-gitgutter index 26c6b54..f7ea5f4 160000 --- a/bundle/vim-gitgutter +++ b/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit 26c6b549f287b8ae348eda083e7c77f79f4de28b +Subproject commit f7ea5f40a680797b0ad8d78ec972e32cf17e63c7 diff --git a/bundle/vim-signify b/bundle/vim-signify new file mode 160000 index 0000000..76bde23 --- /dev/null +++ b/bundle/vim-signify @@ -0,0 +1 @@ +Subproject commit 76bde232d163c99a8e72b517d8ef770b0d79849e From ae5324006316c68cb3484364962868058a464968 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 15 Jan 2017 15:57:06 +0800 Subject: [PATCH 018/160] =?UTF-8?q?Modify=20.gitmodules=20with=EF=BC=9Aign?= =?UTF-8?q?ore=20=3D=20dirty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 8205c62..973bd9d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,7 @@ [submodule "bundle/winmanager"] path = bundle/winmanager url = https://github.com/vim-scripts/winmanager.git + ignore = dirty [submodule "bundle/bufexplorer"] path = bundle/bufexplorer url = https://github.com/jlanzarotta/bufexplorer.git @@ -19,6 +20,7 @@ [submodule "bundle/lookupfile"] path = bundle/lookupfile url = https://github.com/vim-scripts/lookupfile.git + ignore = dirty [submodule "bundle/nerdtree"] path = bundle/nerdtree url = https://github.com/scrooloose/nerdtree.git @@ -28,6 +30,7 @@ [submodule "bundle/taglist"] path = bundle/taglist url = https://github.com/vim-scripts/taglist.vim.git + ignore = dirty [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git @@ -40,10 +43,10 @@ [submodule "bundle/vim-gitgutter"] path = bundle/vim-gitgutter url = git://github.com/airblade/vim-gitgutter.git - [submodule "bundle/bash-support"] path = bundle/bash-support url = https://github.com/vim-scripts/bash-support.vim.git + ignore = dirty [submodule "bundle/vim-pydocstring"] path = bundle/vim-pydocstring url = https://github.com/heavenshell/vim-pydocstring.git From 4f6f47e1eded1939d4bdffa6bfc64d30c61b5933 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 15 Jan 2017 15:59:12 +0800 Subject: [PATCH 019/160] Modify bash-support directroy. --- .gitmodules | 4 ++-- bundle/bash-support | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 160000 bundle/bash-support diff --git a/.gitmodules b/.gitmodules index 973bd9d..9b4ce10 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,8 +43,8 @@ [submodule "bundle/vim-gitgutter"] path = bundle/vim-gitgutter url = git://github.com/airblade/vim-gitgutter.git -[submodule "bundle/bash-support"] - path = bundle/bash-support +[submodule "bundle/bash-support.vim"] + path = bundle/bash-support.vim url = https://github.com/vim-scripts/bash-support.vim.git ignore = dirty [submodule "bundle/vim-pydocstring"] diff --git a/bundle/bash-support b/bundle/bash-support deleted file mode 160000 index 309d6fe..0000000 --- a/bundle/bash-support +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 309d6fe45859f2d30d0e8fe8016ca69f03b9f7d6 From be66968cbccf64e74f7c2131846f8c7e4132e2f1 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 17 Jan 2017 21:57:16 +0800 Subject: [PATCH 020/160] Modify powerline path. --- .vimrc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 94fba7e..b5dc65d 100644 --- a/.vimrc +++ b/.vimrc @@ -328,8 +328,18 @@ set cursorline " 后期一键自动化安装的时候容易,现在配置很麻烦 """"""""""""""""""""""""""""""""""""""" " 找到powerline插件位置,当然也可以放在vim目录下面 -" set rtp+=~/.local/lib/python2.7/site-packages/powerline/bindings/vim/ -set rtp+=~/.local/lib/python3.4/site-packages/powerline/bindings/vim/ +let s:python2_ubuntu="~/.local/lib/python2.7/site-packages/powerline/bindings/vim/" +let s:python3_ubuntu="~/.local/lib/python3.4/site-packages/powerline/bindings/vim/" +let s:python2_mac="~/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim/" +if exists(s:python2_ubuntu) + set rtp+=python2_ubuntu +endif +if exists(s:python3_ubuntu) + set rtp+=python3_ubuntu +endif +if exists(s:python2_mac) + set rtp+=python2_mac +endif " 添加新的字体 set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9 set laststatus=2 From 37833108599f6bbc2f39de371c53dd85a99385dc Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 18 Jan 2017 08:11:54 +0800 Subject: [PATCH 021/160] Modified some things at .vimrc of branch python --- .gitmodules | 1 + .vimrc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9b4ce10..d7410ee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -50,6 +50,7 @@ [submodule "bundle/vim-pydocstring"] path = bundle/vim-pydocstring url = https://github.com/heavenshell/vim-pydocstring.git + ignore = dirty [submodule "bundle/vim-json"] path = bundle/vim-json url = https://github.com/helino/vim-json.git diff --git a/.vimrc b/.vimrc index b5dc65d..cc35a48 100644 --- a/.vimrc +++ b/.vimrc @@ -49,7 +49,7 @@ let g:ag_working_path_mode="r" " ---> markdown """"""""""""""""""""""""""""""""""""""""""""""""""""""" "zshrc的配置 -set shell=bash\ -i +" set shell=bash\ -i let g:instant_markdown_slow=1 " 关闭自动开启浏览器的配置,使用命令:InstantMarkdownPreview let g:instant_markdown_autostart=0 @@ -218,7 +218,7 @@ imap :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" \ -o -name "*.java" -o -name "*.py" \ >cscope.files:!cscope -Rbq:cs reset if has("cscope") - set csprg=/usr/bin/cscope + set csprg=/usr/local/bin/cscope set csto=1 set cst set nocsverb From a8758b61b73a9f040516751b268db36113f68a14 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 20 Feb 2017 06:13:55 +0800 Subject: [PATCH 022/160] Add vim-python-pep8-indent --- .gitmodules | 3 +++ .vimrc | 30 ++++++++++++++++++++++-------- bundle/vim-python-pep8-indent | 1 + 3 files changed, 26 insertions(+), 8 deletions(-) create mode 160000 bundle/vim-python-pep8-indent diff --git a/.gitmodules b/.gitmodules index d7410ee..20b9ee5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -63,3 +63,6 @@ [submodule "bundle/vim-instant-markdown"] path = bundle/vim-instant-markdown url = https://github.com/suan/vim-instant-markdown.git +[submodule "bundle/vim-python-pep8-indent"] + path = bundle/vim-python-pep8-indent + url = https://github.com/Vimjas/vim-python-pep8-indent.git diff --git a/.vimrc b/.vimrc index cc35a48..c9846fe 100644 --- a/.vimrc +++ b/.vimrc @@ -118,6 +118,10 @@ nmap ph GitGutterPrevHunk """"""""""""""""""""""""""""""""""""""" " 设置python或者python3 let g:ycm_python_binary_path="python" +let g:ycm_complete_in_strings = 2 +let g:ycm_collect_identifiers_from_tags_files = 1 +let g:ycm_add_preview_to_completeopt = 1 +nnoremap jd :YcmCompleter GoTo """"""""""""""""""""""""""""""""""""""" @@ -141,23 +145,33 @@ let g:syntastic_style_warning_symbol = 'W>' " 必要配置3 " 不需要手动调用 SyntasticSetTocList. 默认1 let g:syntastic_always_populate_loc_list = 1 -" 自动拉起关闭错误窗口. +" 自动拉起或者关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 2 +let g:syntastic_auto_loc_list = 1 " 打开文件时做语法检查, 默认 0 let g:syntastic_check_on_open = 1 " 报错时做语法检查, 默认 1 -let g:syntastic_check_on_wq = 0 +let g:syntastic_check_on_wq = 1 " 请提前安装pylint和flake8 let g:syntastic_python_checkers=['flake8', 'pylint'] " 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) -let g:syntastic_python_flake8_args='--ignore=F401,E402,W291' +let g:syntastic_python_flake8_args='--ignore=F401,E402,W291,w0232' " pylint 格式(新增msg_id,以便进行相应的warning排除) let g:syntastic_python_pylint_post_args = '--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' -let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303' - +let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] +" 错误跳转 +" :lne, :lp +noremap ln :lne +" 添加自定义的库文件位置 +let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/' + + +""""""""""""""""""""""""""""""""""""""" +" 插件:Vimjas/vim-python-pep8-indent +" 功能:基于pep8的自动缩进设置,非常棒 +""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""" @@ -542,7 +556,7 @@ autocmd! bufwritepost .vimrc source ~/.vimrc """"""""""""""""""""""""""""""""""""""" "--->>>制表符(tabstop)的操作: """"""""""""""""""""""""""""""""""""""" -" 自动缩进 +" ai:自动缩进,ci:类似c语言的缩进,si:基于autoindent的smart缩进 set autoindent " 左缩进 set shiftwidth=4 @@ -576,7 +590,7 @@ endif " 切割 nmap vs :vs nmap sp :sp -" 左边窗口 +" 左边窗口,请熟练使用,确保不适用按钮 nmap hw h " 右边窗口 nmap lw l diff --git a/bundle/vim-python-pep8-indent b/bundle/vim-python-pep8-indent new file mode 160000 index 0000000..8b215aa --- /dev/null +++ b/bundle/vim-python-pep8-indent @@ -0,0 +1 @@ +Subproject commit 8b215aac0192f74b5aeb6ae5a2e1766db2ebecb8 From 6f55a1edc1b017a6eaac1d6331a56c30ae5b8a1a Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 20 Feb 2017 10:44:35 +0800 Subject: [PATCH 023/160] Modify some gitmodules --- .gitmodules | 15 ++++++++++++--- .vimrc | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 20b9ee5..6d5ae66 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,9 +34,9 @@ [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git -[submodule "bundle/ag.vim"] - path = bundle/ag.vim - url = https://github.com/rking/ag.vim.git +; [submodule "bundle/ag.vim"] +; path = bundle/ag.vim +; url = https://github.com/rking/ag.vim.git [submodule "bundle/calendar"] path = bundle/calendar url = https://github.com/itchyny/calendar.vim.git @@ -66,3 +66,12 @@ [submodule "bundle/vim-python-pep8-indent"] path = bundle/vim-python-pep8-indent url = https://github.com/Vimjas/vim-python-pep8-indent.git +[submodule "bundle/DoxygenToolkit"] + path = bundle/DoxygenToolkit + url = https://github.com/vim-scripts/DoxygenToolkit.vim.git +[submodule "bundle/ag.vim"] + path = bundle/ag.vim + url = https://github.com/rking/ag.vim.git +[submodule "bundle/a.vim"] + path = bundle/a.vim + url = https://github.com/vim-scripts/a.vim.git diff --git a/.vimrc b/.vimrc index c9846fe..e593ee0 100644 --- a/.vimrc +++ b/.vimrc @@ -165,7 +165,7 @@ let g:syntastic_sh_checkers=['shellcheckers'] " :lne, :lp noremap ln :lne " 添加自定义的库文件位置 -let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/' +let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' """"""""""""""""""""""""""""""""""""""" From 49845195aec35b56754d2f9bdaacc3e889dd58d4 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 20 Feb 2017 10:48:43 +0800 Subject: [PATCH 024/160] modify gitmodule --- .gitmodules | 9 ++++++--- .vimrc | 2 +- bundle/ctrlp.vim | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) delete mode 160000 bundle/ctrlp.vim diff --git a/.gitmodules b/.gitmodules index 6d5ae66..58bbd78 100644 --- a/.gitmodules +++ b/.gitmodules @@ -66,12 +66,15 @@ [submodule "bundle/vim-python-pep8-indent"] path = bundle/vim-python-pep8-indent url = https://github.com/Vimjas/vim-python-pep8-indent.git -[submodule "bundle/DoxygenToolkit"] - path = bundle/DoxygenToolkit - url = https://github.com/vim-scripts/DoxygenToolkit.vim.git [submodule "bundle/ag.vim"] path = bundle/ag.vim url = https://github.com/rking/ag.vim.git [submodule "bundle/a.vim"] path = bundle/a.vim url = https://github.com/vim-scripts/a.vim.git +[submodule "bundle/powerline"] + path = bundle/powerline + url = https://github.com/powerline/powerline.git +[submodule "bundle/vim-signify"] + path = bundle/vim-signify + url = https://github.com/mhinz/vim-signify.git diff --git a/.vimrc b/.vimrc index e593ee0..0635267 100644 --- a/.vimrc +++ b/.vimrc @@ -147,7 +147,7 @@ let g:syntastic_style_warning_symbol = 'W>' let g:syntastic_always_populate_loc_list = 1 " 自动拉起或者关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 1 +let g:syntastic_auto_loc_list = 2 " 打开文件时做语法检查, 默认 0 let g:syntastic_check_on_open = 1 " 报错时做语法检查, 默认 1 diff --git a/bundle/ctrlp.vim b/bundle/ctrlp.vim deleted file mode 160000 index 564176f..0000000 --- a/bundle/ctrlp.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 564176f01d7f3f7f8ab452ff4e1f5314de7b0981 From b6c074029d86e15a5180edfb99ee00821c63eb9d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 21 Feb 2017 17:56:27 +0800 Subject: [PATCH 025/160] Modify python vimrc --- .gitmodules | 6 ------ .vimrc | 12 ++++++++---- bundle/DoxygenToolkit | 1 - bundle/ag.vim | 1 - 4 files changed, 8 insertions(+), 12 deletions(-) delete mode 160000 bundle/DoxygenToolkit delete mode 160000 bundle/ag.vim diff --git a/.gitmodules b/.gitmodules index 58bbd78..8b40fe3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,9 +34,6 @@ [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git -; [submodule "bundle/ag.vim"] -; path = bundle/ag.vim -; url = https://github.com/rking/ag.vim.git [submodule "bundle/calendar"] path = bundle/calendar url = https://github.com/itchyny/calendar.vim.git @@ -66,9 +63,6 @@ [submodule "bundle/vim-python-pep8-indent"] path = bundle/vim-python-pep8-indent url = https://github.com/Vimjas/vim-python-pep8-indent.git -[submodule "bundle/ag.vim"] - path = bundle/ag.vim - url = https://github.com/rking/ag.vim.git [submodule "bundle/a.vim"] path = bundle/a.vim url = https://github.com/vim-scripts/a.vim.git diff --git a/.vimrc b/.vimrc index 0635267..58f0b53 100644 --- a/.vimrc +++ b/.vimrc @@ -147,7 +147,7 @@ let g:syntastic_style_warning_symbol = 'W>' let g:syntastic_always_populate_loc_list = 1 " 自动拉起或者关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 2 +let g:syntastic_auto_loc_list = 0 " 打开文件时做语法检查, 默认 0 let g:syntastic_check_on_open = 1 " 报错时做语法检查, 默认 1 @@ -158,12 +158,13 @@ let g:syntastic_python_checkers=['flake8', 'pylint'] let g:syntastic_python_flake8_args='--ignore=F401,E402,W291,w0232' " pylint 格式(新增msg_id,以便进行相应的warning排除) let g:syntastic_python_pylint_post_args = '--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' -let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221' +let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] " 错误跳转 " :lne, :lp noremap ln :lne +noremap lo :lclose " 添加自定义的库文件位置 let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' @@ -531,11 +532,14 @@ set completeopt=longest,menu " ---> 折叠配置 """""""""""""""""""""""""""""""""""""""""""""" " 基于缩进的代码折叠 -" set foldmethod=indent +set foldmethod=indent " 基于语法的代码折叠 -set foldmethod=syntax +" set foldmethod=syntax " 启动时关闭代码折叠 set nofoldenable +" 映射 +nnoremap za +vnoremap zf """"""""""""""""""""""""""""""""""""""" "--->>>寄存器 diff --git a/bundle/DoxygenToolkit b/bundle/DoxygenToolkit deleted file mode 160000 index afd8663..0000000 --- a/bundle/DoxygenToolkit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit afd8663d36d2ec19d26befdb10e89e912d26bbd3 diff --git a/bundle/ag.vim b/bundle/ag.vim deleted file mode 160000 index 4a0dd6e..0000000 --- a/bundle/ag.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a0dd6e190f446e5a016b44fdaa2feafc582918e From 393e78b409a45901c0dc9d6d243e68ada8a71903 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 21 Feb 2017 19:44:36 +0800 Subject: [PATCH 026/160] Update vimrc --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 58f0b53..59448f4 100644 --- a/.vimrc +++ b/.vimrc @@ -537,7 +537,7 @@ set foldmethod=indent " set foldmethod=syntax " 启动时关闭代码折叠 set nofoldenable -" 映射 +" 映射(使用空格键进行反复操作) nnoremap za vnoremap zf From ac49aba007d54f53ac5ffd47953e87f3a78ea0f6 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 3 Mar 2017 19:55:44 +0800 Subject: [PATCH 027/160] Syntastic on or off --- .vimrc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.vimrc b/.vimrc index 59448f4..727bf00 100644 --- a/.vimrc +++ b/.vimrc @@ -149,7 +149,7 @@ let g:syntastic_always_populate_loc_list = 1 " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 let g:syntastic_auto_loc_list = 0 " 打开文件时做语法检查, 默认 0 -let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_open = 0 " 报错时做语法检查, 默认 1 let g:syntastic_check_on_wq = 1 " 请提前安装pylint和flake8 @@ -158,13 +158,15 @@ let g:syntastic_python_checkers=['flake8', 'pylint'] let g:syntastic_python_flake8_args='--ignore=F401,E402,W291,w0232' " pylint 格式(新增msg_id,以便进行相应的warning排除) let g:syntastic_python_pylint_post_args = '--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' -let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703' +let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] " 错误跳转 " :lne, :lp noremap ln :lne noremap lo :lclose +noremap :let g:syntastic_auto_loc_list = ( + \g:syntastic_auto_loc_list == '0' ? '1' : '0') " 添加自定义的库文件位置 let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' @@ -215,21 +217,21 @@ let g:NERDTrimTrailingWhitespace=1 " ---> 标签配置1——tags的配置 """""""""""""""""""""""""""""""""""""""""""""" " 生成tags的命令 -map :!ctags --exclude=jj +map :!ctags --exclude=jj \ --languages=c,c++,python,java,php,sh -R \ --c++-kinds=+p --fields=+iaS --extra=+q . \ :TlistUpdate -imap :!ctags --languages=c,c++,python,java,php,sh,js -R +imap :!ctags --languages=c,c++,python,java,php,sh,js -R \ --c++-kinds=+p --fields=+iaS --extra=+q . \ :TlistUpdate """"""""""""""""""""""""""""""""""""""""""""" " ---> 标签配置2——cscope """"""""""""""""""""""""""""""""""""""""""""" -map :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" -o +map :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" -o \ -name "*.java" -o -name "*.py" \ >cscope.files:!cscope -Rbq:cs reset -imap :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" +imap :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" \ -o -name "*.java" -o -name "*.py" \ >cscope.files:!cscope -Rbq:cs reset if has("cscope") @@ -520,7 +522,7 @@ set incsearch set guifont=Monaco:h20 " 鼠标设置 set mouse=a -noremap :let &mouse = (&mouse == 'a' ? 'v' : 'a') +" noremap :let &mouse = (&mouse == 'a' ? 'v' : 'a') " paste设置 set pastetoggle= " 保存所有文件 @@ -537,6 +539,7 @@ set foldmethod=indent " set foldmethod=syntax " 启动时关闭代码折叠 set nofoldenable +set foldlevelstart=99 " 映射(使用空格键进行反复操作) nnoremap za vnoremap zf From c724971abdc0e426cae38209e1373b1f007e59b7 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 16 Mar 2017 08:50:19 +0800 Subject: [PATCH 028/160] Fix bug: too slow when open syntastic check --- .vimrc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.vimrc b/.vimrc index 59448f4..47506ef 100644 --- a/.vimrc +++ b/.vimrc @@ -132,11 +132,6 @@ nnoremap jd :YcmCompleter GoTo " 每一个目录都有一份独有的bamboo.vim配置当前项目的语言配置 " """"""""""""""""""""""""""""""""""""""" -" 必要配置1,和powerline冲突,舍弃 -" Conflicts withs powerline,so close -" set statusline+=%#warningmsg# -" set statusline+=%{SyntasticStatuslineFlag()} -" set statusline+=%* " 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) let g:syntastic_error_symbol = 'EE' let g:syntastic_style_error_symbol = 'E>' @@ -147,7 +142,7 @@ let g:syntastic_style_warning_symbol = 'W>' let g:syntastic_always_populate_loc_list = 1 " 自动拉起或者关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 0 +let g:syntastic_auto_loc_list = 1 " 打开文件时做语法检查, 默认 0 let g:syntastic_check_on_open = 1 " 报错时做语法检查, 默认 1 @@ -167,6 +162,9 @@ noremap ln :lne noremap lo :lclose " 添加自定义的库文件位置 let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' +" syntastic过慢导致的问题(需要按两次才能取消哦,注意大写的E) +let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] } +nnoremap E :SyntasticCheck :SyntasticToggleMode """"""""""""""""""""""""""""""""""""""" From 2c9cd09e2df2d383522caf4578777ef37593ad80 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 17 Mar 2017 08:39:37 +0800 Subject: [PATCH 029/160] Add pylint configure file --- .pylintrc | 406 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ .vimrc | 13 +- 2 files changed, 411 insertions(+), 8 deletions(-) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..43499aa --- /dev/null +++ b/.pylintrc @@ -0,0 +1,406 @@ +[MASTER] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Allow optimization of some AST trees. This will activate a peephole AST +# optimizer, which will apply various small optimizations. For instance, it can +# be used to obtain the result of joining multiple strings with the addition +# operator. Joining a lot of strings can lead to a maximum recursion error in +# Pylint and this flag can prevent that. It has one side effect, the resulting +# AST will be different than the one from reality. This option is deprecated +# and it will be removed in Pylint 2.0. +optimize-ast=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +#enable= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,C0103,W0232,missing-docstring,logging-format-interpolation,fixme + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". This option is deprecated +# and it will be removed in Pylint 2.0. +files-output=no + +# Tells whether to display a full report or only the messages +reports=yes + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + + +[BASIC] + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Regular expression matching correct function names +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for function names +function-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct variable names +variable-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for variable names +variable-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct attribute names +attr-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for attribute names +attr-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct argument names +argument-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for argument names +argument-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming hint for class names +class-name-hint=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct method names +method-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for method names +method-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + + +[ELIF] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=100 + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Maximum number of lines in a module +max-module-lines=1000 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.* + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of statements in function / method body +max-statements=50 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,TERMIOS,Bastion,rexec + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/.vimrc b/.vimrc index 4cd5d10..5b4037d 100644 --- a/.vimrc +++ b/.vimrc @@ -48,8 +48,6 @@ let g:ag_working_path_mode="r" """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> markdown """"""""""""""""""""""""""""""""""""""""""""""""""""""" -"zshrc的配置 -" set shell=bash\ -i let g:instant_markdown_slow=1 " 关闭自动开启浏览器的配置,使用命令:InstantMarkdownPreview let g:instant_markdown_autostart=0 @@ -143,17 +141,16 @@ let g:syntastic_always_populate_loc_list = 1 " 自动拉起或者关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 let g:syntastic_auto_loc_list = 1 -" 打开文件时做语法检查, 默认 0 -let g:syntastic_check_on_open = 0 -" 报错时做语法检查, 默认 1 -let g:syntastic_check_on_wq = 1 " 请提前安装pylint和flake8 let g:syntastic_python_checkers=['flake8', 'pylint'] " 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) let g:syntastic_python_flake8_args='--ignore=F401,E402,W291,w0232' " pylint 格式(新增msg_id,以便进行相应的warning排除) -let g:syntastic_python_pylint_post_args = '--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' -let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912' +let g:syntastic_python_pylint_post_args = + \'--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' +" 在disable中添加,该文件使用命令:pylint --generate-rcfile > .pylintrc生成 +" 使用pylint可以对代码进行评分检查 +let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] " 错误跳转 From 668758c3c3ef029b6cb5fe53d74df290fe66c924 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 22 Mar 2017 22:39:35 +0800 Subject: [PATCH 030/160] Add noremap for insert date --- .vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc b/.vimrc index 5b4037d..3c8542d 100644 --- a/.vimrc +++ b/.vimrc @@ -498,6 +498,8 @@ set hlsearch noremap :nohlsearch:echo "突出高亮显示当前行 set cursorline +" 插入时间 +nnoremap date "=strftime("%Y-%m-%d %T")P " 设置黑色背景,保证告警文本的效果能够更加显著 set background=dark From bbbb296caa8713ac2df125570405ce81b3ea7e59 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 23 Mar 2017 09:45:27 +0800 Subject: [PATCH 031/160] Modify pylint arguments --- .vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 3c8542d..ca64cc5 100644 --- a/.vimrc +++ b/.vimrc @@ -150,7 +150,8 @@ let g:syntastic_python_pylint_post_args = \'--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' " 在disable中添加,该文件使用命令:pylint --generate-rcfile > .pylintrc生成 " 使用pylint可以对代码进行评分检查 -let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' +" let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' +let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] " 错误跳转 From 1a833ddbb0fe1c69ebc539500d157dbb797720e1 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 23 Mar 2017 21:32:47 +0800 Subject: [PATCH 032/160] Add crontabe variable --- .vimrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.vimrc b/.vimrc index 3c8542d..5e50644 100644 --- a/.vimrc +++ b/.vimrc @@ -588,6 +588,15 @@ if exists('$TMUX') set term=screen-256color endif + +""""""""""""""""""""""""""""""""""""""" +" --->>>crontab设置 +""""""""""""""""""""""""""""""""""""""" +if $VIM_CRONTAB == "true" + set nobackup + set nowritebackup +endif + """"""""""""""""""""""""""""""""""""""" " --->>>窗口切割映射键和跳转快捷键 """"""""""""""""""""""""""""""""""""""" From d434099e83100e7fe0573437f78aa4e9580f0924 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 7 Apr 2017 16:55:28 +0800 Subject: [PATCH 033/160] Add ctags exclude files and NERDTree exclude --- .ctagsignore | 9 +++++++++ .vimrc | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .ctagsignore diff --git a/.ctagsignore b/.ctagsignore new file mode 100644 index 0000000..b630062 --- /dev/null +++ b/.ctagsignore @@ -0,0 +1,9 @@ +migrations +*.pyc +logs +cscope.* +tags +static +media +doc +templates diff --git a/.vimrc b/.vimrc index ca64cc5..ff3f451 100644 --- a/.vimrc +++ b/.vimrc @@ -213,11 +213,14 @@ let g:NERDTrimTrailingWhitespace=1 " ---> 标签配置1——tags的配置 """""""""""""""""""""""""""""""""""""""""""""" " 生成tags的命令 -map :!ctags --exclude=jj +map :!ctags \ --languages=c,c++,python,java,php,sh -R + \ --exclude=@/Users/zhengbifeng/.vim/.ctagsignore \ --c++-kinds=+p --fields=+iaS --extra=+q . \ :TlistUpdate -imap :!ctags --languages=c,c++,python,java,php,sh,js -R +imap :!ctags + \ --languages=c,c++,python,java,php,sh,js -R + \ --exclude=@/Users/zhengbifeng/.vim/.ctagsignore \ --c++-kinds=+p --fields=+iaS --extra=+q . \ :TlistUpdate @@ -434,6 +437,9 @@ let NERDTreeShowBookmarks=1 let NERDTreeMinimalUI=1 " 删除文件时自动删除文件对应 buffer let NERDTreeAutoDeleteBuffer=1 +" exclude some files +let NERDTreeIgnore = ['\.pyc$', 'migrations', 'log?', 'cscope.*', 'tags', + \ 'static', 'media', 'doc', 'templates'] " 启动或者隐藏NERDTree nmap :NERDTreeToggle @@ -617,6 +623,10 @@ map wsv :mksession! :wviminfo vim.viminfo map rsv :source ./Session.vim :rviminfo vim.viminfo +if $VIM_CRONTAB == "true" + set nobackup + set nowritebackup +endif """""""""""""""""""""""""""""""""""""""""""""" From 95a3a54eda83bcfd82e2bae826db986a457fb045 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 9 Apr 2017 21:26:34 +0800 Subject: [PATCH 034/160] Delete vim-json --- .gitmodules | 3 --- bundle/vim-json | 1 - 2 files changed, 4 deletions(-) delete mode 160000 bundle/vim-json diff --git a/.gitmodules b/.gitmodules index 8b40fe3..21e97aa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,9 +48,6 @@ path = bundle/vim-pydocstring url = https://github.com/heavenshell/vim-pydocstring.git ignore = dirty -[submodule "bundle/vim-json"] - path = bundle/vim-json - url = https://github.com/helino/vim-json.git [submodule "bundle/syntastic"] path = bundle/syntastic url = https://github.com/scrooloose/syntastic.git diff --git a/bundle/vim-json b/bundle/vim-json deleted file mode 160000 index 4794609..0000000 --- a/bundle/vim-json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 47946093993aecbd6d96a95e45ccc09a091b02eb From b5ce967ad38dd293378a2ce32a15b438a6e89647 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 14 Apr 2017 16:19:21 +0800 Subject: [PATCH 035/160] Add max-length for python --- .flake8 | 2 ++ .vimrc | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..6deafc2 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.vimrc b/.vimrc index 33a7155..2908886 100644 --- a/.vimrc +++ b/.vimrc @@ -154,6 +154,10 @@ let g:syntastic_python_pylint_post_args = let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] +" pyflake8,见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 +" ~/.config/flake8 +" python代码最长长度 +let g:syntastic_python_pylint_post_args='--max-line-length=120' " 错误跳转 " :lne, :lp noremap ln :lne From 7bf8db2dd2b9f676f9bdbb14bcf3a897bc6ae61a Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 18 Apr 2017 15:48:03 +0800 Subject: [PATCH 036/160] Add pylint file --- .pylintrc | 4 ++-- .vimrc | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 43499aa..ab96aeb 100644 --- a/.pylintrc +++ b/.pylintrc @@ -20,7 +20,7 @@ persistent=yes # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins= +load-plugins=pylint_django # Use multiple processes to speed up Pylint. jobs=1 @@ -65,7 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,C0103,W0232,missing-docstring,logging-format-interpolation,fixme +disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,C0103,W0232,missing-docstring,logging-format-interpolation,fixme,W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912 [REPORTS] diff --git a/.vimrc b/.vimrc index 2908886..3aa4c69 100644 --- a/.vimrc +++ b/.vimrc @@ -150,8 +150,7 @@ let g:syntastic_python_pylint_post_args = \'--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' " 在disable中添加,该文件使用命令:pylint --generate-rcfile > .pylintrc生成 " 使用pylint可以对代码进行评分检查 -" let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' -let g:syntastic_python_pylint_args='--disable=W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912' +let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] " pyflake8,见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 From 4d90ae56e95a135eebe6af072306cc995cdfafd4 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 18 Apr 2017 16:19:18 +0800 Subject: [PATCH 037/160] Add pylint ignore-classes which is WSGIRequest --- .pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index ab96aeb..e7fc125 100644 --- a/.pylintrc +++ b/.pylintrc @@ -281,7 +281,8 @@ ignored-modules= # List of class names for which member attributes should not be checked (useful # for classes with dynamically set attributes). This supports the use of # qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local +# 因为测试用例中的SimpleResponse,从而过滤WSGIRequest类 +ignored-classes=optparse.Values,thread._local,_thread._local,WSGIRequest # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E1101 when accessed. Python regular From 21206c02f32e1b67fb35a591ebd0049243038efb Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sat, 22 Apr 2017 11:58:40 +0800 Subject: [PATCH 038/160] Add flake8 --- .flake8 | 1 + .pylintrc | 6 +++--- .vimrc | 15 ++++----------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.flake8 b/.flake8 index 6deafc2..818bd94 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,3 @@ [flake8] max-line-length = 120 +ignore = F401,E402,W291,W0232 diff --git a/.pylintrc b/.pylintrc index e7fc125..eb3475a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -92,7 +92,7 @@ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme # Template used to display messages. This is a python new-style format string # used to format the message information. See doc for all details -#msg-template= +msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}" [BASIC] @@ -192,7 +192,7 @@ max-nested-blocks=5 [FORMAT] # Maximum number of characters on a single line. -max-line-length=100 +max-line-length=120 # Regexp for a line that is allowed to be longer than the limit. ignore-long-lines=^\s*(# )??$ @@ -338,7 +338,7 @@ exclude-protected=_asdict,_fields,_replace,_source,_make # Maximum number of arguments for function / method max-args=5 -# Argument names that match this expression will be ignored. Default to name +# Argment names that match this expression will be ignored. Default to name # with leading underscore ignored-argument-names=_.* diff --git a/.vimrc b/.vimrc index 3aa4c69..a68720e 100644 --- a/.vimrc +++ b/.vimrc @@ -138,25 +138,18 @@ let g:syntastic_style_warning_symbol = 'W>' " 必要配置3 " 不需要手动调用 SyntasticSetTocList. 默认1 let g:syntastic_always_populate_loc_list = 1 -" 自动拉起或者关闭错误窗口. " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 let g:syntastic_auto_loc_list = 1 + " 请提前安装pylint和flake8 -let g:syntastic_python_checkers=['flake8', 'pylint'] " 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) -let g:syntastic_python_flake8_args='--ignore=F401,E402,W291,w0232' -" pylint 格式(新增msg_id,以便进行相应的warning排除) -let g:syntastic_python_pylint_post_args = - \'--msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}"' -" 在disable中添加,该文件使用命令:pylint --generate-rcfile > .pylintrc生成 +" pyflake8,见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 ~/.config/flake8 +let g:syntastic_python_checkers=['flake8', 'pylint'] " 使用pylint可以对代码进行评分检查 let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] -" pyflake8,见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 -" ~/.config/flake8 -" python代码最长长度 -let g:syntastic_python_pylint_post_args='--max-line-length=120' + " 错误跳转 " :lne, :lp noremap ln :lne From 14eb266bde9e06809d5b1a6340bdceedaf9ea08b Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 5 May 2017 16:14:15 +0800 Subject: [PATCH 039/160] Change window size --- .vimrc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 3aa4c69..1382f8f 100644 --- a/.vimrc +++ b/.vimrc @@ -509,7 +509,7 @@ noremap :nohlsearch:echo "突出高亮显示当前行 set cursorline " 插入时间 -nnoremap date "=strftime("%Y-%m-%d %T")P +nnoremap date "=strftime("%Y-%m-%d %T")p " 设置黑色背景,保证告警文本的效果能够更加显著 set background=dark @@ -624,6 +624,14 @@ nmap jw j " 移动窗口,左右移动 nmap rw +" 所有窗口登高等宽 +nmap =w = +" 高度-N +nmap s- :resize -5 +nmap s+ :resize +5 +nmap v- :vertical resize -5 +nmap v+ :vertical resize +5 + """"""""""""""""""""""""""""""""""""""" " --->>> session的保存和读取 """"""""""""""""""""""""""""""""""""""" From 4f649420f55434c6183666594542e60f89e8cd42 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 11 May 2017 22:34:30 +0800 Subject: [PATCH 040/160] I do not know change what? --- .gitmodules | 3 ++ .vimrc | 76 ++++++++++++++++++++++++++++----------------- bundle/vim-markdown | 1 + 3 files changed, 52 insertions(+), 28 deletions(-) create mode 160000 bundle/vim-markdown diff --git a/.gitmodules b/.gitmodules index 21e97aa..50f593b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -69,3 +69,6 @@ [submodule "bundle/vim-signify"] path = bundle/vim-signify url = https://github.com/mhinz/vim-signify.git +[submodule "bundle/vim-markdown"] + path = bundle/vim-markdown + url = https://github.com/plasticboy/vim-markdown.git diff --git a/.vimrc b/.vimrc index a68720e..ac05ad0 100644 --- a/.vimrc +++ b/.vimrc @@ -42,11 +42,15 @@ let g:ag_working_path_mode="r" """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> vim-json,对json文件进行语法高亮 +" json format and check +" """"""""""""""""""""""""""""""""""""""""""""""""""""""" +map json :%!python -m json.tool +vnoremap json :'<,'>!python -m json.tool """"""""""""""""""""""""""""""""""""""""""""""""""""""" -" ---> markdown +" ---> vim-instant-markdown """"""""""""""""""""""""""""""""""""""""""""""""""""""" let g:instant_markdown_slow=1 " 关闭自动开启浏览器的配置,使用命令:InstantMarkdownPreview @@ -55,6 +59,22 @@ let g:instant_markdown_autostart=0 map imp :InstantMarkdownPreview +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> vim-markdown +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" disable the folding configuration: set foldenable +" let g:vim_markdown_folding_disabled = 1 +" To enable conceal use Vim's standard conceal configuration +" 此时文档中看不到```vim配置信息 +set conceallevel=2 +" Allow for the TOC window to auto-fix +let g:vim_markdown_toc_autofit = 1 +" Folding level +let g:vim_markdown_folding_level = 6 +" fold style +" let g:vim_markdown_folding_style_pythonic = 1 + + """""""""""""""""""""""""""""""""""""""""""""""""""""""" " bash 支持设置 " 1,函数注释快捷键:\cfu @@ -139,7 +159,8 @@ let g:syntastic_style_warning_symbol = 'W>' " 不需要手动调用 SyntasticSetTocList. 默认1 let g:syntastic_always_populate_loc_list = 1 " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 -let g:syntastic_auto_loc_list = 1 +" 设置为1,会影响其他插件,抛出E924(help E924)错误,使用lopen来开启错误信息 +let g:syntastic_auto_loc_list = 0 " 请提前安装pylint和flake8 " 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) @@ -176,8 +197,6 @@ nnoremap E :SyntasticCheck :SyntasticToggleMode " 没有特殊的配置,不要文档中的custom configure - - """""""""""""""""""""""""""""""""""""""注释模块""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""" " --->> 注释模块1——nerdcommenter @@ -230,21 +249,21 @@ imap :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" \ -o -name "*.java" -o -name "*.py" \ >cscope.files:!cscope -Rbq:cs reset if has("cscope") - set csprg=/usr/local/bin/cscope - set csto=1 - set cst - set nocsverb - " add any database in current directory - if filereadable("cscope.out") - cs add cscope.out - else - let cscope_file=findfile("cscope.out", ".;") - let cscope_pre=matchstr(cscope_file, ".*/") - if !empty(cscope_file) && filereadable(cscope_file) - exe "cs add" cscope_file cscope_pre - endif - endif - set csverb + set csprg=/usr/local/bin/cscope + set csto=1 + set cst + set nocsverb + " add any database in current directory + if filereadable("cscope.out") + cs add cscope.out + else + let cscope_file=findfile("cscope.out", ".;") + let cscope_pre=matchstr(cscope_file, ".*/") + if !empty(cscope_file) && filereadable(cscope_file) + exe "cs add" cscope_file cscope_pre + endif + endif + set csverb endif " 可以手动输入:cs f s stringA nmap s :cs find s =expand("") @@ -302,9 +321,9 @@ let g:rehash256=1 """"""""""""""""""""""""""""""""""""""""""""""""""""""" "" 背景(dark/light) "if has('gui_running') - "set background=dark +"set background=dark "else - "set background=light +"set background=light "endif "" 256支持 "let g:solarized_termcolors=256 @@ -497,8 +516,8 @@ let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' syntax enable " 高亮命中的文本或者set nohlsearch set hlsearch -" 临时取消高亮显示的开关按钮 -noremap :nohlsearch:echo +" 临时取消高亮F3显示的开关按钮 +noremap hl :nohlsearch:echo "突出高亮显示当前行 set cursorline " 插入时间 @@ -523,8 +542,8 @@ set guifont=Monaco:h20 " 鼠标设置 set mouse=a " noremap :let &mouse = (&mouse == 'a' ? 'v' : 'a') -" paste设置 -set pastetoggle= +" paste设置,不适用F7,而是采用,+p +set pastetoggle=+p " 保存所有文件 nmap wa :wa " 仅仅在下拉菜单中显示匹配项目,自动插入所有匹配项目的相同文本 @@ -534,10 +553,11 @@ set completeopt=longest,menu " ---> 折叠配置 """""""""""""""""""""""""""""""""""""""""""""" " 基于缩进的代码折叠 -set foldmethod=indent +" set foldmethod=indent " 基于语法的代码折叠 -" set foldmethod=syntax -" 启动时关闭代码折叠 +set foldmethod=syntax +" 启动时开启或者关闭折叠 +" set foldenable set nofoldenable set foldlevelstart=99 " 映射(使用空格键进行反复操作) diff --git a/bundle/vim-markdown b/bundle/vim-markdown new file mode 160000 index 0000000..2cd50d2 --- /dev/null +++ b/bundle/vim-markdown @@ -0,0 +1 @@ +Subproject commit 2cd50d2ca657091c6aa787a3847284fb4cceff49 From 6897f459cb5ccd37a4baa6492bf905133ed73373 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 19 May 2017 14:40:15 +0800 Subject: [PATCH 041/160] Add .gitignore --- .flake8 | 2 +- .gitignore | 1 + .pylintrc | 3 ++- .vimrc | 15 ++++++++------- 4 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.flake8 b/.flake8 index 818bd94..ff9a93a 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 120 -ignore = F401,E402,W291,W0232 +ignore = E402 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3862762 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bundle/* diff --git a/.pylintrc b/.pylintrc index eb3475a..d7a342c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,8 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,C0103,W0232,missing-docstring,logging-format-interpolation,fixme,W0611,W0613,C0413,C0411,c0303,c0103,R0901,R0904,R0201,W0212,W0232,C0111,W1202,W0511,R0903,W0221,R0913,R0914,W1201,W0703,R0912 +# disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating +disable= [REPORTS] diff --git a/.vimrc b/.vimrc index 0a5fdf9..7cfbbf4 100644 --- a/.vimrc +++ b/.vimrc @@ -174,7 +174,8 @@ let g:syntastic_sh_checkers=['shellcheckers'] " 错误跳转 " :lne, :lp noremap ln :lne -noremap lo :lclose +noremap lco :lclose +noremap lop :Errors noremap :let g:syntastic_auto_loc_list = ( \g:syntastic_auto_loc_list == '0' ? '1' : '0') " 添加自定义的库文件位置 @@ -553,9 +554,9 @@ set completeopt=longest,menu " ---> 折叠配置 """""""""""""""""""""""""""""""""""""""""""""" " 基于缩进的代码折叠 -" set foldmethod=indent +set foldmethod=indent " 基于语法的代码折叠 -set foldmethod=syntax +" set foldmethod=syntax " 启动时开启或者关闭折叠 " set foldenable set nofoldenable @@ -640,10 +641,10 @@ nmap rw " 所有窗口登高等宽 nmap =w = " 高度-N -nmap s- :resize -5 -nmap s+ :resize +5 -nmap v- :vertical resize -5 -nmap v+ :vertical resize +5 +nmap s_ :resize -20 +nmap s+ :resize +20 +nmap v_ :vertical resize -20 +nmap v+ :vertical resize +20 """"""""""""""""""""""""""""""""""""""" " --->>> session的保存和读取 From 16c1b4177339786526e285a5ff9f3b01d0ef8e46 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sat, 20 May 2017 22:49:48 +0800 Subject: [PATCH 042/160] Add Head increase and decrease --- .vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc b/.vimrc index 0a5fdf9..0cc73c8 100644 --- a/.vimrc +++ b/.vimrc @@ -73,6 +73,8 @@ let g:vim_markdown_toc_autofit = 1 let g:vim_markdown_folding_level = 6 " fold style " let g:vim_markdown_folding_style_pythonic = 1 +" Heder level handle +" :HeaderDecrease, :HeaderIncrease """""""""""""""""""""""""""""""""""""""""""""""""""""""" From a01bdd760c4a20cf4a6239b0e8a455516e62470b Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 26 May 2017 08:28:04 +0800 Subject: [PATCH 043/160] delete some plugin --- .gitmodules | 9 --------- .vimrc | 2 ++ bundle/a.vim | 1 - bundle/calendar | 1 - bundle/vim-signify | 1 - 5 files changed, 2 insertions(+), 12 deletions(-) delete mode 160000 bundle/a.vim delete mode 160000 bundle/calendar delete mode 160000 bundle/vim-signify diff --git a/.gitmodules b/.gitmodules index 50f593b..a44f92b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,9 +34,6 @@ [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git -[submodule "bundle/calendar"] - path = bundle/calendar - url = https://github.com/itchyny/calendar.vim.git [submodule "bundle/vim-gitgutter"] path = bundle/vim-gitgutter url = git://github.com/airblade/vim-gitgutter.git @@ -60,15 +57,9 @@ [submodule "bundle/vim-python-pep8-indent"] path = bundle/vim-python-pep8-indent url = https://github.com/Vimjas/vim-python-pep8-indent.git -[submodule "bundle/a.vim"] - path = bundle/a.vim - url = https://github.com/vim-scripts/a.vim.git [submodule "bundle/powerline"] path = bundle/powerline url = https://github.com/powerline/powerline.git -[submodule "bundle/vim-signify"] - path = bundle/vim-signify - url = https://github.com/mhinz/vim-signify.git [submodule "bundle/vim-markdown"] path = bundle/vim-markdown url = https://github.com/plasticboy/vim-markdown.git diff --git a/.vimrc b/.vimrc index 81e0ce7..d14770b 100644 --- a/.vimrc +++ b/.vimrc @@ -75,6 +75,8 @@ let g:vim_markdown_folding_level = 6 " let g:vim_markdown_folding_style_pythonic = 1 " Heder level handle " :HeaderDecrease, :HeaderIncrease +" TOC +map toc :Toc """""""""""""""""""""""""""""""""""""""""""""""""""""""" diff --git a/bundle/a.vim b/bundle/a.vim deleted file mode 160000 index 2cbe946..0000000 --- a/bundle/a.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2cbe946206ec622d9d8cf2c99317f204c4d41885 diff --git a/bundle/calendar b/bundle/calendar deleted file mode 160000 index a61af2b..0000000 --- a/bundle/calendar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a61af2bf6d8919d75e9ab48776316f1b3e11c336 diff --git a/bundle/vim-signify b/bundle/vim-signify deleted file mode 160000 index 76bde23..0000000 --- a/bundle/vim-signify +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 76bde232d163c99a8e72b517d8ef770b0d79849e From 3eaa70adbea9380bbda6553e80cd5c3d6af29664 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 26 May 2017 09:40:13 +0800 Subject: [PATCH 044/160] temporay backup --- .vimrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 7cfbbf4..9b2ffc5 100644 --- a/.vimrc +++ b/.vimrc @@ -174,8 +174,9 @@ let g:syntastic_sh_checkers=['shellcheckers'] " 错误跳转 " :lne, :lp noremap ln :lne -noremap lco :lclose -noremap lop :Errors +noremap lp :lp +noremap lc :lclose +noremap le :Errors noremap :let g:syntastic_auto_loc_list = ( \g:syntastic_auto_loc_list == '0' ? '1' : '0') " 添加自定义的库文件位置 From 82214346835f1ae76a7927afdedad797fa0534bb Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 26 May 2017 09:40:42 +0800 Subject: [PATCH 045/160] Modify flake8 and pylint configure --- .flake8 | 2 +- .pylintrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index ff9a93a..21c97c8 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 120 -ignore = E402 +ignore = E402,W291 diff --git a/.pylintrc b/.pylintrc index d7a342c..61d85fb 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable= +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument [REPORTS] From 2f3c1f9678e8e9fa611e60b22e04a689c84cd2c7 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 26 May 2017 13:12:03 +0800 Subject: [PATCH 046/160] Add ignore: broad-except --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 61d85fb..90f228f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except [REPORTS] From 62c77f2e4a723128cb452c23e809a742aba15029 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 5 Jun 2017 08:40:12 +0800 Subject: [PATCH 047/160] Modify pylintrc --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 90f228f..b67959e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals [REPORTS] From 748bac9f1f9d22e7d4a75f72bb086792a863dcf4 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 14 Jun 2017 16:43:30 +0800 Subject: [PATCH 048/160] Add new ignore --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index b67959e..0ad5945 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes [REPORTS] From 288102f6c66b143417a6012b0c9de08000a29ebc Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 30 Jun 2017 17:25:30 +0800 Subject: [PATCH 049/160] pylintrc --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 0ad5945..359a5d2 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments [REPORTS] From 508401f5fb71783e40a79ca74ab47cc95468fc72 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 3 Jul 2017 07:31:18 +0800 Subject: [PATCH 050/160] Add ycm configure --- .vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc b/.vimrc index 8e3faeb..948e249 100644 --- a/.vimrc +++ b/.vimrc @@ -143,6 +143,8 @@ let g:ycm_python_binary_path="python" let g:ycm_complete_in_strings = 2 let g:ycm_collect_identifiers_from_tags_files = 1 let g:ycm_add_preview_to_completeopt = 1 +let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py" +let g:ycm_key_invoke_completion = '' nnoremap jd :YcmCompleter GoTo From 3687c9055311e592fc9aace219b96e669ddd5e87 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 3 Jul 2017 07:46:45 +0800 Subject: [PATCH 051/160] Add emmet-vim script --- .gitignore | 2 +- .gitmodules | 3 +++ bundle/emmet-vim | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 160000 bundle/emmet-vim diff --git a/.gitignore b/.gitignore index 3862762..8b13789 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -bundle/* + diff --git a/.gitmodules b/.gitmodules index a44f92b..aa97b6e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -63,3 +63,6 @@ [submodule "bundle/vim-markdown"] path = bundle/vim-markdown url = https://github.com/plasticboy/vim-markdown.git +[submodule "bundle/emmet-vim"] + path = bundle/emmet-vim + url = https://github.com/mattn/emmet-vim.git diff --git a/bundle/emmet-vim b/bundle/emmet-vim new file mode 160000 index 0000000..94261d6 --- /dev/null +++ b/bundle/emmet-vim @@ -0,0 +1 @@ +Subproject commit 94261d6515b37a13e8a115d45750511c890c069f From db242de27de025e5949ae681def12ccfb3fab2ec Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 3 Jul 2017 10:00:38 +0800 Subject: [PATCH 052/160] Modify pylintrc --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 359a5d2..f731655 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args [REPORTS] From ab974deca191202488c860b87ed64a115ad66bf3 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 6 Jul 2017 23:11:32 +0800 Subject: [PATCH 053/160] Add new bind key: open html file in vim --- .vimrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vimrc b/.vimrc index 948e249..477613a 100644 --- a/.vimrc +++ b/.vimrc @@ -664,6 +664,13 @@ map wsv :mksession! :wviminfo vim.viminfo map rsv :source ./Session.vim :rviminfo vim.viminfo +""""""""""""""""""""""""""""""""""""""" +" --->>> html设置 +""""""""""""""""""""""""""""""""""""""" +nmap hml :!open % + + + if $VIM_CRONTAB == "true" set nobackup set nowritebackup From a6d150722640df56b163ecef14df16a08459f56e Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 28 Jul 2017 07:14:57 +0800 Subject: [PATCH 054/160] Fix bugs: generate tags --- .vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 477613a..c0ab90a 100644 --- a/.vimrc +++ b/.vimrc @@ -238,12 +238,12 @@ let g:NERDTrimTrailingWhitespace=1 " 生成tags的命令 map :!ctags \ --languages=c,c++,python,java,php,sh -R - \ --exclude=@/Users/zhengbifeng/.vim/.ctagsignore + \ --exclude=@$HOME/.vim/.ctagsignore \ --c++-kinds=+p --fields=+iaS --extra=+q . \ :TlistUpdate imap :!ctags \ --languages=c,c++,python,java,php,sh,js -R - \ --exclude=@/Users/zhengbifeng/.vim/.ctagsignore + \ --exclude=@$HOME/.vim/.ctagsignore \ --c++-kinds=+p --fields=+iaS --extra=+q . \ :TlistUpdate From 7d0dcb1e46b8dd9ae83d3dcc6e3893c41e7dc94d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 28 Jul 2017 09:18:45 +0800 Subject: [PATCH 055/160] Change pylintrc --- .pylintrc | 2 +- .vimrc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index f731655..b7cdc41 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements [REPORTS] diff --git a/.vimrc b/.vimrc index c0ab90a..b8277bd 100644 --- a/.vimrc +++ b/.vimrc @@ -652,6 +652,8 @@ nmap s_ :resize -20 nmap s+ :resize +20 nmap v_ :vertical resize -20 nmap v+ :vertical resize +20 +" preview window close +nmap pc :pc """"""""""""""""""""""""""""""""""""""" " --->>> session的保存和读取 From 12af23c3485fa34daf462b46655f0f846b5d12fa Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 24 Aug 2017 17:35:21 +0800 Subject: [PATCH 056/160] Update pylintrc --- .netrwhist | 6 +++++- .pylintrc | 2 +- .vimrc | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.netrwhist b/.netrwhist index 06aae74..b6a17c9 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,3 +1,7 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =1 +let g:netrw_dirhist_cnt =5 let g:netrw_dirhist_1='/home/bamboo/.vim' +let g:netrw_dirhist_2='/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary/apps/user/services' +let g:netrw_dirhist_3='/Users/zhengbifeng/grocery-shop/language/python/src/mro' +let g:netrw_dirhist_4='/Users/zhengbifeng/grocery-shop/language/python' +let g:netrw_dirhist_5='/Users/zhengbifeng/grocery-shop/language/python/src/mro' diff --git a/.pylintrc b/.pylintrc index b7cdc41..5f2a3c3 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions [REPORTS] diff --git a/.vimrc b/.vimrc index b8277bd..76edda5 100644 --- a/.vimrc +++ b/.vimrc @@ -516,6 +516,15 @@ endfunction let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' +""""""""""""""""""""""""""""""""""""""" +" ---> 文件基本操作 +""""""""""""""""""""""""""""""""""""""" +" 1 重命名文件,使用插件rename,该方法有很多缺陷 +" saveas : will move a file from its location to CWD. +" 2 使用Explore +noremap sa :Explore + + """"""""""""""""""""""""""""""""""""""" "---->>>>正常的基础命令 @@ -628,6 +637,7 @@ if $VIM_CRONTAB == "true" set nowritebackup endif + """"""""""""""""""""""""""""""""""""""" " --->>>窗口切割映射键和跳转快捷键 """"""""""""""""""""""""""""""""""""""" From 7a4d4c5053510c6ebb440a72728b771b5e5f5b5d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 25 Aug 2017 16:23:09 +0800 Subject: [PATCH 057/160] Fix bugs --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 76edda5..4078c4c 100644 --- a/.vimrc +++ b/.vimrc @@ -80,7 +80,7 @@ map toc :Toc """""""""""""""""""""""""""""""""""""""""""""""""""""""" -" bash 支持设置 +" bash support 支持设置 " 1,函数注释快捷键:\cfu " PS:更加详细的信息请见《印象笔记-vim-插件》笔记 " 或帮助手册 From 734f9dfda9dc432abdab2be06b45b028fbbeca6e Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 14 Sep 2017 11:28:57 +0800 Subject: [PATCH 058/160] add some comments --- .netrwhist | 7 +------ .vimrc | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.netrwhist b/.netrwhist index b6a17c9..7771a52 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,7 +1,2 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =5 -let g:netrw_dirhist_1='/home/bamboo/.vim' -let g:netrw_dirhist_2='/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary/apps/user/services' -let g:netrw_dirhist_3='/Users/zhengbifeng/grocery-shop/language/python/src/mro' -let g:netrw_dirhist_4='/Users/zhengbifeng/grocery-shop/language/python' -let g:netrw_dirhist_5='/Users/zhengbifeng/grocery-shop/language/python/src/mro' +let g:netrw_dirhist_cnt =0 diff --git a/.vimrc b/.vimrc index 4078c4c..632c09f 100644 --- a/.vimrc +++ b/.vimrc @@ -521,7 +521,7 @@ let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' """"""""""""""""""""""""""""""""""""""" " 1 重命名文件,使用插件rename,该方法有很多缺陷 " saveas : will move a file from its location to CWD. -" 2 使用Explore +" 2 使用Explore, 之后使用 R-- 重命名, D--删除文件 noremap sa :Explore From 473e9649129b0ff4ce41bc51398de45d42ab362f Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 17 Oct 2017 14:29:56 +0800 Subject: [PATCH 059/160] add ag.vim --- .gitmodules | 3 +++ .netrwhist | 8 +++++++- .vimrc | 4 +++- bundle/ag.vim | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) create mode 160000 bundle/ag.vim diff --git a/.gitmodules b/.gitmodules index aa97b6e..ff16cfb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -66,3 +66,6 @@ [submodule "bundle/emmet-vim"] path = bundle/emmet-vim url = https://github.com/mattn/emmet-vim.git +[submodule "bundle/ag.vim"] + path = bundle/ag.vim + url = https://github.com/rking/ag.vim diff --git a/.netrwhist b/.netrwhist index 7771a52..f2ed28b 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,2 +1,8 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =0 +let g:netrw_dirhist_cnt =6 +let g:netrw_dirhist_1='/Users/zhengbifeng' +let g:netrw_dirhist_2='/Users/zhengbifeng/Public/story/ilifediary-app/settings' +let g:netrw_dirhist_3='/Users/zhengbifeng/Public/swapi/starwars' +let g:netrw_dirhist_4='/Users/zhengbifeng/Public/swapi/starwars/fixtures' +let g:netrw_dirhist_5='/Users/zhengbifeng/Public/swapi/starwars/migrations' +let g:netrw_dirhist_6='/private/tmp' diff --git a/.vimrc b/.vimrc index 632c09f..cd8acb6 100644 --- a/.vimrc +++ b/.vimrc @@ -38,6 +38,8 @@ syntax on "let g:ag_prg="<...> --vimgrep" " 查找,从项目根目录开始 let g:ag_working_path_mode="r" +" 执行路径 +set runtimepath^=~/.vim/bundle/ag.vim """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -462,7 +464,7 @@ let NERDTreeMinimalUI=1 let NERDTreeAutoDeleteBuffer=1 " exclude some files let NERDTreeIgnore = ['\.pyc$', 'migrations', 'log?', 'cscope.*', 'tags', - \ 'static', 'media', 'doc', 'templates'] + \ 'media', 'doc'] " 启动或者隐藏NERDTree nmap :NERDTreeToggle diff --git a/bundle/ag.vim b/bundle/ag.vim new file mode 160000 index 0000000..cb5d96f --- /dev/null +++ b/bundle/ag.vim @@ -0,0 +1 @@ +Subproject commit cb5d96f1af171e76da048c3d79780b7306806695 From 8e6b03c9407b7405a42a7a701f21f4af4fd11a46 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 23 Oct 2017 20:05:46 +0800 Subject: [PATCH 060/160] Add special tabspace of html, htmldjango, css --- .netrwhist | 9 +++------ .vimrc | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.netrwhist b/.netrwhist index b6a17c9..72daf79 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,7 +1,4 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =5 -let g:netrw_dirhist_1='/home/bamboo/.vim' -let g:netrw_dirhist_2='/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary/apps/user/services' -let g:netrw_dirhist_3='/Users/zhengbifeng/grocery-shop/language/python/src/mro' -let g:netrw_dirhist_4='/Users/zhengbifeng/grocery-shop/language/python' -let g:netrw_dirhist_5='/Users/zhengbifeng/grocery-shop/language/python/src/mro' +let g:netrw_dirhist_cnt =2 +let g:netrw_dirhist_1='/Users/bamboo/grocery-shop/language/js' +let g:netrw_dirhist_2='/Users/bamboo/grocery-shop/language/js/ajax' diff --git a/.vimrc b/.vimrc index 4078c4c..dbf7b5a 100644 --- a/.vimrc +++ b/.vimrc @@ -680,6 +680,11 @@ map rsv :source ./Session.vim :rviminfo vim.viminfo " --->>> html设置 """"""""""""""""""""""""""""""""""""""" nmap hml :!open % +" html文件采用2个空格缩进方式 +autocmd FileType html setlocal ts=2 sts=2 sw=2 +autocmd FileType htmldjango setlocal ts=2 sts=2 sw=2 +autocmd FileType css setlocal ts=2 sts=2 sw=2 +autocmd Filetype ruby setlocal ts=2 sts=2 sw=2 From 5e708d466496038ec584fa709f0567b8be4b2bcb Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 26 Oct 2017 17:56:05 +0800 Subject: [PATCH 061/160] Add a new script: vim-repeat --- .gitmodules | 3 +++ bundle/vim-repeat | 1 + 2 files changed, 4 insertions(+) create mode 160000 bundle/vim-repeat diff --git a/.gitmodules b/.gitmodules index ff16cfb..6ff2d29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -69,3 +69,6 @@ [submodule "bundle/ag.vim"] path = bundle/ag.vim url = https://github.com/rking/ag.vim +[submodule "bundle/vim-repeat"] + path = bundle/vim-repeat + url = https://github.com/tpope/vim-repeat.git diff --git a/bundle/vim-repeat b/bundle/vim-repeat new file mode 160000 index 0000000..070ee90 --- /dev/null +++ b/bundle/vim-repeat @@ -0,0 +1 @@ +Subproject commit 070ee903245999b2b79f7386631ffd29ce9b8e9f From 0a91719f5fb84289981d6d7e5a64cbde770ddb37 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 27 Oct 2017 17:36:37 +0800 Subject: [PATCH 062/160] Add tern script for javascript --- .gitmodules | 3 +++ .netrwhist | 9 ++------- .pylintrc | 2 +- bundle/tern_for_vim | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) create mode 160000 bundle/tern_for_vim diff --git a/.gitmodules b/.gitmodules index 6ff2d29..dc24455 100644 --- a/.gitmodules +++ b/.gitmodules @@ -72,3 +72,6 @@ [submodule "bundle/vim-repeat"] path = bundle/vim-repeat url = https://github.com/tpope/vim-repeat.git +[submodule "bundle/tern_for_vim"] + path = bundle/tern_for_vim + url = https://github.com/ternjs/tern_for_vim.git diff --git a/.netrwhist b/.netrwhist index afce501..3ada152 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,14 +1,9 @@ let g:netrw_dirhistmax =10 -<<<<<<< HEAD -let g:netrw_dirhist_cnt =2 -let g:netrw_dirhist_1='/Users/bamboo/grocery-shop/language/js' -let g:netrw_dirhist_2='/Users/bamboo/grocery-shop/language/js/ajax' -======= -let g:netrw_dirhist_cnt =6 +let g:netrw_dirhist_cnt =7 let g:netrw_dirhist_1='/Users/zhengbifeng' let g:netrw_dirhist_2='/Users/zhengbifeng/Public/story/ilifediary-app/settings' let g:netrw_dirhist_3='/Users/zhengbifeng/Public/swapi/starwars' let g:netrw_dirhist_4='/Users/zhengbifeng/Public/swapi/starwars/fixtures' let g:netrw_dirhist_5='/Users/zhengbifeng/Public/swapi/starwars/migrations' let g:netrw_dirhist_6='/private/tmp' ->>>>>>> 473e9649129b0ff4ce41bc51398de45d42ab362f +let g:netrw_dirhist_7='/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary/apps' diff --git a/.pylintrc b/.pylintrc index 5f2a3c3..22a15f8 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class [REPORTS] diff --git a/bundle/tern_for_vim b/bundle/tern_for_vim new file mode 160000 index 0000000..58b85db --- /dev/null +++ b/bundle/tern_for_vim @@ -0,0 +1 @@ +Subproject commit 58b85db1e40f73b714c02b96973e3477661f0de5 From c03b5f2096c1f8562763c3cc73f8e76d34b3eb8f Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 27 Oct 2017 18:01:37 +0800 Subject: [PATCH 063/160] Fix bugs --- .gitignore | 1 + .gitmodules | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 8b13789..139597f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ + diff --git a/.gitmodules b/.gitmodules index dc24455..e705c80 100644 --- a/.gitmodules +++ b/.gitmodules @@ -75,3 +75,4 @@ [submodule "bundle/tern_for_vim"] path = bundle/tern_for_vim url = https://github.com/ternjs/tern_for_vim.git + ignore = dirty From 53e1f11a9784f5cd7b5d606ce2af48164c777ccd Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sat, 28 Oct 2017 17:20:55 +0800 Subject: [PATCH 064/160] Update gitmodules filename --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index e705c80..4ab512d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -66,12 +66,15 @@ [submodule "bundle/emmet-vim"] path = bundle/emmet-vim url = https://github.com/mattn/emmet-vim.git + ignore = dirty [submodule "bundle/ag.vim"] path = bundle/ag.vim url = https://github.com/rking/ag.vim + ignore = dirty [submodule "bundle/vim-repeat"] path = bundle/vim-repeat url = https://github.com/tpope/vim-repeat.git + ignore = dirty [submodule "bundle/tern_for_vim"] path = bundle/tern_for_vim url = https://github.com/ternjs/tern_for_vim.git From 16bba00ef6460be16fefa3130b1e9a228c0ad450 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 29 Oct 2017 09:41:57 +0800 Subject: [PATCH 065/160] Reinstall ag.vim --- .gitmodules | 4 ---- bundle/ag.vim | 1 - 2 files changed, 5 deletions(-) delete mode 160000 bundle/ag.vim diff --git a/.gitmodules b/.gitmodules index 4ab512d..95f239f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -67,10 +67,6 @@ path = bundle/emmet-vim url = https://github.com/mattn/emmet-vim.git ignore = dirty -[submodule "bundle/ag.vim"] - path = bundle/ag.vim - url = https://github.com/rking/ag.vim - ignore = dirty [submodule "bundle/vim-repeat"] path = bundle/vim-repeat url = https://github.com/tpope/vim-repeat.git diff --git a/bundle/ag.vim b/bundle/ag.vim deleted file mode 160000 index cb5d96f..0000000 --- a/bundle/ag.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cb5d96f1af171e76da048c3d79780b7306806695 From 34956047c006b6dc8d08de4b2b9022e66ced3ca3 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 29 Oct 2017 09:51:33 +0800 Subject: [PATCH 066/160] Add ag.vim --- .gitmodules | 4 ++++ bundle/ag.vim | 1 + 2 files changed, 5 insertions(+) create mode 160000 bundle/ag.vim diff --git a/.gitmodules b/.gitmodules index 95f239f..b412acc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -75,3 +75,7 @@ path = bundle/tern_for_vim url = https://github.com/ternjs/tern_for_vim.git ignore = dirty +[submodule "bundle/ag.vim"] + path = bundle/ag.vim + url = https://github.com/rking/ag.vim.git + ignore = dirty diff --git a/bundle/ag.vim b/bundle/ag.vim new file mode 160000 index 0000000..4a0dd6e --- /dev/null +++ b/bundle/ag.vim @@ -0,0 +1 @@ +Subproject commit 4a0dd6e190f446e5a016b44fdaa2feafc582918e From 44ed19b420bff014476dafa8351e3fb0d17792c6 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 1 Nov 2017 07:58:16 +0800 Subject: [PATCH 067/160] Add deactive syntastic of html --- .netrwhist | 9 +-------- .vimrc | 8 +++++++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.netrwhist b/.netrwhist index 3ada152..7771a52 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,9 +1,2 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =7 -let g:netrw_dirhist_1='/Users/zhengbifeng' -let g:netrw_dirhist_2='/Users/zhengbifeng/Public/story/ilifediary-app/settings' -let g:netrw_dirhist_3='/Users/zhengbifeng/Public/swapi/starwars' -let g:netrw_dirhist_4='/Users/zhengbifeng/Public/swapi/starwars/fixtures' -let g:netrw_dirhist_5='/Users/zhengbifeng/Public/swapi/starwars/migrations' -let g:netrw_dirhist_6='/private/tmp' -let g:netrw_dirhist_7='/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary/apps' +let g:netrw_dirhist_cnt =0 diff --git a/.vimrc b/.vimrc index a3d88ef..82fa4ef 100644 --- a/.vimrc +++ b/.vimrc @@ -179,6 +179,11 @@ let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' " shellcheckers and sh let g:syntastic_sh_checkers=['shellcheckers'] +" HTML +let g:syntastic_html_tidy_ignore_errors = [ + \ ' proprietary attribute' + \] + " 错误跳转 " :lne, :lp noremap ln :lne @@ -190,7 +195,8 @@ noremap :let g:syntastic_auto_loc_list = ( " 添加自定义的库文件位置 let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' " syntastic过慢导致的问题(需要按两次才能取消哦,注意大写的E) -let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] } +" 关闭html错误检查 +let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': ['html'] } nnoremap E :SyntasticCheck :SyntasticToggleMode From da652f5c50c0f925e13d3c1f3c898588da461c53 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 1 Nov 2017 09:36:10 +0800 Subject: [PATCH 068/160] Add a new ignore file --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 139597f..3b569ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ - +.netrwhist From f4b4d5518a518932b03b631bac530160bdd68277 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 1 Nov 2017 09:50:55 +0800 Subject: [PATCH 069/160] Delete ag.vim --- .gitmodules | 4 ---- bundle/ag.vim | 1 - 2 files changed, 5 deletions(-) delete mode 160000 bundle/ag.vim diff --git a/.gitmodules b/.gitmodules index b412acc..95f239f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -75,7 +75,3 @@ path = bundle/tern_for_vim url = https://github.com/ternjs/tern_for_vim.git ignore = dirty -[submodule "bundle/ag.vim"] - path = bundle/ag.vim - url = https://github.com/rking/ag.vim.git - ignore = dirty diff --git a/bundle/ag.vim b/bundle/ag.vim deleted file mode 160000 index 4a0dd6e..0000000 --- a/bundle/ag.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a0dd6e190f446e5a016b44fdaa2feafc582918e From 7e9ff7259add4c279ed794e2a61bfc807be3347d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 1 Nov 2017 09:52:38 +0800 Subject: [PATCH 070/160] Add ag.vim --- .gitmodules | 4 ++++ bundle/ag.vim | 1 + 2 files changed, 5 insertions(+) create mode 160000 bundle/ag.vim diff --git a/.gitmodules b/.gitmodules index 95f239f..b412acc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -75,3 +75,7 @@ path = bundle/tern_for_vim url = https://github.com/ternjs/tern_for_vim.git ignore = dirty +[submodule "bundle/ag.vim"] + path = bundle/ag.vim + url = https://github.com/rking/ag.vim.git + ignore = dirty diff --git a/bundle/ag.vim b/bundle/ag.vim new file mode 160000 index 0000000..4a0dd6e --- /dev/null +++ b/bundle/ag.vim @@ -0,0 +1 @@ +Subproject commit 4a0dd6e190f446e5a016b44fdaa2feafc582918e From 4249dabdacb67db6320daacec64dcfb77be8cbc7 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 1 Nov 2017 14:04:07 +0800 Subject: [PATCH 071/160] Filter python warning: too-many-nested-blocks --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 22a15f8..9f679e3 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks [REPORTS] From 5006c022e1ed09f6be9322a136a3f95c3b0de798 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 15 Nov 2017 11:36:35 +0800 Subject: [PATCH 072/160] Delete syntastic and add ale --- .gitmodules | 3 --- .netrwhist | 2 -- .vimrc | 65 +++++++++++++++++++++++++++++++----------------- bundle/ale | 1 + bundle/syntastic | 1 - 5 files changed, 43 insertions(+), 29 deletions(-) delete mode 100644 .netrwhist create mode 160000 bundle/ale delete mode 160000 bundle/syntastic diff --git a/.gitmodules b/.gitmodules index b412acc..20d28b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -45,9 +45,6 @@ path = bundle/vim-pydocstring url = https://github.com/heavenshell/vim-pydocstring.git ignore = dirty -[submodule "bundle/syntastic"] - path = bundle/syntastic - url = https://github.com/scrooloose/syntastic.git [submodule "bundle/YouCompleteMe"] path = bundle/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git diff --git a/.netrwhist b/.netrwhist deleted file mode 100644 index 7771a52..0000000 --- a/.netrwhist +++ /dev/null @@ -1,2 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =0 diff --git a/.vimrc b/.vimrc index 82fa4ef..2defc2b 100644 --- a/.vimrc +++ b/.vimrc @@ -159,45 +159,57 @@ nnoremap jd :YcmCompleter GoTo " """"""""""""""""""""""""""""""""""""""" " 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) -let g:syntastic_error_symbol = 'EE' -let g:syntastic_style_error_symbol = 'E>' -let g:syntastic_warning_symbol = 'WW' -let g:syntastic_style_warning_symbol = 'W>' +" let g:syntastic_error_symbol = 'EE' +" let g:syntastic_style_error_symbol = 'E>' +" let g:syntastic_warning_symbol = 'WW' +" let g:syntastic_style_warning_symbol = 'W>' " 必要配置3 " 不需要手动调用 SyntasticSetTocList. 默认1 -let g:syntastic_always_populate_loc_list = 1 +" let g:syntastic_always_populate_loc_list = 1 " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 " 设置为1,会影响其他插件,抛出E924(help E924)错误,使用lopen来开启错误信息 -let g:syntastic_auto_loc_list = 0 +" let g:syntastic_auto_loc_list = 0 " 请提前安装pylint和flake8 " 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) " pyflake8,见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 ~/.config/flake8 -let g:syntastic_python_checkers=['flake8', 'pylint'] +" let g:syntastic_python_checkers=['flake8', 'pylint'] " 使用pylint可以对代码进行评分检查 -let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' +" let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' " shellcheckers and sh -let g:syntastic_sh_checkers=['shellcheckers'] +" let g:syntastic_sh_checkers=['shellcheckers'] " HTML -let g:syntastic_html_tidy_ignore_errors = [ - \ ' proprietary attribute' - \] +" let g:syntastic_html_tidy_ignore_errors = [ +" \ ' proprietary attribute' +" \] " 错误跳转 " :lne, :lp -noremap ln :lne -noremap lp :lp -noremap lc :lclose -noremap le :Errors -noremap :let g:syntastic_auto_loc_list = ( - \g:syntastic_auto_loc_list == '0' ? '1' : '0') -" 添加自定义的库文件位置 -let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' +" noremap ln :lne +" noremap lp :lp +" noremap lc :lclose +" noremap le :Errors +" noremap :let g:syntastic_auto_loc_list = ( +" \g:syntastic_auto_loc_list == '0' ? '1' : '0') " syntastic过慢导致的问题(需要按两次才能取消哦,注意大写的E) " 关闭html错误检查 -let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': ['html'] } -nnoremap E :SyntasticCheck :SyntasticToggleMode +" let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': ['html'] } +" nnoremap E :SyntasticCheck :SyntasticToggleMode + + +""""""""""""""""""""""""""""""""""""""" +" 插件: ale +" 功能: 异步代码检查插件 +""""""""""""""""""""""""""""""""""""""" +" use quickfix list instead of the loclist +let g:ale_set_loclist = 0 +let g:ale_set_quickfix = 1 +" let g:ale_open_list = 1 +" let g:ale_keep_list_window_open = 1 +noremap le :let g:ale_open_list = 1 + \:let g:ale_keep_list_window_open = 1 + """"""""""""""""""""""""""""""""""""""" @@ -398,8 +410,13 @@ let g:Powerline_colorscheme='solarized256' """"""""""""""""""""""""""""""""""""""" " ---> 日常模块1——quickfix分析 +" """"""""""""""""""""""""""""""""""""""" -" 快捷键设置暂时没有 +" Quickfix document +noremap ln :lne +noremap lp :lp +noremap lc :cclose +noremap lo :cwindow """"""""""""""""""""""""""""""""""""""" @@ -713,6 +730,8 @@ endif " 3,现在一般用LookupFile来代替find命令,见上面的说明 " """""""""""""""""""""""""""""""""""""""""""""" +" 添加自定义的库文件位置 +" let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' if filereadable("bamboo.vim") source bamboo.vim endif diff --git a/bundle/ale b/bundle/ale new file mode 160000 index 0000000..48be035 --- /dev/null +++ b/bundle/ale @@ -0,0 +1 @@ +Subproject commit 48be035da82c30fe12859179d731720f3819ee4e diff --git a/bundle/syntastic b/bundle/syntastic deleted file mode 160000 index cdfb64d..0000000 --- a/bundle/syntastic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cdfb64db6711f8df6937d368cff75c7213505fe2 From 6145e7ba992eb17bc50fb513ed37c952f4043e8d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 15 Nov 2017 14:37:32 +0800 Subject: [PATCH 073/160] Support ale --- .vimrc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index 2defc2b..60cd8f2 100644 --- a/.vimrc +++ b/.vimrc @@ -205,10 +205,14 @@ nnoremap jd :YcmCompleter GoTo " use quickfix list instead of the loclist let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 -" let g:ale_open_list = 1 -" let g:ale_keep_list_window_open = 1 -noremap le :let g:ale_open_list = 1 - \:let g:ale_keep_list_window_open = 1 +let g:ale_open_list = 1 +let g:ale_keep_list_window_open = 1 + +" help ale-python 信息 +" 指定pylintrc位置 +let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' +" 启用virtualenv +let g:ale_python_pylint_use_global = 1 @@ -731,7 +735,7 @@ endif " """""""""""""""""""""""""""""""""""""""""""""" " 添加自定义的库文件位置 -" let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' +let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' if filereadable("bamboo.vim") source bamboo.vim endif From cfdb396e37b82364ee737be7d5e433de3ae49ec2 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 15 Nov 2017 14:52:42 +0800 Subject: [PATCH 074/160] Update pylintrc --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 9f679e3..0aad5ea 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ [REPORTS] From 44f38d00576bb317b79d033db407e86e2b7dbb57 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 15 Nov 2017 16:20:52 +0800 Subject: [PATCH 075/160] Add new ignore configure --- .flake8 | 2 +- .pylintrc | 2 +- .vimrc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 21c97c8..91fa636 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 120 -ignore = E402,W291 +ignore = E402,W291,F401 diff --git a/.pylintrc b/.pylintrc index 0aad5ea..43c6e45 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init [REPORTS] diff --git a/.vimrc b/.vimrc index 60cd8f2..0900de9 100644 --- a/.vimrc +++ b/.vimrc @@ -206,7 +206,7 @@ nnoremap jd :YcmCompleter GoTo let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 let g:ale_open_list = 1 -let g:ale_keep_list_window_open = 1 +let g:ale_keep_list_window_open = 0 " help ale-python 信息 " 指定pylintrc位置 @@ -735,7 +735,7 @@ endif " """""""""""""""""""""""""""""""""""""""""""""" " 添加自定义的库文件位置 -let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' +" let $PYTHONPATH='/Users/bamboo/Public/iLifeDiary/iLifeDiary/:/Users/zhengbifeng/Public/iLifeDiary/iLifeDiary' if filereadable("bamboo.vim") source bamboo.vim endif From eb03cbd656c36b862a8c695603074319b008f1f6 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 17 Nov 2017 10:08:45 +0800 Subject: [PATCH 076/160] Update pylintrc --- .pylintrc | 2 +- .vimrc | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index 43c6e45..2e24262 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors [REPORTS] diff --git a/.vimrc b/.vimrc index 0900de9..5056941 100644 --- a/.vimrc +++ b/.vimrc @@ -185,10 +185,6 @@ nnoremap jd :YcmCompleter GoTo " \] " 错误跳转 -" :lne, :lp -" noremap ln :lne -" noremap lp :lp -" noremap lc :lclose " noremap le :Errors " noremap :let g:syntastic_auto_loc_list = ( " \g:syntastic_auto_loc_list == '0' ? '1' : '0') @@ -214,6 +210,12 @@ let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' " 启用virtualenv let g:ale_python_pylint_use_global = 1 +" 错误移动 +noremap ef :ALEFirst +noremap en :ALENext +noremap el :ALELast +noremap ep :ALEPrevious + """"""""""""""""""""""""""""""""""""""" From c95d470aa0252f0ac6d6903a2ff209bc9498a908 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 11 Dec 2017 20:40:36 +0800 Subject: [PATCH 077/160] Delete ale --- bundle/ale | 1 - 1 file changed, 1 deletion(-) delete mode 160000 bundle/ale diff --git a/bundle/ale b/bundle/ale deleted file mode 160000 index 48be035..0000000 --- a/bundle/ale +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 48be035da82c30fe12859179d731720f3819ee4e From 0f5426ac75ce33614a9aac49ab391f146fca13ec Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 11 Dec 2017 21:10:36 +0800 Subject: [PATCH 078/160] Fix bugs --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 5056941..8ba814c 100644 --- a/.vimrc +++ b/.vimrc @@ -716,6 +716,9 @@ autocmd FileType html setlocal ts=2 sts=2 sw=2 autocmd FileType htmldjango setlocal ts=2 sts=2 sw=2 autocmd FileType css setlocal ts=2 sts=2 sw=2 autocmd Filetype ruby setlocal ts=2 sts=2 sw=2 +" Emmet-vim +" html基本框架 +" imap html5 :html:5, From b0043594746451d00e6c4e96fb226adc60eb7366 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 17 Dec 2017 18:54:39 +0800 Subject: [PATCH 079/160] Add vim-jsbeautify --- .editorconfig | 32 ++++++++++++++++++++++++++++++++ .gitmodules | 3 +++ .vimrc | 15 ++++++++++++++- bundle/vim-jsbeautify | 1 + 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 160000 bundle/vim-jsbeautify diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a470b61 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,32 @@ +;.editorconfig +;javascript, css, html format + +root = true + +[**.js] +; path to optional external js beautifier +path=~/.vim/bundle/js-beautify/js/lib/beautify.js +; Javascript interpreter to be invoked by default 'node' +bin=node +indent_style = space +indent_size = 2 + +[**.json] +indent_style = space +indent_size = 4 + +[**.jsx] +e4x = true +indent_style = space +indent_size = 2 + +[**.css] +path=~/.vim/bundle/js-beautify/js/lib/beautify-css.js +indent_style = space +indent_size = 2 + +[**.html] +indent_style = space +indent_size = 4 +max_char = 120 +brace_style = expand diff --git a/.gitmodules b/.gitmodules index 20d28b8..8e55d3b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,3 +76,6 @@ path = bundle/ag.vim url = https://github.com/rking/ag.vim.git ignore = dirty +[submodule "bundle/vim-jsbeautify"] + path = bundle/vim-jsbeautify + url = https://github.com/maksimr/vim-jsbeautify.git diff --git a/.vimrc b/.vimrc index 8ba814c..a98a847 100644 --- a/.vimrc +++ b/.vimrc @@ -50,6 +50,17 @@ set runtimepath^=~/.vim/bundle/ag.vim map json :%!python -m json.tool vnoremap json :'<,'>!python -m json.tool +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> jsbeautify: 对css,javascript, html进行格式化 +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +map :call JsBeautify() +" 自动格式化(可以配置vnormap) +autocmd FileType javascript noremap :call JsBeautify() +autocmd FileType json noremap :call JsonBeautify() +autocmd FileType jsx noremap :call JsxBeautify() +autocmd FileType html noremap :call HtmlBeautify() +autocmd FileType css noremap :call CSSBeautify() + """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> vim-instant-markdown @@ -716,7 +727,9 @@ autocmd FileType html setlocal ts=2 sts=2 sw=2 autocmd FileType htmldjango setlocal ts=2 sts=2 sw=2 autocmd FileType css setlocal ts=2 sts=2 sw=2 autocmd Filetype ruby setlocal ts=2 sts=2 sw=2 -" Emmet-vim +""""""""""""""""""""""""""""""""""""""" +" --->>> Emmet-vim +""""""""""""""""""""""""""""""""""""""" " html基本框架 " imap html5 :html:5, diff --git a/bundle/vim-jsbeautify b/bundle/vim-jsbeautify new file mode 160000 index 0000000..e83f749 --- /dev/null +++ b/bundle/vim-jsbeautify @@ -0,0 +1 @@ +Subproject commit e83f749c3de7e958e7bc285e80e484707b6f1e12 From 69b829a27d919b09829baa6c3fc206c85930a3dc Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 17 Dec 2017 19:29:41 +0800 Subject: [PATCH 080/160] Fix bugs --- .editorconfig | 4 ++-- .vimrc | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index a470b61..64292fb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ root = true [**.js] ; path to optional external js beautifier -path=~/.vim/bundle/js-beautify/js/lib/beautify.js +path=~/.vim/bundle/vim-jsbeautify/plugin/lib/js/lib/beautify.js ; Javascript interpreter to be invoked by default 'node' bin=node indent_style = space @@ -21,7 +21,7 @@ indent_style = space indent_size = 2 [**.css] -path=~/.vim/bundle/js-beautify/js/lib/beautify-css.js +path=~/.vim/bundle/vim-jsbeautify/plugin/lib/js/lib/beautify-css.js indent_style = space indent_size = 2 diff --git a/.vimrc b/.vimrc index a98a847..6602884 100644 --- a/.vimrc +++ b/.vimrc @@ -53,13 +53,19 @@ vnoremap json :'<,'>!python -m json.tool """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> jsbeautify: 对css,javascript, html进行格式化 """"""""""""""""""""""""""""""""""""""""""""""""""""""" -map :call JsBeautify() -" 自动格式化(可以配置vnormap) +" map :call JsBeautify() +" 映射(可以配置vnormap) autocmd FileType javascript noremap :call JsBeautify() autocmd FileType json noremap :call JsonBeautify() autocmd FileType jsx noremap :call JsxBeautify() autocmd FileType html noremap :call HtmlBeautify() autocmd FileType css noremap :call CSSBeautify() +" 自动格式化 +autocmd FileType javascript :call JsBeautify() +autocmd FileType json :call JsonBeautify() +autocmd FileType jsx :call JsxBeautify() +autocmd FileType html :call HtmlBeautify() +autocmd FileType css :call CSSBeautify() """"""""""""""""""""""""""""""""""""""""""""""""""""""" From 09f1da21c1797e9f72497997dedc37654de44d54 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 18 Dec 2017 09:19:18 +0800 Subject: [PATCH 081/160] Fix bugs --- .pylintrc | 2 +- .vimrc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 2e24262..55f736f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import [REPORTS] diff --git a/.vimrc b/.vimrc index 6602884..0ec022b 100644 --- a/.vimrc +++ b/.vimrc @@ -631,6 +631,7 @@ vnoremap zf """"""""""""""""""""""""""""""""""""""" "--->>>寄存器 +" vim-repeat: 重复第三方插件的宏命令 """"""""""""""""""""""""""""""""""""""" " 宏快捷键:@a寄存器变为h寄存器 nmap h @ From 3176a2f10fb394ff535f893209ba8a2ab0b84a77 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 19 Dec 2017 14:00:42 +0800 Subject: [PATCH 082/160] Re-add ale plugin --- .gitmodules | 3 +++ bundle/ale | 1 + 2 files changed, 4 insertions(+) create mode 160000 bundle/ale diff --git a/.gitmodules b/.gitmodules index 8e55d3b..3cfbcc2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -79,3 +79,6 @@ [submodule "bundle/vim-jsbeautify"] path = bundle/vim-jsbeautify url = https://github.com/maksimr/vim-jsbeautify.git +[submodule "bundle/ale"] + path = bundle/ale + url = https://github.com/w0rp/ale.git diff --git a/bundle/ale b/bundle/ale new file mode 160000 index 0000000..91090f1 --- /dev/null +++ b/bundle/ale @@ -0,0 +1 @@ +Subproject commit 91090f1af8f8f03efbcf37b8570d832ac69c6797 From a6ef55865c0197eab0bc44ea815544a125dff608 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 19 Dec 2017 21:23:31 +0800 Subject: [PATCH 083/160] Comment some line --- .vimrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index 0ec022b..9e7d0f9 100644 --- a/.vimrc +++ b/.vimrc @@ -265,10 +265,8 @@ let g:NERDDefaultAlign='left' let g:NERDAltDelims_java=1 " Add your own custom formats or override the defaults let g:NERDCustomDelimiters={ 'c': { 'left': '/**', 'right':'*/'} } -" Allow commenting and inverting(反转) empty lines -" (userful when commenting a region),注释空行 +" 注释空行 let g:NERDCommentEmptyLines=1 -" Enable trimming of trailing whitespace when uncommenting let g:NERDTrimTrailingWhitespace=1 From 0c4ec037b3ce8682d706ce497ccfdd8042bb5ed9 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 19 Dec 2017 22:39:52 +0800 Subject: [PATCH 084/160] Update html indent --- .vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index 9e7d0f9..0319a96 100644 --- a/.vimrc +++ b/.vimrc @@ -727,9 +727,9 @@ map rsv :source ./Session.vim :rviminfo vim.viminfo " --->>> html设置 """"""""""""""""""""""""""""""""""""""" nmap hml :!open % -" html文件采用2个空格缩进方式 -autocmd FileType html setlocal ts=2 sts=2 sw=2 -autocmd FileType htmldjango setlocal ts=2 sts=2 sw=2 +" html文件采用4个空格缩进方式, 保持同.editorconfig同步 +autocmd FileType html setlocal ts=4 sts=4 sw=4 +autocmd FileType htmldjango setlocal ts=4 sts=4 sw=4 autocmd FileType css setlocal ts=2 sts=2 sw=2 autocmd Filetype ruby setlocal ts=2 sts=2 sw=2 """"""""""""""""""""""""""""""""""""""" From 7e31b323bb7f579f838a4257d88a4148fdfc1460 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 20 Dec 2017 21:52:34 +0800 Subject: [PATCH 085/160] Add proselint configure --- .proselintrc | 6 ++++++ .vimrc | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 .proselintrc diff --git a/.proselintrc b/.proselintrc new file mode 100644 index 0000000..6a0fb50 --- /dev/null +++ b/.proselintrc @@ -0,0 +1,6 @@ +// 用于配置proselint, 需要链接到主目录 +{ + "checks": { + "typography.symbols.curly_quotes": false + } +} diff --git a/.vimrc b/.vimrc index 0319a96..60f009c 100644 --- a/.vimrc +++ b/.vimrc @@ -215,6 +215,11 @@ nnoremap jd :YcmCompleter GoTo " 插件: ale " 功能: 异步代码检查插件 """"""""""""""""""""""""""""""""""""""" +" 控制错误输出格式, 通过这个 linter找到确切的忽略错误的方式 +let g:airline#extensions#ale#enabled = 1 +let g:ale_echo_msg_error_str = 'E' +let g:ale_echo_msg_warning_str = 'W' +let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' " use quickfix list instead of the loclist let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 @@ -227,6 +232,9 @@ let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' " 启用virtualenv let g:ale_python_pylint_use_global = 1 +" ale_html_tidy_options +let g:ale_html_tidy_options = '--mute' + " 错误移动 noremap ef :ALEFirst noremap en :ALENext From 3d0ec047b11ed688deb48bd0a605faf0594507ad Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 21 Dec 2017 10:18:58 +0800 Subject: [PATCH 086/160] update ale output format --- .pylintrc | 2 +- .vimrc | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 55f736f..a24ee04 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called [REPORTS] diff --git a/.vimrc b/.vimrc index 60f009c..e1377fa 100644 --- a/.vimrc +++ b/.vimrc @@ -219,7 +219,7 @@ nnoremap jd :YcmCompleter GoTo let g:airline#extensions#ale#enabled = 1 let g:ale_echo_msg_error_str = 'E' let g:ale_echo_msg_warning_str = 'W' -let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' +let g:ale_echo_msg_format = '%code: [%linter%] %%s [%severity%]' " use quickfix list instead of the loclist let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 @@ -232,8 +232,6 @@ let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' " 启用virtualenv let g:ale_python_pylint_use_global = 1 -" ale_html_tidy_options -let g:ale_html_tidy_options = '--mute' " 错误移动 noremap ef :ALEFirst From fe37ec8a9d6bb2c5359fc973d0349836b988634d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 24 Dec 2017 16:47:39 +0800 Subject: [PATCH 087/160] Updae gitmodules --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 3cfbcc2..7f40954 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,6 +48,7 @@ [submodule "bundle/YouCompleteMe"] path = bundle/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git + ignore = dirty [submodule "bundle/vim-instant-markdown"] path = bundle/vim-instant-markdown url = https://github.com/suan/vim-instant-markdown.git From 2641821fa400cf26111f98c06e505ede306ead33 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 3 Jan 2018 17:21:48 +0800 Subject: [PATCH 088/160] Add a new .pylintrc configure that's enable by local vim configure named bamboo.vim --- .flake8 | 2 +- .pylintrc | 2 +- .pylintrc-django | 408 +++++++++++++++++++++++++++++++++++++++++++++++ .vimrc | 8 +- 4 files changed, 414 insertions(+), 6 deletions(-) create mode 100644 .pylintrc-django diff --git a/.flake8 b/.flake8 index 91fa636..b7a7998 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 120 -ignore = E402,W291,F401 +ignore = E402,W291,F401,E722 diff --git a/.pylintrc b/.pylintrc index a24ee04..41cd6dd 100644 --- a/.pylintrc +++ b/.pylintrc @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return [REPORTS] diff --git a/.pylintrc-django b/.pylintrc-django new file mode 100644 index 0000000..e055ff2 --- /dev/null +++ b/.pylintrc-django @@ -0,0 +1,408 @@ +[MASTER] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins=pylint_django + +# Use multiple processes to speed up Pylint. +jobs=1 + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Allow optimization of some AST trees. This will activate a peephole AST +# optimizer, which will apply various small optimizations. For instance, it can +# be used to obtain the result of joining multiple strings with the addition +# operator. Joining a lot of strings can lead to a maximum recursion error in +# Pylint and this flag can prevent that. It has one side effect, the resulting +# AST will be different than the one from reality. This option is deprecated +# and it will be removed in Pylint 2.0. +optimize-ast=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +#enable= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +# disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". This option is deprecated +# and it will be removed in Pylint 2.0. +files-output=no + +# Tells whether to display a full report or only the messages +reports=yes + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +msg-template="{path}:{line}:{column}:{C}: {msg_id}[{symbol}] {msg}" + + +[BASIC] + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Regular expression matching correct function names +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for function names +function-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct variable names +variable-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for variable names +variable-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct attribute names +attr-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for attribute names +attr-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct argument names +argument-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for argument names +argument-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming hint for class names +class-name-hint=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct method names +method-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for method names +method-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + + +[ELIF] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=120 + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Maximum number of lines in a module +max-module-lines=1000 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +# 因为测试用例中的SimpleResponse,从而过滤WSGIRequest类 +ignored-classes=optparse.Values,thread._local,_thread._local,WSGIRequest + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Argment names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.* + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of statements in function / method body +max-statements=50 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,TERMIOS,Bastion,rexec + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/.vimrc b/.vimrc index e1377fa..1bc190f 100644 --- a/.vimrc +++ b/.vimrc @@ -297,11 +297,11 @@ imap :!ctags """"""""""""""""""""""""""""""""""""""""""""" " ---> 标签配置2——cscope """"""""""""""""""""""""""""""""""""""""""""" -map :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" -o - \ -name "*.java" -o -name "*.py" +map :!find -L `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" -o + \ -name "*.java" -o -name "*.py" -o -name "*.php" \ >cscope.files:!cscope -Rbq:cs reset -imap :!find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" - \ -o -name "*.java" -o -name "*.py" +imap :!find -L `pwd` -name "*.h" -o -name "*.c" -o -name "*.cpp" + \ -o -name "*.java" -o -name "*.py" -o -name "*.php" \ >cscope.files:!cscope -Rbq:cs reset if has("cscope") set csprg=/usr/local/bin/cscope From 332d98a2c935e83c236d00433b391f2574d01d8f Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 4 Jan 2018 11:28:15 +0800 Subject: [PATCH 089/160] Update vimrc --- .pylintrc-django | 2 +- .vimrc | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.pylintrc-django b/.pylintrc-django index e055ff2..b5f4623 100644 --- a/.pylintrc-django +++ b/.pylintrc-django @@ -66,7 +66,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements [REPORTS] diff --git a/.vimrc b/.vimrc index 1bc190f..b1ebbb0 100644 --- a/.vimrc +++ b/.vimrc @@ -175,25 +175,20 @@ nnoremap jd :YcmCompleter GoTo " 每一个目录都有一份独有的bamboo.vim配置当前项目的语言配置 " """"""""""""""""""""""""""""""""""""""" -" 必要配置2--错误标注(和SyntasticStatuslineFlag()配合) +" 错误标注(和SyntasticStatuslineFlag()配合) " let g:syntastic_error_symbol = 'EE' " let g:syntastic_style_error_symbol = 'E>' " let g:syntastic_warning_symbol = 'WW' " let g:syntastic_style_warning_symbol = 'W>' -" 必要配置3 -" 不需要手动调用 SyntasticSetTocList. 默认1 -" let g:syntastic_always_populate_loc_list = 1 + " 0不自动. 1自动拉起关闭. 2 自动关闭. 3 自动拉起 默认2, 建议为1 " 设置为1,会影响其他插件,抛出E924(help E924)错误,使用lopen来开启错误信息 +" let g:syntastic_always_populate_loc_list = 1 " let g:syntastic_auto_loc_list = 0 -" 请提前安装pylint和flake8 -" 注意,flake8包含(pep8/pycodestyle-pep257/pyflakes三个checkers) -" pyflake8,见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 ~/.config/flake8 +" pylint, flake8, shellcheckers " let g:syntastic_python_checkers=['flake8', 'pylint'] -" 使用pylint可以对代码进行评分检查 " let g:syntastic_python_pylint_args='--rcfile=~/.vim/.pylintrc' -" shellcheckers and sh " let g:syntastic_sh_checkers=['shellcheckers'] " HTML @@ -211,6 +206,7 @@ nnoremap jd :YcmCompleter GoTo " nnoremap E :SyntasticCheck :SyntasticToggleMode + """"""""""""""""""""""""""""""""""""""" " 插件: ale " 功能: 异步代码检查插件 @@ -245,6 +241,12 @@ noremap ep :ALEPrevious " 插件:Vimjas/vim-python-pep8-indent " 功能:基于pep8的自动缩进设置,非常棒 """"""""""""""""""""""""""""""""""""""" +" flake8, 见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 ~/.config/flake8 +" 自定义配置, 见github +" let g:flake8_ignore = 'E701, E301' + +" pylint, 创建~/.vim/.pylintrc, 并通过pylint_options指定, 文件名可以任意取值 + """"""""""""""""""""""""""""""""""""""" From fb6a2110458639079f09c6af1784802f76949ccf Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 4 Jan 2018 14:22:29 +0800 Subject: [PATCH 090/160] Update vimrc --- .vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index b1ebbb0..939633a 100644 --- a/.vimrc +++ b/.vimrc @@ -241,8 +241,8 @@ noremap ep :ALEPrevious " 插件:Vimjas/vim-python-pep8-indent " 功能:基于pep8的自动缩进设置,非常棒 """"""""""""""""""""""""""""""""""""""" -" flake8, 见.vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 ~/.config/flake8 -" 自定义配置, 见github +" flake8, .vim/.flake8,并创建软连接:ln -sf ~/.vim/.flake8 ~/.config/flake8 +" 自定义配置, 见github以及印象笔记 " let g:flake8_ignore = 'E701, E301' " pylint, 创建~/.vim/.pylintrc, 并通过pylint_options指定, 文件名可以任意取值 From 940248f0467c7715a56f2af7f0d3c8fa1e5f2535 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 4 Jan 2018 18:16:11 +0800 Subject: [PATCH 091/160] Update .pylintrc --- .pylintrc-django | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc-django b/.pylintrc-django index b5f4623..a1b61b1 100644 --- a/.pylintrc-django +++ b/.pylintrc-django @@ -65,8 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -# disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements,bad-whitespace,bad-continuation,too-many-lines,wrong-import-order,ungrouped-imports,redefined-builtin,multiple-imports,bare-except [REPORTS] From 293f17671fd8aded7b4cadd1202e9642b551411c Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 8 Jan 2018 21:16:55 +0800 Subject: [PATCH 092/160] Update ale error message format --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 939633a..42f961d 100644 --- a/.vimrc +++ b/.vimrc @@ -215,7 +215,7 @@ nnoremap jd :YcmCompleter GoTo let g:airline#extensions#ale#enabled = 1 let g:ale_echo_msg_error_str = 'E' let g:ale_echo_msg_warning_str = 'W' -let g:ale_echo_msg_format = '%code: [%linter%] %%s [%severity%]' +let g:ale_echo_msg_format = '%...code...%: [%linter%] %%s [%severity%]' " use quickfix list instead of the loclist let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 From d1c7d513b774b85c9ffc5fe9fd261a25f3982b5d Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 9 Jan 2018 09:27:31 +0800 Subject: [PATCH 093/160] Update .vimrc --- .pylintrc-django | 51 +----------------------------------------------- .vimrc | 4 ++++ 2 files changed, 5 insertions(+), 50 deletions(-) diff --git a/.pylintrc-django b/.pylintrc-django index a1b61b1..5e7df66 100644 --- a/.pylintrc-django +++ b/.pylintrc-django @@ -1,83 +1,34 @@ [MASTER] -# Specify a configuration file. -#rcfile= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Add files or directories to the blacklist. They should be base names, not -# paths. ignore=CVS -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. ignore-patterns= -# Pickle collected data for later comparisons. persistent=yes -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. load-plugins=pylint_django -# Use multiple processes to speed up Pylint. jobs=1 -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code extension-pkg-whitelist= -# Allow optimization of some AST trees. This will activate a peephole AST -# optimizer, which will apply various small optimizations. For instance, it can -# be used to obtain the result of joining multiple strings with the addition -# operator. Joining a lot of strings can lead to a maximum recursion error in -# Pylint and this flag can prevent that. It has one side effect, the resulting -# AST will be different than the one from reality. This option is deprecated -# and it will be removed in Pylint 2.0. optimize-ast=no [MESSAGES CONTROL] -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED confidence= -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. #enable= -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements,bad-whitespace,bad-continuation,too-many-lines,wrong-import-order,ungrouped-imports,redefined-builtin,multiple-imports,bare-except +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements,bad-whitespace,bad-continuation,too-many-lines,wrong-import-order,ungrouped-imports,redefined-builtin,multiple-imports,bare-except,unidiomatic-typecheck,wrong-import-position,trailing-whitespace [REPORTS] -# Set the output format. Available formats are text, parseable, colorized, msvs -# (visual studio) and html. You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. output-format=text -# Put messages in a separate file for each module / package specified on the -# command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". This option is deprecated -# and it will be removed in Pylint 2.0. files-output=no # Tells whether to display a full report or only the messages diff --git a/.vimrc b/.vimrc index 42f961d..94dd2ef 100644 --- a/.vimrc +++ b/.vimrc @@ -577,6 +577,10 @@ let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc' " saveas : will move a file from its location to CWD. " 2 使用Explore, 之后使用 R-- 重命名, D--删除文件 noremap sa :Explore +" 3 复制当前文件名到剪贴板(cs-copy filename, cp-copy file path) +" 关于expand, 见印象笔记 +noremap cf :let @+=expand("%") +noremap cp :let @+=expand("%:p") From a33ad98cbfaaf113818484d8102f1ea3b17df651 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 10 Jan 2018 18:03:42 +0800 Subject: [PATCH 094/160] Update .pylintrc --- .pylintrc-django | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc-django b/.pylintrc-django index 5e7df66..2ffda05 100644 --- a/.pylintrc-django +++ b/.pylintrc-django @@ -23,7 +23,7 @@ confidence= #enable= -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements,bad-whitespace,bad-continuation,too-many-lines,wrong-import-order,ungrouped-imports,redefined-builtin,multiple-imports,bare-except,unidiomatic-typecheck,wrong-import-position,trailing-whitespace +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-member,global-statement,redefined-outer-name,method-hidden,unused-variable,no-else-return,misplaced-bare-raise,multiple-statements,bad-whitespace,bad-continuation,too-many-lines,wrong-import-order,ungrouped-imports,redefined-builtin,multiple-imports,bare-except,unidiomatic-typecheck,wrong-import-position,trailing-whitespace,assign-to-new-keyword,no-value-for-parameter,redefined-argument-from-local,unnecessary-pass,access-member-before-definition,pointless-string-statement,len-as-condition,not-callable [REPORTS] From 458b2ab2f08559746d38c08c5411e56a09a5fa34 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 11 Jan 2018 08:04:12 +0800 Subject: [PATCH 095/160] add tidy.conf --- .editorconfig | 1 + .tidy.conf | 5 +++++ .vimrc | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .tidy.conf diff --git a/.editorconfig b/.editorconfig index 64292fb..8533d1e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,6 @@ ;.editorconfig ;javascript, css, html format +; root = true diff --git a/.tidy.conf b/.tidy.conf new file mode 100644 index 0000000..30a3e97 --- /dev/null +++ b/.tidy.conf @@ -0,0 +1,5 @@ +// 自定义的tidy配置, 另见https://gist.github.com/paultreny/9822049 + + +// 忽略空元素报警 +drop-empty-elements: no diff --git a/.vimrc b/.vimrc index 94dd2ef..8a33556 100644 --- a/.vimrc +++ b/.vimrc @@ -53,6 +53,7 @@ vnoremap json :'<,'>!python -m json.tool """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> jsbeautify: 对css,javascript, html进行格式化 """"""""""""""""""""""""""""""""""""""""""""""""""""""" +let g:editorconfig_Beautifier = '~/.vim/.editorconfig' " map :call JsBeautify() " 映射(可以配置vnormap) autocmd FileType javascript noremap :call JsBeautify() @@ -227,6 +228,8 @@ let g:ale_keep_list_window_open = 0 let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' " 启用virtualenv let g:ale_python_pylint_use_global = 1 +" tidy +let g:ale_html_tidy_options = '-q -e -language en -config ~/.vim/.tidy.conf' " 错误移动 @@ -736,14 +739,15 @@ map rsv :source ./Session.vim :rviminfo vim.viminfo """"""""""""""""""""""""""""""""""""""" -" --->>> html设置 +" --->>> html设置, 确保放在基本配置的后面, 避免被覆盖 """"""""""""""""""""""""""""""""""""""" nmap hml :!open % " html文件采用4个空格缩进方式, 保持同.editorconfig同步 autocmd FileType html setlocal ts=4 sts=4 sw=4 autocmd FileType htmldjango setlocal ts=4 sts=4 sw=4 autocmd FileType css setlocal ts=2 sts=2 sw=2 -autocmd Filetype ruby setlocal ts=2 sts=2 sw=2 +autocmd FileType ruby setlocal ts=2 sts=2 sw=2 +autocmd FileType javascript setlocal ts=2 sts=2 sw=2 """"""""""""""""""""""""""""""""""""""" " --->>> Emmet-vim """"""""""""""""""""""""""""""""""""""" From c3018906a6a716271d4d9be5326d3b23a76e6fae Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 19 Jan 2018 07:52:10 +0800 Subject: [PATCH 096/160] Add new plugin: Calorizer --- .VimballRecord | 1 + .gitmodules | 4 + .vimrc | 10 + autoload/Colorizer.vim | 2595 ++++++++++++++++++++++++++++++++++++ bundle/Colorizer | 1 + doc/Colorizer.txt | 520 ++++++++ plugin/ColorizerPlugin.vim | 95 ++ 7 files changed, 3226 insertions(+) create mode 100644 .VimballRecord create mode 100644 autoload/Colorizer.vim create mode 160000 bundle/Colorizer create mode 100644 doc/Colorizer.txt create mode 100644 plugin/ColorizerPlugin.vim diff --git a/.VimballRecord b/.VimballRecord new file mode 100644 index 0000000..4f75956 --- /dev/null +++ b/.VimballRecord @@ -0,0 +1 @@ +Colorizer-.vmb: call delete('/Users/bamboo/.vim/plugin/ColorizerPlugin.vim')|call delete('/Users/bamboo/.vim/doc/Colorizer.txt')|call delete('/Users/bamboo/.vim/autoload/Colorizer.vim') diff --git a/.gitmodules b/.gitmodules index 7f40954..0204ad8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -83,3 +83,7 @@ [submodule "bundle/ale"] path = bundle/ale url = https://github.com/w0rp/ale.git +[submodule "bundle/Colorizer"] + path = bundle/Colorizer + url = https://github.com/chrisbra/Colorizer.git + ignore = dirty diff --git a/.vimrc b/.vimrc index 8a33556..9753745 100644 --- a/.vimrc +++ b/.vimrc @@ -437,6 +437,16 @@ set laststatus=2 " 主题风格 let g:Powerline_colorscheme='solarized256' +""""""""""""""""""""""""""""""""""""""" +"--->>配色配置5 +" Colorizer 高亮html/css中的颜色代码 +""""""""""""""""""""""""""""""""""""""" +" 自动开启, 编辑vimrc太过卡顿, 采用映射, 人工开启 +" let g:colorizer_auto_color = 1 +noremap color :let g:colorizer_auto_color = 1 +let g:colorizer_auto_filetype='css,html' +let g:colorizer_skip_comments = 1 +let g:colorizer_auto_map = 1 diff --git a/autoload/Colorizer.vim b/autoload/Colorizer.vim new file mode 100644 index 0000000..a60d515 --- /dev/null +++ b/autoload/Colorizer.vim @@ -0,0 +1,2595 @@ +" Plugin: Highlight Colornames and Values +" Maintainer: Christian Brabandt +" URL: http://www.github.com/chrisbra/color_highlight +" Last Change: Thu, 15 Jan 2015 21:49:17 +0100 +" Licence: Vim License (see :h License) +" Version: 0.11 +" GetLatestVimScripts: 3963 11 :AutoInstall: Colorizer.vim +" +" This plugin was inspired by the css_color.vim plugin from Nikolaus Hofer. +" Changes made: - make terminal colors work more reliably and with all +" color terminals +" - performance improvements, coloring is almost instantenously +" - detect rgb colors like this: rgb(R,G,B) +" - detect hvl coloring: hvl(H,V,L) +" - fix small bugs +" - Color ANSI Term values and hide terminal escape sequences + +" Init some variables "{{{1 +let s:cpo_save = &cpo +set cpo&vim + +" the 6 value iterations in the xterm color cube "{{{2 +let s:valuerange6 = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ] + +"" the 4 value iterations in the 88 color xterm cube "{{{2 +let s:valuerange4 = [ 0x00, 0x8B, 0xCD, 0xFF ] +" +"" 16 basic colors "{{{2 +let s:basic16 = [ + \ [ 0x00, 0x00, 0x00 ], + \ [ 0xCD, 0x00, 0x00 ], + \ [ 0x00, 0xCD, 0x00 ], + \ [ 0xCD, 0xCD, 0x00 ], + \ [ 0x00, 0x00, 0xEE ], + \ [ 0xCD, 0x00, 0xCD ], + \ [ 0x00, 0xCD, 0xCD ], + \ [ 0xE5, 0xE5, 0xE5 ], + \ [ 0x7F, 0x7F, 0x7F ], + \ [ 0xFF, 0x00, 0x00 ], + \ [ 0x00, 0xFF, 0x00 ], + \ [ 0xFF, 0xFF, 0x00 ], + \ [ 0x5C, 0x5C, 0xFF ], + \ [ 0xFF, 0x00, 0xFF ], + \ [ 0x00, 0xFF, 0xFF ], + \ [ 0xFF, 0xFF, 0xFF ] + \ ] + +" Cygwin / Window console / ConEmu has different color codes +if ($ComSpec =~# '^\%(command\.com\|cmd\.exe\)$' && + \ !s:HasGui()) || + \ (exists("$ConEmuPID") && + \ $ConEmuANSI ==# "OFF") || + \ ($TERM ==# 'cygwin' && &t_Co == 16) " Cygwin terminal + + " command.com/ConEmu Color Cube (currently only supports 16 colors) + let s:basic16 = [ + \ [ 0x00, 0x00, 0x00 ], + \ [ 0x00, 0x00, 0x80 ], + \ [ 0x00, 0x80, 0x00 ], + \ [ 0x00, 0x80, 0x80 ], + \ [ 0x80, 0x00, 0x00 ], + \ [ 0x80, 0x00, 0x80 ], + \ [ 0xFF, 0xFF, 0x00 ], + \ [ 0xFF, 0xFF, 0xFF ], + \ [ 0xC0, 0xC0, 0xC0 ], + \ [ 0x00, 0x00, 0xFF ], + \ [ 0x00, 0xFF, 0x00 ], + \ [ 0x00, 0xFF, 0xFF ], + \ [ 0xFF, 0x00, 0x00 ], + \ [ 0xFF, 0x00, 0xFF ], + \ [ 0xFF, 0xFF, 0x00 ], + \ [ 0xFF, 0xFF, 0xFF ] + \ ] + let &t_Co=16 +endif + +" xterm-8 colors "{{{2 +let s:xterm_8colors = { +\ 'black': '#000000', +\ 'darkblue': '#00008B', +\ 'darkgreen': '#00CD00', +\ 'darkcyan': '#00CDCD', +\ 'darkred': '#CD0000', +\ 'darkmagenta': '#8B008B', +\ 'brown': '#CDCD00', +\ 'darkyellow': '#CDCD00', +\ 'lightgrey': '#E5E5E5', +\ 'lightgray': '#E5E5E5', +\ 'gray': '#E5E5E5', +\ 'grey': '#E5E5E5' +\ } + +" xterm-16 colors "{{{2 +let s:xterm_16colors = { +\ 'darkgrey': '#7F7F7F', +\ 'darkgray': '#7F7F7F', +\ 'blue': '#5C5CFF', +\ 'lightblue': '#5C5CFF', +\ 'green': '#00FF00', +\ 'lightgreen': '#00FF00', +\ 'cyan': '#00FFFF', +\ 'lightcyan': '#00FFFF', +\ 'red': '#FF0000', +\ 'lightred': '#FF0000', +\ 'magenta': '#FF00FF', +\ 'lightmagenta': '#FF00FF', +\ 'yellow': '#FFFF00', +\ 'lightyellow': '#FFFF00', +\ 'white': '#FFFFFF', +\ } +" add the items from the 8 color xterm variable to the 16 color xterm +call extend(s:xterm_16colors, s:xterm_8colors) + +" W3C Colors "{{{2 +let s:w3c_color_names = { +\ 'aliceblue': '#F0F8FF', +\ 'antiquewhite': '#FAEBD7', +\ 'aqua': '#00FFFF', +\ 'aquamarine': '#7FFFD4', +\ 'azure': '#F0FFFF', +\ 'beige': '#F5F5DC', +\ 'bisque': '#FFE4C4', +\ 'black': '#000000', +\ 'blanchedalmond': '#FFEBCD', +\ 'blue': '#0000FF', +\ 'blueviolet': '#8A2BE2', +\ 'brown': '#A52A2A', +\ 'burlywood': '#DEB887', +\ 'cadetblue': '#5F9EA0', +\ 'chartreuse': '#7FFF00', +\ 'chocolate': '#D2691E', +\ 'coral': '#FF7F50', +\ 'cornflowerblue': '#6495ED', +\ 'cornsilk': '#FFF8DC', +\ 'crimson': '#DC143C', +\ 'cyan': '#00FFFF', +\ 'darkblue': '#00008B', +\ 'darkcyan': '#008B8B', +\ 'darkgoldenrod': '#B8860B', +\ 'darkgray': '#A9A9A9', +\ 'darkgreen': '#006400', +\ 'darkkhaki': '#BDB76B', +\ 'darkmagenta': '#8B008B', +\ 'darkolivegreen': '#556B2F', +\ 'darkorange': '#FF8C00', +\ 'darkorchid': '#9932CC', +\ 'darkred': '#8B0000', +\ 'darksalmon': '#E9967A', +\ 'darkseagreen': '#8FBC8F', +\ 'darkslateblue': '#483D8B', +\ 'darkslategray': '#2F4F4F', +\ 'darkturquoise': '#00CED1', +\ 'darkviolet': '#9400D3', +\ 'deeppink': '#FF1493', +\ 'deepskyblue': '#00BFFF', +\ 'dimgray': '#696969', +\ 'dodgerblue': '#1E90FF', +\ 'firebrick': '#B22222', +\ 'floralwhite': '#FFFAF0', +\ 'forestgreen': '#228B22', +\ 'fuchsia': '#FF00FF', +\ 'gainsboro': '#DCDCDC', +\ 'ghostwhite': '#F8F8FF', +\ 'gold': '#FFD700', +\ 'goldenrod': '#DAA520', +\ 'gray': '#808080', +\ 'green': '#008000', +\ 'greenyellow': '#ADFF2F', +\ 'honeydew': '#F0FFF0', +\ 'hotpink': '#FF69B4', +\ 'indianred': '#CD5C5C', +\ 'indigo': '#4B0082', +\ 'ivory': '#FFFFF0', +\ 'khaki': '#F0E68C', +\ 'lavender': '#E6E6FA', +\ 'lavenderblush': '#FFF0F5', +\ 'lawngreen': '#7CFC00', +\ 'lemonchiffon': '#FFFACD', +\ 'lightblue': '#ADD8E6', +\ 'lightcoral': '#F08080', +\ 'lightcyan': '#E0FFFF', +\ 'lightgoldenrodyellow': '#FAFAD2', +\ 'lightgray': '#D3D3D3', +\ 'lightgreen': '#90EE90', +\ 'lightpink': '#FFB6C1', +\ 'lightsalmon': '#FFA07A', +\ 'lightseagreen': '#20B2AA', +\ 'lightskyblue': '#87CEFA', +\ 'lightslategray': '#778899', +\ 'lightsteelblue': '#B0C4DE', +\ 'lightyellow': '#FFFFE0', +\ 'lime': '#00FF00', +\ 'limegreen': '#32CD32', +\ 'linen': '#FAF0E6', +\ 'magenta': '#FF00FF', +\ 'maroon': '#800000', +\ 'mediumaquamarine': '#66CDAA', +\ 'mediumblue': '#0000CD', +\ 'mediumorchid': '#BA55D3', +\ 'mediumpurple': '#9370D8', +\ 'mediumseagreen': '#3CB371', +\ 'mediumslateblue': '#7B68EE', +\ 'mediumspringgreen': '#00FA9A', +\ 'mediumturquoise': '#48D1CC', +\ 'mediumvioletred': '#C71585', +\ 'midnightblue': '#191970', +\ 'mintcream': '#F5FFFA', +\ 'mistyrose': '#FFE4E1', +\ 'moccasin': '#FFE4B5', +\ 'navajowhite': '#FFDEAD', +\ 'navy': '#000080', +\ 'oldlace': '#FDF5E6', +\ 'olive': '#808000', +\ 'olivedrab': '#6B8E23', +\ 'orange': '#FFA500', +\ 'orangered': '#FF4500', +\ 'orchid': '#DA70D6', +\ 'palegoldenrod': '#EEE8AA', +\ 'palegreen': '#98FB98', +\ 'paleturquoise': '#AFEEEE', +\ 'palevioletred': '#D87093', +\ 'papayawhip': '#FFEFD5', +\ 'peachpuff': '#FFDAB9', +\ 'peru': '#CD853F', +\ 'pink': '#FFC0CB', +\ 'plum': '#DDA0DD', +\ 'powderblue': '#B0E0E6', +\ 'purple': '#800080', +\ 'red': '#FF0000', +\ 'rosybrown': '#BC8F8F', +\ 'royalblue': '#4169E1', +\ 'saddlebrown': '#8B4513', +\ 'salmon': '#FA8072', +\ 'sandybrown': '#F4A460', +\ 'seagreen': '#2E8B57', +\ 'seashell': '#FFF5EE', +\ 'sienna': '#A0522D', +\ 'silver': '#C0C0C0', +\ 'skyblue': '#87CEEB', +\ 'slateblue': '#6A5ACD', +\ 'slategray': '#708090', +\ 'snow': '#FFFAFA', +\ 'springgreen': '#00FF7F', +\ 'steelblue': '#4682B4', +\ 'tan': '#D2B48C', +\ 'teal': '#008080', +\ 'thistle': '#D8BFD8', +\ 'tomato': '#FF6347', +\ 'turquoise': '#40E0D0', +\ 'violet': '#EE82EE', +\ 'wheat': '#F5DEB3', +\ 'white': '#FFFFFF', +\ 'whitesmoke': '#F5F5F5', +\ 'yellow': '#FFFF00', +\ 'yellowgreen': '#9ACD32' +\ } + +" X11 color names taken from "{{{2 +" http://cvsweb.xfree86.org/cvsweb/*checkout*/xc/programs/rgb/rgb.txt?rev=1.2 +let s:x11_color_names = { +\ 'snow': '#FFFAFA', +\ 'ghostwhite': '#F8F8FF', +\ 'whitesmoke': '#F5F5F5', +\ 'gainsboro': '#DCDCDC', +\ 'floralwhite': '#FFFAF0', +\ 'oldlace': '#FDF5E6', +\ 'linen': '#FAF0E6', +\ 'antiquewhite': '#FAEBD7', +\ 'papayawhip': '#FFEFD5', +\ 'blanchedalmond': '#FFEBCD', +\ 'bisque': '#FFE4C4', +\ 'peachpuff': '#FFDAB9', +\ 'navajowhite': '#FFDEAD', +\ 'moccasin': '#FFE4B5', +\ 'cornsilk': '#FFF8DC', +\ 'ivory': '#FFFFF0', +\ 'lemonchiffon': '#FFFACD', +\ 'seashell': '#FFF5EE', +\ 'honeydew': '#F0FFF0', +\ 'mintcream': '#F5FFFA', +\ 'azure': '#F0FFFF', +\ 'aliceblue': '#F0F8FF', +\ 'lavender': '#E6E6FA', +\ 'lavenderblush': '#FFF0F5', +\ 'mistyrose': '#FFE4E1', +\ 'white': '#FFFFFF', +\ 'black': '#000000', +\ 'darkslategray': '#2F4F4F', +\ 'darkslategrey': '#2F4F4F', +\ 'dimgray': '#696969', +\ 'dimgrey': '#696969', +\ 'slategray': '#708090', +\ 'slategrey': '#708090', +\ 'lightslategray': '#778899', +\ 'lightslategrey': '#778899', +\ 'gray': '#BEBEBE', +\ 'grey': '#BEBEBE', +\ 'lightgrey': '#D3D3D3', +\ 'lightgray': '#D3D3D3', +\ 'midnightblue': '#191970', +\ 'navy': '#000080', +\ 'navyblue': '#000080', +\ 'cornflowerblue': '#6495ED', +\ 'darkslateblue': '#483D8B', +\ 'slateblue': '#6A5ACD', +\ 'mediumslateblue': '#7B68EE', +\ 'lightslateblue': '#8470FF', +\ 'mediumblue': '#0000CD', +\ 'royalblue': '#4169E1', +\ 'blue': '#0000FF', +\ 'dodgerblue': '#1E90FF', +\ 'deepskyblue': '#00BFFF', +\ 'skyblue': '#87CEEB', +\ 'lightskyblue': '#87CEFA', +\ 'steelblue': '#4682B4', +\ 'lightsteelblue': '#B0C4DE', +\ 'lightblue': '#ADD8E6', +\ 'powderblue': '#B0E0E6', +\ 'paleturquoise': '#AFEEEE', +\ 'darkturquoise': '#00CED1', +\ 'mediumturquoise': '#48D1CC', +\ 'turquoise': '#40E0D0', +\ 'cyan': '#00FFFF', +\ 'lightcyan': '#E0FFFF', +\ 'cadetblue': '#5F9EA0', +\ 'mediumaquamarine': '#66CDAA', +\ 'aquamarine': '#7FFFD4', +\ 'darkgreen': '#006400', +\ 'darkolivegreen': '#556B2F', +\ 'darkseagreen': '#8FBC8F', +\ 'seagreen': '#2E8B57', +\ 'mediumseagreen': '#3CB371', +\ 'lightseagreen': '#20B2AA', +\ 'palegreen': '#98FB98', +\ 'springgreen': '#00FF7F', +\ 'lawngreen': '#7CFC00', +\ 'green': '#00FF00', +\ 'chartreuse': '#7FFF00', +\ 'mediumspringgreen': '#00FA9A', +\ 'greenyellow': '#ADFF2F', +\ 'limegreen': '#32CD32', +\ 'yellowgreen': '#9ACD32', +\ 'forestgreen': '#228B22', +\ 'olivedrab': '#6B8E23', +\ 'darkkhaki': '#BDB76B', +\ 'khaki': '#F0E68C', +\ 'palegoldenrod': '#EEE8AA', +\ 'lightgoldenrodyellow': '#FAFAD2', +\ 'lightyellow': '#FFFFE0', +\ 'yellow': '#FFFF00', +\ 'gold': '#FFD700', +\ 'lightgoldenrod': '#EEDD82', +\ 'goldenrod': '#DAA520', +\ 'darkgoldenrod': '#B8860B', +\ 'rosybrown': '#BC8F8F', +\ 'indianred': '#CD5C5C', +\ 'saddlebrown': '#8B4513', +\ 'sienna': '#A0522D', +\ 'peru': '#CD853F', +\ 'burlywood': '#DEB887', +\ 'beige': '#F5F5DC', +\ 'wheat': '#F5DEB3', +\ 'sandybrown': '#F4A460', +\ 'tan': '#D2B48C', +\ 'chocolate': '#D2691E', +\ 'firebrick': '#B22222', +\ 'brown': '#A52A2A', +\ 'darksalmon': '#E9967A', +\ 'salmon': '#FA8072', +\ 'lightsalmon': '#FFA07A', +\ 'orange': '#FFA500', +\ 'darkorange': '#FF8C00', +\ 'coral': '#FF7F50', +\ 'lightcoral': '#F08080', +\ 'tomato': '#FF6347', +\ 'orangered': '#FF4500', +\ 'red': '#FF0000', +\ 'hotpink': '#FF69B4', +\ 'deeppink': '#FF1493', +\ 'pink': '#FFC0CB', +\ 'lightpink': '#FFB6C1', +\ 'palevioletred': '#DB7093', +\ 'maroon': '#B03060', +\ 'mediumvioletred': '#C71585', +\ 'violetred': '#D02090', +\ 'magenta': '#FF00FF', +\ 'violet': '#EE82EE', +\ 'plum': '#DDA0DD', +\ 'orchid': '#DA70D6', +\ 'mediumorchid': '#BA55D3', +\ 'darkorchid': '#9932CC', +\ 'darkviolet': '#9400D3', +\ 'blueviolet': '#8A2BE2', +\ 'purple': '#A020F0', +\ 'mediumpurple': '#9370DB', +\ 'thistle': '#D8BFD8', +\ 'snow1': '#FFFAFA', +\ 'snow2': '#EEE9E9', +\ 'snow3': '#CDC9C9', +\ 'snow4': '#8B8989', +\ 'seashell1': '#FFF5EE', +\ 'seashell2': '#EEE5DE', +\ 'seashell3': '#CDC5BF', +\ 'seashell4': '#8B8682', +\ 'antiquewhite1': '#FFEFDB', +\ 'antiquewhite2': '#EEDFCC', +\ 'antiquewhite3': '#CDC0B0', +\ 'antiquewhite4': '#8B8378', +\ 'bisque1': '#FFE4C4', +\ 'bisque2': '#EED5B7', +\ 'bisque3': '#CDB79E', +\ 'bisque4': '#8B7D6B', +\ 'peachpuff1': '#FFDAB9', +\ 'peachpuff2': '#EECBAD', +\ 'peachpuff3': '#CDAF95', +\ 'peachpuff4': '#8B7765', +\ 'navajowhite1': '#FFDEAD', +\ 'navajowhite2': '#EECFA1', +\ 'navajowhite3': '#CDB38B', +\ 'navajowhite4': '#8B795E', +\ 'lemonchiffon1': '#FFFACD', +\ 'lemonchiffon2': '#EEE9BF', +\ 'lemonchiffon3': '#CDC9A5', +\ 'lemonchiffon4': '#8B8970', +\ 'cornsilk1': '#FFF8DC', +\ 'cornsilk2': '#EEE8CD', +\ 'cornsilk3': '#CDC8B1', +\ 'cornsilk4': '#8B8878', +\ 'ivory1': '#FFFFF0', +\ 'ivory2': '#EEEEE0', +\ 'ivory3': '#CDCDC1', +\ 'ivory4': '#8B8B83', +\ 'honeydew1': '#F0FFF0', +\ 'honeydew2': '#E0EEE0', +\ 'honeydew3': '#C1CDC1', +\ 'honeydew4': '#838B83', +\ 'lavenderblush1': '#FFF0F5', +\ 'lavenderblush2': '#EEE0E5', +\ 'lavenderblush3': '#CDC1C5', +\ 'lavenderblush4': '#8B8386', +\ 'mistyrose1': '#FFE4E1', +\ 'mistyrose2': '#EED5D2', +\ 'mistyrose3': '#CDB7B5', +\ 'mistyrose4': '#8B7D7B', +\ 'azure1': '#F0FFFF', +\ 'azure2': '#E0EEEE', +\ 'azure3': '#C1CDCD', +\ 'azure4': '#838B8B', +\ 'slateblue1': '#836FFF', +\ 'slateblue2': '#7A67EE', +\ 'slateblue3': '#6959CD', +\ 'slateblue4': '#473C8B', +\ 'royalblue1': '#4876FF', +\ 'royalblue2': '#436EEE', +\ 'royalblue3': '#3A5FCD', +\ 'royalblue4': '#27408B', +\ 'blue1': '#0000FF', +\ 'blue2': '#0000EE', +\ 'blue3': '#0000CD', +\ 'blue4': '#00008B', +\ 'dodgerblue1': '#1E90FF', +\ 'dodgerblue2': '#1C86EE', +\ 'dodgerblue3': '#1874CD', +\ 'dodgerblue4': '#104E8B', +\ 'steelblue1': '#63B8FF', +\ 'steelblue2': '#5CACEE', +\ 'steelblue3': '#4F94CD', +\ 'steelblue4': '#36648B', +\ 'deepskyblue1': '#00BFFF', +\ 'deepskyblue2': '#00B2EE', +\ 'deepskyblue3': '#009ACD', +\ 'deepskyblue4': '#00688B', +\ 'skyblue1': '#87CEFF', +\ 'skyblue2': '#7EC0EE', +\ 'skyblue3': '#6CA6CD', +\ 'skyblue4': '#4A708B', +\ 'lightskyblue1': '#B0E2FF', +\ 'lightskyblue2': '#A4D3EE', +\ 'lightskyblue3': '#8DB6CD', +\ 'lightskyblue4': '#607B8B', +\ 'slategray1': '#C6E2FF', +\ 'slategray2': '#B9D3EE', +\ 'slategray3': '#9FB6CD', +\ 'slategray4': '#6C7B8B', +\ 'lightsteelblue1': '#CAE1FF', +\ 'lightsteelblue2': '#BCD2EE', +\ 'lightsteelblue3': '#A2B5CD', +\ 'lightsteelblue4': '#6E7B8B', +\ 'lightblue1': '#BFEFFF', +\ 'lightblue2': '#B2DFEE', +\ 'lightblue3': '#9AC0CD', +\ 'lightblue4': '#68838B', +\ 'lightcyan1': '#E0FFFF', +\ 'lightcyan2': '#D1EEEE', +\ 'lightcyan3': '#B4CDCD', +\ 'lightcyan4': '#7A8B8B', +\ 'paleturquoise1': '#BBFFFF', +\ 'paleturquoise2': '#AEEEEE', +\ 'paleturquoise3': '#96CDCD', +\ 'paleturquoise4': '#668B8B', +\ 'cadetblue1': '#98F5FF', +\ 'cadetblue2': '#8EE5EE', +\ 'cadetblue3': '#7AC5CD', +\ 'cadetblue4': '#53868B', +\ 'turquoise1': '#00F5FF', +\ 'turquoise2': '#00E5EE', +\ 'turquoise3': '#00C5CD', +\ 'turquoise4': '#00868B', +\ 'cyan1': '#00FFFF', +\ 'cyan2': '#00EEEE', +\ 'cyan3': '#00CDCD', +\ 'cyan4': '#008B8B', +\ 'darkslategray1': '#97FFFF', +\ 'darkslategray2': '#8DEEEE', +\ 'darkslategray3': '#79CDCD', +\ 'darkslategray4': '#528B8B', +\ 'aquamarine1': '#7FFFD4', +\ 'aquamarine2': '#76EEC6', +\ 'aquamarine3': '#66CDAA', +\ 'aquamarine4': '#458B74', +\ 'darkseagreen1': '#C1FFC1', +\ 'darkseagreen2': '#B4EEB4', +\ 'darkseagreen3': '#9BCD9B', +\ 'darkseagreen4': '#698B69', +\ 'seagreen1': '#54FF9F', +\ 'seagreen2': '#4EEE94', +\ 'seagreen3': '#43CD80', +\ 'seagreen4': '#2E8B57', +\ 'palegreen1': '#9AFF9A', +\ 'palegreen2': '#90EE90', +\ 'palegreen3': '#7CCD7C', +\ 'palegreen4': '#548B54', +\ 'springgreen1': '#00FF7F', +\ 'springgreen2': '#00EE76', +\ 'springgreen3': '#00CD66', +\ 'springgreen4': '#008B45', +\ 'green1': '#00FF00', +\ 'green2': '#00EE00', +\ 'green3': '#00CD00', +\ 'green4': '#008B00', +\ 'chartreuse1': '#7FFF00', +\ 'chartreuse2': '#76EE00', +\ 'chartreuse3': '#66CD00', +\ 'chartreuse4': '#458B00', +\ 'olivedrab1': '#C0FF3E', +\ 'olivedrab2': '#B3EE3A', +\ 'olivedrab3': '#9ACD32', +\ 'olivedrab4': '#698B22', +\ 'darkolivegreen1': '#CAFF70', +\ 'darkolivegreen2': '#BCEE68', +\ 'darkolivegreen3': '#A2CD5A', +\ 'darkolivegreen4': '#6E8B3D', +\ 'khaki1': '#FFF68F', +\ 'khaki2': '#EEE685', +\ 'khaki3': '#CDC673', +\ 'khaki4': '#8B864E', +\ 'lightgoldenrod1': '#FFEC8B', +\ 'lightgoldenrod2': '#EEDC82', +\ 'lightgoldenrod3': '#CDBE70', +\ 'lightgoldenrod4': '#8B814C', +\ 'lightyellow1': '#FFFFE0', +\ 'lightyellow2': '#EEEED1', +\ 'lightyellow3': '#CDCDB4', +\ 'lightyellow4': '#8B8B7A', +\ 'yellow1': '#FFFF00', +\ 'yellow2': '#EEEE00', +\ 'yellow3': '#CDCD00', +\ 'yellow4': '#8B8B00', +\ 'gold1': '#FFD700', +\ 'gold2': '#EEC900', +\ 'gold3': '#CDAD00', +\ 'gold4': '#8B7500', +\ 'goldenrod1': '#FFC125', +\ 'goldenrod2': '#EEB422', +\ 'goldenrod3': '#CD9B1D', +\ 'goldenrod4': '#8B6914', +\ 'darkgoldenrod1': '#FFB90F', +\ 'darkgoldenrod2': '#EEAD0E', +\ 'darkgoldenrod3': '#CD950C', +\ 'darkgoldenrod4': '#8B6508', +\ 'rosybrown1': '#FFC1C1', +\ 'rosybrown2': '#EEB4B4', +\ 'rosybrown3': '#CD9B9B', +\ 'rosybrown4': '#8B6969', +\ 'indianred1': '#FF6A6A', +\ 'indianred2': '#EE6363', +\ 'indianred3': '#CD5555', +\ 'indianred4': '#8B3A3A', +\ 'sienna1': '#FF8247', +\ 'sienna2': '#EE7942', +\ 'sienna3': '#CD6839', +\ 'sienna4': '#8B4726', +\ 'burlywood1': '#FFD39B', +\ 'burlywood2': '#EEC591', +\ 'burlywood3': '#CDAA7D', +\ 'burlywood4': '#8B7355', +\ 'wheat1': '#FFE7BA', +\ 'wheat2': '#EED8AE', +\ 'wheat3': '#CDBA96', +\ 'wheat4': '#8B7E66', +\ 'tan1': '#FFA54F', +\ 'tan2': '#EE9A49', +\ 'tan3': '#CD853F', +\ 'tan4': '#8B5A2B', +\ 'chocolate1': '#FF7F24', +\ 'chocolate2': '#EE7621', +\ 'chocolate3': '#CD661D', +\ 'chocolate4': '#8B4513', +\ 'firebrick1': '#FF3030', +\ 'firebrick2': '#EE2C2C', +\ 'firebrick3': '#CD2626', +\ 'firebrick4': '#8B1A1A', +\ 'brown1': '#FF4040', +\ 'brown2': '#EE3B3B', +\ 'brown3': '#CD3333', +\ 'brown4': '#8B2323', +\ 'salmon1': '#FF8C69', +\ 'salmon2': '#EE8262', +\ 'salmon3': '#CD7054', +\ 'salmon4': '#8B4C39', +\ 'lightsalmon1': '#FFA07A', +\ 'lightsalmon2': '#EE9572', +\ 'lightsalmon3': '#CD8162', +\ 'lightsalmon4': '#8B5742', +\ 'orange1': '#FFA500', +\ 'orange2': '#EE9A00', +\ 'orange3': '#CD8500', +\ 'orange4': '#8B5A00', +\ 'darkorange1': '#FF7F00', +\ 'darkorange2': '#EE7600', +\ 'darkorange3': '#CD6600', +\ 'darkorange4': '#8B4500', +\ 'coral1': '#FF7256', +\ 'coral2': '#EE6A50', +\ 'coral3': '#CD5B45', +\ 'coral4': '#8B3E2F', +\ 'tomato1': '#FF6347', +\ 'tomato2': '#EE5C42', +\ 'tomato3': '#CD4F39', +\ 'tomato4': '#8B3626', +\ 'orangered1': '#FF4500', +\ 'orangered2': '#EE4000', +\ 'orangered3': '#CD3700', +\ 'orangered4': '#8B2500', +\ 'red1': '#FF0000', +\ 'red2': '#EE0000', +\ 'red3': '#CD0000', +\ 'red4': '#8B0000', +\ 'deeppink1': '#FF1493', +\ 'deeppink2': '#EE1289', +\ 'deeppink3': '#CD1076', +\ 'deeppink4': '#8B0A50', +\ 'hotpink1': '#FF6EB4', +\ 'hotpink2': '#EE6AA7', +\ 'hotpink3': '#CD6090', +\ 'hotpink4': '#8B3A62', +\ 'pink1': '#FFB5C5', +\ 'pink2': '#EEA9B8', +\ 'pink3': '#CD919E', +\ 'pink4': '#8B636C', +\ 'lightpink1': '#FFAEB9', +\ 'lightpink2': '#EEA2AD', +\ 'lightpink3': '#CD8C95', +\ 'lightpink4': '#8B5F65', +\ 'palevioletred1': '#FF82AB', +\ 'palevioletred2': '#EE799F', +\ 'palevioletred3': '#CD6889', +\ 'palevioletred4': '#8B475D', +\ 'maroon1': '#FF34B3', +\ 'maroon2': '#EE30A7', +\ 'maroon3': '#CD2990', +\ 'maroon4': '#8B1C62', +\ 'violetred1': '#FF3E96', +\ 'violetred2': '#EE3A8C', +\ 'violetred3': '#CD3278', +\ 'violetred4': '#8B2252', +\ 'magenta1': '#FF00FF', +\ 'magenta2': '#EE00EE', +\ 'magenta3': '#CD00CD', +\ 'magenta4': '#8B008B', +\ 'orchid1': '#FF83FA', +\ 'orchid2': '#EE7AE9', +\ 'orchid3': '#CD69C9', +\ 'orchid4': '#8B4789', +\ 'plum1': '#FFBBFF', +\ 'plum2': '#EEAEEE', +\ 'plum3': '#CD96CD', +\ 'plum4': '#8B668B', +\ 'mediumorchid1': '#E066FF', +\ 'mediumorchid2': '#D15FEE', +\ 'mediumorchid3': '#B452CD', +\ 'mediumorchid4': '#7A378B', +\ 'darkorchid1': '#BF3EFF', +\ 'darkorchid2': '#B23AEE', +\ 'darkorchid3': '#9A32CD', +\ 'darkorchid4': '#68228B', +\ 'purple1': '#9B30FF', +\ 'purple2': '#912CEE', +\ 'purple3': '#7D26CD', +\ 'purple4': '#551A8B', +\ 'mediumpurple1': '#AB82FF', +\ 'mediumpurple2': '#9F79EE', +\ 'mediumpurple3': '#8968CD', +\ 'mediumpurple4': '#5D478B', +\ 'thistle1': '#FFE1FF', +\ 'thistle2': '#EED2EE', +\ 'thistle3': '#CDB5CD', +\ 'thistle4': '#8B7B8B', +\ 'gray0': '#000000', +\ 'grey0': '#000000', +\ 'gray1': '#030303', +\ 'grey1': '#030303', +\ 'gray2': '#050505', +\ 'grey2': '#050505', +\ 'gray3': '#080808', +\ 'grey3': '#080808', +\ 'gray4': '#0A0A0A', +\ 'grey4': '#0A0A0A', +\ 'gray5': '#0D0D0D', +\ 'grey5': '#0D0D0D', +\ 'gray6': '#0F0F0F', +\ 'grey6': '#0F0F0F', +\ 'gray7': '#121212', +\ 'grey7': '#121212', +\ 'gray8': '#141414', +\ 'grey8': '#141414', +\ 'gray9': '#171717', +\ 'grey9': '#171717', +\ 'gray10': '#1A1A1A', +\ 'grey10': '#1A1A1A', +\ 'gray11': '#1C1C1C', +\ 'grey11': '#1C1C1C', +\ 'gray12': '#1F1F1F', +\ 'grey12': '#1F1F1F', +\ 'gray13': '#212121', +\ 'grey13': '#212121', +\ 'gray14': '#242424', +\ 'grey14': '#242424', +\ 'gray15': '#262626', +\ 'grey15': '#262626', +\ 'gray16': '#292929', +\ 'grey16': '#292929', +\ 'gray17': '#2B2B2B', +\ 'grey17': '#2B2B2B', +\ 'gray18': '#2E2E2E', +\ 'grey18': '#2E2E2E', +\ 'gray19': '#303030', +\ 'grey19': '#303030', +\ 'gray20': '#333333', +\ 'grey20': '#333333', +\ 'gray21': '#363636', +\ 'grey21': '#363636', +\ 'gray22': '#383838', +\ 'grey22': '#383838', +\ 'gray23': '#3B3B3B', +\ 'grey23': '#3B3B3B', +\ 'gray24': '#3D3D3D', +\ 'grey24': '#3D3D3D', +\ 'gray25': '#404040', +\ 'grey25': '#404040', +\ 'gray26': '#424242', +\ 'grey26': '#424242', +\ 'gray27': '#454545', +\ 'grey27': '#454545', +\ 'gray28': '#474747', +\ 'grey28': '#474747', +\ 'gray29': '#4A4A4A', +\ 'grey29': '#4A4A4A', +\ 'gray30': '#4D4D4D', +\ 'grey30': '#4D4D4D', +\ 'gray31': '#4F4F4F', +\ 'grey31': '#4F4F4F', +\ 'gray32': '#525252', +\ 'grey32': '#525252', +\ 'gray33': '#545454', +\ 'grey33': '#545454', +\ 'gray34': '#575757', +\ 'grey34': '#575757', +\ 'gray35': '#595959', +\ 'grey35': '#595959', +\ 'gray36': '#5C5C5C', +\ 'grey36': '#5C5C5C', +\ 'gray37': '#5E5E5E', +\ 'grey37': '#5E5E5E', +\ 'gray38': '#616161', +\ 'grey38': '#616161', +\ 'gray39': '#636363', +\ 'grey39': '#636363', +\ 'gray40': '#666666', +\ 'grey40': '#666666', +\ 'gray41': '#696969', +\ 'grey41': '#696969', +\ 'gray42': '#6B6B6B', +\ 'grey42': '#6B6B6B', +\ 'gray43': '#6E6E6E', +\ 'grey43': '#6E6E6E', +\ 'gray44': '#707070', +\ 'grey44': '#707070', +\ 'gray45': '#737373', +\ 'grey45': '#737373', +\ 'gray46': '#757575', +\ 'grey46': '#757575', +\ 'gray47': '#787878', +\ 'grey47': '#787878', +\ 'gray48': '#7A7A7A', +\ 'grey48': '#7A7A7A', +\ 'gray49': '#7D7D7D', +\ 'grey49': '#7D7D7D', +\ 'gray50': '#7F7F7F', +\ 'grey50': '#7F7F7F', +\ 'gray51': '#828282', +\ 'grey51': '#828282', +\ 'gray52': '#858585', +\ 'grey52': '#858585', +\ 'gray53': '#878787', +\ 'grey53': '#878787', +\ 'gray54': '#8A8A8A', +\ 'grey54': '#8A8A8A', +\ 'gray55': '#8C8C8C', +\ 'grey55': '#8C8C8C', +\ 'gray56': '#8F8F8F', +\ 'grey56': '#8F8F8F', +\ 'gray57': '#919191', +\ 'grey57': '#919191', +\ 'gray58': '#949494', +\ 'grey58': '#949494', +\ 'gray59': '#969696', +\ 'grey59': '#969696', +\ 'gray60': '#999999', +\ 'grey60': '#999999', +\ 'gray61': '#9C9C9C', +\ 'grey61': '#9C9C9C', +\ 'gray62': '#9E9E9E', +\ 'grey62': '#9E9E9E', +\ 'gray63': '#A1A1A1', +\ 'grey63': '#A1A1A1', +\ 'gray64': '#A3A3A3', +\ 'grey64': '#A3A3A3', +\ 'gray65': '#A6A6A6', +\ 'grey65': '#A6A6A6', +\ 'gray66': '#A8A8A8', +\ 'grey66': '#A8A8A8', +\ 'gray67': '#ABABAB', +\ 'grey67': '#ABABAB', +\ 'gray68': '#ADADAD', +\ 'grey68': '#ADADAD', +\ 'gray69': '#B0B0B0', +\ 'grey69': '#B0B0B0', +\ 'gray70': '#B3B3B3', +\ 'grey70': '#B3B3B3', +\ 'gray71': '#B5B5B5', +\ 'grey71': '#B5B5B5', +\ 'gray72': '#B8B8B8', +\ 'grey72': '#B8B8B8', +\ 'gray73': '#BABABA', +\ 'grey73': '#BABABA', +\ 'gray74': '#BDBDBD', +\ 'grey74': '#BDBDBD', +\ 'gray75': '#BFBFBF', +\ 'grey75': '#BFBFBF', +\ 'gray76': '#C2C2C2', +\ 'grey76': '#C2C2C2', +\ 'gray77': '#C4C4C4', +\ 'grey77': '#C4C4C4', +\ 'gray78': '#C7C7C7', +\ 'grey78': '#C7C7C7', +\ 'gray79': '#C9C9C9', +\ 'grey79': '#C9C9C9', +\ 'gray80': '#CCCCCC', +\ 'grey80': '#CCCCCC', +\ 'gray81': '#CFCFCF', +\ 'grey81': '#CFCFCF', +\ 'gray82': '#D1D1D1', +\ 'grey82': '#D1D1D1', +\ 'gray83': '#D4D4D4', +\ 'grey83': '#D4D4D4', +\ 'gray84': '#D6D6D6', +\ 'grey84': '#D6D6D6', +\ 'gray85': '#D9D9D9', +\ 'grey85': '#D9D9D9', +\ 'gray86': '#DBDBDB', +\ 'grey86': '#DBDBDB', +\ 'gray87': '#DEDEDE', +\ 'grey87': '#DEDEDE', +\ 'gray88': '#E0E0E0', +\ 'grey88': '#E0E0E0', +\ 'gray89': '#E3E3E3', +\ 'grey89': '#E3E3E3', +\ 'gray90': '#E5E5E5', +\ 'grey90': '#E5E5E5', +\ 'gray91': '#E8E8E8', +\ 'grey91': '#E8E8E8', +\ 'gray92': '#EBEBEB', +\ 'grey92': '#EBEBEB', +\ 'gray93': '#EDEDED', +\ 'grey93': '#EDEDED', +\ 'gray94': '#F0F0F0', +\ 'grey94': '#F0F0F0', +\ 'gray95': '#F2F2F2', +\ 'grey95': '#F2F2F2', +\ 'gray96': '#F5F5F5', +\ 'grey96': '#F5F5F5', +\ 'gray97': '#F7F7F7', +\ 'grey97': '#F7F7F7', +\ 'gray98': '#FAFAFA', +\ 'grey98': '#FAFAFA', +\ 'gray99': '#FCFCFC', +\ 'grey99': '#FCFCFC', +\ 'gray100': '#FFFFFF', +\ 'grey100': '#FFFFFF', +\ 'darkgrey': '#A9A9A9', +\ 'darkgray': '#A9A9A9', +\ 'darkblue': '#00008B', +\ 'darkcyan': '#008B8B', +\ 'darkmagenta': '#8B008B', +\ 'darkred': '#8B0000', +\ 'lightgreen': '#90EE90' +\ } + +" Functions, to highlight certain types {{{1 +function! s:ColorRGBValues(val) "{{{2 + let s:position = getpos('.') + if IsInComment() + " skip coloring comments + return + endif + " strip parantheses and split on comma + let rgb = s:StripParentheses(a:val) + if empty(rgb) + call s:Warn("Error in expression". a:val. "! Please report as bug.") + return + endif + for i in range(3) + if rgb[i][-1:-1] == '%' + let val = matchstr(rgb[i], '\d\+') + if (val + 0 > 100) + let rgb[1] = 100 + endif + let rgb[i] = float2nr((val + 0.0)*255/100) + else + if rgb[i] + 0 > 255 + let rgb[i] = 255 + endif + endif + endfor + if len(rgb) == 4 + let rgb = s:ApplyAlphaValue(rgb) + endif + let clr = printf("%02X%02X%02X", rgb[0],rgb[1],rgb[2]) + call s:SetMatcher(a:val, {'bg': clr}) +endfunction + +function! s:ColorHSLValues(val) "{{{2 + let s:position = getpos('.') + if IsInComment() + " skip coloring comments + return + endif + " strip parantheses and split on comma + let hsl = s:StripParentheses(a:val) + if empty(hsl) + call s:Warn("Error in expression". a:val. "! Please report as bug.") + return + endif + let str = s:PrepareHSLArgs(hsl) + + call s:SetMatcher(a:val, {'bg': str}) + return +endfu + +function! s:PreviewColorName(color) "{{{2 + let s:position = getpos('.') + let name=tolower(a:color) + let clr = s:colors[name] + " Skip color-name, e.g. white-space property + call s:SetMatcher('-\@\c-\@!', {'bg': clr[1:]}) +endfu + +function! s:PreviewColorHex(match) "{{{2 + let s:position = getpos('.') + if IsInComment() + " skip coloring comments + return + endif + let color = (a:match[0] == '#' ? a:match[1:] : a:match) + let pattern = color + if len(color) == 3 + let color = substitute(color, '.', '&&', 'g') + endif + if &t_Co == 8 && !s:HasGui() + " The first 12 color names, can be displayed by 8 color terminals + let list = values(s:xterm_8colors) + let idx = match(list, a:match) + if idx == -1 + " Color can't be displayed by 8 color terminal + return + else + let color = list[idx] + endif + endif + if len(split(pattern, '\zs')) == 8 + " apply alpha value + let l = split(pattern, '..\zs') + call map(l, 'printf("%2d", "0x".v:val)') + let l[3] = string(str2float(l[3])/255) " normalize to 0-1 + let l = s:ApplyAlphaValue(l) + let color = printf("%02X%02X%02X", l[0], l[1], l[2]) + endif + call s:SetMatcher(s:hex_pattern[0]. pattern. s:hex_pattern[2], {'bg': color}) +endfunction + +function! s:PreviewColorTerm(pre, text, post) "{{{2 + " a:pre: Ansi-Sequences determining the highlighting + " a:text: Text to color + " a:post: Ansi-Sequences resetting the coloring (might be empty) + let s:position = getpos('.') + let color = s:Ansi2Color(a:pre) + let clr_Dict = {} + + if &t_Co == 8 && !s:HasGui() + " The first 12 color names, can be displayed by 8 color terminals + let i = 0 + for clr in color + let list = values(s:xterm_8colors) + let idx = match(list, clr) + if idx == -1 + " Color can't be displayed by 8 color terminal + let color[i] = NONE + else + let color[i] = list[idx] + endif + let i+=1 + endfor + endif + let clr_Dict.fg = color[0] + let clr_Dict.bg = color[1] + let pre = escape(a:pre, '[]') + let post = escape(a:post, '[]') + let txt = escape(a:text, '\^$.*~[]') + " limit the pattern to the belonging line (should make syntax matching + " faster!) + let pattern = '\%(\%'.line('.').'l\)\%('. pre. '\)\@<='.txt. '\('.post.'\)\@=' + " needs matchaddpos + let clr_Dict.pos = [[ line('.'), col('.'), strlen(a:pre. a:text. a:post)]] + call s:SetMatcher(pattern, clr_Dict) +endfunction +function! s:PreviewColorNroff(match) "{{{2 + let s:position = getpos('.') + let clr_Dict = {} + let color = [] + if a:match[0] == '_' + let special = 'underline' + else + let special = 'bold' + endif + let synid=synIDtrans(synID(line('.'), col('.'), 1)) + if synid == 0 + let synid = hlID('Normal') + endif + let color=[synIDattr(synid, 'fg'), synIDattr(synid, 'bg')] + if color == [0, 0] || color == ['', ''] + let color = [synIDattr(hlID('Normal'), 'fg'), synIDattr(hlID('Normal'), 'bg')] + endif + + let clr_Dict.fg = color[0] + let clr_Dict.bg = color[1] + let clr_Dict.special=special + " limit the pattern to the belonging line (should make syntax matching + " faster!) + let pattern = '\%(\%'.line('.').'l\)'.a:match + " needs matchaddpos + let clr_Dict.pos = [[ line('.'), col('.'), 3]] + call s:SetMatcher(pattern, clr_Dict) +endfunction +function! s:PreviewTaskWarriorColors(submatch) "{{{2 + " a:submatch is something like 'black on rgb141' + + " this highlighting should overrule e.g. colorname highlighting + let s:position = getpos('.') + let s:default_match_priority += 1 + let color = ['', 'NONE', 'NONE'] + let color_Dict = {} + " The submatch is everything after the first equalsign! + let tpat = '\(inverse\|underline\|bright\|bold\)\?\%(\s*\)\(\S\{3,}\)'. + \ '\?\%(\s*\)\?\%(on\s\+'. + \ '\%(inverse\|underline\|bright\|bold\)\?\%(\s*\)\(\S\{3,}\)\)\?' + let colormatch = matchlist(a:submatch, tpat) + try + if !empty(colormatch) && !empty(colormatch[0]) + let i=-1 + for m in colormatch[1:3] + let i+=1 + if i == 0 + if (!empty(colormatch[1])) + let color_Dict.special=colormatch[1] + else + continue + endif + endif + if match(keys(s:colors), '\<'.m.'\>') > -1 + if i == 1 + let color_Dict.fg = s:colors[m][1:] " skip the # sign + elseif i == 2 + let color_Dict.bg = s:colors[m][1:] " skip the # sign + endif + continue + elseif match(m, '^rgb...') > -1 + let color[i] = m[3] * 36 + m[4] * 6 + m[5] + 16 " (start at index 16) + if color[i] > 231 + " invalid color + return + endif + elseif match(m, '^color') > -1 + let color[i] = matchstr(m, '\d\+')+0 + if color[i] > 231 + " invalid color + return + endif + elseif match(m, '^gray') > -1 + let color[i] = matchstr(m, '\d\+') + 232 + if color[i] > 231 + " invalid color + return + endif + endif + if i == 1 + let color_Dict.ctermfg = color[i] + elseif i == 2 + let color_Dict.ctermbg = color[i] + endif + endfor + + let cname = get(color_Dict, 'fg', 'NONE') + if cname ==# 'NONE' && get(color_Dict, 'ctermfg') + let cname = s:Term2RGB(color_Dict.ctermfg) + endif + call s:SetMatcher('=\s*\zs\<'.a:submatch.'\>$', color_Dict) + endif + finally + let s:default_match_priority -= 1 + let s:stop = 1 + endtry +endfunction + +function! s:PreviewVimColors(submatch) "{{{2 + " a:submatch is something like 'black on rgb141' + + " this highlighting should overrule e.g. colorname highlighting + let s:position = getpos('.') + let s:default_match_priority += 1 + if !exists("s:x11_color_pattern") + let s:x11_color_pattern = s:GetColorPattern(keys(s:x11_color_names)) + endif + let color_Dict = {} + let pat1 = '\%(\(cterm[fb]g\)\s*=\s*\)\@<=\<\(\d\+\)\>' + let pat2 = '\%(\(gui[fb]g\)\s*=\s*\)\@<=#\(\x\{6}\)\>' + let pat3 = '\%#=1\%(\(gui[fb]g\)\s*=\s*\)\@<=\('.s:x11_color_pattern.'\)' + + let cterm = matchlist(a:submatch, pat1) + let gui = matchlist(a:submatch, pat2) + if (!empty(gui) && (gui[2] ==# 'bg' || + \ gui[2] ==# 'fg' || + \ gui[2] ==# 'foreground' || + \ gui[2] ==# 'background')) + let gui=[] + endif + if empty(gui) + let gui = matchlist(a:submatch, pat3) + if !empty(gui) + let gui[2] = s:x11_color_names[tolower(gui[2])] + endif + endif + try + if !empty(cterm) + let color_Dict.ctermbg = cterm[2] + elseif !empty(gui) + let color_Dict.bg = gui[2] + endif + + if empty(gui) && empty(cterm) + return + endif + + call s:SetMatcher('\<'.a:submatch.'\>', color_Dict) + finally + let s:default_match_priority -= 1 + endtry +endfunction + +function! s:PreviewVimHighlightDump(match) "{{{2 + " highlights dumps of :hi + " e.g + "SpecialKey xxx term=bold cterm=bold ctermfg=124 guifg=Cyan + let s:position = getpos('.') + let s:default_match_priority += 1 + let dict = {} + try + let match = split(a:match, '\_s\+') + if a:match =~# 'cleared' + " ipaddr xxx cleared + return + elseif a:match =~# 'links to' + " try to find a non-cleared group + let c1 = SynID(match[0]) + let group = match[0] + if empty(c1) + let group = match[-1] + endif + call s:SetMatch('Color_'.group, '^'.s:GetPatternLiteral(a:match), {}) + else + let dict.name = 'Color_'.match[0] + call remove(match, 0, 1) + let dict = s:DictFromList(dict, match) + call s:SetMatcher(s:GetPatternLiteral(a:match), dict) + endif + finally + let s:default_match_priority -= 1 + " other highlighting functions shouldn't run anymore + let s:stop = 1 + endtry +endfunction + +function! s:PreviewVimHighlight(match) "{{{2 + " like colorhighlight plugin, + " colorizer highlight statements in .vim files + let s:position = getpos('.') + let tmatch = a:match + let def = [] + let dict = {} + try + if a:match =~ '^\s*hi\%[ghlight]\s\+clear' + " highlight clear lines, don't colorize! + return + endif + " Special case: + " HtmlHiLink foo bar -> links foo to bar + " hi! def link foo bar -> links foo to bar + let match = matchlist(tmatch, '\C\%(\%[Html\]HiLink\|hi\%[ghlight]!\?\s*\%(def\%[ault]\s*\)\?link\)\s\+\(\w\+\)\s\+\(\w\+\)') + " Hopefully tmatch[1] has already been defined ;( + if len(match) + call s:SetMatch('Color_'.match[1], '^\V'.escape(a:match, '\\'), {}) + return + endif + let tmatch = substitute(tmatch, '^\c\s*hi\%[ghlight]!\?\(\s*def\%[ault]\)\?', '', '') + let match = map(split(tmatch), 'substitute(v:val, ''^\s\+\|\s\+$'', "", "g")') + if len(match) < 2 + return + else + let dict.name = 'Color_'.get(match, 0) + let dict = s:DictFromList(dict, match) + call s:SetMatcher(s:GetPatternLiteral(a:match), dict) + endif + endtry +endfunction + +function! s:IsInComment() "{{{1 + return s:skip_comments && + \ synIDattr(synIDtrans(synID(line('.'), col('.'),1)), 'name') == "Comment" +endfu + +function! s:DictFromList(dict, list) "{{{1 + let dict = copy(a:dict) + let match = filter(a:list, 'v:val =~# ''=''') + for item in match + let [t1, t2] = split(item, '=') + let dict[t1] = t2 + endfor + return dict +endfunction + +function! s:GetPatternLiteral(pat) "{{{1 + return '\V'. substitute(escape(a:pat, '\\'), "\n", '\\n', 'g') +endfu +function! s:Term2RGB(index) "{{{1 + " Return index in colortable in RRGGBB form + return join(map(copy(s:colortable[a:index]), 'printf("%02X", v:val)'),'') +endfu + +function! s:Reltime(...) "{{{1 + return exists("a:1") ? reltime(a:1) : reltime() +endfu + +function! s:PrintColorStatistics() "{{{1 + if get(g:, 'colorizer_debug', 0) + echohl Title + echom printf("Colorstatistics at: %s", strftime("%H:%M")) + echom printf("Duration: %s", reltimestr(s:relstop)) + for name in sort(keys(extend(s:color_patterns, s:color_patterns_special))) + let value = get(extend(s:color_patterns, s:color_patterns_special), name) + echom printf("%15s: %ss", name, (value[-1] == [] ? ' 0.000000' : reltimestr(value[-1]))) + endfor + echohl Normal + endif +endfu + +function! s:ColorInit(...) "{{{1 + let s:force_hl = !empty(a:1) + let s:term_true_color = (exists('+tgc') && &tgc) + let s:stop = 0 + + " default matchadd priority + let s:default_match_priority = -2 + + " pattern/function dict + " Needed for s:ColorMatchingLines(), disabled, as this is too slow. + "let s:pat_func = {'#\x\{3,6\}': function('PreviewColorHex'), + " \ 'rgba\=(\s*\%(\d\+%\?\D*\)\{3,4})': + " \ function('ColorRGBValues'), + " \ 'hsla\=(\s*\%(\d\+%\?\D*\)\{3,4})': + " \ function('s:ColorHSLValues')} + + " Cache old values + if !exists("s:old_tCo") + let s:old_tCo = &t_Co + endif + + if !exists("s:swap_fg_bg") + let s:swap_fg_bg = 0 + endif + + if !exists("s:round") + let s:round = 0 + endif + + " Enable Autocommands + if exists("g:colorizer_auto_color") + call Colorizer#AutoCmds(g:colorizer_auto_color) + endif + + " Debugging + let s:debug = get(g:, 'colorizer_debug', 0) + + " Don't highlight comment? + let s:skip_comments = get(g:, 'colorizer_skip_comments', 0) + + " foreground / background contrast + let s:predefined_fgcolors = {} + let s:predefined_fgcolors['dark'] = ['444444', '222222', '000000'] + let s:predefined_fgcolors['light'] = ['bbbbbb', 'dddddd', 'ffffff'] + if !exists('g:colorizer_fgcontrast') + " Default to black / white + let g:colorizer_fgcontrast = len(s:predefined_fgcolors['dark']) - 1 + elseif g:colorizer_fgcontrast >= len(s:predefined_fgcolors['dark']) + call s:Warn("g:colorizer_fgcontrast value invalid, using default") + let g:colorizer_fgcontrast = len(s:predefined_fgcolors['dark']) - 1 + endif + + if !exists("s:old_fgcontrast") + " if the value was changed since last time, + " be sure to clear the old highlighting. + let s:old_fgcontrast = g:colorizer_fgcontrast + endif + + if exists("g:colorizer_swap_fgbg") + if s:swap_fg_bg != g:colorizer_swap_fgbg + let s:force_hl = 1 + endif + let s:swap_fg_bg = g:colorizer_swap_fgbg + endif + + if exists("g:colorizer_colornames") + if exists("s:color_names") && + \ s:color_names != g:colorizer_colornames + let s:force_hl = 1 + endif + let s:color_names = g:colorizer_colornames + else + let s:color_names = 1 + endif + + let s:color_syntax = get(g:, 'colorizer_syntax', 0) + if get(g:, 'colorizer_only_unfolded', 0) && exists(":foldd") == 1 + let s:color_unfolded = 'foldd ' + else + let s:color_unfolded = '' + endif + + if hlID('Color_Error') == 0 + hi default link Color_Error Error + endif + + if !s:force_hl && s:old_fgcontrast != g:colorizer_fgcontrast + \ && s:swap_fg_bg == 0 + " Doesn't work with swapping fg bg colors + let s:force_hl = 1 + let s:old_fgcontrast = g:colorizer_fgcontrast + endif + + " User manually changed the &t_Co option, so reset it + if s:old_tCo != &t_Co + unlet! s:colortable + endif + + if !exists("s:init_css") || !exists("s:colortable") || + \ empty(s:colortable) + " Only calculate the colortable when running + if &t_Co == 8 + let s:colortable = map(range(0,7), 's:Xterm2rgb16(v:val)') + elseif &t_Co == 16 + let s:colortable = map(range(0,15), 's:Xterm2rgb16(v:val)') + elseif &t_Co == 88 + let s:colortable = map(range(0,87), 's:Xterm2rgb88(v:val)') + " terminal with 256 colors or gVim + elseif &t_Co == 256 || empty(&t_Co) + let s:colortable = map(range(0,255), 's:Xterm2rgb256(v:val)') + endif + if s:debug && exists("s:colortable") + let g:colortable = s:colortable + endif + let s:init_css = 1 + elseif s:force_hl + call Colorizer#ColorOff() + endif + let s:conceal = [&l:cole, &l:cocu] + + let s:hex_pattern = get(g:, 'colorizer_hex_pattern', + \ ['#', '\%(\x\{3}\|\x\{6}\|\x\{8\}\)', '\%(\>\|[-_]\)\@=']) + + if s:HasGui() || &t_Co >= 8 || s:HasColorPattern() + " The list of available match() patterns + let w:match_list = s:GetMatchList() + " If the syntax highlighting got reset, force recreating it + if ((empty(w:match_list) || !hlexists(w:match_list[0].group) || + \ (empty(SynID(w:match_list[0].group)) && !s:force_hl))) + let s:force_hl = 1 + endif + if &t_Co > 16 || s:HasGui() + let s:colors = (exists("g:colorizer_x11_names") ? + \ s:x11_color_names : s:w3c_color_names) + elseif &t_Co == 16 + " should work with 16 colors terminals + let s:colors = s:xterm_16colors + else + let s:colors = s:xterm_8colors + endif + if exists("g:colorizer_custom_colors") + call extend(s:colors, g:colorizer_custom_colors, 'force') + endif + let s:colornamepattern = s:GetColorPattern(keys(s:colors)) + "call map(w:match_list, 'v:val.pattern') + else + throw "nocolor" + endif + + " Dictionary, containing all information on what to color + " Key: Name + " Value: List, containing 1) Pattern to find color + " 2) func ref to call on the match of 1 + " 3) Name of variable, to enable or this enty + " 4) condition, that must be fullfilled, before + " using this entry + " ´ 5) reltime for dumping statistics + let s:color_patterns = { + \ 'rgb': ['rgb(\s*\%(\d\+%\?[^)]*\)\{3})', + \ function("s:ColorRGBValues"), 'colorizer_rgb', 1, [] ], + \ 'rgba': ['rgba(\s*\%(\d\+%\?\D*\)\{3}\%(\%(0\?\%(.\d\+\)\?\)\|1\))', + \ function("s:ColorRGBValues"), 'colorizer_rgba', 1, [] ], + \ 'hsla': ['hsla\=(\s*\%(\d\+%\?\D*\)\{3}\%(\%(0\?\%(.\d\+\)\?\)\|1\)\=)', + \ function("s:ColorHSLValues"), 'colorizer_hsla', 1, [] ], + \ 'vimcolors': ['\%(gui[fb]g\|cterm[fb]g\)\s*=\s*\<\%(\d\+\|#\x\{6}\|\w\+\)\>', + \ function("s:PreviewVimColors"), 'colorizer_vimcolors', '&ft ==# "vim"', [] ], + \ 'vimhighlight': ['^\s*\%(\%[Html]HiLink\s\+\w\+\s\+\w\+\)\|'. + \ '\(^\s*hi\%[ghlight]!\?\s\+\(clear\)\@!\S\+.*\)', + \ function("s:PreviewVimHighlight"), 'colorizer_vimhighlight', '&ft ==# "vim"', [] ], + \ 'taskwarrior': ['^color[^=]*=\zs.\+$', + \ function("s:PreviewTaskWarriorColors"), 'colorizer_taskwarrior', 'expand("%:e") ==# "theme"', [] ], + \ 'hex': [join(s:hex_pattern, ''), function("s:PreviewColorHex"), 'colorizer_hex', 1, [] ], + \ 'vimhighl_dump': ['^\v\w+\s+xxx%((\s+(term|cterm%([bf]g)?|gui%(%([bf]g|sp))?'. + \ ')\=[#0-9A-Za-z_,]+)+)?%(\_\s+links to \w+)?%( cleared)@!', + \ function("s:PreviewVimHighlightDump"), 'colorizer_vimhighl_dump', 'empty(&ft)', [] ] + \ } + + " term_conceal: patterns to hide, currently: $ and the color patterns  + let s:color_patterns_special = { + \ 'term': ['\%(\%x1b\[0m\)\?\(\%(\%x1b\[\d\+\%([:;]\d\+\)*m\)\+\)\([^\e]*\)\(\%x1b\%(\[0m\|\[K\)\)\=', + \ function("s:PreviewColorTerm"), 'colorizer_term', [] ], + \ 'term_nroff': ['\%(\(.\)\%u8\1\)\|\%(_\%u8.\)', function("s:PreviewColorNroff"), 'colorizer_nroff', [] ], + \ 'term_conceal': [ ['\%(\(\%(\%x1b\[0m\)\?\%x1b\[\d\+\%([;:]\d\+\)*\a\)\|\%x1b\[K$\)', + \ '\%d13', '\%(\%x1b\[K\)', '\%(\%x1b\]\d\+;\d\+;\)', '\%(\%x1b\\\)', + \ '\%x1b(B\%x1b\[m', '\%x1b\[m\%x0f', '_\%u8.\@=', '\(.\)\%u8\%(\1\)\@='], + \ '', + \ 'colorizer_term_conceal', [] ] + \ } + + if exists("s:colornamepattern") && s:color_names + let s:color_patterns["colornames"] = [ s:colornamepattern, + \ function("s:PreviewColorName"), 'colorizer_colornames', 1, [] ] + endif +endfu + +function! s:AddOffset(list) "{{{1 + return a:list + let result=[] + for val in a:list + let val = ('0X'.val) + 0 + if val < get(g:, 'colorizer_min_offset', 0) + let val = get(g:, 'colorizer_add_offset', 0) + endif + call add(result, val) + endfor + return result +endfu +function! s:SwapColors(list) "{{{1 + if empty(a:list[0]) && empty(a:list[1]) + return a:list + elseif s:swap_fg_bg > 0 + return [a:list[1]] + ['NONE'] + elseif s:swap_fg_bg == -1 + return [a:list[1], a:list[0]] + else + return a:list + endif +endfu + +function! s:FGforBG(bg) "{{{1 + " takes a 6hex color code and returns a matching color that is visible + let fgc = g:colorizer_fgcontrast + if fgc == -1 + return a:bg + endif + if a:bg ==# 'NONE' + return (&bg==#'dark' ? s:predefined_fgcolors['dark'][fgc] : s:predefined_fgcolors['light'][fgc]) + endif + let r = '0x'.a:bg[0:1]+0 + let g = '0x'.a:bg[2:3]+0 + let b = '0x'.a:bg[4:5]+0 + if r*30 + g*59 + b*11 > 12000 + return s:predefined_fgcolors['dark'][fgc] + else + return s:predefined_fgcolors['light'][fgc] + end +endfunction + +function! s:DidColor(clr, pat) "{{{1 + let idx = index(w:match_list, a:pat) + if idx > -1 + let attr = SynID(a:clr) + if (!empty(attr) && get(w:match_list, idx) ==# a:pat) + return 1 + endif + endif + return 0 +endfu + +function! s:DoHlGroup(group, Dict) "{{{1 + if !s:force_hl + let syn = SynID(a:group) + if !empty(syn) + " highlighting already exists + return + endif + endif + + if empty(a:Dict) + " try to link the given highlight group + call s:Exe("hi link ". a:group. " ". matchstr(a:group, 'Color_\zs.*')) + return + endif + + let hi = printf('hi %s ', a:group) + let fg = get(a:Dict, 'fg', '') + let bg = get(a:Dict, 'bg', '') + let [fg, bg] = s:SwapColors([fg, bg]) + let [fg, bg] = s:AddOffset([fg, bg]) + + if !empty(fg) && fg[0] !=# '#' && fg !=# 'NONE' + let fg='#'.fg + endif + if !empty(bg) && bg[0] !=# '#' && bg !=# 'NONE' + let bg='#'.bg + endif + if !empty(fg) + let hi .= printf('guifg=%s', fg) + endif + if has_key(a:Dict, "gui") + let hi.=printf(" gui=%s ", a:Dict['gui']) + endif + if has_key(a:Dict, "guifg") + let hi.=printf(" guifg=%s ", a:Dict['guifg']) + endif + if !empty(bg) + let hi .= printf(' guibg=%s', bg) + endif + let hi .= printf('%s', !empty(get(a:Dict, 'special', '')) ? + \ (' gui='. a:Dict.special) : '') + if !s:HasGui() + let fg = get(a:Dict, 'ctermfg', '') + let bg = get(a:Dict, 'ctermbg', '') + let [fg, bg] = s:SwapColors([fg, bg]) + if !empty(bg) || bg == 0 + let hi.= printf(' ctermbg=%s', bg) + endif + if !empty(fg) || fg == 0 + let hi.= printf(' ctermfg=%s', fg) + endif + let hi .= printf('%s', !empty(get(a:Dict, 'special','')) ? + \ (' cterm='. a:Dict.special) : '') + if has_key(a:Dict, "term") + let hi.=printf(" term=%s ", a:Dict['term']) + endif + if has_key(a:Dict, "cterm") + let hi.=printf(" cterm=%s ", a:Dict['cterm']) + endif + endif + call s:Exe(hi) +endfunction + +function! s:Exe(stmt) "{{{1 + "Don't error out for invalid colors + try + exe a:stmt + catch + " Only report errors, when debugging info is turned on + if s:debug + call s:Warn("Invalid statement: ".a:stmt) + endif + endtry +endfu + +function! s:SynID(group, ...) "{{{1 + let property = exists("a:1") ? a:1 : 'fg' + let c1 = synIDattr(synIDtrans(hlID(a:group)), property) + " since when can c1 be negative? Is this a vim bug? + " it used to be empty on errors or non-existing properties... + if empty(c1) || c1 < 0 + return '' + else + return c1 + endif +endfu + +function! s:GenerateColors(dict) "{{{1 + let result=copy(a:dict) + + if !has_key(result, 'bg') && has_key(result, 'ctermbg') + let result.bg = s:Term2RGB(result.ctermbg) + elseif !has_key(result, 'bg') && has_key(result, 'guibg') + let result.bg = result.guibg + endif + if !has_key(result, 'fg') && has_key(result, 'ctermfg') + let result.fg = s:Term2RGB(result.ctermfg) + elseif !has_key(result, 'fg') && has_key(result, 'guifg') + let result.fg = result.guifg + endif + + if !has_key(result, 'fg') && + \ has_key(result, 'bg') + let result.fg = toupper(s:FGforBG(result.bg)) + endif + if !has("gui_running") + " need to make sure, we have ctermfg/ctermbg values + if !has_key(result, 'ctermfg') && + \ has_key(result, 'fg') + let result.ctermfg = (s:term_true_color ? result.fg : s:Rgb2xterm(result.fg)) + endif + if !has_key(result, 'ctermbg') && + \ has_key(result, 'bg') + let result.ctermbg = (s:term_true_color ? result.bg : s:Rgb2xterm(result.bg)) + endif + endif + for key in keys(result) + if empty(result[key]) + let result[key] = 0 + endif + endfor + return result +endfunction + +function! s:SetMatcher(pattern, Dict) "{{{1 + let param = s:GenerateColors(a:Dict) + let clr = get(param, 'name', '') + if empty(clr) + let clr = 'Color_'. get(param, 'fg'). '_'. get(param, 'bg'). + \ (!empty(get(param, 'special', '')) ? + \ ('_'. get(param, 'special')) : '') + endif + call s:SetMatch(clr, a:pattern, param) +endfunction + +function! s:SetMatch(group, pattern, param_dict) "{{{1 + call s:DoHlGroup(a:group, a:param_dict) + if has_key(a:param_dict, 'pos') + call matchaddpos(a:group, a:param_dict.pos, s:default_match_priority) + " do not add the pattern to the matchlist + "call add(w:match_list, a:pattern) + return + endif + if s:DidColor(a:group, a:pattern) + return + endif + " let 'hls' overrule our syntax highlighting + call matchadd(a:group, a:pattern, s:default_match_priority) + call add(w:match_list, a:pattern) +endfunction + + +function! s:Xterm2rgb16(color) "{{{1 + " 16 basic colors + let r=0 + let g=0 + let b=0 + let r = s:basic16[a:color][0] + let g = s:basic16[a:color][1] + let b = s:basic16[a:color][2] + return [ r, g, b ] +endfunction + +function! s:Xterm2rgb88(color) "{{{1 + " 16 basic colors + let r=0 + let g=0 + let b=0 + if a:color < 16 + return s:Xterm2rgb16(a:color) + + " 4x4x4 color cube + elseif a:color >= 16 && a:color < 80 + let color=a:color-16 + let r = s:valuerange4[(color/16)%4] + let g = s:valuerange4[(color/4)%4] + let b = s:valuerange4[color%4] + " gray tone + elseif a:color >= 80 && a:color <= 87 + let color = (a:color-80) + 0.0 + let r = 46.36363636 + color * 23.18181818 + + \ (color > 0.0 ? 23.18181818 : 0.0) + 0.0 + let r = float2nr(r) + let g = r + let b = r + endif + + let rgb=[r,g,b] + return rgb +endfunction + +function! s:Xterm2rgb256(color) "{{{1 + " 16 basic colors + let r=0 + let g=0 + let b=0 + if a:color < 16 + return s:Xterm2rgb16(a:color) + + " color cube color + elseif a:color >= 16 && a:color < 232 + let color=a:color-16 + let r = s:valuerange6[(color/36)%6] + let g = s:valuerange6[(color/6)%6] + let b = s:valuerange6[color%6] + + " gray tone + elseif a:color >= 232 && a:color <= 255 + let r = 8 + (a:color-232) * 0x0a + let g = r + let b = r + endif + let rgb=[r,g,b] + return rgb +endfunction + +function! s:RoundColor(...) "{{{1 + let result = [] + let minlist = [] + let min = 1000 + let list = (&t_Co == 256 ? s:valuerange6 : s:valuerange4) + if &t_Co > 16 + for item in a:000 + for val in list + let t = abs(val - item) + if (min > t) + let min = t + let r = val + endif + endfor + call add(result, r) + call add(minlist, min) + let min = 1000 + endfor + endif + if &t_Co <= 16 + let result = [ a:1, a:2, a:3 ] + let minlist = [ 255, 255, 255 ] + endif + " Check with the values from the 16 color xterm, if the difference + " is lower + let result = s:Check16ColorTerm(result, minlist) + return result +endfunction + +function! s:Check16ColorTerm(rgblist, minlist) "{{{1 +" We only check those values for 256 color terminals here: +" [205,0,0] [0,205,0] [205,205,0] [205,0,205] +" [0,205,205] [0,0,238] [92,92,255] +" The other values are already included in the s:colortable list + let min = a:minlist[0] + a:minlist[1] + a:minlist[2] + if &t_Co == 256 + for value in [[205,0,0], [0,205,0], [205,205,0], [205,0,205], + \ [0,205,205], [0,0,238], [92,92,255]] + " euclidian distance would be needed, + " but this works good enough and is faster. + let t = abs(value[0] - a:rgblist[0]) + + \ abs(value[1] - a:rgblist[1]) + + \ abs(value[2] - a:rgblist[2]) + if min > t + return value + endif + endfor + elseif &t_Co == 88 + for value in [[0,0,238], [229,229,229], [127,127,127], [92,92,255]] + let t = abs(value[0] - a:rgblist[0]) + + \ abs(value[1] - a:rgblist[1]) + + \ abs(value[2] - a:rgblist[2]) + if min > t + return value + endif + endfor + else " 16 color terminal + " Check for values from 16 color terminal + let best = [] + let min = 100000 + let list = (&t_Co == 16 ? s:basic16 : s:basic16[:7]) + for value in list + let t = abs(value[0] - a:rgblist[0]) + + \ abs(value[1] - a:rgblist[1]) + + \ abs(value[2] - a:rgblist[2]) + if min > t + let min = t + let best = value + endif + endfor + return best + endif + return a:rgblist +endfunction + +function! s:Ansi2Color(chars) "{{{1 + " chars look like this + "  + if !exists("s:term2ansi") + let s:term2ansi = {} + " Color values taken from + " https://en.wikipedia.org/wiki/ANSI_escape_code#Colors + let s:term2ansi.std = { 30: printf("%.2X%.2X%.2X", 0, 0, 0), + \ 31: printf("%.2X%.2X%.2X", 205, 0, 0), + \ 32: printf("%.2X%.2X%.2X", 0, 205, 0), + \ 33: printf("%.2X%.2X%.2X", 205, 205, 0), + \ 34: printf("%.2X%.2X%.2X", 0, 0, 238), + \ 35: printf("%.2X%.2X%.2X", 205, 0, 205), + \ 36: printf("%.2X%.2X%.2X", 0, 205, 205), + \ 37: printf("%.2X%.2X%.2X", 229, 229, 229) + \ } + let s:term2ansi.bold = { 30: printf("%.2X%.2X%.2X", 127, 127, 127), + \ 31: printf("%.2X%.2X%.2X", 255, 0, 0), + \ 32: printf("%.2X%.2X%.2X", 0, 255, 0), + \ 33: printf("%.2X%.2X%.2X", 255, 255, 0), + \ 34: printf("%.2X%.2X%.2X", 92, 92, 255), + \ 35: printf("%.2X%.2X%.2X", 255, 0, 255), + \ 36: printf("%.2X%.2X%.2X", 0, 255, 255), + \ 37: printf("%.2X%.2X%.2X", 255, 255, 255) + \ } + endif + + let fground = "" + let bground = "" + let check = [0,0] " check fground and bground color + + if a:chars =~ '48;5;\d\+' + let check[0] = 0 + elseif a:chars=~ '.*3[0-7]\(;1\)\?[m;]' + let check[0] = 1 + elseif a:chars =~ '.*38\([:;]\)2\1' + let check[0] = 2 " Uses True Color Support + endif + if a:chars =~ '48;5;\d\+' + let check[1] = 3 + elseif a:chars =~ '.*48\([:;]\)2\1' + let check[1] = 2 + elseif a:chars=~ '.*4[0-7]\(;1\)\?[m;]' + let check[1] = 1 + endif + + if check[0] == 2 + " Check for TrueColor Support + " Esc[38;2;;; + " 38: background color + " 48: foregournd color + " delimiter could be either : or ; + " skip leading ESC [ and trailing m char + let pat = split(a:chars[2:-2], '[:;]') + if pat[0] == 38 " background color + let fground = printf("%.2X%.2X%.2X", pat[2], pat[3], pat[4]) + elseif a:pat[1] == 48 " foreground color + let bground = printf("%.2X%.2X%.2X", pat[2], pat[3], pat[4]) + endif + elseif check[1] == 3 + let nr = matchstr(a:chars, '\%x1b\[48;5;\zs\d\+\zem') + let bground = s:Term2RGB(nr) + else + for val in ["std", "bold"] + for key in keys(s:term2ansi[val]) + let bright = (val == "std" ? "" : ";1") + + if check[0] " Check for a match of the foreground color + if a:chars =~ ".*".key.bright."[m;]" + let fground = s:term2ansi[val][key] + endif + endif + if check[1] "Check for background color + if a:chars =~ ".*".(key+10).bright."[m;]" + let bground = s:term2ansi[val][key] + endif + endif + if !empty(bground) && !empty(fground) + break + endif + endfor + if !empty(fground) && !empty(bground) + break + endif + endfor + endif + return [(empty(fground) ? 'NONE' : fground), (empty(bground) ? "NONE" : bground)] +endfunction + +function! s:TermConceal(pattern) "{{{1 + " Conceals a list of patterns + if exists("b:Colorizer_did_syntax") + return + endif + let s:position = getpos('.') + " concealing + for pat in a:pattern + exe "syn match ColorTermESC /". pat. "/ conceal containedin=ALL" + endfor + setl cocu=nv cole=2 + let b:Colorizer_did_syntax=1 +endfu +function! s:GetColorPattern(list) "{{{1 + "let list = map(copy(a:list), ' ''\%(-\@-\@!\)'' ') + "let list = map(copy(a:list), ' ''\%(-\@-\@!\)'' ') + let list = copy(a:list) + " Force the old re engine. It should be faster without backtracking. + return '\%#=1\%(\<\('.join(copy(a:list), '\|').'\)\>\)' +endfunction + +function! s:GetMatchList() "{{{1 + " this is window-local! + return filter(getmatches(), 'v:val.group =~ ''^\(Color_\w\+\)\|NONE''') +endfunction + +function! s:CheckTimeout(pattern, force) "{{{1 + " Abort, if pattern is not found within 100 ms and force + " is not set + return (!empty(a:force) || search(a:pattern, 'cnw', '', 100)) +endfunction + +function! s:SaveRestoreOptions(save, dict, list) "{{{1 + if a:save + return s:SaveOptions(a:list) + else + for [key, value] in items(a:dict) + if key !~ '@' + call setbufvar('', '&'. key, value) + else + call call('setreg', [key[1]] + value) + endif + unlet value + endfor + endif +endfun + +function! s:SaveOptions(list) "{{{1 + let save = {} + for item in a:list + if item !~ '^@' + exe "let save.". item. " = &l:". item + else + let save[item] = [] + call add(save[item], getreg(item[1])) + call add(save[item], getregtype(item)) + endif + if item == 'ma' && !&l:ma + setl ma + elseif item == 'ro' && &l:ro + setl noro + elseif item == 'lz' && &l:lz + setl lz + elseif item == 'ed' && &g:ed + setl noed + elseif item == 'gd' && &g:gd + setl nogd + endif + endfor + return save +endfunction + +function! s:StripParentheses(val) "{{{1 + return split(matchstr(a:val, '^\(hsl\|rgb\)a\?\s*(\zs[^)]*\ze)'), '\s*,\s*') +endfunction + +function! s:ApplyAlphaValue(rgb) "{{{1 + " Add Alpha Value to RGB values + " takes a list of [ rr, gg, bb, aa] values + " alpha can be 0-1 + let bg = SynID('Normal', 'bg') + if empty(bg) + return a:rgb[0:3] + else + if (bg =~? '\d\{1,3}') && bg < 256 + " Xterm color code + " (add dummy in front of it, will be split later) + let bg = '#'.join(s:colortable[bg]) + endif + let rgb = [] + let bg_ = split(bg[1:], '..\zs') + let alpha = str2float(a:rgb[3]) + if alpha > 1 + let alpha = 1 + 0.0 + elseif alpha < 0 + let alpha = 0 + 0.0 + endif + let i = 0 + for value in a:rgb[0:2] + let value += 0 " convert to nr + let value = float2nr(ceil(value * alpha) + ceil((bg_[i]+0)*(1-alpha))) + if value > 255 + let value = 255 + elseif value < 0 + let value = 0 + endif + call add(rgb, value) + let i+=1 + unlet value " reset type of value + endfor + return rgb + endif +endfunction + +function! s:HSL2RGB(h, s, l, ...) "{{{1 + let s = a:s + 0.0 + let l = a:l + 0.0 + if l <= 0.5 + let m2 = l * (s + 1) + else + let m2 = l + s - l * s + endif + let m1 = l * 2 - m2 + let r = float2nr(s:Hue2RGB(m1, m2, a:h + 120)) + let g = float2nr(s:Hue2RGB(m1, m2, a:h)) + let b = float2nr(s:Hue2RGB(m1, m2, a:h - 120)) + if a:0 + let rgb = s:ApplyAlphaValue([r, g, b, a:1]) + endif + return printf("%02X%02X%02X", r, g, b) +endfunction + +function! s:Hue2RGB(m1, m2, h) "{{{1 + let h = (a:h + 0.0)/360 + if h < 0 + let h = h + 1 + elseif h > 1 + let h = h - 1 + endif + if h * 6 < 1 + let res = a:m1 + (a:m2 - a:m1) * h * 6 + elseif h * 2 < 1 + let res = a:m2 + elseif h * 3 < 2 + let res = a:m1 + (a:m2 - a:m1) * (2.0/3.0 - h) * 6 + else + let res = a:m1 + endif + return round(res * 255) +endfunction + +function! s:Rgb2xterm(color) "{{{1 +" selects the nearest xterm color for a rgb value like #FF0000 +" hard code values for 000000 and FFFFFF, they will be called many times +" so make this fast + if a:color ==# 'NONE' + return 'NONE' + endif + if len(a:color) <= 3 + " a:color is already a terminal color + return a:color + endif + if !exists("s:colortable") + call s:ColorInit('') + endif + let color = (a:color[0] == '#' ? a:color[1:] : a:color) + if ( color == '000000') + return 0 + elseif (color == 'FFFFFF') + return 15 + else + let r = '0x'.color[0:1]+0 + let g = '0x'.color[2:3]+0 + let b = '0x'.color[4:5]+0 + + " Try exact match first + let i = index(s:colortable, [r, g, b]) + if i > -1 + return i + endif + + " Grey scale ? + if ( r == g && r == b ) + if &t_Co == 256 + " 0 and 15 have already been take care of + if r < 5 + return 0 " black + elseif r > 244 + return 15 " white + endif + " grey cube starts at index 232 + return 232+(r-5)/10 + elseif &t_Co == 88 + if r < 23 + return 0 " black + elseif r < 69 + return 80 + elseif r > 250 + return 15 " white + else + " should be good enough + return 80 + (r-69)/23 + endif + endif + endif + + " Round to the next step in the xterm color cube + " euclidian distance would be needed, + " but this works good enough and is faster. + let round = s:RoundColor(r, g, b) + " Return closest match or -1 if not found + return index(s:colortable, round) + endif +endfunction + +function! s:Warn(msg) "{{{1 + let msg = 'Colorizer: '. a:msg + echohl WarningMsg + echomsg msg + echohl None + let v:errmsg = msg +endfu + +function! s:LoadSyntax(file) "{{{1 + unlet! b:current_syntax + exe "sil! ru! syntax/".a:file. ".vim" +endfu +function! s:HasGui() "{{{1 + return has("gui_running") || (exists("+tgc") && &tgc) +endfu +function! s:HasColorPattern() "{{{1 + let _pos = winsaveview() + try + if !exists("s:colornamepattern") + let s:colornamepattern = s:GetColorPattern(keys(s:colors)) + endif + let pattern = values(s:color_patterns) + [s:colornamepattern] + call cursor(1,1) + for pat in pattern + if s:CheckTimeout(pat, '') + return 1 + endif + endfor + return 0 + + finally + call winrestview(_pos) + endtry +endfunction + +function! s:PrepareHSLArgs(list) "{{{1 + let hsl=a:list + let hsl[0] = (matchstr(hsl[0], '\d\+') + 360)%360 + let hsl[1] = (matchstr(hsl[1], '\d\+') + 0.0)/100 + let hsl[2] = (matchstr(hsl[2], '\d\+') + 0.0)/100 + if len(hsl) == 4 + return s:HSL2RGB(hsl[0], hsl[1], hsl[2], hsl[3]) + endif + return s:HSL2RGB(hsl[0], hsl[1], hsl[2]) +endfu +function! s:SyntaxMatcher(enable) "{{{1 + if !a:enable + return + endif + let did_clean = {} + " + let list=s:GetMatchList() + if len(list) > 1000 + " This will probably slow + call s:Warn("Colorizer many colors detected, syntax highlighting will probably slow down Vim considerably!") + endif + if &ft =~? 'css' + " cssColor defines some color names like yellow or red and overrules + " our colors + sil! syn clear cssColor + endif + for hi in list + if !get(did_clean, hi.group, 0) + let did_clean[hi.group] = 1 + exe "sil! syn clear" hi.group + endif + if a:enable + if has_key(hi, 'pattern') + exe "syn match" hi.group "excludenl /". escape(hi.pattern, '/'). "/ display containedin=ALL" + else + " matchaddpos() + let line=hi.pos1[0] + let pos =hi.pos1[1]-1 + let len =hi.pos1[1]+hi.pos1[2]-2 + exe printf('syn match %s excludenl /\%%%dl\%%>%dc\&.*\%%<%dc/ display containedin=ALL', hi.group, line, pos, len) + endif + " We have syntax highlighting, can clear the matching + " ignore errors (just in case) + sil! call matchdelete(hi.id) + endif + endfor +endfu + +function! Colorizer#ColorToggle() "{{{1 + if !exists("w:match_list") || empty(w:match_list) + call Colorizer#DoColor(0, 1, line('$')) + else + call Colorizer#ColorOff() + endif +endfu + +function! Colorizer#ColorOff() "{{{1 + for _match in s:GetMatchList() + sil! call matchdelete(_match.id) + endfor + call Colorizer#LocalFTAutoCmds(0) + if exists("s:conceal") + let [&l:cole, &l:cocu] = s:conceal + if !empty(hlID('ColorTermESC')) + syn clear ColorTermESC + endif + endif + unlet! b:Colorizer_did_syntax w:match_list s:conceal +endfu + +function! Colorizer#DoColor(force, line1, line2, ...) "{{{1 + " initialize plugin + try + if v:version < 800 && !has('nvim') + call s:Warn("Colorizer needs Vim 8.0") + return + endif + call s:ColorInit(a:force) + if exists("a:1") && !empty(a:1) + let s:color_syntax = ( a:1 =~# '^\%(syntax\|nomatch\)$' ) + endif + catch /nocolor/ + " nothing to do + call s:Warn("Your terminal doesn't support colors or no colors". + \ 'found in the current buffer!') + return + endtry + let error = "" + + let _a = winsaveview() + let save = s:SaveRestoreOptions(1, {}, + \ ['mod', 'ro', 'ma', 'lz', 'ed', 'gd', '@/']) + let s:relstart = s:Reltime() + + " highlight Hex Codes: + " + " The :%s command is a lot faster than this: + ":g/#\x\{3,6}\>/call s:ColorMatchingLines(line('.')) + " Should color #FF0000 + " #F0F + " #FFF + " + if &t_Co > 16 || s:HasGui() + " Also support something like + " CSS rgb(255,0,0) + " rgba(255,0,0,1) + " rgba(255,0,0,0.8) + " rgba(255,0,0,0.2) + " rgb(10%,0,100%) + " hsl(0,100%,50%) -> hsl2rgb conversion RED + " hsla(120,100%,50%,1) Lime + " hsl(120,100%,25%) Darkgreen + " hsl(120, 100%, 75%) lightgreen + " hsl(120, 75%, 75%) pastelgreen + " highlight rgb(X,X,X) values + for Pat in values(s:color_patterns) + let start = s:Reltime() + if !get(g:, Pat[2], 1) || (get(g:, Pat[2]. '_disable', 0) > 0) + let Pat[4] = s:Reltime(start) + " Coloring disabled + continue + endif + + " 4th element in pattern is condition, that must be fullfilled, + " before we continue + if !empty(Pat[3]) && !eval(Pat[3]) + let Pat[4] = s:Reltime(start) + continue + endif + + " Check, the pattern isn't too costly... + if s:CheckTimeout(Pat[0], a:force) && !s:IsInComment() + let cmd = printf(':sil keeppatterns %d,%d%ss/%s/\=call(Pat[1], [submatch(0)])/egin', + \ a:line1, a:line2, s:color_unfolded, Pat[0]) + try + if Pat[2] ==# 'colorizer_vimhighlight' && !empty(bufname('')) + " try to load the corresponding syntax file so the syntax + " groups will be defined + let s:extension = fnamemodify(expand('%'), ':t:r') + let s:old_syntax = exists("b:current_syntax") ? b:current_syntax : '' + call s:LoadSyntax(s:extension) + endif + + exe cmd + let Pat[4] = s:Reltime(start) + + if s:stop + break + endif + + catch + " some error occured, stop when finished (and don't setup auto + " comands + let error.=" Colorize: ". string(Pat) + break + + finally + if exists("s:extension") + call s:LoadSyntax(&ft) + unlet! s:extension + endif + endtry + endif + endfor + else + call s:Warn('Color configuration seems wrong, skipping colorization! Check t_Co setting!') + endif + + for Pat in [ s:color_patterns_special.term, s:color_patterns_special.term_nroff ] + let start = s:Reltime() + if (s:CheckTimeout(Pat[0], a:force)) && !s:IsInComment() + + if !get(g:, Pat[2], 1) || (get(s:, Pat[2]. '_disable', 0) > 0) + " Coloring disabled + continue + endif + + if Pat[2] is# 'colorizer_nroff' + let arg = '[submatch(0)]' + else + let arg = '[submatch(1), submatch(2), submatch(3)]' + endif + let cmd = printf(':sil keeppatterns %d,%d%ss/%s/\=call(Pat[1],%s)/egin', + \ a:line1, a:line2, s:color_unfolded, Pat[0], arg) + try + exe cmd + let Pat[3] = s:Reltime(start) + " Hide ESC Terminal Chars + let start = s:Reltime() + call s:TermConceal(s:color_patterns_special.term_conceal[0]) + let s:color_patterns_special.term_conceal[3] = s:Reltime(start) + catch + " some error occured, stop when finished (and don't setup auto + " comands + let error=" ColorTerm " + break + endtry + endif + endfor + + " convert matches into synatx highlighting, so TOhtml can display it + " correctly + call s:SyntaxMatcher(s:color_syntax) + if !exists("#FTColorizer#BufWinEnter#") && empty(error) + " Initialise current window. + call Colorizer#LocalFTAutoCmds(1) + call Colorizer#ColorWinEnter(1, 1) " don't call DoColor recursively! + endif + let s:relstop = s:Reltime(s:relstart) + if !empty(error) + " Some error occured, stop trying to color the file + call Colorizer#ColorOff() + call s:Warn("Some error occured here: ". error) + if exists("s:position") + call s:Warn("Position: ". string(s:position)) + call matchadd('Color_Error', '\%'.s:position[1].'l\%'.s:position[2].'c.*\>') + endif + endif + call s:PrintColorStatistics() + call s:SaveRestoreOptions(0, save, []) + call winrestview(_a) +endfu + +function! Colorizer#RGB2Term(arg,bang) "{{{1 + if a:arg =~ '^rgb' + let clr = s:StripParentheses(a:arg) + let color = printf("#%02X%02X%02X", clr[0], clr[1], clr[2]) + else + let color = a:arg[0] == '#' ? a:arg : '#'.a:arg + endif + + call s:ColorInit(1) + let tcolor = s:Rgb2xterm(color) + if empty(a:bang) + call s:DoHlGroup("Color_". color[1:], s:GenerateColors({'bg': color[1:]})) + exe "echohl" "Color_".color[1:] + echo a:arg. " => ". tcolor + echohl None + endif + return tcolor +endfu + +function! Colorizer#Term2RGB(arg) "{{{1 + let index = a:arg + 0 + if a:arg > 255 || a:arg < 0 + call s:Warn('invalid index') + return + endif + + let _t_Co=&t_Co + let &t_Co = 256 + call s:ColorInit(1) + + let rgb = s:Term2RGB(index) + call s:DoHlGroup("Color_". rgb, s:GenerateColors({'bg': rgb, 'ctermbg': index})) + exe "echohl" "Color_".rgb + echo "TerminalColor: ". a:arg. " => ". rgb + echohl None + let &t_Co = _t_Co +endfu + + +function! Colorizer#HSL2Term(arg) "{{{1 + let hsl = s:StripParentheses(a:arg) + if empty(hsl) + call s:Warn("Error evaluating expression". a:val. "! Please report as bug.") + return a:val + endif + let str = s:PrepareHSLArgs(hsl) + + let tcolor = s:Rgb2xterm('#'.str) + call s:DoHlGroup("Color_".str, s:GenerateColors({'bg': str})) + exe "echohl" str + echo a:arg. " => ". tcolor + echohl None +endfu + +function! Colorizer#AutoCmds(enable) "{{{1 + if a:enable && !get(g:, 'colorizer_debug', 0) + aug Colorizer + au! + au InsertLeave * sil call Colorizer#ColorLine('!', line('w0'), line('w$')) + au TextChangedI * sil call Colorizer#ColorLine('', line('.'),line('.')) + au GUIEnter,ColorScheme * sil call Colorizer#DoColor('!', 1, line('$')) + au WinEnter,BufWinEnter * sil call Colorizer#ColorWinEnter() + aug END + else + aug Colorizer + au! + aug END + aug! Colorizer + endif +endfu + +function! Colorizer#LocalFTAutoCmds(enable) "{{{1 + if a:enable + aug FTColorizer + au! + au InsertLeave silent call + \ Colorizer#ColorLine('', line('w0'), line('w$')) + au CursorMoved,CursorMovedI call Colorizer#ColorLine('',line('.'), line('.')) + au WinEnter,BufWinEnter silent call Colorizer#ColorWinEnter() + "au BufLeave call Colorizer#ColorOff() + au GUIEnter,ColorScheme silent + \ call Colorizer#DoColor('!', 1, line('$')) + if get(g:, 'colorizer_cursormoved', 0) + au CursorMoved,CursorMovedI * call Colorizer#ColorLine('', line('.'),line('.')) + au CusorHold, CursorHoldI * silent call Colorizer#ColorLine('!', line('w0'), line('w$')) + endif + aug END + if !exists("b:undo_ftplugin") + " simply unlet a dummy variable + let b:undo_ftplugin = 'unlet! b:Colorizer_foobar' + endif + " Delete specific auto commands, because the filetype + " has been changed. + let b:undo_ftplugin .= '| exe "sil! au! FTColorizer"' + let b:undo_ftplugin .= '| exe "sil! aug! FTColorizer"' + let b:undo_ftplugin .= '| exe ":ColorClear"' + else + aug FTColorizer + au! + aug END + aug! FTColorizer + endif +endfu + +function! Colorizer#ColorWinEnter(...) "{{{1 + let force = a:0 ? a:1 : 0 + " be fast! + if !force + let ft_list = split(get(g:, "colorizer_auto_filetype", ""), ',') + if match(ft_list, "^".&ft."$") == -1 + " current filetype doesn't match g:colorizer_auto_filetype, + " so nothing to do + return + endif + if get(b:, 'Colorizer_changedtick', 0) == b:changedtick && + \ !empty(getmatches()) + " nothing to do + return + endif + endif + let g:colorizer_only_unfolded = 1 + let _c = getpos('.') + if !exists("a:2") + " don't call it recursively! + call Colorizer#DoColor('', 1, line('$')) + endif + let b:Colorizer_changedtick = b:changedtick + unlet! g:colorizer_only_unfolded + call setpos('.', _c) +endfu + +function! Colorizer#ColorLine(force, start, end) "{{{1 + if get(b:, 'Colorizer_changedtick', 0) == b:changedtick && empty(a:force) + " nothing to do + return + else + call Colorizer#DoColor(a:force, a:start, a:end) + let b:Colorizer_changedtick = b:changedtick + endif +endfu + +function! Colorizer#SwitchContrast() "{{{1 + if exists("s:swap_fg_bg") && s:swap_fg_bg + call s:Warn('Contrast Adjustment does not work with swapped foreground colors!') + return + endif + if !exists("s:predefined_fgcolors") + " init variables + call s:ColorInit('') + endif + " make sure, g:colorizer_fgcontrast is set up + if !exists('g:colorizer_fgcontrast') + " Default to black / white + let g:colorizer_fgcontrast = len(s:predefined_fgcolors['dark']) - 1 + endif + let g:colorizer_fgcontrast-=1 + if g:colorizer_fgcontrast < -1 + let g:colorizer_fgcontrast = len(s:predefined_fgcolors['dark']) - 1 + endif + echom 'Colorizer: using fgcontrast' g:colorizer_fgcontrast + call Colorizer#DoColor(1, 1, line('$')) +endfu + +function! Colorizer#SwitchFGBG() "{{{1 + let range = [ 0, 1, -1 ] + if !exists("s:round") + let s:round = 0 + else + let s:round = (s:round >= 2 ? 0 : s:round+1) + endif + let s:swap_fg_bg = range[s:round] + call Colorizer#DoColor(1, 1, line('$')) +endfu + +" DEBUG TEST "{{{1 +if !get(g:, 'colorizer_debug', 0) + let &cpo = s:cpo_save + unlet s:cpo_save + finish +endif + +fu! ColorizerXtermColors() "{{{2 + let list=[] + for c in range(0, 254) + let css_color = s:Xterm2rgb256(c) + call add(list, css_color) + endfor + return list +endfu + +fu! ColorizerGet(args) "{{{2 + exe "return s:".a:args +endfu + +" Plugin folklore and Vim Modeline " {{{1 +let &cpo = s:cpo_save +unlet s:cpo_save +" vim: set foldmethod=marker et fdl=0: diff --git a/bundle/Colorizer b/bundle/Colorizer new file mode 160000 index 0000000..e6876f6 --- /dev/null +++ b/bundle/Colorizer @@ -0,0 +1 @@ +Subproject commit e6876f6f390de7039116efe348a754f121d8ce77 diff --git a/doc/Colorizer.txt b/doc/Colorizer.txt new file mode 100644 index 0000000..5c9173a --- /dev/null +++ b/doc/Colorizer.txt @@ -0,0 +1,520 @@ +*Colorizer.txt* A plugin to color colornames and codes + +Author: Christian Brabandt +Version: 0.11 Thu, 15 Jan 2015 21:49:17 +0100 +Copyright: (c) 2009-2013 by Christian Brabandt + The VIM LICENSE applies to Colorizer.txt + (see |copyright|) except use ColorizerPlugin instead of "Vim". + NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK. + +============================================================================== +Contents *Colorizer* +============================================================================== + + 1. Colorizer Manual.............................|Colorizer-manual| + 1.1 :ColorHighlight......................|:ColorHighlight| + 1.2 :ColorClear..........................|:ColorClear| + 1.3 :RGB2Term............................|:RGB2Term| + 1.4 :HSL2RGB.............................|:HSL2RGB| + 1.5 :Term2RGB............................|:Term2RGB| + 1.6 :ColorContrast.......................|:ColorContrast| + 1.7 :ColorSwapFgBg.......................|:ColorSwapFgBg| + 1.8 :ColorToggle.........................|:ColorToggle| + 2. Configuration................................|Colorizer-config| + 2.1 Automatic loading...................|Colorizer-auto| + 2.2 Automatically highlight filetypes...|Colorizer-hl-ft| + 2.3 Skip coloring comments..............|Colorizer-comments| + 2.4 Adjust the contrast.................|Colorizer-contrast| + 2.5 Highlight colornames................|Colorizer-hl-names| + 2.6 Use X11 colornames..................|Colorizer-names| + 2.7 Use syntax highlighting.............|Colorizer-syntax| + 2.8 Specify patterns to highlight.......|Colorizer-pattern| + 2.9 Colorizing Taskwarrior files........|Colorizer-taskwarrior-files| + 2.10 Colorizing vim syntax files.........|Colorizer-vim-files| + 2.11 Use custom colornames...............|Colorizer-custom-colornames| + 2.12 Colorizing :hi statements...........|Colorizer-vim-hi| + 3. Colorizer Mappings...........................|Colorizer-maps| + 4. Colorizer Tips...............................|Colorizer-tips| + 5. Colorizer Feedback...........................|Colorizer-feedback| + 6. Colorizer History............................|Colorizer-history| + +============================================================================== +1. Colorizer Manual *Colorizer-manual* +============================================================================== + +Functionality + +This plugin is based on the css_color plugin by Nikolaus Hofer. The idea is to +highlight color names and codes in the same color that they represent. + +The plugin understands the W3C colors (used for CSS files for example), the +color names from the X11 Window System and also codes in hex notation, like +#FF0000 (which represents Red in the RGB color system). Additionally, it +supports the CSS color specifications, e.g. rgb(RR,GG,BB) color representation +in either absolute or percentage values and also the HVL color +representation like hvl(H,V,L) + +It works best in the gui version of Vim, but the plugin also supports 256 and +88 color terminals and translates the colors to those supported by the +terminal. 16 and 8 color terminals should work theoretically too, but have not +been widely tested. Note that translating the colors to the terminal might +impose a performance penalty, depending on the terminal type and the number of +matches in the file. + +This plugin defines the following commands: + + *:ColorHighlight* +:[range]ColorHighlight[!] [args] + +Scan the lines given by [range] for color code names and highlight those. If +[range] is omitted, the whole file will be scanned. If the ! is used, the +plugin will redefine all highlighting groups. If ! is not used, it will +skip patterns, that would take too long and make Vim unresponsive. + +[args] can by any of "syntax" or "match". "syntax" means to convert the +highlighting to syntax highlighting. This is useful, so a plugin like +|2html.vim| can convert the colors correctly to HTML. The default is +"match", which uses the |matchadd()| function. (Prepending "no" is +supported and will disable that setting and use the opposite). + + *:ColorClear* +:ColorClear Turn off color highlighting. + + *:RGB2Term* +:RGB2Term Translate the color code given as argument to + the closest color that can be displayed in the + terminal. The color must be given in the + format #RRGGBB (the hex format of the colors red, + green and blue (the '#' is optional), or + alternatively like rgb(X,X,X) + + Uses the number of colors your terminal is capable + of (or 256 colors for gVim). + + *:HSL2RGB* +:HSL2RGB hsl(h,v,l) Translate the HVL color defined by the string + 'hsl(h,v%,l%)' into a color that the current + terminal can display. Note that the color must be + given in the format 'hsl(HH, V, L)' where HH + defines the Hue as absolute value between 0 and + 255 and V and L represent a percentage for value + and Lightness. + + *:Term2RGB* +:Term2RGB number Translate terminal color to an RGB color + (using the xterm 256 color cube). + + *:ColorContrast* +:ColorContrast Switch between all different color contrast + settings (foreground colors). + *:ColorSwapFgBg* +:ColorSwapFgBg Switch between foreground and background colors. + This will toggle in 3 ways. From Swapping + foreground and background colors, to only + highlighting the foreground color back to normal + foreground background color. + + *:ColorToggle* +:ColorToggle Switch between highlighting colors and no + highlighting. + +============================================================================== +2 Colorizer Configuration *Colorizer-config* +============================================================================== + +2.1 Automatic loading *Colorizer-auto* +--------------------- + +The Colorizer plugin can be configured to automatically load when opening a +new file. Note that this might slow down the loading process, especially on +the terminal. To enable this, simply set the variable 'g:colorizer_auto_color' +to 1, e.g. by defining it in your |.vimrc| > + + :let g:colorizer_auto_color = 1 +< +(Not recommended, see below at |Colorizer-hl-ft| for the preferred way) + +2.2 Automatically highlight filetypes *Colorizer-hl-ft* +------------------------------------- + +If you want to have certain filetypes automatically highlighted, you can use +the variable g:colorizer_auto_filetype, e.g. to enable highlighting for +HTML and CSS files by default, add the following to your |.vimrc|: > + + :let g:colorizer_auto_filetype='css,html' +< +After restarting Vim, the plugin will become active whenever the filetype is +set to either html or css. + +2.3 Skip coloring comments *Colorizer-comments* +-------------------------- + +You can skip comments from being colored by setting the variable +g:colorizer_skip_comments to 1: > + + :let g:colorizer_skip_comments = 1 +< +The plugin will skip all matches of color codes and names that appear inside +comments (this only works when syntax highlighting is enabled |:syn-on|) + +Note however, that if the same color is used inside comments and outside +comments, it will also be highlighted inside the comments, because +coloring is done matching only the color pattern and once this is done outside +of comments, this will also match inside comments. + +2.4 Adjust the contrast *Colorizer-contrast* +----------------------- + +Colorizer can be adjusted to blur the contrast between foreground and +background color. For this, the variable 'g:colorizer_fgcontrast' can be used. +It can be given any value between -1 and 2 with 2 being the default. Each +smaller value will decrease the contrast a little bit, with -1 being special, +as there is the foreground color equals the background color. Use +|:ColorContrast| to cycle through the different values. + +2.5 Highlight colornames *Colorizer-hl-names* +------------------------ + +If for any reason you don't want the plugin to highlight colornames, you can +prevent this by setting the g:colorizer_colornames variable to 0, e.g. put > + + :let g:colorizer_colornames = 0 +< +into your |.vimrc| + +2.6 Use X11 colornames *Colorizer-names* +---------------------- + +Colorizer can be configured to support all color names defined by the X11 +Window System. By default it only supports the colors defined by the W3C for +the CSS specification. To use the X11 color names, set the variable +'g:colorzer_x11_names' to 1, e,g. put in your |.vimrc| > + + let g:colorizer_x11_names = 1 +< + +2.7 Use syntax highlighting *Colorizer-syntax* +--------------------------- + +The plugin by default uses the |matchadd()| functions for highlighting colors +on the fly. Unfortunately, this is a problem, if you want to have the result +successfully transformed to a HTML file using the |2html.vim| plugin. Therefore, +the Colorizer plugin can also convert the highlighting to correct syntax +highlighting. Use either the > + + :ColorHighlight syntax +< +command (see |:ColorHighlight|) or set the variable 'g:colorizer_syntax' to 1, +e.g. in your |.vimrc| put > + + let g:colorizer_syntax = 1 +< + +2.8 Specify pattern to highlight *Colorizer-pattern* +-------------------------------- + +By default, Colorizer detects the following patterns and highlights them as +hex colors (for better readability it is separated into 3 parts): > + + # %(\x\{3}\|\x\{6}\) \%(\>\|[-_]\)\@=/' +< + +This means it always looks for a '#' followed by either a 3 or 6 hexadecimal +digits denoting the RGB hex color codes, followed by either the word-boundary +(|/\>|), a hyphen or a underscore. But only the first and middle part will be +highlighted (i.e. the RGB color codes). + +You can of course specify a different pattern for your needs by setting the +g:colorizer_hex_pattern variable. e.g. to display '#RRGGBB' and have all of it +highlighted, use > + + let g:colorizer_hex_pattern = ['#', '\%(\x\{3}\|\x\{6}\)', ''] + +2.9 Colorizing Taskwarrior files *Colorizer-taskwarrior-files* +-------------------------------- + +For taskwarrior files, this plugin can also highlight those colors. By +default, this will only work, if the file name ends with '.theme' + +For an example, see this website: +http://taskwarrior.org/news/182 + +2.10 Colorizing vim syntax files *Colorizer-vim-files* +-------------------------------- + +Colorizer also supports highlighting vim syntax files. For this to work, the +'filetype' must be set to vim, then the plugin tries to identify the colors +and highlight them. + +2.11 Use custom colornames *Colorizer-custom-colornames* +-------------------------- + +You can add separate colornames to be colored. For this to work, set the +variable g:colorizer_custom_colors to your liking, e.g. like this: > + + let g:colorizer_custom_colors = { 'blue': '#ff0000'} + +Guess what, this will color the word blue in red. + +2.12 Colorizing :highlight statements *Colorizer-vim-hi* +------------------------------------- + +Colorizer also supports highlighting |:hi| statements, that are used by vim +colorschemes and syntax files as well as a dump of the |:hi| command +To colorizer :hi statements, the 'filetype' must be set to vim, while for :hi +dumps, the 'filetype' must be empty. + +============================================================================== +3. Colorizer Mappings *Colorizer-maps* +============================================================================== + +By default, the Colorizer plugin does not map any key, so that it won't +pollute the global mapping namespace. If you want however to have the +following default maps set up, set the global variable g:colorizer_auto_map +in your |.vimrc| like this: > + + :let g:colorizer_auto_map = 1 + +< +This will set up the following key mappings (if they are not already taken): + +Keys Name Function +---- ---- -------- +cC Colorizer Toggle highlighting of Colors. In visual + mode it only highlights the colors in the + selected region (normal and visual mode). +cT ColorContrast Cycle through contrast setting + |:ColorContrast| (normal and visual mode) +cF ColorFgBg Toggle foreground and background color + |:ColorSwapFgBg| + +It uses the prefix c to set all functionality up. By default, +is defined as '\' (||). Use the name provided in the second column to +map the function to a different key. + +============================================================================== +4. Colorizer Tips *Colorizer-tips* +============================================================================== + +You can enable the plugin to be loaded for certain filetypes automatically. +This makes sense for example for CSS files or HTML files. To do so, create the +following autocommand in your |.vimrc| > + + :au BufNewFile,BufRead *.css,*.html,*.htm :ColorHighlight! +< +This will automatically highlight all existing color codes and names if you +edit either a HTML file or a CSS file. Note that this does not update the +highlighting, after you have been changing the file. + +The recommended way to do this is to use the g:colorizer_auto_filetype +variable and set this to the desired filetypes. |Colorizer-hl-ft| + + *Colorizer-slowdown* +---------------- +Slow performance +---------------- +Depending on your file, any of the highlighting functions might cause an +performance decrease. This can be analyed, by setting the variable +g:colorizer_debug to 1 in e.g. your |.vimrc| like this: > + + :let g:colorizer_debug = 1 +< +The next time, you call |:ColorHighlight|, the plugin will output runtime +statistics, from which you can see, which function caused the slowdowns. +Consider this output: + + Colorstatistics at: 12:20 ` + Duration: 0.034110 ` + colornames: 0.030865s ` + hex: 0.000968s ` + hsla: 0.000350s ` + rgb: 0.000354s ` + rgba: 0.000491s ` + taskwarrior: 0.000020s ` + term: 0.000219s ` + term_conceal: 0.000105s ` + vimcolors: 0.000036s ` + vimhighl_dump: 0.000025s ` + vimhighlight: 0.000025s ` + +From this you can see, that the colorname highlighting caused the largest +slowdown, it took 0.03 seconds to complete. This is expected, as the +colornames pattern is long and contains many branches. + +Functions with a value less then 100 have probably been skipped and were not +being executed. + +If you want to skip certain functions, you can set the variable +g:colorizer__disable and then those functions won't be called anymore +(e.g. do disable the colorname highlighting, put in your |.vimrc| this: > + + let g:colorizer_colornames_disable = 1 +< +If the slowdown is still noticeable, you might want to create +a new issue at the plugins repository (|Colorizer-feedback|). You should +provide a sample file, so that I will be able to reproduce the issue. + +Note, this needs a Vim with the |+reltime| feature. +============================================================================== +5. Colorizer Feedback *Colorizer-feedback* +============================================================================== + +Feedback is always welcome. If you like the plugin, please rate it at the +vim-page: http://www.vim.org/scripts/script.php?script_id=3963 + +You can also follow the development of the plugin at github: +http://github.com/chrisbra/color_highlight + +Bugs can also be reported there: +https://github.com/chrisbra/color_highlight/issues + +Alternatively, you can also report any bugs to the maintainer, mentioned in +the third line of this document. Please don't hesitate to contact me, I +won't bite ;) + +If you like the plugin, write me an email (look in the third line for my mail +address). And if you are really happy, vote for the plugin and consider +looking at my Amazon whishlist: http://www.amazon.de/wishlist/2BKAHE8J7Z6UW + +============================================================================== +6. Colorizer History *Colorizer-history* +============================================================================== + +0.12 (unreleased) {{{1 +- TermConceal should also conceal  +- properly escape terminal colors, so that |Colorizer-syntax| works correctly +- use matchaddpos() for highlighting ansi term colors (should speed up vim + highlighting considerably) +- only reset TermConceal syntax group (reported by audriusk in + https://github.com/chrisbra/Colorizer/issues/41, thanks!) +- correctly check for patch 7.4.083 (:keeppatterns modifier, reported by + gbell12 in https://github.com/chrisbra/Colorizer/issues/42, thanks!) +- disable BufLeave autocommand to disable colors +- basic Neovim support (also should work with TrueColor in Terminal) +- Make |:RGB2term| always init colortable, so that when resetting 't_Co' + it will work correctly +- Make it work with Vims Term Truecolor feature (patch 7.4.1770) +- Make it work with neovim fixes https://github.com/chrisbra/Colorizer/issues/45 + and https://github.com/chrisbra/Colorizer/issues/46 +- Support css colors: #rrggbbaa format +- handle hsla values correctly +- clear css cssColor syntax rule when ":ColorHighlight syntax" in css files is + used. fixes https://github.com/chrisbra/Colorizer/issues/50 reported by + msva, thanks! +- make TermConceal also hide the sgr0 attributes (to reset the terminal) + fixes https://github.com/chrisbra/Colorizer/issues/53 reported by + LucHermitte, thanks! +- also conceal and highlight nroff sequences like T^HT (as bold) and _^HT (as + underlined) + +0.11 Jan 15, 2015 {{{1 +- use |TextChanged| autocommand if possible +- Support Ansi True Color support if possible +- Hide ^[[K$ for terminal colors (reported by masukomi at + https://github.com/chrisbra/Colorizer/issues/36, thanks!) +- Do not expand() to expand shellvars (fixed by Daniel Hahler in + https://github.com/chrisbra/Colorizer/issues/37, thanks!) +- Document, how to analyze slowdown |Colorizer-slowdown| +- |:ColorContrast| would error, if the plugin has not been initialized + (reported by Daniel Hahler in + https://github.com/chrisbra/Colorizer/issues/38, thanks!) +- always define reltime variable (reported by mantislin in + https://github.com/chrisbra/Colorizer/issues/39, thanks!) +- Only call conceal function once for ansiterm colors +- reduce calls to DoColor in autocommands (to only do, when something changed) + +0.10 Mar 27, 2014 {{{1 +- Also highlight Ansi Term sequences +- Match colornames using the "old" RE Engine, if Vim supports it. +- Make |:RGB2Xterm| output the color name in its color +- Rename |:RGB2Xterm| to |:RGB2Term| +- Highlight Taskwarrior file +- Code refactoring +- Make |:ColorSwapFgBg| work as expected (did not always toggle reliably + between all states) +- Correctly parse Ansi Term colors +- |:Term2RGB| +- Highlight Vim color files correctly +- merge colorhighlight plugin https://github.com/blueyed/colorhighlight.vim + +0.9: Aug 14, 2013: {{{1 +- https://github.com/chrisbra/color_highlight/issues/15 (rgba highlighting + didn't work for floating point value of alpha, reported by LiTuX.S, thanks!) +- https://github.com/chrisbra/color_highlight/issues/16 (rgb() pattern did + match too much, reported by taecilla, thanks!) +- https://github.com/chrisbra/color_highlight/issues/19 (error on calling + ColorWinEnter() command, reported by wedgwood, thanks!) +- https://github.com/chrisbra/color_highlight/issues/20 and + https://github.com/chrisbra/color_highlight/issues/21 + (also color on split commands, reported by wedgwood and Andri Möll, Thanks!) +- https://github.com/chrisbra/color_highlight/issues/22 (Make sure, patterns + like white-space won't get colored, reported by Andri Möll, Thanks!) +- https://github.com/chrisbra/color_highlight/issues/23 (ColorToggle got + confused when several windows with highlighting exists, reported by Andri + Möll, Thanks!) +- https://github.com/chrisbra/color_highlight/issues/24 (turning off coloring + should also remove the autocommands, reported by Andri Möll, Thanks!) + +0.8: Dec 14, 2012 {{{1 +- https://github.com/chrisbra/color_highlight/issues/13 (colorizing should not + stop at word-boundaries, reported by teschmitz, thanks!) +- https://github.com/chrisbra/color_highlight/issues/14 (convert highlighting + to syntax groups, so TOhtml works, reported by teschmitz, thanks!) + +0.7: Jul 25, 2012 {{{1 +- Highlight rgb colors with whitespace after comma (reported by sergey-vlasov + in https://github.com/chrisbra/color_highlight/issues/12, thanks!) +- Save and restore the search register, so the plugin doesn't clobber it +- check for 'ed' and 'gd' defaults + +0.6: May 17, 2012 {{{1 +- Fix various issues with hsl coloring (reported by teschmitz in + https://github.com/chrisbra/color_highlight/issues/9, thanks!) +- Make it possible, to skip coloring comments (reported by teschmitz in + https://github.com/chrisbra/color_highlight/issues/10, thanks!) +- search highlighting should overrule color highlighting(reported by teschmitz + in https://github.com/chrisbra/color_highlight/issues/11, thanks!) +- updated documentation (suggested by teschmitz, thanks!) + +0.5: Apr 03, 2012 {{{1 +- Fix issue 7 (reported by teschmitz in + https://github.com/chrisbra/color_highlight/issues/7, thanks!) +0.4: Mar, 23, 2012 {{{1 +- |:ColorSwapFgBg| (suggested by teschmitz, in + https://github.com/chrisbra/color_highlight/issues/3, thanks!) +- make automatic color loading work (reported by wedgwood in + https://github.com/chrisbra/color_highlight/issues/6, thanks!) + |Colorizer-auto| and |Colorizer-hl-ft| +- more documentation updates +- added Mappings (suggested by Ingo Karkat, thanks!) |Colorizer-maps| +- prevent highlighting of color names (suggested by Tarlika Schmitz in + https://github.com/chrisbra/color_highlight/issues/5, thanks!) + |Colorizer-hl-names| +- enable filetype specific autocommands, so that for certain filetypes + colors are highlighted automatically |Colorizer-hl-ft| + (suggested by Tarlika Schmitz, thanks!) + +0.3: Mar 15, 2012 {{{1 +- Use the g:colorizer_fgcontrast variable to have lesser contrast between + foreground and background colors (patch by Ingo Karkat, thanks!) +- gvim did not color rgb(...) codes +- did not correctly highlight 3 letter color codes (issue + https://github.com/chrisbra/color_highlight/issues/1, + reported by Taybin Rutkin, thanks!) +- support autoloading (requested by Ingo Karkat, thanks!) +- add |GLVS| support +- |:ColorContrast| to interactively switch between contrast settings + (suggested by Ingo Karkat, thanks!) +0.2: Mar 02, 2012 {{{1 + +- Initial upload +- development versions are available at the github repository +- put plugin on a public repository + (http://github.com/chrisbra/color_highlight) + +0.1: Mar 02, 2012 {{{1 +- first internal version + }}} +============================================================================== +Modeline: +vim:tw=78:ts=8:ft=help:et:fdm=marker:fdl=0:norl diff --git a/plugin/ColorizerPlugin.vim b/plugin/ColorizerPlugin.vim new file mode 100644 index 0000000..cd9dab0 --- /dev/null +++ b/plugin/ColorizerPlugin.vim @@ -0,0 +1,95 @@ +" Plugin: Highlight Colornames and Values +" Maintainer: Christian Brabandt +" URL: http://www.github.com/chrisbra/color_highlight +" Last Change: Thu, 15 Jan 2015 21:49:17 +0100 +" Licence: Vim License (see :h License) +" Version: 0.11 +" GetLatestVimScripts: 3963 11 :AutoInstall: Colorizer.vim +" +" This plugin was inspired by the css_color.vim plugin from Nikolaus Hofer. +" Changes made: - make terminal colors work more reliably and with all +" color terminals +" - performance improvements, coloring is almost instantenously +" - detect rgb colors like this: rgb(R,G,B) +" - detect hsl coloring: hsl(H,V,L) +" - fix small bugs + +" Init some variables "{{{1 +" Plugin folklore "{{{2 +if v:version < 700 || exists("g:loaded_colorizer") || &cp + finish +endif +let g:loaded_colorizer = 1 + +let s:cpo_save = &cpo +set cpo&vim + +" helper functions "{{{1 +fu! ColorHiArgs(A,L,P) + return "syntax\nmatch\nnosyntax\nnomatch" +endfu + +" define commands "{{{1 +command! -bang -range=% -nargs=? -complete=custom,ColorHiArgs ColorHighlight + \ :call Colorizer#DoColor(, , , ) +command! -bang -nargs=1 RGB2Term + \ :call Colorizer#RGB2Term(, ) +command! -nargs=1 Term2RGB :call Colorizer#Term2RGB() + +command! -bang ColorClear :call Colorizer#ColorOff() +command! -bang ColorToggle :call Colorizer#ColorToggle() +command! -nargs=1 HSL2RGB :call Colorizer#HSL2Term() +command! ColorContrast :call Colorizer#SwitchContrast() +command! ColorSwapFgBg :call Colorizer#SwitchFGBG() + +" define mappings "{{{1 +nnoremap Colorizer :ColorToggle +xnoremap Colorizer :ColorHighlight +nnoremap ColorContrast :ColorContrast +xnoremap ColorContrast :ColorContrast +nnoremap ColorFgBg :ColorSwapFgBg +xnoremap ColorFgBg :ColorSwapFgBg + +if get(g:, 'colorizer_auto_map', 0) + " only map, if the mapped keys are not yet taken by a different plugin + " and the user hasn't mapped the function to different keys + if empty(maparg('cC', 'n')) && empty(hasmapto('Colorizer', 'n')) + nmap cC Colorizer + endif + if empty(maparg('cC', 'x')) && empty(hasmapto('Colorizer', 'x')) + xmap cC Colorizer + endif + if empty(maparg('cT', 'n')) && empty(hasmapto('ColorContrast', 'n')) + nmap cT ColorContrast + endif + if empty(maparg('cT', 'x')) && empty(hasmapto('ColorContrast', 'n')) + xmap cT ColorContrast + endif + if empty(maparg('cF', 'n')) && empty(hasmapto('ColorFgBg', 'n')) + nmap cF ColorFgBg + endif + if empty(maparg('cF', 'x')) && empty(hasmapto('ColorFgBg', 'x')) + xmap cF ColorFgBg + endif +endif + +" Enable Autocommands "{{{1 +if exists("g:colorizer_auto_color") + " Prevent autoloading + exe "call Colorizer#AutoCmds(g:colorizer_auto_color)" +endif + +if exists("g:colorizer_auto_filetype") + " Setup some autocommands for specific filetypes. + aug FT_ColorizerPlugin + au! + exe "au Filetype" g:colorizer_auto_filetype + \ "call Colorizer#LocalFTAutoCmds(1)\| + \ :ColorHighlight" + aug END +endif + +" Plugin folklore and Vim Modeline " {{{1 +let &cpo = s:cpo_save +unlet s:cpo_save +" vim: set foldmethod=marker et fdl=0: From e908fbede4aa164cce73f00674c9cdddcdda9718 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 11 Feb 2018 07:52:03 +0800 Subject: [PATCH 097/160] Add some comment --- .tidy.conf | 5 +++++ .vimrc | 1 + 2 files changed, 6 insertions(+) diff --git a/.tidy.conf b/.tidy.conf index 30a3e97..5db6333 100644 --- a/.tidy.conf +++ b/.tidy.conf @@ -3,3 +3,8 @@ // 忽略空元素报警 drop-empty-elements: no + +// template报警 +show-body-only: yes +vertical-space yes +fix-url: no diff --git a/.vimrc b/.vimrc index 9753745..df821cf 100644 --- a/.vimrc +++ b/.vimrc @@ -230,6 +230,7 @@ let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' let g:ale_python_pylint_use_global = 1 " tidy let g:ale_html_tidy_options = '-q -e -language en -config ~/.vim/.tidy.conf' +" 禁用某些插件, 目前只能使用白名单(ale_linters, ale_linters_explicit) " 错误移动 From b0a7324d41bf51888ba2b01a339a7bfaf8ac0d34 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 15 Feb 2018 12:00:54 +0800 Subject: [PATCH 098/160] Update vim-gitgutter --- .gitmodules | 6 +++--- bundle/vim-gitgutter | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0204ad8..eb426a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,9 +34,6 @@ [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git -[submodule "bundle/vim-gitgutter"] - path = bundle/vim-gitgutter - url = git://github.com/airblade/vim-gitgutter.git [submodule "bundle/bash-support.vim"] path = bundle/bash-support.vim url = https://github.com/vim-scripts/bash-support.vim.git @@ -87,3 +84,6 @@ path = bundle/Colorizer url = https://github.com/chrisbra/Colorizer.git ignore = dirty +[submodule "bundle/vim-gitgutter"] + path = bundle/vim-gitgutter + url = https://github.com/airblade/vim-gitgutter.git diff --git a/bundle/vim-gitgutter b/bundle/vim-gitgutter index f7ea5f4..85f6e13 160000 --- a/bundle/vim-gitgutter +++ b/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit f7ea5f40a680797b0ad8d78ec972e32cf17e63c7 +Subproject commit 85f6e136bd08e9dd91490c2edd780d79f822f82f From 703e8926d52ba4087ba56fe21450e6aac539b7ab Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 21 Feb 2018 07:44:11 +0800 Subject: [PATCH 099/160] Update vim --- .gitmodules | 3 +++ .vimrc | 40 ++++++++++++++++++++++++++++++++-------- bundle/vimcdoc | 1 + 3 files changed, 36 insertions(+), 8 deletions(-) create mode 160000 bundle/vimcdoc diff --git a/.gitmodules b/.gitmodules index 0204ad8..37c3feb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -87,3 +87,6 @@ path = bundle/Colorizer url = https://github.com/chrisbra/Colorizer.git ignore = dirty +[submodule "bundle/vimcdoc"] + path = bundle/vimcdoc + url = https://github.com/yianwillis/vimcdoc.git diff --git a/.vimrc b/.vimrc index df821cf..7ec3433 100644 --- a/.vimrc +++ b/.vimrc @@ -219,8 +219,8 @@ let g:ale_echo_msg_warning_str = 'W' let g:ale_echo_msg_format = '%...code...%: [%linter%] %%s [%severity%]' " use quickfix list instead of the loclist let g:ale_set_loclist = 0 -let g:ale_set_quickfix = 1 -let g:ale_open_list = 1 +let g:ale_set_quickfix = 0 +let g:ale_open_list = 0 let g:ale_keep_list_window_open = 0 " help ale-python 信息 @@ -731,10 +731,11 @@ nmap rw " 所有窗口登高等宽 nmap =w = " 高度-N -nmap s_ :resize -20 -nmap s+ :resize +20 -nmap v_ :vertical resize -20 -nmap v+ :vertical resize +20 +nmap s_ :resize -10 +nmap s+ :resize +10 +" 宽度 +nmap v_ :vertical resize -10 +nmap v+ :vertical resize +10 " preview window close nmap pc :pc @@ -765,14 +766,37 @@ autocmd FileType javascript setlocal ts=2 sts=2 sw=2 " html基本框架 " imap html5 :html:5, - - if $VIM_CRONTAB == "true" set nobackup set nowritebackup endif +"""""""""""""""""""""""""""""""""""""""""""""" +" ---> 大文件 +"""""""""""""""""""""""""""""""""""""""""""""" +" Protect large files from sources and other overhead. +" Files become read only +if !exists("my_auto_commands_loaded") + let my_auto_commands_loaded = 1 + " Large files are > 10M + " Set options: + " eventignore+=FileType (no syntax highlighting etc + " assumes FileType always on) + " noswapfile (save copy of file) + " bufhidden=unload (save memory when other file is viewed) + " buftype=nowrite (file is read-only) + " undolevels=-1 (no undo possible) + let g:LargeFile = 1024 * 1024 * 10 + augroup LargeFile + autocmd BufReadPre * let f=expand("") | if getfsize(f) > g:LargeFile + \| set eventignore+=FileType + \| setlocal noswapfile bufhidden=unload buftype=nowrite undolevels=-1 + \| else | set eventignore-=FileType | endif + augroup END +endif + + """""""""""""""""""""""""""""""""""""""""""""" " --->>> bamboo.vim的配置(建议放在最后) " 1,设置tags的加载,不同的语言加载不同的tags diff --git a/bundle/vimcdoc b/bundle/vimcdoc new file mode 160000 index 0000000..0bb5afe --- /dev/null +++ b/bundle/vimcdoc @@ -0,0 +1 @@ +Subproject commit 0bb5afe5249c561e034308686f6f022ac0df3de1 From 90924f582f7d5c4e5115991f5cdcbec9cd0756e0 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 2 Mar 2018 16:22:19 +0800 Subject: [PATCH 100/160] Update .gitignore --- .gitignore | 3 ++- .vimrc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3b569ae..26830e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .netrwhist - +tags +cscope.* diff --git a/.vimrc b/.vimrc index 7ec3433..83835fe 100644 --- a/.vimrc +++ b/.vimrc @@ -255,7 +255,8 @@ noremap ep :ALEPrevious """"""""""""""""""""""""""""""""""""""" " vim-surround配置 -" 见印象笔记中的说明 +" 见help surround +" 主页: https://github.com/tpope/vim-surround """"""""""""""""""""""""""""""""""""""" " 没有特殊的配置,不要文档中的custom configure @@ -610,7 +611,8 @@ noremap hl :nohlsearch:echo "突出高亮显示当前行 set cursorline " 插入时间 -nnoremap date "=strftime("%Y-%m-%d %T")p +nnoremap date "=strftime("%Y-%m-%d")p +nnoremap time "=strftime("%Y-%m-%d %T")p " 设置黑色背景,保证告警文本的效果能够更加显著 set background=dark From f1d421882b584231eeda055fffec46c2411b587f Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sun, 4 Mar 2018 10:02:13 +0800 Subject: [PATCH 101/160] Fix bug --- .vimrc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.vimrc b/.vimrc index 83835fe..baf0a65 100644 --- a/.vimrc +++ b/.vimrc @@ -54,19 +54,19 @@ vnoremap json :'<,'>!python -m json.tool " ---> jsbeautify: 对css,javascript, html进行格式化 """"""""""""""""""""""""""""""""""""""""""""""""""""""" let g:editorconfig_Beautifier = '~/.vim/.editorconfig' -" map :call JsBeautify() +map :call JsBeautify() " 映射(可以配置vnormap) autocmd FileType javascript noremap :call JsBeautify() autocmd FileType json noremap :call JsonBeautify() autocmd FileType jsx noremap :call JsxBeautify() autocmd FileType html noremap :call HtmlBeautify() autocmd FileType css noremap :call CSSBeautify() -" 自动格式化 -autocmd FileType javascript :call JsBeautify() -autocmd FileType json :call JsonBeautify() -autocmd FileType jsx :call JsxBeautify() -autocmd FileType html :call HtmlBeautify() -autocmd FileType css :call CSSBeautify() +" 自动格式化, 关闭自动格式化(会导致其他问题) +" autocmd FileType javascript :call JsBeautify() +" autocmd FileType json :call JsonBeautify() +" autocmd FileType jsx :call JsxBeautify() +" autocmd FileType html :call HtmlBeautify() +" autocmd FileType css :call CSSBeautify() """"""""""""""""""""""""""""""""""""""""""""""""""""""" From 4bb6cbb1a901ac8f2bea9c73d173ef5c70b65134 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 23 Mar 2018 21:58:15 +0800 Subject: [PATCH 102/160] Rename tagslist --- .gitmodules | 7 +++---- bundle/{taglist => taglist.vim} | 0 2 files changed, 3 insertions(+), 4 deletions(-) rename bundle/{taglist => taglist.vim} (100%) diff --git a/.gitmodules b/.gitmodules index 9fa10d0..c3e5533 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,10 +34,6 @@ path = bundle/vim-colors-solarized url = https://github.com/altercation/vim-colors-solarized.git ignore = dirty -[submodule "bundle/taglist"] - path = bundle/taglist - url = https://github.com/vim-scripts/taglist.vim.git - ignore = dirty [submodule "bundle/vim-surround"] path = bundle/vim-surround url = https://github.com/tpope/vim-surround.git @@ -106,3 +102,6 @@ path = bundle/vim-gitgutter url = https://github.com/airblade/vim-gitgutter.git ignore = dirty +[submodule "bundle/taglist.vim"] + path = bundle/taglist.vim + url = https://github.com/vim-scripts/taglist.vim.git diff --git a/bundle/taglist b/bundle/taglist.vim similarity index 100% rename from bundle/taglist rename to bundle/taglist.vim From 0532ab77e1e2bc7128499dd1f7b319b6210e8d2a Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 23 Mar 2018 22:01:02 +0800 Subject: [PATCH 103/160] Update --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index c3e5533..2588474 100644 --- a/.gitmodules +++ b/.gitmodules @@ -105,3 +105,4 @@ [submodule "bundle/taglist.vim"] path = bundle/taglist.vim url = https://github.com/vim-scripts/taglist.vim.git + ignore = dirty From a344b85a2cfb01d7fff0f6a7f88f13e8b3723fde Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 26 Mar 2018 13:37:56 +0800 Subject: [PATCH 104/160] Open auto check of ale plugins --- .vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index baf0a65..87909f3 100644 --- a/.vimrc +++ b/.vimrc @@ -219,9 +219,9 @@ let g:ale_echo_msg_warning_str = 'W' let g:ale_echo_msg_format = '%...code...%: [%linter%] %%s [%severity%]' " use quickfix list instead of the loclist let g:ale_set_loclist = 0 -let g:ale_set_quickfix = 0 -let g:ale_open_list = 0 -let g:ale_keep_list_window_open = 0 +let g:ale_set_quickfix = 1 +let g:ale_open_list = 1 +let g:ale_keep_list_window_open = 1 " help ale-python 信息 " 指定pylintrc位置 From 38c1d43fb603f0dcc7e018900debea6ba24ff95b Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 26 Mar 2018 13:39:03 +0800 Subject: [PATCH 105/160] Fix bugs --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 87909f3..e883c0a 100644 --- a/.vimrc +++ b/.vimrc @@ -221,7 +221,7 @@ let g:ale_echo_msg_format = '%...code...%: [%linter%] %%s [%severity%]' let g:ale_set_loclist = 0 let g:ale_set_quickfix = 1 let g:ale_open_list = 1 -let g:ale_keep_list_window_open = 1 +let g:ale_keep_list_window_open = 0 " help ale-python 信息 " 指定pylintrc位置 From 87316d0a4ba3b626391771fca27977e1089ba315 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Mon, 26 Mar 2018 19:31:13 +0800 Subject: [PATCH 106/160] Add new pylint load plugins: pylint_flask --- .pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 41cd6dd..c842151 100644 --- a/.pylintrc +++ b/.pylintrc @@ -20,7 +20,7 @@ persistent=yes # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins=pylint_django +load-plugins=pylint_flask # Use multiple processes to speed up Pylint. jobs=1 @@ -65,7 +65,6 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -# disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return [REPORTS] From 457e599fa3469fe4aad71f6b4a9845a4d796a65a Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 30 Mar 2018 10:29:33 +0800 Subject: [PATCH 107/160] Update some configure --- .flake8 | 2 +- .pylintrc | 6 +++--- .vimrc | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.flake8 b/.flake8 index b7a7998..d924a84 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 120 -ignore = E402,W291,F401,E722 +ignore = E402,W291,F401,E722,F841 diff --git a/.pylintrc b/.pylintrc index c842151..bbe3e43 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return,wrong-import-position,unused-variable,method-hidden,line-too-long [REPORTS] @@ -282,12 +282,12 @@ ignored-modules= # for classes with dynamically set attributes). This supports the use of # qualified names. # 因为测试用例中的SimpleResponse,从而过滤WSGIRequest类 -ignored-classes=optparse.Values,thread._local,_thread._local,WSGIRequest +ignored-classes=optparse.Values,thread._local,_thread._local,WSGIRequest,SQLAlchemy, scoped_session # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E1101 when accessed. Python regular # expressions are accepted. -generated-members= +generated-members=query # List of decorators that produce context managers, such as # contextlib.contextmanager. Add to this list to register other decorators that diff --git a/.vimrc b/.vimrc index e883c0a..a3df86a 100644 --- a/.vimrc +++ b/.vimrc @@ -733,11 +733,11 @@ nmap rw " 所有窗口登高等宽 nmap =w = " 高度-N -nmap s_ :resize -10 -nmap s+ :resize +10 +nmap s_ :resize -20 +nmap s+ :resize +20 " 宽度 -nmap v_ :vertical resize -10 -nmap v+ :vertical resize +10 +nmap v_ :vertical resize -20 +nmap v+ :vertical resize +20 " preview window close nmap pc :pc From 9b7dce95749157212a2b8accc1d7e30901258728 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 30 Mar 2018 19:58:13 +0800 Subject: [PATCH 108/160] Update some profile --- .flake8 | 2 +- .pylintrc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index d924a84..a3b379f 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] -max-line-length = 120 +max-line-length = 200 ignore = E402,W291,F401,E722,F841 diff --git a/.pylintrc b/.pylintrc index bbe3e43..2cd503e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -32,7 +32,7 @@ unsafe-load-any-extension=no # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code -extension-pkg-whitelist= +extension-pkg-whitelist=lxml # Allow optimization of some AST trees. This will activate a peephole AST # optimizer, which will apply various small optimizations. For instance, it can @@ -65,7 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return,wrong-import-position,unused-variable,method-hidden,line-too-long +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return,wrong-import-position,unused-variable,method-hidden,line-too-long,inconsistent-return-statements [REPORTS] From c3932c5c963ffc8c715020f0d3d3a275bf37926f Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sat, 31 Mar 2018 17:33:00 +0800 Subject: [PATCH 109/160] Update YCM --- .gitmodules | 10 +++------- bundle/YouCompleteMe | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2588474..64a0ee6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,10 +46,6 @@ path = bundle/vim-pydocstring url = https://github.com/heavenshell/vim-pydocstring.git ignore = dirty -[submodule "bundle/YouCompleteMe"] - path = bundle/YouCompleteMe - url = https://github.com/Valloric/YouCompleteMe.git - ignore = dirty [submodule "bundle/vim-instant-markdown"] path = bundle/vim-instant-markdown url = https://github.com/suan/vim-instant-markdown.git @@ -102,7 +98,7 @@ path = bundle/vim-gitgutter url = https://github.com/airblade/vim-gitgutter.git ignore = dirty -[submodule "bundle/taglist.vim"] - path = bundle/taglist.vim - url = https://github.com/vim-scripts/taglist.vim.git +[submodule "bundle/YouCompleteMe"] + path = bundle/YouCompleteMe + url = https://github.com/Valloric/YouCompleteMe.git ignore = dirty diff --git a/bundle/YouCompleteMe b/bundle/YouCompleteMe index d02de4b..3a76021 160000 --- a/bundle/YouCompleteMe +++ b/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit d02de4b399eec80f28142ce39481be585ef3627f +Subproject commit 3a760212cb306655780a2c3be6412890ba5cf89b From 11e10e0a855a57aa1336efa60fd725509c37887a Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sat, 31 Mar 2018 17:44:38 +0800 Subject: [PATCH 110/160] Update taglist --- .gitmodules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 64a0ee6..81a77f9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,10 +6,6 @@ path = bundle/nerdcommenter url = https://github.com/scrooloose/nerdcommenter.git ignore = dirty -[submodule "taglist"] - path = taglist - url = https://github.com/vim-scripts/taglist.vim.git - ignore = dirty [submodule "bundle/winmanager"] path = bundle/winmanager url = https://github.com/vim-scripts/winmanager.git @@ -102,3 +98,7 @@ path = bundle/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git ignore = dirty +[submodule "bundle/taglist.vim"] + path = bundle/taglist.vim + url = https://github.com/vim-scripts/taglist.vim.git + ignore = dirty From bcf55d34bfc17799cbed2b3a20c28efd67fef89b Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Tue, 3 Apr 2018 10:16:42 +0800 Subject: [PATCH 111/160] Add toml --- .gitmodules | 4 ++++ bundle/vim-toml | 1 + 2 files changed, 5 insertions(+) create mode 160000 bundle/vim-toml diff --git a/.gitmodules b/.gitmodules index 81a77f9..9b55343 100644 --- a/.gitmodules +++ b/.gitmodules @@ -102,3 +102,7 @@ path = bundle/taglist.vim url = https://github.com/vim-scripts/taglist.vim.git ignore = dirty +[submodule "bundle/vim-toml"] + path = bundle/vim-toml + url = https://github.com/cespare/vim-toml.git + ignore = dirty diff --git a/bundle/vim-toml b/bundle/vim-toml new file mode 160000 index 0000000..624f024 --- /dev/null +++ b/bundle/vim-toml @@ -0,0 +1 @@ +Subproject commit 624f02475080ea26d9430b8d31d7c3199b0ec939 From 9641b2616b6e442080d991740b18cfe38ccabc81 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 19 Apr 2018 11:55:18 +0800 Subject: [PATCH 112/160] Add new mmap --- .pylintrc | 2 +- .vimrc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 2cd503e..a5d9a67 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return,wrong-import-position,unused-variable,method-hidden,line-too-long,inconsistent-return-statements +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return,wrong-import-position,unused-variable,method-hidden,line-too-long,inconsistent-return-statements,too-many-lines,useless-else-on-loop [REPORTS] diff --git a/.vimrc b/.vimrc index a3df86a..d9a8da7 100644 --- a/.vimrc +++ b/.vimrc @@ -227,7 +227,7 @@ let g:ale_keep_list_window_open = 0 " 指定pylintrc位置 let g:ale_python_pylint_options = '--rcfile ~/.vim/.pylintrc' " 启用virtualenv -let g:ale_python_pylint_use_global = 1 +let g:ale_python_pylint_use_global = 0 " tidy let g:ale_html_tidy_options = '-q -e -language en -config ~/.vim/.tidy.conf' " 禁用某些插件, 目前只能使用白名单(ale_linters, ale_linters_explicit) @@ -640,6 +640,12 @@ nmap wa :wa " 仅仅在下拉菜单中显示匹配项目,自动插入所有匹配项目的相同文本 set completeopt=longest,menu +" 映射文件移动命令 +nmap mo3 :30% +nmap mo5 :50% +nmap mo8 :80% + + """""""""""""""""""""""""""""""""""""""""""""" " ---> 折叠配置 """""""""""""""""""""""""""""""""""""""""""""" From 8a1355d3e9f91c1e803e3583d1a029ca98ae1032 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 19 Apr 2018 14:13:17 +0800 Subject: [PATCH 113/160] Fix bugs --- .vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index d9a8da7..e99df67 100644 --- a/.vimrc +++ b/.vimrc @@ -641,9 +641,9 @@ nmap wa :wa set completeopt=longest,menu " 映射文件移动命令 -nmap mo3 :30% -nmap mo5 :50% -nmap mo8 :80% +nmap mo3 :30% +nmap mo5 :50% +nmap mo8 :80% """""""""""""""""""""""""""""""""""""""""""""" From bf076e762c9199f650a16837c921cc9b290e5a32 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 19 Apr 2018 14:14:55 +0800 Subject: [PATCH 114/160] Fix bugs --- .vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index e99df67..858b621 100644 --- a/.vimrc +++ b/.vimrc @@ -641,9 +641,9 @@ nmap wa :wa set completeopt=longest,menu " 映射文件移动命令 -nmap mo3 :30% -nmap mo5 :50% -nmap mo8 :80% +nmap mo3 30% +nmap mo5 50% +nmap mo8 80% """""""""""""""""""""""""""""""""""""""""""""" From d2a45924591a9263254bf3d469006084be0628fe Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 25 Apr 2018 20:05:47 +0800 Subject: [PATCH 115/160] Add dockerfile filetype support --- .vimrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 858b621..0b3ef8c 100644 --- a/.vimrc +++ b/.vimrc @@ -69,6 +69,14 @@ autocmd FileType css noremap :call CSSBeautify() " autocmd FileType css :call CSSBeautify() + +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" ---> filetype +""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" set dockerfile if find *Dockerfile +autocmd BufNewFile,BufRead *Dockerfile set filetype=dockerfile + + """"""""""""""""""""""""""""""""""""""""""""""""""""""" " ---> vim-instant-markdown """"""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -232,12 +240,17 @@ let g:ale_python_pylint_use_global = 0 let g:ale_html_tidy_options = '-q -e -language en -config ~/.vim/.tidy.conf' " 禁用某些插件, 目前只能使用白名单(ale_linters, ale_linters_explicit) - " 错误移动 noremap ef :ALEFirst noremap en :ALENext noremap el :ALELast noremap ep :ALEPrevious +" 关闭自动打开错误quickfix +" noremap ec :call BambooDisableAleQuickfix() +" function BambooDisableAleQuickfix() +" let g:ale_set_quickfix = 0 +" let g:ale_open_list = 0 +" endfunc From 619880c40ccf339ab6984b0d58b22dacda83baec Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Sat, 5 May 2018 11:29:40 +0800 Subject: [PATCH 116/160] Update cscope key map --- .vimrc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.vimrc b/.vimrc index 0b3ef8c..8412b7e 100644 --- a/.vimrc +++ b/.vimrc @@ -270,6 +270,7 @@ noremap ep :ALEPrevious " vim-surround配置 " 见help surround " 主页: https://github.com/tpope/vim-surround +" 单引号/双引号/标签的快速操作 """"""""""""""""""""""""""""""""""""""" " 没有特殊的配置,不要文档中的custom configure @@ -341,14 +342,18 @@ if has("cscope") set csverb endif " 可以手动输入:cs f s stringA -nmap s :cs find s =expand("") -nmap g :cs find g =expand("") -nmap c :cs find c =expand("") -nmap t :cs find t =expand("") -nmap e :cs find e =expand("") -nmap f :cs find f =expand("") -nmap i :cs find i ^=expand("")$ -nmap d :cs find d =expand("") +" 查找该符号所有出现的地方 +nmap css :cs find s =expand("") +" 查找该符号定义的地方 +nmap csg :cs find g =expand("") +" 查找调用该符号的函数 +nmap csc :cs find c =expand("") +" 查找该字符串, 比cs find s更加全面 +nmap cst :cs find t =expand("") +nmap cse :cs find e =expand("") +nmap csf :cs find f =expand("") +nmap csi :cs find i ^=expand("")$ +nmap csd :cs find d =expand("") """"""""""""""""""""""""""""""""""""""""" " ---> 标签配置3 From 5f8b8b40a74592b33e7de2fd4d88e16e58a435f5 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 17 May 2018 08:39:02 +0800 Subject: [PATCH 117/160] Update --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index 8412b7e..33b9677 100644 --- a/.vimrc +++ b/.vimrc @@ -614,6 +614,7 @@ noremap sa :Explore " 关于expand, 见印象笔记 noremap cf :let @+=expand("%") noremap cp :let @+=expand("%:p") +noremap ct :let @+=expand("%:t") From 9a569a4d5700fe4fd29c76107af0866ef1b7f485 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 1 Jun 2018 10:22:19 +0800 Subject: [PATCH 118/160] Update pylintrc --- .pylintrc | 2 +- .vimrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index a5d9a67..84321e0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,unused-import,super-init-not-called,no-else-return,wrong-import-position,unused-variable,method-hidden,line-too-long,inconsistent-return-statements,too-many-lines,useless-else-on-loop +disable=missing-docstring,invalid-name,no-init,protected-access,no-self-use,unused-argument,broad-except,logging-format-interpolation,too-many-return-statements,too-many-locals,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-function-args,too-many-public-methods,fixme,too-many-branches,too-many-statements,too-many-boolean-expressions,old-style-class,too-many-nested-blocks,arguments-differ,attribute-defined-outside-init,too-many-ancestors,super-init-not-called,no-else-return,wrong-import-position,method-hidden,line-too-long,inconsistent-return-statements,too-many-lines,useless-else-on-loop [REPORTS] diff --git a/.vimrc b/.vimrc index 33b9677..cd4d64b 100644 --- a/.vimrc +++ b/.vimrc @@ -629,7 +629,7 @@ set hlsearch noremap hl :nohlsearch:echo "突出高亮显示当前行 set cursorline -" 插入时间 +" 插入时间, 使用UTC时间来表示 nnoremap date "=strftime("%Y-%m-%d")p nnoremap time "=strftime("%Y-%m-%d %T")p From ec04d78b812e7b35248c1f05204b68b5fa6a1e14 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Thu, 12 Jul 2018 17:16:06 +0800 Subject: [PATCH 119/160] Delete vim-gitgutter, it not fit me --- .gitmodules | 4 ---- bundle/vim-gitgutter | 1 - 2 files changed, 5 deletions(-) delete mode 160000 bundle/vim-gitgutter diff --git a/.gitmodules b/.gitmodules index 9b55343..a4ffeb6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -90,10 +90,6 @@ path = bundle/vimcdoc url = https://github.com/yianwillis/vimcdoc.git ignore = dirty -[submodule "bundle/vim-gitgutter"] - path = bundle/vim-gitgutter - url = https://github.com/airblade/vim-gitgutter.git - ignore = dirty [submodule "bundle/YouCompleteMe"] path = bundle/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git diff --git a/bundle/vim-gitgutter b/bundle/vim-gitgutter deleted file mode 160000 index f7ea5f4..0000000 --- a/bundle/vim-gitgutter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f7ea5f40a680797b0ad8d78ec972e32cf17e63c7 From 83c411746d8fe955278220327a5610e0905f2bee Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 25 Jul 2018 19:24:58 +0800 Subject: [PATCH 120/160] Add xml autocommand into vimrc --- .vimrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.vimrc b/.vimrc index cd4d64b..43d6b8e 100644 --- a/.vimrc +++ b/.vimrc @@ -787,6 +787,15 @@ autocmd FileType htmldjango setlocal ts=4 sts=4 sw=4 autocmd FileType css setlocal ts=2 sts=2 sw=2 autocmd FileType ruby setlocal ts=2 sts=2 sw=2 autocmd FileType javascript setlocal ts=2 sts=2 sw=2 + + +""""""""""""""""""""""""""""""""""""""" +" --->>> xml +""""""""""""""""""""""""""""""""""""""" +" 使用xmllint对选择的文本自动进行xml, 之后执行==G就能格式化 +au FileType xml setlocal equalprg=xmllint\ --format\ --recover\ -\ 2>/dev/null + + """"""""""""""""""""""""""""""""""""""" " --->>> Emmet-vim """"""""""""""""""""""""""""""""""""""" From 71d58b0a5babe7f6b42a1287147fcaf8bd987e63 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Fri, 17 Aug 2018 11:59:56 +0800 Subject: [PATCH 121/160] Add django-plus --- .gitmodules | 3 +++ bundle/django-plus.vim | 1 + 2 files changed, 4 insertions(+) create mode 160000 bundle/django-plus.vim diff --git a/.gitmodules b/.gitmodules index a4ffeb6..31395a3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -102,3 +102,6 @@ path = bundle/vim-toml url = https://github.com/cespare/vim-toml.git ignore = dirty +[submodule "bundle/django-plus.vim"] + path = bundle/django-plus.vim + url = https://github.com/tweekmonster/django-plus.vim.git diff --git a/bundle/django-plus.vim b/bundle/django-plus.vim new file mode 160000 index 0000000..28a2217 --- /dev/null +++ b/bundle/django-plus.vim @@ -0,0 +1 @@ +Subproject commit 28a22174ae247da089fd0abcb0825f1e5b5d7f64 From f277d4fd8ed83226ca68f52990140f422c5174d6 Mon Sep 17 00:00:00 2001 From: unlessbamboo Date: Wed, 18 Sep 2019 07:46:06 +0800 Subject: [PATCH 122/160] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vimrc | 4 + bundle/eclim/eclim/autoload/eclim.vim | 581 ++++++ .../eclim/eclim/autoload/eclim/c/complete.vim | 38 + .../eclim/eclim/autoload/eclim/c/project.vim | 327 +++ .../eclim/eclim/autoload/eclim/c/search.vim | 118 ++ .../eclim/autoload/eclim/client/nailgun.vim | 160 ++ .../autoload/eclim/client/python/nailgun.py | 213 ++ .../autoload/eclim/client/python/nailgun.vim | 115 + .../eclim/autoload/eclim/common/buffers.vim | 379 ++++ .../eclim/autoload/eclim/common/history.vim | 316 +++ .../eclim/autoload/eclim/common/largefile.vim | 58 + .../eclim/autoload/eclim/common/license.vim | 87 + .../eclim/autoload/eclim/common/locate.vim | 624 ++++++ .../eclim/autoload/eclim/common/template.vim | 237 +++ .../eclim/autoload/eclim/common/util.vim | 255 +++ .../eclim/autoload/eclim/display/fold.vim | 70 + .../eclim/autoload/eclim/display/menu.vim | 103 + .../eclim/autoload/eclim/display/signs.vim | 420 ++++ .../eclim/autoload/eclim/display/window.vim | 350 ++++ bundle/eclim/eclim/autoload/eclim/help.vim | 169 ++ .../eclim/eclim/autoload/eclim/html/util.vim | 135 ++ .../autoload/eclim/java/ant/complete.vim | 144 ++ .../eclim/autoload/eclim/java/ant/doc.vim | 170 ++ .../eclim/autoload/eclim/java/ant/ivy.vim | 31 + .../eclim/autoload/eclim/java/ant/util.vim | 36 + .../eclim/autoload/eclim/java/classpath.vim | 238 +++ .../eclim/autoload/eclim/java/complete.vim | 169 ++ .../eclim/autoload/eclim/java/correct.vim | 139 ++ .../eclim/eclim/autoload/eclim/java/debug.vim | 783 +++++++ .../eclim/eclim/autoload/eclim/java/doc.vim | 269 +++ .../eclim/autoload/eclim/java/hierarchy.vim | 135 ++ .../eclim/eclim/autoload/eclim/java/impl.vim | 349 ++++ .../eclim/autoload/eclim/java/import.vim | 140 ++ .../eclim/eclim/autoload/eclim/java/junit.vim | 261 +++ .../eclim/autoload/eclim/java/logging.vim | 127 ++ .../eclim/eclim/autoload/eclim/java/maven.vim | 118 ++ .../eclim/eclim/autoload/eclim/java/new.vim | 96 + .../eclim/autoload/eclim/java/outline.vim | 119 ++ .../eclim/autoload/eclim/java/refactor.vim | 120 ++ .../eclim/autoload/eclim/java/search.vim | 378 ++++ .../eclim/eclim/autoload/eclim/java/src.vim | 88 + .../eclim/eclim/autoload/eclim/java/tools.vim | 304 +++ .../eclim/eclim/autoload/eclim/java/util.vim | 352 ++++ bundle/eclim/eclim/autoload/eclim/lang.vim | 640 ++++++ .../eclim/autoload/eclim/lang/hierarchy.vim | 145 ++ .../eclim/autoload/eclim/project/problems.vim | 125 ++ .../eclim/autoload/eclim/project/run.vim | 256 +++ .../eclim/autoload/eclim/project/tree.vim | 517 +++++ .../eclim/autoload/eclim/project/util.vim | 1545 ++++++++++++++ .../eclim/autoload/eclim/python/complete.vim | 32 + .../autoload/eclim/python/django/find.vim | 388 ++++ .../autoload/eclim/python/django/manage.vim | 207 ++ .../autoload/eclim/python/django/template.vim | 109 + .../autoload/eclim/python/django/util.vim | 222 ++ .../eclim/autoload/eclim/python/project.vim | 337 +++ .../eclim/autoload/eclim/python/search.vim | 58 + .../taglisttoo/lang/commonsvalidator.vim | 33 + .../eclim/taglisttoo/lang/cproject.vim | 40 + .../eclim/taglisttoo/lang/eclimhelp.vim | 32 + .../eclim/taglisttoo/lang/forrest.vim | 39 + .../autoload/eclim/taglisttoo/lang/gant.vim | 33 + .../eclim/taglisttoo/lang/hibernate.vim | 37 + .../autoload/eclim/taglisttoo/lang/junit.vim | 33 + .../autoload/eclim/taglisttoo/lang/spring.vim | 33 + .../autoload/eclim/taglisttoo/lang/webxml.vim | 43 + bundle/eclim/eclim/autoload/eclim/tree.vim | 1188 +++++++++++ bundle/eclim/eclim/autoload/eclim/util.vim | 1843 +++++++++++++++++ .../eclim/eclim/autoload/eclim/vimplugin.vim | 82 + bundle/eclim/eclim/autoload/eclim/web.vim | 193 ++ .../eclim/autoload/eclim/xml/definition.vim | 79 + .../eclim/eclim/autoload/eclim/xml/format.vim | 106 + .../eclim/eclim/autoload/eclim/xml/util.vim | 137 ++ .../eclim/autoload/eclim/xml/validate.vim | 75 + bundle/eclim/eclim/bin/bash_complete | 21 + bundle/eclim/eclim/compiler/eclim_ant.vim | 89 + bundle/eclim/eclim/compiler/eclim_javadoc.vim | 46 + bundle/eclim/eclim/compiler/eclim_make.vim | 56 + bundle/eclim/eclim/compiler/eclim_maven.vim | 61 + bundle/eclim/eclim/compiler/eclim_mvn.vim | 56 + bundle/eclim/eclim/compiler/eclim_xmllint.vim | 39 + bundle/eclim/eclim/dict/java | 32 + bundle/eclim/eclim/doc/404.txt | 11 + bundle/eclim/eclim/doc/archive/changes.txt | 1494 +++++++++++++ bundle/eclim/eclim/doc/archive/news.txt | 691 ++++++ bundle/eclim/eclim/doc/changes.txt | 372 ++++ bundle/eclim/eclim/doc/cheatsheet.txt | 349 ++++ bundle/eclim/eclim/doc/contribute.txt | 60 + .../eclim/doc/development/architecture.txt | 38 + .../eclim/eclim/doc/development/commands.txt | 241 +++ .../eclim/doc/development/gettingstarted.txt | 224 ++ bundle/eclim/eclim/doc/development/index.txt | 24 + .../eclim/eclim/doc/development/installer.txt | 38 + .../eclim/eclim/doc/development/plugins.txt | 226 ++ bundle/eclim/eclim/doc/eclimd.txt | 411 ++++ bundle/eclim/eclim/doc/faq.txt | 331 +++ bundle/eclim/eclim/doc/features.txt | 131 ++ bundle/eclim/eclim/doc/gettinghelp.txt | 49 + bundle/eclim/eclim/doc/gettingstarted.txt | 323 +++ bundle/eclim/eclim/doc/index.txt | 167 ++ bundle/eclim/eclim/doc/install.txt | 499 +++++ bundle/eclim/eclim/doc/relatedprojects.txt | 22 + bundle/eclim/eclim/doc/vim/c/complete.txt | 24 + bundle/eclim/eclim/doc/vim/c/index.txt | 30 + bundle/eclim/eclim/doc/vim/c/inspection.txt | 59 + bundle/eclim/eclim/doc/vim/c/project.txt | 62 + bundle/eclim/eclim/doc/vim/c/search.txt | 131 ++ bundle/eclim/eclim/doc/vim/c/validate.txt | 48 + .../eclim/eclim/doc/vim/code_completion.txt | 127 ++ bundle/eclim/eclim/doc/vim/core/eclim.txt | 170 ++ bundle/eclim/eclim/doc/vim/core/history.txt | 85 + bundle/eclim/eclim/doc/vim/core/index.txt | 12 + bundle/eclim/eclim/doc/vim/core/locate.txt | 111 + bundle/eclim/eclim/doc/vim/core/project.txt | 495 +++++ bundle/eclim/eclim/doc/vim/core/util.txt | 220 ++ bundle/eclim/eclim/doc/vim/dltk/buildpath.txt | 55 + .../eclim/eclim/doc/vim/groovy/complete.txt | 16 + bundle/eclim/eclim/doc/vim/groovy/index.txt | 9 + .../eclim/eclim/doc/vim/groovy/validate.txt | 35 + bundle/eclim/eclim/doc/vim/html/index.txt | 159 ++ bundle/eclim/eclim/doc/vim/index.txt | 32 + bundle/eclim/eclim/doc/vim/java/android.txt | 70 + bundle/eclim/eclim/doc/vim/java/ant.txt | 219 ++ bundle/eclim/eclim/doc/vim/java/classpath.txt | 371 ++++ bundle/eclim/eclim/doc/vim/java/complete.txt | 35 + bundle/eclim/eclim/doc/vim/java/debug.txt | 262 +++ bundle/eclim/eclim/doc/vim/java/format.txt | 79 + bundle/eclim/eclim/doc/vim/java/import.txt | 60 + bundle/eclim/eclim/doc/vim/java/index.txt | 57 + .../eclim/eclim/doc/vim/java/inspection.txt | 149 ++ bundle/eclim/eclim/doc/vim/java/java.txt | 109 + bundle/eclim/eclim/doc/vim/java/javadoc.txt | 110 + bundle/eclim/eclim/doc/vim/java/logging.txt | 104 + bundle/eclim/eclim/doc/vim/java/maven.txt | 51 + bundle/eclim/eclim/doc/vim/java/methods.txt | 258 +++ bundle/eclim/eclim/doc/vim/java/refactor.txt | 171 ++ bundle/eclim/eclim/doc/vim/java/search.txt | 239 +++ bundle/eclim/eclim/doc/vim/java/types.txt | 51 + bundle/eclim/eclim/doc/vim/java/unittests.txt | 233 +++ bundle/eclim/eclim/doc/vim/java/validate.txt | 142 ++ bundle/eclim/eclim/doc/vim/java/webxml.txt | 39 + .../eclim/eclim/doc/vim/javascript/index.txt | 66 + bundle/eclim/eclim/doc/vim/php/buildpath.txt | 58 + bundle/eclim/eclim/doc/vim/php/complete.txt | 27 + bundle/eclim/eclim/doc/vim/php/index.txt | 29 + bundle/eclim/eclim/doc/vim/php/search.txt | 112 + bundle/eclim/eclim/doc/vim/php/validate.txt | 57 + .../eclim/eclim/doc/vim/python/complete.txt | 21 + bundle/eclim/eclim/doc/vim/python/django.txt | 285 +++ bundle/eclim/eclim/doc/vim/python/index.txt | 41 + bundle/eclim/eclim/doc/vim/python/path.txt | 100 + bundle/eclim/eclim/doc/vim/python/search.txt | 80 + .../eclim/eclim/doc/vim/python/validate.txt | 47 + bundle/eclim/eclim/doc/vim/refactoring.txt | 42 + bundle/eclim/eclim/doc/vim/ruby/buildpath.txt | 113 + bundle/eclim/eclim/doc/vim/ruby/complete.txt | 25 + bundle/eclim/eclim/doc/vim/ruby/index.txt | 11 + bundle/eclim/eclim/doc/vim/ruby/search.txt | 117 ++ bundle/eclim/eclim/doc/vim/ruby/validate.txt | 48 + bundle/eclim/eclim/doc/vim/scala/complete.txt | 22 + bundle/eclim/eclim/doc/vim/scala/import.txt | 35 + bundle/eclim/eclim/doc/vim/scala/index.txt | 11 + bundle/eclim/eclim/doc/vim/scala/search.txt | 51 + bundle/eclim/eclim/doc/vim/scala/validate.txt | 35 + bundle/eclim/eclim/doc/vim/search.txt | 10 + bundle/eclim/eclim/doc/vim/settings.txt | 38 + bundle/eclim/eclim/doc/vim/validation.txt | 15 + bundle/eclim/eclim/doc/vim/xml/index.txt | 211 ++ bundle/eclim/eclim/ftplugin/ant.vim | 49 + bundle/eclim/eclim/ftplugin/c.vim | 63 + .../eclim/eclim/ftplugin/commonsvalidator.vim | 35 + bundle/eclim/eclim/ftplugin/cpp.vim | 24 + bundle/eclim/eclim/ftplugin/eclimhelp.vim | 37 + .../eclim/ftplugin/eclipse_classpath.vim | 66 + .../eclim/eclim/ftplugin/eclipse_cproject.vim | 76 + .../eclim/eclim/ftplugin/forrestdocument.vim | 37 + bundle/eclim/eclim/ftplugin/forreststatus.vim | 37 + bundle/eclim/eclim/ftplugin/gant.vim | 35 + bundle/eclim/eclim/ftplugin/hibernate.vim | 44 + bundle/eclim/eclim/ftplugin/htmldjango.vim | 100 + bundle/eclim/eclim/ftplugin/htmljinja.vim | 89 + bundle/eclim/eclim/ftplugin/ivy.vim | 47 + bundle/eclim/eclim/ftplugin/java-xml.vim | 40 + bundle/eclim/eclim/ftplugin/java.vim | 257 +++ bundle/eclim/eclim/ftplugin/junitresult.vim | 35 + bundle/eclim/eclim/ftplugin/log4j.vim | 48 + bundle/eclim/eclim/ftplugin/make.vim | 32 + bundle/eclim/eclim/ftplugin/mvn_pom.vim | 40 + bundle/eclim/eclim/ftplugin/pydevproject.vim | 45 + bundle/eclim/eclim/ftplugin/python.vim | 72 + bundle/eclim/eclim/ftplugin/spring.vim | 36 + bundle/eclim/eclim/ftplugin/strutsconfig.vim | 28 + bundle/eclim/eclim/ftplugin/tld.vim | 36 + bundle/eclim/eclim/ftplugin/webxml.vim | 63 + bundle/eclim/eclim/ftplugin/xml.vim | 52 + bundle/eclim/eclim/indent/css.vim | 73 + bundle/eclim/eclim/indent/html.vim | 181 ++ bundle/eclim/eclim/indent/htmldjango.vim | 62 + bundle/eclim/eclim/indent/htmljinja.vim | 73 + bundle/eclim/eclim/indent/indentanything.vim | 683 ++++++ bundle/eclim/eclim/indent/javascript.vim | 146 ++ bundle/eclim/eclim/indent/xml.vim | 169 ++ bundle/eclim/eclim/plugin/cproject.vim | 31 + bundle/eclim/eclim/plugin/django.vim | 32 + bundle/eclim/eclim/plugin/eclim.vim | 472 +++++ bundle/eclim/eclim/plugin/ftdetect.vim | 101 + bundle/eclim/eclim/plugin/ftdetect_cdt.vim | 28 + bundle/eclim/eclim/plugin/ftdetect_jdt.vim | 55 + bundle/eclim/eclim/plugin/ftdetect_pydev.vim | 25 + bundle/eclim/eclim/plugin/java_tools.vim | 60 + bundle/eclim/eclim/plugin/project.vim | 238 +++ bundle/eclim/eclim/plugin/pydev.vim | 43 + bundle/eclim/eclim/plugin/settings_c.vim | 58 + bundle/eclim/eclim/plugin/settings_java.vim | 140 ++ bundle/eclim/eclim/plugin/settings_python.vim | 51 + bundle/eclim/eclim/plugin/vimplugin.vim | 38 + bundle/eclim/eclim/syntax/ant.vim | 64 + .../eclim/eclim/syntax/commonsvalidator.vim | 27 + bundle/eclim/eclim/syntax/eclim_filelist.vim | 24 + bundle/eclim/eclim/syntax/eclimhelp.vim | 29 + .../eclim/eclim/syntax/eclipse_classpath.vim | 27 + .../eclim/eclim/syntax/eclipse_cproject.vim | 27 + bundle/eclim/eclim/syntax/forrestdocument.vim | 27 + bundle/eclim/eclim/syntax/forreststatus.vim | 27 + bundle/eclim/eclim/syntax/gant.vim | 33 + .../eclim/syntax/groovy_simple_template.vim | 31 + bundle/eclim/eclim/syntax/hg.vim | 48 + bundle/eclim/eclim/syntax/hibernate.vim | 27 + bundle/eclim/eclim/syntax/htmldjango.vim | 55 + bundle/eclim/eclim/syntax/ivy.vim | 27 + bundle/eclim/eclim/syntax/java.vim | 36 + bundle/eclim/eclim/syntax/junitresult.vim | 25 + bundle/eclim/eclim/syntax/log4j.vim | 49 + bundle/eclim/eclim/syntax/mvn_pom.vim | 27 + bundle/eclim/eclim/syntax/mysql.vim | 45 + bundle/eclim/eclim/syntax/perl.vim | 38 + bundle/eclim/eclim/syntax/pydevproject.vim | 24 + bundle/eclim/eclim/syntax/spring.vim | 27 + bundle/eclim/eclim/syntax/sql.vim | 50 + bundle/eclim/eclim/syntax/strutsconfig.vim | 27 + bundle/eclim/eclim/syntax/tld.vim | 27 + bundle/eclim/eclim/syntax/webxml.vim | 27 + bundle/eclim/eclim/syntax/xml.vim | 43 + bundle/eclim/plugin/eclim.vim | 188 ++ 243 files changed, 35817 insertions(+) create mode 100644 bundle/eclim/eclim/autoload/eclim.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/c/complete.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/c/project.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/c/search.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/client/nailgun.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/client/python/nailgun.py create mode 100644 bundle/eclim/eclim/autoload/eclim/client/python/nailgun.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/buffers.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/history.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/largefile.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/license.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/locate.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/template.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/common/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/display/fold.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/display/menu.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/display/signs.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/display/window.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/help.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/html/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/ant/complete.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/ant/doc.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/ant/ivy.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/ant/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/classpath.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/complete.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/correct.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/debug.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/doc.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/hierarchy.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/impl.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/import.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/junit.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/logging.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/maven.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/new.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/outline.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/refactor.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/search.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/src.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/tools.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/java/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/lang.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/lang/hierarchy.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/project/problems.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/project/run.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/project/tree.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/project/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/complete.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/django/find.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/django/manage.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/django/template.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/django/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/project.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/python/search.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/commonsvalidator.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/cproject.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/eclimhelp.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/forrest.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/gant.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/hibernate.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/junit.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/spring.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/taglisttoo/lang/webxml.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/tree.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/vimplugin.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/web.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/xml/definition.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/xml/format.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/xml/util.vim create mode 100644 bundle/eclim/eclim/autoload/eclim/xml/validate.vim create mode 100644 bundle/eclim/eclim/bin/bash_complete create mode 100644 bundle/eclim/eclim/compiler/eclim_ant.vim create mode 100644 bundle/eclim/eclim/compiler/eclim_javadoc.vim create mode 100644 bundle/eclim/eclim/compiler/eclim_make.vim create mode 100644 bundle/eclim/eclim/compiler/eclim_maven.vim create mode 100644 bundle/eclim/eclim/compiler/eclim_mvn.vim create mode 100644 bundle/eclim/eclim/compiler/eclim_xmllint.vim create mode 100644 bundle/eclim/eclim/dict/java create mode 100644 bundle/eclim/eclim/doc/404.txt create mode 100644 bundle/eclim/eclim/doc/archive/changes.txt create mode 100644 bundle/eclim/eclim/doc/archive/news.txt create mode 100644 bundle/eclim/eclim/doc/changes.txt create mode 100644 bundle/eclim/eclim/doc/cheatsheet.txt create mode 100644 bundle/eclim/eclim/doc/contribute.txt create mode 100644 bundle/eclim/eclim/doc/development/architecture.txt create mode 100644 bundle/eclim/eclim/doc/development/commands.txt create mode 100644 bundle/eclim/eclim/doc/development/gettingstarted.txt create mode 100644 bundle/eclim/eclim/doc/development/index.txt create mode 100644 bundle/eclim/eclim/doc/development/installer.txt create mode 100644 bundle/eclim/eclim/doc/development/plugins.txt create mode 100644 bundle/eclim/eclim/doc/eclimd.txt create mode 100644 bundle/eclim/eclim/doc/faq.txt create mode 100644 bundle/eclim/eclim/doc/features.txt create mode 100644 bundle/eclim/eclim/doc/gettinghelp.txt create mode 100644 bundle/eclim/eclim/doc/gettingstarted.txt create mode 100644 bundle/eclim/eclim/doc/index.txt create mode 100644 bundle/eclim/eclim/doc/install.txt create mode 100644 bundle/eclim/eclim/doc/relatedprojects.txt create mode 100644 bundle/eclim/eclim/doc/vim/c/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/c/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/c/inspection.txt create mode 100644 bundle/eclim/eclim/doc/vim/c/project.txt create mode 100644 bundle/eclim/eclim/doc/vim/c/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/c/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/code_completion.txt create mode 100644 bundle/eclim/eclim/doc/vim/core/eclim.txt create mode 100644 bundle/eclim/eclim/doc/vim/core/history.txt create mode 100644 bundle/eclim/eclim/doc/vim/core/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/core/locate.txt create mode 100644 bundle/eclim/eclim/doc/vim/core/project.txt create mode 100644 bundle/eclim/eclim/doc/vim/core/util.txt create mode 100644 bundle/eclim/eclim/doc/vim/dltk/buildpath.txt create mode 100644 bundle/eclim/eclim/doc/vim/groovy/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/groovy/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/groovy/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/html/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/android.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/ant.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/classpath.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/debug.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/format.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/import.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/inspection.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/java.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/javadoc.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/logging.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/maven.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/methods.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/refactor.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/types.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/unittests.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/java/webxml.txt create mode 100644 bundle/eclim/eclim/doc/vim/javascript/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/php/buildpath.txt create mode 100644 bundle/eclim/eclim/doc/vim/php/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/php/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/php/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/php/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/python/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/python/django.txt create mode 100644 bundle/eclim/eclim/doc/vim/python/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/python/path.txt create mode 100644 bundle/eclim/eclim/doc/vim/python/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/python/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/refactoring.txt create mode 100644 bundle/eclim/eclim/doc/vim/ruby/buildpath.txt create mode 100644 bundle/eclim/eclim/doc/vim/ruby/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/ruby/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/ruby/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/ruby/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/scala/complete.txt create mode 100644 bundle/eclim/eclim/doc/vim/scala/import.txt create mode 100644 bundle/eclim/eclim/doc/vim/scala/index.txt create mode 100644 bundle/eclim/eclim/doc/vim/scala/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/scala/validate.txt create mode 100644 bundle/eclim/eclim/doc/vim/search.txt create mode 100644 bundle/eclim/eclim/doc/vim/settings.txt create mode 100644 bundle/eclim/eclim/doc/vim/validation.txt create mode 100644 bundle/eclim/eclim/doc/vim/xml/index.txt create mode 100644 bundle/eclim/eclim/ftplugin/ant.vim create mode 100644 bundle/eclim/eclim/ftplugin/c.vim create mode 100644 bundle/eclim/eclim/ftplugin/commonsvalidator.vim create mode 100644 bundle/eclim/eclim/ftplugin/cpp.vim create mode 100644 bundle/eclim/eclim/ftplugin/eclimhelp.vim create mode 100644 bundle/eclim/eclim/ftplugin/eclipse_classpath.vim create mode 100644 bundle/eclim/eclim/ftplugin/eclipse_cproject.vim create mode 100644 bundle/eclim/eclim/ftplugin/forrestdocument.vim create mode 100644 bundle/eclim/eclim/ftplugin/forreststatus.vim create mode 100644 bundle/eclim/eclim/ftplugin/gant.vim create mode 100644 bundle/eclim/eclim/ftplugin/hibernate.vim create mode 100644 bundle/eclim/eclim/ftplugin/htmldjango.vim create mode 100644 bundle/eclim/eclim/ftplugin/htmljinja.vim create mode 100644 bundle/eclim/eclim/ftplugin/ivy.vim create mode 100644 bundle/eclim/eclim/ftplugin/java-xml.vim create mode 100644 bundle/eclim/eclim/ftplugin/java.vim create mode 100644 bundle/eclim/eclim/ftplugin/junitresult.vim create mode 100644 bundle/eclim/eclim/ftplugin/log4j.vim create mode 100644 bundle/eclim/eclim/ftplugin/make.vim create mode 100644 bundle/eclim/eclim/ftplugin/mvn_pom.vim create mode 100644 bundle/eclim/eclim/ftplugin/pydevproject.vim create mode 100644 bundle/eclim/eclim/ftplugin/python.vim create mode 100644 bundle/eclim/eclim/ftplugin/spring.vim create mode 100644 bundle/eclim/eclim/ftplugin/strutsconfig.vim create mode 100644 bundle/eclim/eclim/ftplugin/tld.vim create mode 100644 bundle/eclim/eclim/ftplugin/webxml.vim create mode 100644 bundle/eclim/eclim/ftplugin/xml.vim create mode 100644 bundle/eclim/eclim/indent/css.vim create mode 100644 bundle/eclim/eclim/indent/html.vim create mode 100644 bundle/eclim/eclim/indent/htmldjango.vim create mode 100644 bundle/eclim/eclim/indent/htmljinja.vim create mode 100644 bundle/eclim/eclim/indent/indentanything.vim create mode 100644 bundle/eclim/eclim/indent/javascript.vim create mode 100644 bundle/eclim/eclim/indent/xml.vim create mode 100644 bundle/eclim/eclim/plugin/cproject.vim create mode 100644 bundle/eclim/eclim/plugin/django.vim create mode 100644 bundle/eclim/eclim/plugin/eclim.vim create mode 100644 bundle/eclim/eclim/plugin/ftdetect.vim create mode 100644 bundle/eclim/eclim/plugin/ftdetect_cdt.vim create mode 100644 bundle/eclim/eclim/plugin/ftdetect_jdt.vim create mode 100644 bundle/eclim/eclim/plugin/ftdetect_pydev.vim create mode 100644 bundle/eclim/eclim/plugin/java_tools.vim create mode 100644 bundle/eclim/eclim/plugin/project.vim create mode 100644 bundle/eclim/eclim/plugin/pydev.vim create mode 100644 bundle/eclim/eclim/plugin/settings_c.vim create mode 100644 bundle/eclim/eclim/plugin/settings_java.vim create mode 100644 bundle/eclim/eclim/plugin/settings_python.vim create mode 100644 bundle/eclim/eclim/plugin/vimplugin.vim create mode 100644 bundle/eclim/eclim/syntax/ant.vim create mode 100644 bundle/eclim/eclim/syntax/commonsvalidator.vim create mode 100644 bundle/eclim/eclim/syntax/eclim_filelist.vim create mode 100644 bundle/eclim/eclim/syntax/eclimhelp.vim create mode 100644 bundle/eclim/eclim/syntax/eclipse_classpath.vim create mode 100644 bundle/eclim/eclim/syntax/eclipse_cproject.vim create mode 100644 bundle/eclim/eclim/syntax/forrestdocument.vim create mode 100644 bundle/eclim/eclim/syntax/forreststatus.vim create mode 100644 bundle/eclim/eclim/syntax/gant.vim create mode 100644 bundle/eclim/eclim/syntax/groovy_simple_template.vim create mode 100644 bundle/eclim/eclim/syntax/hg.vim create mode 100644 bundle/eclim/eclim/syntax/hibernate.vim create mode 100644 bundle/eclim/eclim/syntax/htmldjango.vim create mode 100644 bundle/eclim/eclim/syntax/ivy.vim create mode 100644 bundle/eclim/eclim/syntax/java.vim create mode 100644 bundle/eclim/eclim/syntax/junitresult.vim create mode 100644 bundle/eclim/eclim/syntax/log4j.vim create mode 100644 bundle/eclim/eclim/syntax/mvn_pom.vim create mode 100644 bundle/eclim/eclim/syntax/mysql.vim create mode 100644 bundle/eclim/eclim/syntax/perl.vim create mode 100644 bundle/eclim/eclim/syntax/pydevproject.vim create mode 100644 bundle/eclim/eclim/syntax/spring.vim create mode 100644 bundle/eclim/eclim/syntax/sql.vim create mode 100644 bundle/eclim/eclim/syntax/strutsconfig.vim create mode 100644 bundle/eclim/eclim/syntax/tld.vim create mode 100644 bundle/eclim/eclim/syntax/webxml.vim create mode 100644 bundle/eclim/eclim/syntax/xml.vim create mode 100644 bundle/eclim/plugin/eclim.vim diff --git a/.vimrc b/.vimrc index cd4d64b..ea15865 100644 --- a/.vimrc +++ b/.vimrc @@ -175,6 +175,9 @@ let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extr let g:ycm_key_invoke_completion = '' nnoremap jd :YcmCompleter GoTo +" java eclim +let g:EclimCompletionMethod = 'omnifunc' + """"""""""""""""""""""""""""""""""""""" " --->语法检查,syntastic的配置参数 @@ -658,6 +661,7 @@ set pastetoggle=+p nmap wa :wa " 仅仅在下拉菜单中显示匹配项目,自动插入所有匹配项目的相同文本 set completeopt=longest,menu +set nocompatible " 映射文件移动命令 nmap mo3 30% diff --git a/bundle/eclim/eclim/autoload/eclim.vim b/bundle/eclim/eclim/autoload/eclim.vim new file mode 100644 index 0000000..5b50038 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim.vim @@ -0,0 +1,581 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" Plugin that integrates vim with the eclipse plugin eclim (ECLipse +" IMproved). +" +" This plugin contains shared functions that can be used regardless of the +" current file type being edited. +" +" License: +" +" Copyright (C) 2005 - 2017 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Variables {{{ + let s:echo_connection_errors = 1 + + let s:command_ping = '-command ping' + let s:command_settings = '-command settings' + let s:command_settings_update = '-command settings_update -s ""' + let s:command_shutdown = "-command shutdown" + let s:command_jobs = '-command jobs' + let s:connect= '^connect: .*$' + + let s:vim_settings = {} + let s:vim_settings_defaults = {} + let s:vim_settings_types = {} + let s:vim_settings_validators = {} +" }}} + +function! eclim#Execute(command, ...) " {{{ + " Optional args: + " options { + " One of the following to determine the eclimd instance to use, honored in + " the order shown here: + " instance: dictionary representing an eclimd instance. + " project: project name + " workspace: workspace path + " dir: directory path to use as the current dir + " exec: 1 to execute the command using execute instead of system. + " raw: 1 to get the result without evaluating as json + " } + + if exists('g:EclimDisabled') + " if we are not in an autocmd or the autocmd is for an acwrite buffer, + " alert the user that eclimd is disabled. + if expand('') == '' || &buftype == 'acwrite' + call eclim#util#EchoWarning( + \ "eclim is currently disabled. use :EclimEnable to enable it.") + endif + return + endif + + if !eclim#EclimAvailable() + return + endif + + let command = '-editor vim ' . a:command + + " encode special characters + " http://www.w3schools.com/TAGS/ref_urlencode.asp + let command = substitute(command, '\*', '%2A', 'g') + let command = substitute(command, '\$', '%24', 'g') + let command = substitute(command, '<', '%3C', 'g') + let command = substitute(command, '>', '%3E', 'g') + + " determine the eclimd instance to use + let options = a:0 ? a:1 : {} + let instance = get(options, 'instance', {}) + if len(instance) == 0 + let project = get(options, 'project', '') + if project != '' + let workspace = eclim#project#util#GetProjectWorkspace(project) + if type(workspace) == g:LIST_TYPE + let workspaces = workspace + unlet workspace + let response = eclim#util#PromptList( + \ 'Muliple workspaces found, please choose the target workspace', + \ workspaces, g:EclimHighlightInfo) + + " user cancelled, error, etc. + if response < 0 + return + endif + + let workspace = workspaces[response] + endif + else + let workspace = '' + endif + + if workspace == '' + let workspace = get(options, 'workspace', '') + endif + + let dir = workspace != '' ? workspace : get(options, 'dir', '') + let chosen = eclim#client#nailgun#ChooseEclimdInstance(dir) + if type(chosen) != g:DICT_TYPE + return + endif + let instance = chosen + endif + + let exec = get(options, 'exec', 0) + let [retcode, result] = eclim#client#nailgun#Execute(instance, command, exec) + let result = substitute(result, '\n$', '', '') + + " an echo during startup causes an annoying issue with vim. + "call eclim#util#Echo(' ') + + " check for errors + let error = '' + if result =~ '^[^\n]*Exception:\?[^\n]*\n\s\+\ ' || + \ result =~ '^[^\n]*ResourceException(.\{-})\[[0-9]\+\]:[^\n]*\n\s\+\ ' + if g:EclimLogLevel != 'trace' && !&verbose + let error = substitute(result, '\(.\{-}\)\n.*', '\1', '') + else + let error = result + endif + elseif retcode + let error = result + endif + + if retcode || error != '' + if s:echo_connection_errors + if error =~ s:connect + " if we are not in an autocmd or the autocmd is for an acwrite buffer, + " alert the user that eclimd is not running. + if expand('') == '' || &buftype == 'acwrite' + call eclim#util#EchoWarning( + \ "unable to connect to eclimd (port: " . instance.port . ") - " . error) + endif + else + let error = error . "\n" . + \ 'while executing command (port: ' . instance.port . '): ' . command + " if we are not in an autocmd or in a autocmd for an acwrite buffer, + " echo the error, otherwise just log it. + if expand('') == '' || &buftype == 'acwrite' + call eclim#util#EchoError(error) + else + call eclim#util#EchoDebug(error) + endif + endif + endif + return + endif + + let raw = get(options, 'raw', 0) + return result != '' && !raw ? eval(result) : result +endfunction " }}} + +function! eclim#Disable() " {{{ + if !exists('g:EclimDisabled') + let g:EclimDisabled = 1 + endif +endfunction " }}} + +function! eclim#Enable() " {{{ + if exists('g:EclimDisabled') + unlet g:EclimDisabled + endif +endfunction " }}} + +function! eclim#EclimAvailable(...) " {{{ + " Optional args: + " echo: Whether or not to echo an error if eclim is not available + " (default: 1) + let instances = eclim#UserHome() . '/.eclim/.eclimd_instances' + let available = filereadable(instances) + let echo = a:0 ? a:1 : 1 + if echo && !available && expand('') == '' + call eclim#util#EchoError(printf( + \ 'No eclimd instances found running (eclimd created file not found %s)', + \ eclim#UserHome() . '/.eclim/.eclimd_instances')) + endif + return available +endfunction " }}} + +function! eclim#PingEclim(echo, ...) " {{{ + " If echo is non 0, then the result is echoed to the user. + " Optional args: + " workspace + + let workspace = a:0 ? a:1 : '' + if a:echo + let result = eclim#Execute(s:command_ping, {'workspace': workspace}) + if type(result) == g:DICT_TYPE + call eclim#util#Echo( + \ 'eclim ' . result.eclim . "\n" . + \ 'eclipse ' . result.eclipse) + endif + else + let savedErr = s:echo_connection_errors + let savedLog = g:EclimLogLevel + let s:echo_connection_errors = 0 + let g:EclimLogLevel = 'off' + + let result = eclim#Execute(s:command_ping, {'workspace': workspace}) + + let s:echo_connection_errors = savedErr + let g:EclimLogLevel = savedLog + + return type(result) == g:DICT_TYPE + endif +endfunction " }}} + +function! eclim#ParseSettingErrors(errors) " {{{ + let errors = [] + for error in a:errors + let message = error.message + let setting = substitute(message, '^\(.\{-}\): .*', '\1', '') + let message = substitute(message, '^.\{-}: \(.*\)', '\1', '') + if error.line == 1 && setting != error.message + let line = search('^\s*' . setting . '\s*=', 'cnw') + let error.line = line > 0 ? line : 1 + endif + call add(errors, { + \ 'bufnr': bufnr('%'), + \ 'lnum': error.line, + \ 'text': message, + \ 'type': error.warning == 1 ? 'w' : 'e', + \ }) + endfor + return errors +endfunction " }}} + +function! eclim#SaveSettings(command, project) " {{{ + " don't check modified since undo seems to not set the modified flag + "if &modified + let tempfile = substitute(tempname(), '\', '/', 'g') + + " get all lines, filtering out comments and blank lines + let lines = filter(getline(1, line('$')), 'v:val !~ "^\\s*\\(#\\|$\\)"') + + " convert lines into a settings dict + let index = 0 + let settings = {} + let pattern = '^\s*\([[:alnum:]_.-]\+\)\s*=\s*\(.*\)' + while index < len(lines) + if lines[index] =~ pattern + let name = substitute(lines[index], pattern, '\1', '') + let value = substitute(lines[index], pattern, '\2', '') + while value =~ '\\$' + let index += 1 + let value = substitute(value, '\\$', '', '') + let value .= substitute(lines[index], '^\s*', '', '') + endwhile + let settings[name] = value + endif + let index += 1 + endwhile + call writefile([string(settings)], tempfile) + + let command = a:command + let command = substitute(command, '', a:project, '') + let command = substitute(command, '', tempfile, '') + + if exists('b:eclimd_instance') + let result = eclim#Execute(command, {'instance': b:eclimd_instance}) + else + let result = eclim#Execute(command) + endif + + if type(result) == g:LIST_TYPE + call eclim#util#EchoError + \ ("Operation contained errors. See location list for details.") + let errors = eclim#ParseSettingErrors(result) + call eclim#util#SetLocationList(errors) + else + call eclim#util#ClearLocationList() + call eclim#util#Echo(result) + endif + + setlocal nomodified + "endif +endfunction " }}} + +function! eclim#Settings(workspace) " {{{ + let instance = eclim#client#nailgun#ChooseEclimdInstance(a:workspace) + if type(instance) != g:DICT_TYPE + return + endif + + let settings = eclim#Execute(s:command_settings, {'instance': instance}) + if type(settings) != g:LIST_TYPE + return + endif + + let content = ['# Global settings for workspace: ' . instance.workspace, ''] + let path = '' + for setting in settings + if setting.path != path + if path != '' + let content += ['# }', ''] + endif + let path = setting.path + call add(content, '# ' . path . ' {') + endif + let description = split(setting.description, '\n') + let content += map(description, "'\t# ' . v:val") + call add(content, "\t" . setting.name . '=' . setting.value) + endfor + if path != '' + call add(content, '# }') + endif + + call eclim#util#TempWindow("Workspace_Settings", content) + setlocal buftype=acwrite + setlocal filetype=jproperties + setlocal noreadonly + setlocal modifiable + setlocal foldmethod=marker + setlocal foldmarker={,} + let b:eclimd_instance = instance + + augroup eclim_settings + autocmd! BufWriteCmd + exec 'autocmd BufWriteCmd ' . + \ 'call eclim#SaveSettings(s:command_settings_update, "")' + augroup END +endfunction " }}} + +function! eclim#ShutdownEclim() " {{{ + call eclim#Execute(s:command_shutdown) +endfunction " }}} + +function! eclim#LoadVimSettings() " {{{ + " Set some initial logging variables for the case where eclim#UserHome needs + " to make a system call + if !exists('g:EclimLogLevel') + let g:EclimLogLevel = 'info' + let g:EclimHighlightTrace = 'Normal' + endif + + let settings_file = eclim#UserHome() . '/.eclim/.eclim_settings' + if filereadable(settings_file) + let lines = readfile(settings_file) + if len(lines) == 1 && lines[0] =~ '^{.*}$' + let settings = eval(lines[0]) + for [key, value] in items(settings) + let name = 'g:Eclim' . key + if !exists(name) + exec 'let ' . name . ' = ' . string(value) + endif + unlet value + endfor + endif + endif + + " Handle legacy sign/log level values + let legacy = {0: 'off', 1: 'error', 2: 'error', 3: 'warning', 4: 'info', 5: 'debug', 6: 'trace'} + if exists('g:EclimLogLevel') && type(g:EclimLogLevel) == g:NUMBER_TYPE + let g:EclimLogLevel = get(legacy, g:EclimLogLevel, 'info') + endif + if exists('g:EclimSignLevel') && type(g:EclimSignLevel) == g:NUMBER_TYPE + let g:EclimSignLevel = get(legacy, g:EclimSignLevel, 'info') + endif +endfunction " }}} + +function! eclim#AddVimSetting(namespace, name, default, desc, ...) " {{{ + " Optional args: + " regex: regular expression used to validate the setting's value. + if !has_key(s:vim_settings, a:namespace) + let s:vim_settings[a:namespace] = {} + endif + let name = substitute(a:name, 'g:Eclim', '', '') + let s:vim_settings[a:namespace][name] = {'desc': a:desc} + let s:vim_settings_defaults[name] = a:default + let s:vim_settings_types[name] = type(a:default) + let regex = a:0 ? a:1 : '' + if regex != '' + let s:vim_settings_validators[name] = regex + if exists(a:name) + exec 'let value = ' . a:name + if value !~ '^' . regex . '$' + echo a:name . ' must match ' . regex + exec 'unlet ' . a:name + endif + endif + endif + + if !exists(a:name) + exec 'let ' . a:name . ' = ' . string(a:default) + endif +endfunction " }}} + +function! eclim#VimSettings() " {{{ + let content = [ + \ "# Eclim's global vim settings", + \ "# The settings here allow you to configure the vim side behavior of eclim.", + \ "# You can use on a setting name to open the eclim docs for that setting.", + \ "#", + \ "# Note: If you have g:EclimXXX variables set in your .vimrc, those will take", + \ "# precedence over any changes you make here.", + \ ] + for namespace in sort(keys(s:vim_settings)) + let content += ['', '# ' . namespace . ' {{{'] + for name in sort(keys(s:vim_settings[namespace])) + let setting = s:vim_settings[namespace][name] + let desc = split(setting.desc, '\n') + let content += map(desc, "'\t# ' . v:val") + exec 'let value = string(g:Eclim' . name . ')' + call add(content, "\t" . name . '=' . value) + endfor + let content += ['# }}}'] + endfor + + call eclim#util#TempWindow("Vim_Settings", content) + setlocal buftype=acwrite + setlocal filetype=jproperties + setlocal noreadonly + setlocal modifiable + setlocal foldmethod=marker + setlocal foldmarker={{{,}}} + nnoremap :call VimSettingHelp() + + augroup eclim_settings + autocmd! BufWriteCmd + autocmd BufWriteCmd call eclim#SaveVimSettings() + augroup END +endfunction " }}} + +function! s:VimSettingHelp() " {{{ + let pos = getpos('.') + try + call cursor(0, 1) + normal! w + let syntax = synIDattr(synID(line('.'), col('.'), 1), 'name') + finally + call setpos('.', pos) + endtry + + if syntax == 'jpropertiesIdentifier' + let line = getline('.') + let name = substitute(line, '^\s*\(\w\+\)=.*', '\1', '') + if name != line + exec 'EclimHelp g:Eclim' . name + endif + endif +endfunction " }}} + +function! eclim#SaveVimSettings() " {{{ + " get all lines, filtering out comments and blank lines + let lines = filter(getline(1, line('$')), 'v:val !~ "^\\s*\\(#\\|$\\)"') + + " convert lines into a settings dict + let index = 0 + let settings = {} + let pattern = '^\s*\([[:alnum:]_.-]\+\)\s*=\s*\(.*\)' + let errors = [] + while index < len(lines) + try + if lines[index] =~ pattern + let name = substitute(lines[index], pattern, '\1', '') + if !has_key(s:vim_settings_types, name) + continue + endif + + let value = substitute(lines[index], pattern, '\2', '') + while value =~ '\\$' + let index += 1 + let value = substitute(value, '\\$', '', '') + let value .= substitute(lines[index], '^\s*', '', '') + endwhile + let value = substitute(value, "\\(^['\"]\\|['\"]$\\)", '', 'g') + + if has_key(s:vim_settings_validators, name) + let regex = s:vim_settings_validators[name] + if value !~ '^' . regex . '$' + let [line, col] = searchpos('^\s*' . name . '=', 'nw') + call add(errors, { + \ 'filename': expand('%'), + \ 'message': name . ': must match ' . regex, + \ 'line': line, + \ 'column': col, + \ 'type': 'error', + \ }) + continue + endif + endif + + if s:vim_settings_types[name] != g:STRING_TYPE + try + let typed_value = eval(value) + unlet value + let value = typed_value + catch /E121\|E115/ + let [line, col] = searchpos('^\s*' . name . '=', 'nw') + call add(errors, { + \ 'filename': expand('%'), + \ 'message': name . ': ' . v:exception, + \ 'line': line, + \ 'column': col, + \ 'type': 'error', + \ }) + continue + endtry + endif + + let default = s:vim_settings_defaults[name] + if value != default + let settings[name] = value + endif + endif + finally + let index += 1 + unlet! value typed_value default + endtry + endwhile + + if len(errors) + call eclim#util#SetLocationList(eclim#util#ParseLocationEntries(errors)) + call eclim#util#EchoError( + \ len(errors) . ' error' . (len(errors) > 1 ? 's' : '') . ' found.') + return + endif + + call eclim#util#ClearLocationList() + + if !isdirectory(eclim#UserHome() . '/.eclim') + call mkdir(eclim#UserHome() . '/.eclim') + endif + let settings_file = eclim#UserHome() . '/.eclim/.eclim_settings' + if writefile([string(settings)], settings_file) == 0 + call eclim#util#Echo('Settings saved. You may need to restart vim for all changes to take affect.') + else + call eclim#util#Echo('Unable to write settings.') + endif + + setlocal nomodified +endfunction " }}} + +function! eclim#UserHome() " {{{ + if exists('g:EclimUserHome') + let home = g:EclimUserHome + else + let home = $HOME + endif + return substitute(home, '\', '/', 'g') +endfunction " }}} + +function! eclim#WaitOnRunningJobs(timeout) " {{{ + " Args: + " timeout: max time to wait in milliseconds + let running = 1 + let waited = 0 + while running && waited < a:timeout + let jobs = eclim#Execute(s:command_jobs) + if type(jobs) == g:LIST_TYPE + let running = 0 + for job in jobs + if job.status == 'running' + call eclim#util#EchoDebug('Wait on job: ' . job.job) + let running = 1 + let waited += 300 + sleep 300m + break + endif + endfor + endif + endwhile + if running + call eclim#util#EchoDebug('Timeout exceeded waiting on jobs') + endif +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/c/complete.vim b/bundle/eclim/eclim/autoload/eclim/c/complete.vim new file mode 100644 index 0000000..4935f7d --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/c/complete.vim @@ -0,0 +1,38 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2014 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Varables {{{ + let s:complete_command = + \ '-command c_complete -p "" -f "" ' . + \ '-o -e -l ' +" }}} + +function! eclim#c#complete#CodeComplete(findstart, base) " {{{ + if a:findstart && getline('.') =~ '#include\s\+<' + call eclim#lang#SilentUpdate(0) + return stridx(getline('.'), '<') + endif + return eclim#lang#CodeComplete( + \ s:complete_command, a:findstart, a:base, + \ {'temp': 0, 'layout': g:EclimCCompleteLayout}) +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/c/project.vim b/bundle/eclim/eclim/autoload/eclim/c/project.vim new file mode 100644 index 0000000..e7191a8 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/c/project.vim @@ -0,0 +1,327 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" see http://eclim.org/vim/c/project.html +" +" License: +" +" Copyright (C) 2005 - 2017 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Varables {{{ + let s:configs_command = '-command c_project_configs -p ""' + let s:src_command = + \ '-command c_project_src -p "" -a -d ""' + let s:include_command = + \ '-command c_project_include -p "" -a -l -d ""' + let s:symbol_command = + \ '-command c_project_symbol -p "" -a -l -n ""' +" }}} + +" Configs([project]) {{{ +" Open a buffer with current project configs info. +function! eclim#c#project#Configs(...) + if len(a:000) > 0 && a:000[0] != '' + let project = a:000[0] + else + let project = eclim#project#util#GetCurrentProjectName() + endif + + if project == '' + " force printing of project error message + call eclim#project#util#IsCurrentFileInProject() + return + endif + + let command = s:configs_command + let command = substitute(command, '', project, '') + + let configs = eclim#Execute(command, {'project': project}) + if type(configs) != g:LIST_TYPE + return + endif + + let content = [] + for config in configs + call add(content, 'Config: ' . config.name) + call add(content, '') + + call add(content, "\tSources: |add|") + if has_key(config, 'sources') + for src in config.sources + call add(content, "\t\tdir: " . src.dir) + if has_key(src, 'excludes') + call add(content, "\t\t\texcludes: " . join(src.excludes, ',')) + endif + endfor + endif + call add(content, '') + + if has_key(config, 'tools') + for tool in config.tools + call add(content, "\tTool: " . tool.name) + call add(content, "\t\tIncludes: |add|") + if has_key(tool, 'includes') + for include in tool.includes + call add(content, "\t\t\tpath: " . include) + endfor + endif + call add(content, "\t\tSymbols: |add|") + if has_key(tool, 'symbols') + for symbol in tool.symbols + call add(content, "\t\t\tname/value: " . symbol) + endfor + endif + call add(content, '') + endfor + endif + endfor + + call eclim#util#TempWindow('[' . project . ' configs]', content) + let b:project = project + call s:Syntax() + + nnoremap :call FollowLink() + nnoremap D :call Delete() +endfunction " }}} + +" s:Syntax() {{{ +function! s:Syntax() + syntax match CProjectConfigLabel /^\s*[A-Z]\w\+:/ + syntax match CProjectConfigSubLabel /^\s*[a-z][a-z\/]\+:/ + syntax match CProjectConfigLink /|\S.\{-}\S|/ + hi link CProjectConfigLabel Statement + hi link CProjectConfigSubLabel Identifier + hi link CProjectConfigLink Label +endfunction " }}} + +" s:FollowLink() {{{ +function! s:FollowLink() + let line = getline('.') + let link = substitute( + \ getline('.'), '.*|\(.\{-}\%' . col('.') . 'c.\{-}\)|.*', '\1', '') + if link == line + return + endif + + if line =~ '^\s*Sources:' + call s:AddSource() + elseif line =~ '^\s*Includes:' + call s:AddInclude() + elseif line =~ '^\s*Symbols:' + call s:AddSymbol() + endif +endfunction " }}} + +" s:AddSource() {{{ +function! s:AddSource() + let project_root = eclim#project#util#GetProjectRoot(b:project) + let complete = 'customlist,eclim#project#util#CommandCompleteProjectRelative' + let dir = input('dir: ', '', complete) + while dir != '' && !isdirectory(project_root . '/' . dir) + call eclim#util#Echo('Directory "' . dir . '" not found in the project.') + let dir = input('dir: ', dir, complete) + endwhile + + if dir == '' + return + endif + + let excludes = input('excludes (comma separated patterns): ') + + let command = s:src_command + let command = substitute(command, '', b:project, '') + let command = substitute(command, '', 'add', '') + let command = substitute(command, '', dir, '') + if excludes != '' + let command .= ' -e "' . excludes . '"' + endif + + let result = eclim#Execute(command) + if result != '0' + call eclim#c#project#Configs(b:project) + call eclim#util#Echo(result) + endif +endfunction " }}} + +" s:AddInclude() {{{ +function! s:AddInclude() + let project_root = eclim#project#util#GetProjectRoot(b:project) + let complete = 'customlist,eclim#project#util#CommandCompleteAbsoluteOrProjectRelativeDir' + let dir = input('dir: ', '', complete) + + if dir == '' + return + endif + + let command = s:include_command + let command = substitute(command, '', b:project, '') + let command = substitute(command, '', 'add', '') + let command = substitute(command, '', s:GetLang(), '') + let command = substitute(command, '', dir, '') + + let result = eclim#Execute(command) + if result != '0' + call eclim#c#project#Configs(b:project) + call eclim#util#Echo(result) + endif +endfunction " }}} + +" s:AddSymbol() {{{ +function! s:AddSymbol() + let project_root = eclim#project#util#GetProjectRoot(b:project) + let name = input('name: ', '') + if name == '' + return + endif + + let value = input('value: ') + if value == '' + return + endif + + let command = s:symbol_command + let command = substitute(command, '', b:project, '') + let command = substitute(command, '', 'add', '') + let command = substitute(command, '', s:GetLang(), '') + let command = substitute(command, '', name, '') + let command .= ' -v "' . value . '"' + + let result = eclim#Execute(command) + if result != '0' + call eclim#c#project#Configs(b:project) + call eclim#util#Echo(result) + endif +endfunction " }}} + +" s:Delete() {{{ +function! s:Delete() + let reload = 0 + let message = '' + let pos = getpos('.') + let lnum = line('.') + let line = getline(lnum) + + " source entry excludes + if line =~ '^\s*excludes:\s\+' + let lnum -= 1 + let line = getline(lnum) + endif + + " source entry dir + if line =~ '^\s*dir:\s\+' + let reload = 1 + let message = s:DeleteSource(lnum) + + " include path entry + elseif line =~ '^\s*path:\s\+' + let reload = 1 + let message = s:DeleteInclude(lnum) + + " symbol entry + elseif line =~ '^\s*name/value:\s\+' + let reload = 1 + let message = s:DeleteSymbol(lnum) + endif + + if reload + call eclim#c#project#Configs(b:project) + call setpos('.', pos) + if message != '' + call eclim#util#Echo(message) + endif + endif +endfunction " }}} + +" s:DeleteSource(lnum) {{{ +function! s:DeleteSource(lnum) + let dir = substitute(getline(a:lnum), '^\s*dir:\s\+\(.*\)', '\1', '') + let command = s:src_command + let command = substitute(command, '', b:project, '') + let command = substitute(command, '', 'delete', '') + let command = substitute(command, '', dir, '') + + let result = eclim#Execute(command) + if result != '0' + return result + endif + return '' +endfunction " }}} + +" s:DeleteInclude(lnum) {{{ +function! s:DeleteInclude(lnum) + let dir = substitute(getline(a:lnum), '^\s*path:\s\+\(.*\)', '\1', '') + let dir = substitute(dir, '\(^"\|"$\)', '', 'g') + let dir = substitute(dir, '^\$', '', '') + let dir = substitute(dir, '\(^{\|}$\)', '', 'g') + let dir = substitute(dir, '^workspace_loc:', '', '') + + let command = s:include_command + let command = substitute(command, '', b:project, '') + let command = substitute(command, '', 'delete', '') + let command = substitute(command, '', s:GetLang(), '') + let command = substitute(command, '', dir, '') + + let result = eclim#Execute(command) + if result != '0' + return result + endif + return '' +endfunction " }}} + +" s:DeleteSymbol(lnum) {{{ +function! s:DeleteSymbol(lnum) + let name = substitute( + \ getline(a:lnum), '^\s*name/value:\s\+\(.\{-}\)=.*', '\1', '') + + let command = s:symbol_command + let command = substitute(command, '', b:project, '') + let command = substitute(command, '', 'delete', '') + let command = substitute(command, '', s:GetLang(), '') + let command = substitute(command, '', name, '') + + let result = eclim#Execute(command) + if result != '0' + return result + endif + return '' +endfunction " }}} + +" s:GetLang() {{{ +function! s:GetLang() + let lang_line = getline(search('^\s\+Tool:', 'bnW')) + if lang_line =~? 'assembl' + return 'assembly' + elseif lang_line =~? 'c++\|cpp' + return "c++" + endif + return 'c' +endfunction " }}} + +" CommandCompleteProject(argLead, cmdLine, cursorPos) {{{ +" Custom command completion for project names. +function! eclim#c#project#CommandCompleteProject(argLead, cmdLine, cursorPos) + let c_projects = eclim#project#util#CommandCompleteProjectByNature( + \ a:argLead, a:cmdLine, a:cursorPos, 'c') + let cpp_projects = eclim#project#util#CommandCompleteProjectByNature( + \ a:argLead, a:cmdLine, a:cursorPos, 'cpp') + let projects = c_projects + cpp_projects + call sort(projects) + return projects +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/c/search.vim b/bundle/eclim/eclim/autoload/eclim/c/search.vim new file mode 100644 index 0000000..d7ca5dd --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/c/search.vim @@ -0,0 +1,118 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2015 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Varables {{{ + let s:search = '-command c_search' + let s:includepaths = '-command c_includepaths -p ""' + let s:sourcepaths = '-command c_sourcepaths -p ""' + let s:options_map = { + \ '-a': ['split', 'vsplit', 'edit', 'tabnew'], + \ '-s': ['all', 'project'], + \ '-i': [], + \ '-p': [], + \ '-t': [ + \ 'class_struct', + \ 'function', + \ 'variable', + \ 'union', + \ 'method', + \ 'field', + \ 'enum', + \ 'enumerator', + \ 'namespace', + \ 'typedef', + \ 'macro' + \ ], + \ '-x': ['all', 'declarations', 'definitions', 'references'], + \ } +" }}} + +function! eclim#c#search#Search(argline) " {{{ + return eclim#lang#Search(s:search, g:EclimCSearchSingleResult, a:argline) +endfunction " }}} + +function eclim#c#search#FindInclude(argline) " {{{ + if !eclim#project#util#IsCurrentFileInProject(1) + return + endif + + let [action_args, argline] = eclim#util#ExtractCmdArgs(a:argline, '-a:') + let action = len(action_args) == 2 ? action_args[1] : g:EclimCSearchSingleResult + + let file = substitute(getline('.'), '.*#include\s*[<"]\(.*\)[>"].*', '\1', '') + + let project = eclim#project#util#GetCurrentProjectName() + let command = substitute(s:includepaths, '', project, '') + let result = eclim#Execute(command) + let paths = type(result) == g:LIST_TYPE ? result : [] + + let command = substitute(s:sourcepaths, '', project, '') + let result = eclim#Execute(command) + let paths += type(result) == g:LIST_TYPE ? result : [] + + let dir = expand('%:p:h') + if index(paths, dir) == -1 + call add(paths, dir) + endif + let results = map( + \ split(globpath(join(paths, ','), file), '\n'), + \ '{"filename": v:val, "line": 0, "column": 0}') + + if !empty(results) + call eclim#lang#SearchResults(results, action) + return 1 + else + call eclim#util#EchoInfo("File not found.") + endif +endfunction " }}} + +function! eclim#c#search#SearchContext(argline) " {{{ + if getline('.')[col('.') - 1] == '$' + call cursor(line('.'), col('.') + 1) + let cnum = eclim#util#GetCurrentElementColumn() + call cursor(line('.'), col('.') - 1) + else + let cnum = eclim#util#GetCurrentElementColumn() + endif + + if getline('.') =~ '#include\s*[<"][A-Za-z0-9.]*\%' . cnum . 'c' + call eclim#c#search#FindInclude(a:argline) + return + "elseif getline('.') =~ '\<\(class\|????\)\s\+\%' . cnum . 'c' + " call eclim#c#search#Search(a:argline . ' -x references') + return + endif + + call eclim#c#search#Search(a:argline . ' -x context') +endfunction " }}} + +function! eclim#c#search#CommandCompleteSearch(argLead, cmdLine, cursorPos) " {{{ + return eclim#util#CommandCompleteOptions( + \ a:argLead, a:cmdLine, a:cursorPos, s:options_map) +endfunction " }}} + +function! eclim#c#search#CommandCompleteSearchContext(argLead, cmdLine, cursorPos) " {{{ + let options_map = {'-a': s:options_map['-a']} + return eclim#util#CommandCompleteOptions( + \ a:argLead, a:cmdLine, a:cursorPos, options_map) +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/client/nailgun.vim b/bundle/eclim/eclim/autoload/eclim/client/nailgun.vim new file mode 100644 index 0000000..1c5d4a7 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/client/nailgun.vim @@ -0,0 +1,160 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2017 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Global Variables {{{ + if !exists("g:EclimNailgunKeepAlive") + " keepAlive flag - can be re-defined in the user ~/.vimrc . + " Read once, on client initialization. Subsequent changes of + " this flag in run-time has no effect. + let g:EclimNailgunKeepAlive = 0 + endif +" }}} + +function! eclim#client#nailgun#ChooseEclimdInstance(...) " {{{ + " Function which prompts the user to pick the target workspace and returns + " their choice or if only one workspace is active simply return it without + " prompting the user. If the optional 'dir' argument is supplied and that dir + " is a subdirectory of one of the workspaces, then that workspace will be + " returned. + " Optional args: + " dir + + if !eclim#EclimAvailable() + return + endif + + let instances = eclim#client#nailgun#GetEclimdInstances() + if len(instances) == 1 + return instances[keys(instances)[0]] + endif + + if len(instances) > 1 + let path = a:0 && a:1 != '' ? a:1 : expand('%:p') + if path == '' + let path = getcwd() . '/' + endif + let path = substitute(path, '\', '/', 'g') + + " when we are in a temp window, use the initiating filename + if &buftype != '' && exists('b:filename') + let path = b:filename + endif + + " project inside of a workspace dir + for workspace in keys(instances) + if path =~ '^' . workspace + return instances[workspace] + endif + endfor + + " project outside of a workspace dir + let project = eclim#project#util#GetProject(path) + if len(project) > 0 + return get(instances, project.workspace, 0) + endif + + let workspaces = keys(instances) + let response = eclim#util#PromptList( + \ 'Muliple workspaces found, please choose the target workspace', + \ workspaces, g:EclimHighlightInfo) + + " user cancelled, error, etc. + if response < 0 + return + endif + + return instances[workspaces[response]] + endif + + call eclim#util#Echo('No eclimd instances found running.') +endfunction " }}} + +function! eclim#client#nailgun#GetEclimdInstances() " {{{ + " Returns a dict with eclimd instances. + let instances = {} + if eclim#EclimAvailable() + let dotinstances = eclim#UserHome() . '/.eclim/.eclimd_instances' + let lines = readfile(dotinstances) + for line in lines + if line !~ '^{' + continue + endif + let values = eval(line) + let instances[values.workspace] = values + endfor + endif + return instances +endfunction " }}} + +function! eclim#client#nailgun#Execute(instance, command, ...) " {{{ + let exec = a:0 ? a:1 : 0 + + if !exec + if g:EclimNailgunClient == 'python' && has('python') + return eclim#client#python#nailgun#Execute(a:instance.port, a:command) + endif + endif + + let [retcode, result] = eclim#client#nailgun#GetEclimCommand(a:instance.home) + if retcode != 0 + return [retcode, result] + endif + + let command = a:command + if exec + let command = escape(command, '%#') + endif + + let eclim = result . ' --nailgun-server localhost --nailgun-port ' . a:instance.port . ' ' . command + if exec + let eclim = '!' . eclim + endif + + let result = eclim#util#System(eclim, exec, exec) + return [v:shell_error, result] +endfunction " }}} + +function! eclim#client#nailgun#GetEclimCommand(home) " {{{ + " Gets the command to exexute eclim. + let command = a:home . 'bin/eclim' + if !filereadable(command) + return [1, 'Could not locate file: ' . command] + endif + return [0, '"' . command . '"'] +endfunction " }}} + +function! eclim#client#nailgun#CommandCompleteWorkspaces(argLead, cmdLine, cursorPos) " {{{ + " Custom command completion for available workspaces. + + let cmdLine = strpart(a:cmdLine, 0, a:cursorPos) + let args = eclim#util#ParseCmdLine(cmdLine) + let argLead = cmdLine =~ '\s$' ? '' : args[len(args) - 1] + + let instances = eclim#client#nailgun#GetEclimdInstances() + let workspaces = sort(keys(instances)) + if cmdLine !~ '[^\\]\s$' + call filter(workspaces, 'v:val =~ "^' . argLead . '"') + endif + + return workspaces +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.py b/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.py new file mode 100644 index 0000000..2f0752c --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.py @@ -0,0 +1,213 @@ +""" +Copyright (C) 2005 - 2017 Eric Van Dewoestine + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +@author: Anton Sharonov +@author: Eric Van Dewoestine +""" +import socket + +try: + from cStringIO import StringIO +except: + from StringIO import StringIO + +class Nailgun(object): + """ + Client used to communicate with a nailgun server. + """ + + def __init__(self, **kwargs): + self.socket = None + self.port = kwargs.get('port') + self.keepAlive = int(kwargs.get('keepAlive', 0)) + self.reconnectCounter = 0 + + def send(self, cmdline): + """ + Sends a complete command to the nailgun server. Handles connecting to the + server if not currently connected. + @param cmdline command, which is sent to server, for instance + "-command ping". + @return tuple consisting of: + - retcode from server (0 for success, non-0 for failure) + - string response from server + """ + if not self.isConnected(): + # with keepAlive do only first reconnect + if not self.keepAlive or self.reconnectCounter == 0: + (retcode, result) = self.reconnect() + if retcode: + return (retcode, result) + + if not self.isConnected(): # Only for keepAlive + return (-1, "connect: ERROR - socket is not connected (nailgun.py)") + + try: # outer try for pre python 2.5 support. + try: + for arg in self.parseArgs(cmdline): + self.sendChunk("A", arg) + + if self.keepAlive: + self.sendChunk("K") + + self.sendChunk("C", "org.eclim.command.Main") + + (retcode, result) = self.processResponse() + if self.keepAlive and retcode: + # force reconnect on error (may not be necessary) + self.reconnect() + + return (retcode, result) + except socket.error, ex: + args = ex.args + if len(args) > 1: + retcode, msg = args[0], args[1] + elif len(args): + retcode, msg = 1, args[0] + else: + retcode, msg = 1, 'No message' + return (retcode, 'send: %s' % msg) + finally: + if not self.keepAlive: + try: + self.close() + except: + # don't let an error on close mask any previous error. + pass + + def connect(self, port=None): + """ + Establishes the connection to specified port or if not supplied, + uses the default. + """ + port = port or self.port + try: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(('localhost', port)) + except socket.error, ex: + args = ex.args + if len(args) > 1: + retcode, msg = args[0], args[1] + elif len(args): + retcode, msg = 1, args[0] + else: + retcode, msg = 1, 'No message' + return (retcode, 'connect: %s' % msg) + + self.socket = sock + return (0, '') + + def reconnect(self): + if self.socket != None: + self.close() + self.reconnectCounter += 1 + return self.connect() + + def close(self): + self.socket.close() + self.socket = None + + def isConnected(self): + return self.socket != None + + def parseArgs(self, cmdline): + # FIXME: doesn't handle escaping of spaces/quotes yet (may never need to) + args = [] + arg = '' + quote = '' + for char in cmdline: + if char == ' ' and not quote: + if arg: + args.append(arg) + arg = '' + elif char == '"' or char == "'": + if quote and char == quote: + quote = '' + elif not quote: + quote = char + else: + arg += char + else: + arg += char + + if arg: + args.append(arg) + + return args + + def sendChunk(self, chunkType, text=''): + """ + Sends a nailgun 'chunk' to the server. + """ + #print("sendChunk " + chunkType + " " + text) + length = len(text) + str = "%c%c%c%c%c" % ( + (length / (65536*256)) % 256, + (length / 65536) % 256, + (length / 256) % 256, + length % 256, + chunkType) + nbytes = self.socket.sendall(str) + nbytes = self.socket.sendall(text) + + def processResponse(self): + result = StringIO() + exit = 0 + exitFlag = 1 # expecting 1 times exit chunk + while exitFlag > 0: + answer = self.recvBlocked(5) + if len(answer) < 5: + print("error: socket closed unexpectedly\n") + return None + lenPayload = ord(answer[0]) * 65536 * 256 \ + + ord(answer[1]) * 65536 \ + + ord(answer[2]) * 256 \ + + ord(answer[3]) + #print("lenPayload detected : %d" % lenPayload) + chunkType = answer[4] + if chunkType == "1": + # STDOUT + result.write(self.recvToFD(1, answer, lenPayload)) + elif chunkType == "2": + # STDERR + result.write(self.recvToFD(2, answer, lenPayload)) + elif chunkType == "X": + exitFlag = exitFlag - 1 + exit = int(self.recvToFD(2, answer, lenPayload)) + else: + print("error: unknown chunk type = %d\n" % chunkType) + exitFlag = 0 + + return [exit, result.getvalue()] + + def recvBlocked(self, lenPayload): + """ + Receives until all data is read - necessary because usual recv sometimes + returns with number of bytes read less then asked. + """ + received = "" + while (len(received) < lenPayload): + received = received + self.socket.recv(lenPayload - len(received)) + return received + + def recvToFD(self, destFD, buf, lenPayload): + """ + This function just mimics the function with the same name from the C + client. We don't really care which file descriptor the server tells us to + write to - STDOUT and STDERR are the same on VIM side. + """ + received = self.recvBlocked(lenPayload) + return received diff --git a/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.vim b/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.vim new file mode 100644 index 0000000..81cfa31 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/client/python/nailgun.vim @@ -0,0 +1,115 @@ +" Author: Anton Sharonov +" Author: Eric Van Dewoestine +" +" Description: {{{ +" +" License: +" +" Copyright (C) 2005 - 2010 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Variables {{{ + let s:python_dir = expand(":h") +" }}} + +" Execute(port, command) {{{ +" Sends to the eclimd server command, supplied as argument string. +" Returns server's respond. +function! eclim#client#python#nailgun#Execute(port, command) + call s:InitClient(a:port) + let result_viml = "" + let retcode = 0 + + let begin = localtime() + try +python << PYTHONEOF +command = vim.eval('a:command') +(retcode, result) = client.send(command) +vim.command('let retcode = %i' % retcode) +vim.command("let result = '%s'" % result.replace("'", "''")) +PYTHONEOF + finally + call eclim#util#EchoTrace( + \ 'nailgun.py (port: ' . a:port . '): ' . a:command, localtime() - begin) + endtry + + return [retcode, result] +endfunction " }}} + +" Reconnect(port) {{{ +" Does unconditional reconnect of the python_if +" (useful to manual recover from errors in the python_if) +function! eclim#client#python#nailgun#Reconnect(port) + call s:InitClient(a:port) +python << PYTHONEOF +client.reconnect() +PYTHONEOF +endfunction " }}} + +" SetKeepAlive(port, value) {{{ +" Updates the in runtime value of the keepAlive flag. +function! eclim#client#python#nailgun#SetKeepAlive(port, value) + call s:InitClient(a:port) +python << PYTHONEOF +client.keepAlive = int(vim.eval('a:value')) +PYTHONEOF +endfunction " }}} + +" GetKeepAlive(port) {{{ +" Retrieves the value of the keepAlive flag. +function! eclim#client#python#nailgun#GetKeepAlive(port) + call s:InitClient(a:port) + let result = 0 +python << PYTHONEOF +vim.command("let result = %s" % client.keepAlive) +PYTHONEOF + return result +endfunction " }}} + +" GetReconnectCounter(port) {{{ +" Retrieves the value of the reconnect counter. +function! eclim#client#python#nailgun#GetReconnectCounter(port) + call s:InitClient(a:port) + let result = 0 +python << PYTHONEOF +vim.command("let result = %d" % client.reconnectCounter) +PYTHONEOF + return result +endfunction " }}} + +" s:InitClient(port) {{{ +" Initializes the python interface to the nailgun server. +function! s:InitClient(port) +python << PYTHONEOF +if not vars().has_key('clients'): + import sys, vim + sys.path.append(vim.eval('s:python_dir')) + import nailgun + + clients = {} + +port = int(vim.eval('a:port')) +if not clients.has_key(port): + clients[port] = nailgun.Nailgun( + port=port, + keepAlive=vim.eval('g:EclimNailgunKeepAlive'), + ) +client = clients[port] +PYTHONEOF +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/buffers.vim b/bundle/eclim/eclim/autoload/eclim/common/buffers.vim new file mode 100644 index 0000000..672a2e7 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/buffers.vim @@ -0,0 +1,379 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" +" License: +" +" Copyright (C) 2005 - 2014 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" ScriptVariables {{{ + let s:eclim_tab_id = 0 +" }}} + +function! eclim#common#buffers#Buffers(bang) " {{{ + " Like, :buffers, but opens a temporary buffer. + + let options = {'maxfilelength': 0} + let buffers = eclim#common#buffers#GetBuffers(options) + + if g:EclimBuffersSort != '' + call sort(buffers, 'eclim#common#buffers#BufferCompare') + endif + + let lines = [] + let buflist = [] + let filelength = options['maxfilelength'] + let tabid = exists('*gettabvar') ? s:GetTabId() : 0 + let tabbuffers = tabpagebuflist() + for buffer in buffers + let eclim_tab_id = getbufvar(buffer.bufnr, 'eclim_tab_id') + if a:bang != '' || eclim_tab_id == '' || eclim_tab_id == tabid + " for buffers w/ out a tab id, don't show them in the list if they + " are active, but aren't open on the current tab. + if a:bang == '' && buffer.status =~ 'a' && index(tabbuffers, buffer.bufnr) == -1 + continue + endif + + call add(lines, s:BufferEntryToLine(buffer, filelength)) + call add(buflist, buffer) + endif + endfor + + call eclim#util#TempWindow('[buffers]', lines) + + setlocal modifiable noreadonly + call append(line('$'), ['', '" use ? to view help']) + setlocal nomodifiable readonly + + let b:eclim_buffers = buflist + + " syntax + set ft=eclim_buffers + hi link BufferActive Special + hi link BufferHidden Comment + syntax match BufferActive /+\?active\s\+\(\[RO\]\)\?/ + syntax match BufferHidden /+\?hidden\s\+\(\[RO\]\)\?/ + syntax match Comment /^".*/ + + " mappings + nnoremap :call BufferOpen(g:EclimBuffersDefaultAction) + nnoremap E :call BufferOpen('edit') + nnoremap S :call BufferOpen('split') + nnoremap V :call BufferOpen('vsplit') + nnoremap T :call BufferOpen('tablast \| tabnew') + nnoremap D :call BufferDelete() + nnoremap R :Buffers + + " assign to buffer var to get around weird vim issue passing list containing + " a string w/ a '<' in it on execution of mapping. + let b:buffers_help = [ + \ ' - open buffer with default action', + \ 'E - open with :edit', + \ 'S - open in a new split window', + \ 'V - open in a new vertically split window', + \ 'T - open in a new tab', + \ 'D - delete the buffer', + \ 'R - refresh the buffer list', + \ ] + nnoremap ? + \ :call eclim#help#BufferHelp(b:buffers_help, 'vertical', 40) + + "augroup eclim_buffers + " autocmd! + " autocmd BufAdd,BufWinEnter,BufDelete,BufWinLeave * + " \ call eclim#common#buffers#BuffersUpdate() + " autocmd BufUnload autocmd! eclim_buffers + "augroup END +endfunction " }}} + +function! eclim#common#buffers#BuffersToggle(bang) " {{{ + let name = eclim#util#EscapeBufferName('[buffers]') + if bufwinnr(name) == -1 + call eclim#common#buffers#Buffers(a:bang) + else + exec "bdelete " . bufnr(name) + endif +endfunction " }}} + +function! eclim#common#buffers#BufferCompare(buffer1, buffer2) " {{{ + exec 'let attr1 = a:buffer1.' . g:EclimBuffersSort + exec 'let attr2 = a:buffer2.' . g:EclimBuffersSort + let compare = attr1 == attr2 ? 0 : attr1 > attr2 ? 1 : -1 + if g:EclimBuffersSortDirection == 'desc' + let compare = 0 - compare + endif + return compare +endfunction " }}} + +function! eclim#common#buffers#Only() " {{{ + let curwin = winnr() + let winnum = 1 + while winnum <= winnr('$') + let fixed = g:EclimOnlyExcludeFixed && ( + \ getwinvar(winnum, '&winfixheight') == 1 || + \ getwinvar(winnum, '&winfixwidth') == 1) + let excluded = bufname(winbufnr(winnum)) =~ g:EclimOnlyExclude + if winnum != curwin && !fixed && !excluded + if winnum < curwin + let curwin -= 1 + endif + exec winnum . 'winc w' + close + exec curwin . 'winc w' + continue + endif + let winnum += 1 + endwhile +endfunction " }}} + +function! eclim#common#buffers#GetBuffers(...) " {{{ + let options = a:0 ? a:1 : {} + + redir => list + silent buffers + redir END + + let buffers = [] + let maxfilelength = 0 + for entry in split(list, '\n') + let buffer = {} + let buffer.status = substitute(entry, '\s*[0-9]\+\s\+\(.\{-}\)\s\+".*', '\1', '') + let buffer.path = substitute(entry, '.\{-}"\(.\{-}\)".*', '\1', '') + let buffer.path = fnamemodify(buffer.path, ':p') + let buffer.file = fnamemodify(buffer.path, ':p:t') + let buffer.dir = fnamemodify(buffer.path, ':p:h') + let buffer.bufnr = str2nr(substitute(entry, '\s*\([0-9]\+\).*', '\1', '')) + let buffer.lnum = str2nr(substitute(entry, '.*"\s\+\w\+\s\+\(\d\+\)', '\1', '')) + call add(buffers, buffer) + + if len(buffer.file) > maxfilelength + let maxfilelength = len(buffer.file) + endif + endfor + + if has_key(options, 'maxfilelength') + let options['maxfilelength'] = maxfilelength + endif + + return buffers +endfunction " }}} + +function! eclim#common#buffers#TabInit() " {{{ + let tabnr = 1 + while tabnr <= tabpagenr('$') + let tab_id = gettabvar(tabnr, 'eclim_tab_id') + if tab_id == '' + let s:eclim_tab_id += 1 + call settabvar(tabnr, 'eclim_tab_id', s:eclim_tab_id) + for bufnr in tabpagebuflist(tabnr) + let btab_id = getbufvar(bufnr, 'eclim_tab_id') + if btab_id == '' + call setbufvar(bufnr, 'eclim_tab_id', s:eclim_tab_id) + endif + endfor + endif + let tabnr += 1 + endwhile +endfunction " }}} + +function! eclim#common#buffers#TabEnter() " {{{ + if !s:GetTabId() + call s:SetTabId() + endif + + if g:EclimBuffersDeleteOnTabClose + if exists('s:tab_count') && s:tab_count > tabpagenr('$') + " delete any buffers associated with the closed tab + let buffers = eclim#common#buffers#GetBuffers() + for buffer in buffers + let eclim_tab_id = getbufvar(buffer.bufnr, 'eclim_tab_id') + " don't delete active buffers, just in case the tab has the wrong + " eclim_tab_id + if eclim_tab_id == s:tab_prev && buffer.status !~ 'a' + try + exec 'bdelete ' . buffer.bufnr + catch /E89/ + " ignore since it happens when using bd! on the last buffer for + " another tab. + endtry + endif + endfor + endif + endif +endfunction " }}} + +function! eclim#common#buffers#TabLeave() " {{{ + let s:tab_prev = s:GetTabId() + let s:tab_count = tabpagenr('$') +endfunction " }}} + +function! eclim#common#buffers#TabLastOpenIn() " {{{ + if !buflisted('%') + silent! unlet b:eclim_tab_id + endif + + if !s:GetTabId() + call s:SetTabId() + endif + + let tabnr = 1 + let other_tab = 0 + let bufnr = bufnr('%') + while tabnr <= tabpagenr('$') + if tabnr != tabpagenr() && + \ eclim#util#ListContains(tabpagebuflist(tabnr), bufnr) + let other_tab = tabnr + break + endif + let tabnr += 1 + endwhile + + if !exists('b:eclim_tab_id') || !other_tab + let b:eclim_tab_id = s:GetTabId() + endif +endfunction " }}} + +function! eclim#common#buffers#OpenNextHiddenTabBuffer(current) " {{{ + let allbuffers = eclim#common#buffers#GetBuffers() + + " build list of buffers open in other tabs to exclude + let tabbuffers = [] + let lasttab = tabpagenr('$') + let index = 1 + while index <= lasttab + if index != tabpagenr() + for bnum in tabpagebuflist(index) + call add(tabbuffers, bnum) + endfor + endif + let index += 1 + endwhile + + " build list of buffers not open in any window, and last seen on the + " current tab. + let hiddenbuffers = [] + for buffer in allbuffers + let bnum = buffer.bufnr + if bnum != a:current && index(tabbuffers, bnum) == -1 && bufwinnr(bnum) == -1 + let eclim_tab_id = getbufvar(bnum, 'eclim_tab_id') + if eclim_tab_id != '' && eclim_tab_id != t:eclim_tab_id + continue + endif + + if bnum < a:current + call insert(hiddenbuffers, bnum) + else + call add(hiddenbuffers, bnum) + endif + endif + endfor + + " we found a hidden buffer, so open it + if len(hiddenbuffers) > 0 + exec 'buffer ' . hiddenbuffers[0] + doautocmd BufEnter + doautocmd BufWinEnter + doautocmd BufReadPost + return hiddenbuffers[0] + endif + return 0 +endfunction " }}} + +function! s:BufferDelete() " {{{ + let line = line('.') + if line > len(b:eclim_buffers) + return + endif + + let index = line - 1 + setlocal modifiable + setlocal noreadonly + exec line . ',' . line . 'delete _' + setlocal nomodifiable + setlocal readonly + let buffer = b:eclim_buffers[index] + call remove(b:eclim_buffers, index) + + let winnr = winnr() + " make sure the autocmds are executed in the following order + noautocmd exec 'bd ' . buffer.bufnr + doautocmd BufDelete + doautocmd BufEnter + exec winnr . 'winc w' +endfunction " }}} + +function! s:BufferEntryToLine(buffer, filelength) " {{{ + let line = '' + let line .= a:buffer.status =~ '+' ? '+' : ' ' + let line .= a:buffer.status =~ 'a' ? 'active' : 'hidden' + let line .= a:buffer.status =~ '[-=]' ? ' [RO] ' : ' ' + let line .= a:buffer.file + + let pad = a:filelength - len(a:buffer.file) + 2 + while pad > 0 + let line .= ' ' + let pad -= 1 + endwhile + + let line .= a:buffer.dir + return line +endfunction " }}} + +function! s:BufferOpen(cmd) " {{{ + let line = line('.') + if line > len(b:eclim_buffers) + return + endif + + let file = bufname(b:eclim_buffers[line - 1].bufnr) + let winnr = b:winnr + close + + " prevent opening the buffer in a split of a vertical tool window (project + " tree, taglist, etc.) + if exists('g:VerticalToolBuffers') && has_key(g:VerticalToolBuffers, winbufnr(winnr)) + let winnr = 1 + while has_key(g:VerticalToolBuffers, winbufnr(winnr)) + let winnr += 1 + if winnr > winnr('$') + let winnr -= 1 + break + endif + endwhile + endif + + exec winnr . 'winc w' + call eclim#util#GoToBufferWindowOrOpen(file, a:cmd) +endfunction " }}} + +function! s:GetTabId(...) " {{{ + let tabnr = a:0 ? a:1 : tabpagenr() + " using gettabvar over t:eclim_tab_id because while autocmds are executing, + " the tabpagenr() may return the correct tab number, but accessing + " t:eclim_tab_id may return the value from the previously focused tab. + return gettabvar(tabnr, 'eclim_tab_id') +endfunction " }}} + +function! s:SetTabId(...) " {{{ + let tabnr = a:0 ? a:1 : tabpagenr() + let s:eclim_tab_id += 1 + " using settabvar for reason explained in s:GetTabId() + call settabvar(tabnr, 'eclim_tab_id', s:eclim_tab_id) +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/history.vim b/bundle/eclim/eclim/autoload/eclim/common/history.vim new file mode 100644 index 0000000..404047d --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/history.vim @@ -0,0 +1,316 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2014 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Variables {{{ +let s:command_add = '-command history_add -p "" -f ""' +let s:command_list = '-command history_list -p "" -f ""' +let s:command_revision = + \ '-command history_revision -p "" -f "" -r ' +let s:command_clear = '-command history_clear -p "" -f ""' +" }}} + +function! eclim#common#history#AddHistory() " {{{ + " Adds the current state of the file to the eclipse local history (should be + " invoked prior to saving to disk). + if !filereadable(expand('%')) || !eclim#project#util#IsCurrentFileInProject(0) + return + endif + + let project = eclim#project#util#GetCurrentProjectName() + let file = eclim#project#util#GetProjectRelativeFilePath() + let command = s:command_add + let command = substitute(command, '', project, '') + let command = substitute(command, '', file, '') + call eclim#Execute(command) +endfunction " }}} + +function! eclim#common#history#History() " {{{ + " Opens a temporary buffer with a list of local history revisions. + if !eclim#project#util#IsCurrentFileInProject() + return + endif + + let project = eclim#project#util#GetCurrentProjectName() + let file = eclim#project#util#GetProjectRelativeFilePath() + let command = s:command_list + let command = substitute(command, '', project, '') + let command = substitute(command, '', file, '') + let history = eclim#Execute(command) + if type(history) != g:LIST_TYPE + return + endif + + let lines = [file] + let revisions = [0] + let indent = eclim#util#GetIndent(1) + for rev in history + call add(lines, indent . rev.datetime . ' (' . rev.delta . ')') + call add(revisions, rev.timestamp) + endfor + call add(lines, '') + call eclim#util#TempWindow('[History]', lines) + + setlocal modifiable noreadonly + if !g:EclimKeepLocalHistory + call append(line('$'), + \ '" Note: local history is currently disabled: ' . + \ 'g:EclimKeepLocalHistory = ' . g:EclimKeepLocalHistory) + endif + call append(line('$'), '" use ? to view help') + setlocal nomodifiable readonly + syntax match Comment /^".*/ + + let b:history_revisions = revisions + call s:Syntax() + + command! -count=1 HistoryDiffNext call s:DiffNextPrev(1, ) + command! -count=1 HistoryDiffPrev call s:DiffNextPrev(-1, ) + augroup eclim_history_window + autocmd! BufWinLeave + autocmd BufWinLeave + \ delcommand HistoryDiffNext | + \ delcommand HistoryDiffPrev + augroup END + noremap :call View() + noremap d :call Diff() + noremap r :call Revert() + noremap c :call Clear(1) + + " assign to buffer var to get around weird vim issue passing list containing + " a string w/ a '<' in it on execution of mapping. + let b:history_help = [ + \ ' - view the entry', + \ 'd - diff the file with the version under the cursor', + \ 'r - revert the file to the version under the cursor', + \ 'c - clear the history', + \ ':HistoryDiffNext - diff the file with the next version in the history', + \ ':HistoryDiffPrev - diff the file with the previous version in the history', + \ ] + nnoremap ? + \ :call eclim#help#BufferHelp(b:history_help, 'vertical', 50) +endfunction " }}} + +function! eclim#common#history#HistoryClear(bang) " {{{ + " Clear the history for the current file. + if !eclim#project#util#IsCurrentFileInProject() + return + endif + + call s:Clear(a:bang == '', expand('%:p')) +endfunction " }}} + +function s:View(...) " {{{ + " View the contents of the revision under the cursor. + if line('.') == 1 || line('.') > len(b:history_revisions) + return + endif + + let current = b:filename + let entry = line('.') - 1 + let revision = b:history_revisions[entry] + if eclim#util#GoToBufferWindow(current) + let filetype = &ft + let project = eclim#project#util#GetCurrentProjectName() + let file = eclim#project#util#GetProjectRelativeFilePath() + let command = s:command_revision + let command = substitute(command, '', project, '') + let command = substitute(command, '', file, '') + let command = substitute(command, '', revision, '') + let result = eclim#Execute(command) + if result == "0" + return + endif + + let cmd = len(a:000) > 0 ? a:000[0] : 'split' + call eclim#util#GoToBufferWindowOrOpen( + \ current . '_' . revision, 'keepalt ' . cmd) + + setlocal modifiable + setlocal noreadonly + + let temp = tempname() + call writefile(split(result, '\n'), temp) + try + silent 1,$delete _ + silent read ++edit `=temp` + silent 1,1delete _ + finally + call delete(temp) + endtry + + exec 'setlocal filetype=' . filetype + setlocal nomodified + setlocal readonly + setlocal nomodifiable + setlocal noswapfile + setlocal nobuflisted + setlocal buftype=nofile + setlocal bufhidden=wipe + doautocmd BufReadPost + + call s:HighlightEntry(entry) + + return 1 + else + call eclim#util#EchoWarning('Target file is no longer open.') + endif +endfunction " }}} + +function s:Diff() " {{{ + " Diff the contents of the revision under the cursor against the current + " contents. + let hist_buf = bufnr('%') + let winend = winnr('$') + let winnum = 1 + while winnum <= winend + let bufnr = winbufnr(winnum) + if getbufvar(bufnr, 'history_diff') != '' + exec bufnr . 'bd' + continue + endif + let winnum += 1 + endwhile + call eclim#util#GoToBufferWindow(hist_buf) + + let current = b:filename + let orien = g:EclimHistoryDiffOrientation == 'horizontal' ? '' : 'vertical' + if s:View(orien . ' below split') + let b:history_diff = 1 + diffthis + augroup history_diff + autocmd! BufWinLeave + call eclim#util#GoToBufferWindowRegister(current) + autocmd BufWinLeave diffoff + augroup END + + call eclim#util#GoToBufferWindow(current) + diffthis + endif +endfunction " }}} + +function s:DiffNextPrev(dir, count) " {{{ + let winnr = winnr() + if eclim#util#GoToBufferWindow('[History]') + let num = v:count > 0 ? v:count : a:count + let cur = exists('b:history_current_entry') ? b:history_current_entry : 0 + let index = cur + (a:dir * num) + if index < 0 || index > len(b:history_revisions) + call eclim#util#EchoError('Operation exceeds history stack range.') + exec winnr . 'winc w' + return + endif + call cursor(index + 1, 0) + call s:Diff() + endif +endfunction " }}} + +function s:Revert() " {{{ + " Revert the file to the revision under the cursor. + if line('.') == 1 || line('.') > len(b:history_revisions) + return + endif + + let current = b:filename + let revision = b:history_revisions[line('.') - 1] + if eclim#util#GoToBufferWindow(current) + let project = eclim#project#util#GetCurrentProjectName() + let file = eclim#project#util#GetProjectRelativeFilePath() + let command = s:command_revision + let command = substitute(command, '', project, '') + let command = substitute(command, '', file, '') + let command = substitute(command, '', revision, '') + let result = eclim#Execute(command) + if result == "0" + return + endif + + let ff = &ff + let temp = tempname() + call writefile(split(result, '\n'), temp) + try + silent 1,$delete _ + silent read ++edit `=temp` + silent 1,1delete _ + finally + call delete(temp) + endtry + + if ff != &ff + call eclim#util#EchoWarning( + \ "Warning: the file format is being reverted from '" . ff . "' to '" . + \ &ff . "'. Using vim's undo will not restore the previous format so " . + \ "if you choose to undo the reverting of this file, you will need to " . + \ "manually set the file format back to " . ff . " (set ff=" . ff . ").") + endif + endif +endfunction " }}} + +function s:Clear(prompt, ...) " {{{ + " Optional args: + " filename + let response = 1 + if a:prompt + let response = eclim#util#PromptConfirm( + \ 'Clear local history?', g:EclimHighlightInfo) + endif + + if response == 1 + let filename = len(a:000) > 0 ? a:000[0] : b:filename + let current = eclim#project#util#GetProjectRelativeFilePath(filename) + let project = eclim#project#util#GetCurrentProjectName() + let command = s:command_clear + let command = substitute(command, '', project, '') + let command = substitute(command, '', current, '') + let result = eclim#Execute(command) + if result == "0" + return + endif + + if filename != expand('%:p') + quit + endif + call eclim#util#Echo(result) + endif +endfunction " }}} + +function! s:Syntax() " {{{ + set ft=eclim_history + hi link HistoryFile Identifier + hi link HistoryCurrentEntry Constant + syntax match HistoryFile /.*\%1l.*/ + syntax match Comment /^".*/ +endfunction " }}} + +function s:HighlightEntry(index) " {{{ + let winnr = winnr() + if eclim#util#GoToBufferWindow('[History]') + let b:history_current_entry = a:index + try + " forces reset of syntax + call s:Syntax() + exec 'syntax match HistoryCurrentEntry /.*\%' . (a:index + 1) . 'l.*/' + finally + exec winnr . 'winc w' + endtry + endif +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/largefile.vim b/bundle/eclim/eclim/autoload/eclim/common/largefile.vim new file mode 100644 index 0000000..cd3cfc6 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/largefile.vim @@ -0,0 +1,58 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" Initially based on vimscript 1506 +" +" License: +" +" Copyright (C) 2005 - 2012 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Settings {{{ +let s:file_size = g:EclimLargeFileSize * 1024 * 1024 +let s:events = ['BufRead', 'CursorHold', 'FileType'] +" }}} + +function! eclim#common#largefile#InitSettings() " {{{ + let file = expand("") + let size = getfsize(file) + if size >= s:file_size || size == -2 + if !exists('b:save_events') + let b:save_events = &eventignore + call s:ApplySettings() + setlocal noswapfile nowrap bufhidden=unload + autocmd eclim_largefile BufEnter,BufWinEnter call ApplySettings() + autocmd eclim_largefile BufLeave,BufWinLeave call RevertSettings() + endif + endif +endfunction " }}} + +function! s:ApplySettings() " {{{ + let &eventignore=join(s:events, ',') + if !exists('b:largefile_notified') + let b:largefile_notified = 1 + call eclim#util#Echo('Note: Large file settings applied.') + endif +endfunction " }}} + +function! s:RevertSettings() " {{{ + if exists('b:save_events') + let &eventignore=b:save_events + endif +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/license.vim b/bundle/eclim/eclim/autoload/eclim/common/license.vim new file mode 100644 index 0000000..4fa954d --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/license.vim @@ -0,0 +1,87 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" +" License: +" +" Copyright (C) 2005 - 2012 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Variables {{{ + let s:year = exists('*strftime') ? strftime('%Y') : '2009' +" }}} + +" GetLicense() {{{ +" Retrieves the file containing the license text. +function! eclim#common#license#GetLicense() + let file = eclim#project#util#GetProjectSetting('org.eclim.project.copyright') + if type(file) == g:NUMBER_TYPE + return + elseif file == '' + call eclim#util#EchoWarning( + \ "Project setting 'org.eclim.project.copyright' has not been supplied.") + return + endif + + let file = eclim#project#util#GetCurrentProjectRoot() . '/' . file + if !filereadable(file) + return + endif + return file +endfunction " }}} + +" License(pre, post, mid) {{{ +" Retrieves the license configured license and applies the specified prefix +" and postfix as the lines before and after the license and uses 'mid' as the +" prefix for every line. +" Returns the license as a list of strings. +function! eclim#common#license#License(pre, post, mid) + let file = eclim#common#license#GetLicense() + if type(file) == g:NUMBER_TYPE && file == 0 + return '' + endif + + let contents = readfile(file) + if a:mid != '' + call map(contents, 'a:mid . v:val') + endif + + if a:pre != '' + call insert(contents, a:pre) + endif + + if a:post != '' + call add(contents, a:post) + endif + + call map(contents, "substitute(v:val, '${year}', s:year, 'g')") + + let author = eclim#project#util#GetProjectSetting('org.eclim.user.name') + if type(author) == g:STRING_TYPE && author != '' + call map(contents, "substitute(v:val, '${author}', author, 'g')") + endif + + let email = eclim#project#util#GetProjectSetting('org.eclim.user.email') + if type(email) == g:STRING_TYPE && email != '' + call map(contents, "substitute(v:val, '${email}', email, 'g')") + endif + call map(contents, "substitute(v:val, '\\s\\+$', '', '')") + + return contents +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/locate.vim b/bundle/eclim/eclim/autoload/eclim/common/locate.vim new file mode 100644 index 0000000..042d84f --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/locate.vim @@ -0,0 +1,624 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2017 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Global Variables {{{ +let g:eclim_locate_default_updatetime = &updatetime + +" disable autocomplpop in the locate prompt +if exists('g:acp_behavior') + let g:acp_behavior['locate_prompt'] = [] +endif + +" }}} + +" Script Variables {{{ +let s:command_locate = '-command locate_file -s ""' +let s:scopes = [ + \ 'project', + \ 'workspace', + \ 'buffers', + \ 'quickfix', + \ ] + +let s:help = [ + \ ' - close the locate prompt + results', + \ ', - select the next file', + \ ', - select the previous file', + \ ' - open selected file w/ default action', + \ ' - open with :edit', + \ ' - open in a split window', + \ ' - open in a new tab', + \ ' - choose search scope', + \ ' - toggle help buffer', + \ ] +" }}} + +function! eclim#common#locate#LocateFile(action, file, ...) " {{{ + " Locates a file using the specified action for opening the file when found. + " action - '' (use user default), 'split', 'edit', etc. + " file - 'somefile.txt', + " '', (kick off completion mode), + " '' (locate the file under the cursor) + " scope - optional scope to search in (project, workspace, buffers, etc.) + let project = eclim#project#util#GetCurrentProjectName() + let scope = a:0 > 0 ? a:1 : g:EclimLocateFileScope + + if !eclim#util#ListContains(s:scopes, scope) && + \ !eclim#util#ListContains(g:EclimLocateUserScopes, scope) + call eclim#util#EchoWarning('Unrecognized scope: ' . scope) + return + endif + + if scope == 'project' && (project == '' || !eclim#EclimAvailable(0)) + let scope = g:EclimLocateFileNonProjectScope + endif + + let workspace = '' + if scope == 'project' || scope == 'workspace' + let instance = eclim#client#nailgun#ChooseEclimdInstance() + if type(instance) != g:DICT_TYPE + return + endif + + let workspace = instance.workspace + if !eclim#PingEclim(0, workspace) + call eclim#util#EchoError('Unable to connect to eclimd.') + return + endif + endif + + let results = [] + let action = a:action + if action == '' + let action = g:EclimLocateFileDefaultAction + endif + + let file = a:file + if file == '' + call s:LocateFileCompletionInit(action, scope, project, workspace) + return + elseif file == '' + let file = eclim#util#GrabUri() + + " if grabbing a relative url, remove any anchor info or query parameters + let file = substitute(file, '[#?].*', '', '') + endif + + let name = fnamemodify(file, ':t') + if name == '' + call eclim#util#Echo('Please supply more than just a directory name.') + return + endif + + let pattern = file + let pattern = s:LocateFileConvertPattern(pattern, 0) + let pattern = '[^/]*' . pattern + try + let b:workspace = workspace + let b:project = project + let results = s:LocateFileFunction(scope)(pattern) + finally + unlet! b:workspace + unlet! b:project + endtry + + call map(results, "v:val.path") + + let result = '' + " One result. + if len(results) == 1 + let result = results[0] + + " More than one result. + elseif len(results) > 1 + let message = "Multiple results, choose the file to open" + let response = eclim#util#PromptList(message, results, g:EclimHighlightInfo) + if response == -1 + return + endif + + let result = results[response] + + " No results + else + call eclim#util#Echo('Unable to locate file pattern "' . file . '".') + return + endif + + call eclim#util#GoToBufferWindowOrOpen(eclim#util#Simplify(result), action) + call eclim#util#Echo(' ') +endfunction " }}} + +function! eclim#common#locate#LocateFileCompletion() " {{{ + let line = getline('.') + if line !~ '^> ' + call setline(1, substitute(line, '^>\?\s*', '> \1', '')) + call cursor(1, 3) + let line = getline('.') + endif + + let completions = [] + let display = [] + let name = substitute(line, '^>\s*', '', '') + if name !~ '^\s*$' + let pattern = name + let pattern = s:LocateFileConvertPattern(pattern, g:EclimLocateFileFuzzy) + + let results = s:LocateFileFunction(b:scope)(pattern) + if !empty(results) + for result in results + let rel = eclim#util#Simplify(get(result, 'projectPath', result.path)) + let dict = {'word': result.name, 'menu': rel, 'info': result.path} + call add(completions, dict) + call add(display, result.name . ' ' . rel) + endfor + endif + endif + let b:completions = completions + let winnr = winnr() + noautocmd exec bufwinnr(b:results_bufnum) . 'winc w' + setlocal modifiable + 1,$delete _ + call append(1, display) + 1,1delete _ + setlocal nomodifiable + exec winnr . 'winc w' + + " part of bad hack for gvim on windows + let b:start_selection = 1 + + call s:LocateFileSelection(1) +endfunction " }}} + +function! eclim#common#locate#LocateFileClose() " {{{ + if bufname(bufnr('%')) !~ '^\[Locate.*\]$' + let bufnr = bufnr('\[Locate in *\]') + let winnr = bufwinnr(bufnr) + if winnr != -1 + let curbuf = bufnr('%') + exec winnr . 'winc w' + try + exec 'bw ' . b:results_bufnum + bw + autocmd! locate_file_init + stopinsert + finally + exec bufwinnr(curbuf) . 'winc w' + endtry + endif + endif +endfunction " }}} + +function! s:LocateFileCompletionInit(action, scope, project, workspace) " {{{ + let file = expand('%') + let bufnum = bufnr('%') + let winnr = winnr() + let winrestcmd = winrestcmd() + + topleft 12split [Locate\ Results] + set filetype=locate_results + setlocal nonumber nowrap + setlocal noswapfile nobuflisted + setlocal nospell norelativenumber + setlocal buftype=nofile bufhidden=delete + + let results_bufnum = bufnr('%') + + let locate_in = (a:scope == 'project' ? a:project : a:scope) + exec 'topleft 1split ' . escape('[Locate in ' . locate_in . ']', ' -') + setlocal modifiable + call setline(1, '> ') + call cursor(1, col('$')) + set filetype=locate_prompt + syntax match Keyword /^>/ + setlocal winfixheight + setlocal nonumber + setlocal nolist + setlocal noswapfile nobuflisted + setlocal nospell norelativenumber + setlocal buftype=nofile bufhidden=delete + + let b:bufnum = bufnum + let b:winnr = winnr + let b:project = a:project + let b:workspace = a:workspace + let b:scope = a:scope + let b:results_bufnum = results_bufnum + let b:help_bufnum = 0 + let b:selection = 1 + let b:winrestcmd = winrestcmd + + set updatetime=300 + + augroup locate_file_init + autocmd! + autocmd BufEnter nested startinsert! | let &updatetime = 300 + autocmd BufLeave \[Locate*\] + \ call eclim#util#DelayedCommand('call eclim#common#locate#LocateFileClose()') + exec 'autocmd InsertLeave ' . + \ 'let &updatetime = g:eclim_locate_default_updatetime | ' . + \ 'doautocmd BufWinLeave | bw | ' . + \ 'doautocmd BufWinLeave | bw ' . b:results_bufnum . ' | ' . + \ 'call eclim#util#GoToBufferWindow(' . b:bufnum . ') | ' . + \ 'doautocmd BufEnter | ' . + \ 'doautocmd WinEnter | ' . + \ winrestcmd + exec 'autocmd WinEnter ' + \ 'exec bufwinnr(' . bufnr('%') . ') "winc w"' + augroup END + + " enable completion after user starts typing + call s:LocateFileCompletionAutocmdDeferred() + + inoremap =LocateFileSelection("n") + inoremap =LocateFileSelection("n") + inoremap =LocateFileSelection("n") + inoremap =LocateFileSelection("p") + inoremap =LocateFileSelection("p") + inoremap =LocateFileSelection("p") + exec 'inoremap ' . + \ '=LocateFileSelect("' . a:action . '")' + inoremap =LocateFileSelect('edit') + inoremap =LocateFileSelect('split') + inoremap =LocateFileSelect("tablast \| tabnew") + inoremap =LocateFileChangeScope() + inoremap =LocateFileHelp() + + startinsert! +endfunction " }}} + +function! s:LocateFileCompletionAutocmd() " {{{ + augroup locate_file + autocmd! + autocmd CursorHoldI call eclim#common#locate#LocateFileCompletion() + augroup END +endfunction " }}} + +function! s:LocateFileCompletionAutocmdDeferred() " {{{ + augroup locate_file + autocmd! + autocmd CursorMovedI call LocateFileCompletionAutocmd() + augroup END +endfunction " }}} + +function! s:LocateFileSelection(sel) " {{{ + " pause completion while tabbing though results + augroup locate_file + autocmd! + augroup END + + let sel = a:sel + let prev_sel = b:selection + + let winnr = winnr() + noautocmd exec bufwinnr(b:results_bufnum) . 'winc w' + + if sel == 'n' + let sel = prev_sel < line('$') ? prev_sel + 1 : 1 + elseif sel == 'p' + let sel = prev_sel > 1 ? prev_sel - 1 : line('$') + endif + + syntax clear + exec 'syntax match PmenuSel /\%' . sel . 'l.*/' + exec 'call cursor(' . sel . ', 1)' + let save_scrolloff = &scrolloff + let &scrolloff = 5 + normal! zt + let &scrolloff = save_scrolloff + + exec winnr . 'winc w' + + exec 'let b:selection = ' . sel + + call s:LocateFileCompletionAutocmdDeferred() + + return '' +endfunction " }}} + +function! s:LocateFileSelect(action) " {{{ + if exists('b:completions') && !empty(b:completions) + let &updatetime = g:eclim_locate_default_updatetime + + let file = eclim#util#Simplify(b:completions[b:selection - 1].info) + let bufnum = b:bufnum + let winnr = b:winnr + let winrestcmd = b:winrestcmd + + " close locate windows + exec 'bdelete ' . b:results_bufnum + exec 'bdelete ' . bufnr('%') + + " reset windows to pre-locate sizes + exec winrestcmd + + " open the selected result + exec winnr . "wincmd w" + " call eclim#util#GoToBufferWindow(bufnum) + call eclim#util#GoToBufferWindowOrOpen(file, a:action) + call feedkeys("\", 'n') + doautocmd WinEnter + endif + return '' +endfunction " }}} + +function! s:LocateFileChangeScope() " {{{ + if b:help_bufnum && bufexists(b:help_bufnum) + exec 'bdelete ' . b:help_bufnum + endif + + let bufnr = bufnr('%') + let winnr = winnr() + + " trigger [Locate] buffer's BufLeave autocmd before we leave the buffer + doautocmd BufLeave + + noautocmd exec bufwinnr(b:results_bufnum) . 'winc w' + silent noautocmd exec '50vnew [Locate\ Scope]' + + let b:locate_bufnr = bufnr + let b:locate_winnr = winnr + stopinsert + setlocal modifiable + call append(1, s:scopes + g:EclimLocateUserScopes) + 1,1delete _ + call append(line('$'), + \ ['', '" - select a scope', '" , , or q - cancel']) + syntax match Comment /^".*/ + setlocal nomodifiable + setlocal winfixheight + setlocal nonumber + setlocal nolist + setlocal noswapfile nobuflisted + setlocal nospell norelativenumber + setlocal buftype=nofile bufhidden=delete + + nnoremap :call ChooseScope() + nnoremap q :call CloseScopeChooser() + nnoremap :call CloseScopeChooser() + nnoremap :call CloseScopeChooser() + + autocmd BufLeave call CloseScopeChooser() + + return '' +endfunction " }}} + +function! s:ChooseScope() " {{{ + let scope = getline('.') + if scope =~ '^"\|^\s*$' + return + endif + + let project = '' + let locate_in = scope + + if scope == 'project' + let project = '' + let names = eclim#project#util#GetProjectNames() + let prompt = 'Choose a project (ctrl-c to cancel): ' + while project == '' + let project = input( + \ prompt, '', 'customlist,eclim#project#util#CommandCompleteProject') + if project == '' + echo '' + return + endif + + if !eclim#util#ListContains(names, project) + let prompt = "Project '" . project . "' not found (ctrl-c to cancel): " + let project = '' + endif + endwhile + let locate_in = project + let workspace = eclim#project#util#GetProjectWorkspace(project) + if type(workspace) == g:LIST_TYPE + let workspaces = workspace + unlet workspace + let response = eclim#util#PromptList( + \ 'Muliple workspaces found, please choose the target workspace', + \ workspaces, g:EclimHighlightInfo) + + " user cancelled, error, etc. + if response < 0 + return + endif + + let workspace = workspaces[response] + endif + + elseif scope == 'workspace' + let project = '' + let instance = eclim#client#nailgun#ChooseEclimdInstance() + if type(instance) != g:DICT_TYPE + return + endif + let workspace = instance.workspace + else + let workspace = '' + endif + + call s:CloseScopeChooser() + + let b:scope = scope + let b:project = project + let b:workspace = workspace != '' ? workspace : b:workspace + + exec 'file ' . escape('[Locate in ' . locate_in . ']', ' ') + + call eclim#common#locate#LocateFileCompletion() +endfunction " }}} + +function! s:CloseScopeChooser() " {{{ + let winnum = b:locate_winnr + bwipeout + exec winnum . 'winc w' + + " hack to make :q work like the other close mappings + doautocmd BufEnter + " if we end up in a non-Locate window, make sure everything is as it should + " be (a hack for the above hack). + augroup locate_file_chooser_hack + autocmd! + autocmd BufEnter * + \ if bufname('%') !~ '^\[Locate in .*\]$' | + \ call eclim#common#locate#LocateFileClose() | + \ endif | + \ autocmd! locate_file_chooser_hack + augroup END +endfunction " }}} + +function! s:LocateFileHelp() " {{{ + let winnr = winnr() + noautocmd exec bufwinnr(b:results_bufnum) . 'winc w' + let help_bufnum = eclim#help#BufferHelp(s:help, 'vertical', 50) + exec winnr . 'winc w' + let b:help_bufnum = help_bufnum + + return '' +endfunction " }}} + +function! s:LocateFileConvertPattern(pattern, fuzzy) " {{{ + let pattern = a:pattern + + if a:fuzzy + let pattern = '.*' . substitute(pattern, '\(.\)', '\1.*?', 'g') + let pattern = substitute(pattern, '\.\([^*]\)', '\\.\1', 'g') + else + " if the user supplied a path, prepend a '.*/' to it so that they don't need + " to type full paths to match. + if pattern =~ '.\+/' + let pattern = '.*/' . pattern + endif + let pattern = substitute(pattern, '\*\*', '.*', 'g') + let pattern = substitute(pattern, '\(^\|\([^.]\)\)\*', '\1[^/]*?', 'g') + let pattern = substitute(pattern, '\.\([^*]\)', '\\.\1', 'g') + "let pattern = substitute(pattern, '\([^*]\)?', '\1.', 'g') + let pattern .= '.*' + endif + + return pattern +endfunction " }}} + +function! s:LocateFileFunction(scope) " {{{ + if eclim#util#ListContains(s:scopes, a:scope) + return function('s:LocateFile_' . a:scope) + endif + return function('LocateFile_' . a:scope) +endfunction " }}} + +function! s:LocateFileCommand(pattern) " {{{ + let command = s:command_locate + if g:EclimLocateFileCaseInsensitive == 'always' || + \ (a:pattern !~# '[A-Z]' && g:EclimLocateFileCaseInsensitive != 'never') + let command .= ' -i' + endif + let command .= ' -p "' . a:pattern . '"' + return command +endfunction " }}} + +function! s:LocateFile_workspace(pattern) " {{{ + let command = substitute(s:LocateFileCommand(a:pattern), '', 'workspace', '') + let results = eclim#Execute(command, {'workspace': b:workspace}) + if type(results) != g:LIST_TYPE + return [] + endif + return results +endfunction " }}} + +function! s:LocateFile_project(pattern) " {{{ + let command = substitute(s:LocateFileCommand(a:pattern), '', 'project', '') + let command .= ' -n "' . b:project . '"' + let results = eclim#Execute(command, {'workspace': b:workspace}) + if type(results) != g:LIST_TYPE + return [] + endif + return results +endfunction " }}} + +function! s:LocateFile_buffers(pattern) " {{{ + redir => list + silent exec 'buffers' + redir END + + let buffers = map(split(list, '\n'), + \ "substitute(v:val, '.\\{-}\"\\(.\\{-}\\)\".*', '\\1', '')") + if a:pattern =~ '/' + let buffers = map(buffers, "fnamemodify(v:val, ':p')") + endif + + if len(buffers) > 0 + let tempfile = substitute(tempname(), '\', '/', 'g') + call writefile(buffers, tempfile) + try + return eclim#common#locate#LocateFileFromFileList(a:pattern, tempfile) + finally + call delete(tempfile) + endtry + endif + return [] +endfunction " }}} + +function! s:LocateFile_quickfix(pattern) " {{{ + let buffers = [] + let prev = '' + for entry in getqflist() + let name = bufname(entry.bufnr) + if a:pattern =~ '/' + let name = fnamemodify(name, ':p') + endif + if name != prev + call add(buffers, name) + let prev = name + endif + endfor + + if len(buffers) > 0 + let tempfile = substitute(tempname(), '\', '/', 'g') + call writefile(buffers, tempfile) + try + return eclim#common#locate#LocateFileFromFileList(a:pattern, tempfile) + finally + call delete(tempfile) + endtry + endif + return [] +endfunction " }}} + +function! eclim#common#locate#LocateFileFromFileList(pattern, file) " {{{ + let file = a:file + if eclim#EclimAvailable(0) + let command = substitute(s:LocateFileCommand(a:pattern), '', 'list', '') + let command .= ' -f "' . file . '"' + let results = eclim#Execute(command, {'workspace': b:workspace}) + if type(results) != g:LIST_TYPE + return [] + endif + else + let results = [] + for result in readfile(file) + call add(results, {'name': fnamemodify(result, ':t'), 'path': result}) + endfor + endif + + return results +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/template.vim b/bundle/eclim/eclim/autoload/eclim/common/template.vim new file mode 100644 index 0000000..c569928 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/template.vim @@ -0,0 +1,237 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" +" License: +" +" Copyright (C) 2005 - 2012 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Global Variables {{{ +if !exists("g:EclimTemplateDir") + let g:EclimTemplateDir = g:EclimBaseDir . '/template' +endif +if !exists("g:EclimTemplateExtension") + let g:EclimTemplateExtension = '.vim' +endif +if !exists("g:EclimTemplateIgnore") + let g:EclimTemplateIgnore = [] +endif +" }}} + +" Script Variables {{{ +let s:quote = "['\"]" +let s:tag_regex = + \ '' +let s:tagname_regex = '.\{-} 0 + let ext = strpart(filename, stridx(filename, '.')) + while stridx(ext, '.') != -1 + let ext = strpart(ext, stridx(ext, '.') + 1) + if filereadable(templatesDir . '/' . ext . g:EclimTemplateExtension) + return templatesDir . '/' . ext . g:EclimTemplateExtension + endif + endwhile + endif + + " template equal to file type + if filereadable(templatesDir . '/' . &ft . g:EclimTemplateExtension) + return templatesDir . '/' . &ft . g:EclimTemplateExtension + endif + + return '' +endfunction " }}} + +" s:ExecuteTemplate(lines) {{{ +" Executes any logic in the supplied lines and appends those lines to the +" current file. +function! s:ExecuteTemplate(lines) + for line in a:lines + if line =~ s:tag_regex + let tag = substitute(line, s:tagname_regex, '\1', '') + call s:ExecuteTemplate(s:Process_{tag}(line)) + else + call append(line('$'), line) + endif + endfor +endfunction " }}} + +" s:EvaluateExpression(expression) {{{ +" Evaluates the supplied expression. +function! s:EvaluateExpression(expression) + exec "return " . a:expression +endfunction " }}} + +" s:GetAttribute(line, tag, attribute, fail) {{{ +" Gets the an attribute value. +function! s:GetAttribute(line, tag, attribute, fail) + let attribute = substitute(a:line, + \ '.\{-}.*', + \ '\2', '') + + if attribute == a:line + if a:fail + call s:TemplateError( + \ a:line, "syntax error - missing '" . a:attribute . "' attribute") + endif + return "" + endif + return attribute +endfunction " }}} + +" s:TemplateError(line, message) {{{ +" Echos an error message to the user. +function! s:TemplateError(line, message) + call eclim#util#EchoError("Template error, line " . a:line . ": " . a:message) +endfunction " }}} + +" s:Process_var(line) {{{ +" Process tags. +function! s:Process_var(line) + let name = expand(s:GetAttribute(a:line, 'var', 'name', 1)) + let value = expand(s:GetAttribute(a:line, 'var', 'value', 1)) + + exec "let " . name . " = \"" . s:EvaluateExpression(value) . "\"" + + return [] +endfunction " }}} + +" s:Process_import(line) {{{ +" Process tags. +function! s:Process_import(line) + let resource = expand(s:GetAttribute(a:line, 'import', 'resource', 1)) + if resource !~ '^/\' + let resource = expand(g:EclimTemplateDir . '/' . resource) + endif + + if !filereadable(resource) + call s:TemplateError(a:line, "resource not found '" . resource . "'") + endif + + exec "source " . resource + + return [] +endfunction " }}} + +" s:Process_out(line) {{{ +" Process tags. +function! s:Process_out(line) + let value = s:GetAttribute(a:line, 'out', 'value', 1) + let result = s:EvaluateExpression(value) + return s:Out(a:line, '', result) +endfunction " }}} + +" s:Process_include(line) {{{ +" Process tags. +function! s:Process_include(line) + let template = expand( + \ g:EclimTemplateDir . '/' . s:GetAttribute(a:line, 'include', 'template', 1)) + + if !filereadable(template) + call s:TemplateError(a:line, "template not found '" . template . "'") + return [] + endif + + return readfile(template) +endfunction " }}} + +" s:Process_username(line) {{{ +" Process tags. +function! s:Process_username(line) + silent! let username = eclim#project#util#GetProjectSetting('org.eclim.user.name') + if type(username) == g:NUMBER_TYPE + let username = '' + endif + return s:Out(a:line, '', username) +endfunction " }}} + +" s:Out(line, pattern, value) {{{ +function! s:Out(line, pattern, value) + let results = type(a:value) == g:LIST_TYPE ? a:value : [a:value] + if results[0] == '' && a:line =~ '^\s*' . a:pattern . '\s*$' + return [] + endif + + let line = substitute(a:line, a:pattern, results[0], '') + return [line] + (len(results) > 1 ? results[1:] : []) +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/common/util.vim b/bundle/eclim/eclim/autoload/eclim/common/util.vim new file mode 100644 index 0000000..b8ca94c --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/common/util.vim @@ -0,0 +1,255 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2017 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Variables {{{ +let s:command_read = '-command archive_read -f ""' +" }}} + +function! eclim#common#util#DiffLastSaved() " {{{ + " Diff a modified file with the last saved version. + if &modified + let winnum = winnr() + let filetype=&ft + vertical belowright new | r # + 1,1delete _ + + diffthis + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile + setlocal readonly + exec "setlocal ft=" . filetype + let diffnum = winnr() + + augroup diff_saved + autocmd! BufUnload + autocmd BufUnload :diffoff! + augroup END + + exec winnum . "winc w" + diffthis + + " for some reason, these settings only take hold if set here. + call setwinvar(diffnum, "&foldmethod", "diff") + call setwinvar(diffnum, "&foldlevel", "0") + else + echo "No changes" + endif +endfunction " }}} + +function! eclim#common#util#SwapWords() " {{{ + " Initially based on http://www.vim.org/tips/tip.php?tip_id=329 + + " save the last search pattern + let save_search = @/ + + normal! "_yiw + let pos = getpos('.') + keepjumps s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/ + call setpos('.', pos) + + " restore the last search pattern + let @/ = save_search + + silent! call repeat#set(":call eclim#common#util#SwapWords()\", v:count) +endfunction " }}} + +function! eclim#common#util#SwapAround(char) " {{{ + if len(a:char) != 1 + call eclim#util#EchoError('Arg must be a single character.') + return + endif + + let pos = getpos('.') + let save_search = @/ + try + let lnum = line('.') + let line = getline('.') + let start_col = 0 + if line[col('.') - 1] =~ '[(\[{]' + let start_col = col('.') + normal! % + endif + let col = col('.') + exec 'normal! f' . a:char + if col('.') == col + call eclim#util#EchoError('Char not found on this line.') + return + endif + + let delim_col = col('.') + + let [_, end_col] = searchpos('\S', 'b', lnum) + if !start_col + if line[col('.') - 1] =~ '[)\]}]' + normal! % + let start_col = col('.') + else + let [_, start_col] = searchpos('[(\[{' . a:char . ']', 'b', lnum) + if start_col == end_col + call eclim#util#EchoError('Unable to determine the start of the first block.') + return + endif + let start_col += 1 + endif + endif + + let first = [start_col, end_col] + + call cursor(0, delim_col) + let [_, start_col] = searchpos('\S', '', lnum) + if start_col == delim_col + call eclim#util#EchoError('Could not find item to swap with.') + return + endif + if line[col('.') - 1] =~ '[(\[{]' + normal! % + let end_col = col('.') + else + let [_, end_col] = searchpos('[)\]}' . a:char . ']', '', lnum) + if start_col == end_col + call eclim#util#EchoError('Unable to determine the end of the second block.') + return + endif + let end_col -= 1 + endif + + let second = [start_col, end_col] + + let first_part = strpart(line, first[0] - 1, first[1] - first[0] + 1) + let second_part = strpart(line, second[0] - 1, second[1] - second[0] + 1) + + " replace second with first + let prefix = strpart(line, 0, second[0] - 1) + let suffix = strpart(line, second[1]) + let line = prefix . first_part . suffix + + " replace first with second + let prefix = strpart(line, 0, first[0] - 1) + let suffix = strpart(line, first[1]) + let line = prefix . second_part . suffix + + call setline('.', line) + silent! call repeat#set( + \ ":call eclim#common#util#SwapAround(" . string(a:char) . ")\", v:count) + finally + call setpos('.', pos) + let @/ = save_search + endtry +endfunction " }}} + +function! eclim#common#util#Tcd(dir) " {{{ + " Like vim's :lcd, but tab local instead of window local. + let t:cwd = fnamemodify(a:dir, ':p') + + " initialize the tab cwd for all other tabs if not already set + let curtab = tabpagenr() + try + let index = 1 + while index <= tabpagenr('$') + if index != curtab + exec 'tabn ' . index + if !exists('t:cwd') + let t:cwd = getcwd() + " try to find a window without a localdir if necessary + if haslocaldir() + let curwin = winnr() + let windex = 1 + while windex <= winnr('$') + if windex != curwin + exec windex . 'winc w' + if !haslocaldir() + let t:cwd = getcwd() + break + endif + endif + let windex += 1 + endwhile + exec curwin . 'winc w' + endif + endif + endif + let index += 1 + endwhile + finally + exec 'tabn ' . curtab + endtry + + call s:ApplyTcd(0) + + augroup tcd + autocmd! + autocmd TabEnter * call ApplyTcd(1) + augroup END +endfunction " }}} + +function! s:ApplyTcd(honor_lcd) " {{{ + if !exists('t:cwd') + return + endif + + if a:honor_lcd && haslocaldir() + let lcwd = getcwd() + exec 'cd ' . escape(t:cwd, ' ') + exec 'lcd ' . escape(lcwd, ' ') + else + exec 'cd ' . escape(t:cwd, ' ') + endif +endfunction " }}} + +function! eclim#common#util#ReadFile() " {{{ + " Reads the contents of an archived file. + let archive = substitute(expand('%'), '\', '/', 'g') + let command = substitute(s:command_read, '', archive, '') + + let file = eclim#Execute(command) + + if string(file) != '0' + let project = exists('b:eclim_project') ? b:eclim_project : '' + let bufnum = bufnr('%') + silent exec "keepalt keepjumps edit! " . escape(file, ' ') + if project != '' + let b:eclim_project = project + let b:eclim_file = archive + endif + + exec 'bdelete ' . bufnum + + " alternate solution, that keeps the archive url as the buffer's filename, + " but prevents taglist from being able to parse tags. + "setlocal noreadonly + "setlocal modifiable + "silent! exec "read " . file + "1,1delete _ + + silent exec "doautocmd BufReadPre " . file + silent exec "doautocmd BufReadPost " . file + + setlocal readonly + setlocal nomodifiable + setlocal noswapfile + " causes taglist.vim errors (fold then delete fails) + "setlocal bufhidden=delete + endif +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/display/fold.vim b/bundle/eclim/eclim/autoload/eclim/display/fold.vim new file mode 100644 index 0000000..74811b0 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/display/fold.vim @@ -0,0 +1,70 @@ +" Author: Kannan Rajah +" +" License: {{{ +" +" Copyright (C) 2014 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +function! eclim#display#fold#GetTreeFold(lnum) " {{{ + " Folding to create a tree structure + " The default VIM fold shows the first line of a block separately. + " But we want to show it with its contents. This is more compact and + " easier to read. + " Code is taken from: + " http://learnvimscriptthehardway.stevelosh.com/chapters/49.html + if getline(a:lnum) =~? '\v^\s*$' + return '-1' + endif + + let this_indent = eclim#display#fold#IndentLevel(a:lnum) + let next_line = eclim#display#fold#NextNonBlankLine(a:lnum) + let next_indent = eclim#display#fold#IndentLevel(next_line) + + if next_indent == this_indent + return this_indent + elseif next_indent < this_indent + return this_indent + elseif next_indent > this_indent + return '>' . next_indent + endif +endfunction " }}} + +function! eclim#display#fold#IndentLevel(lnum) " {{{ + return indent(a:lnum) / &shiftwidth +endfunction " }}} + +function! eclim#display#fold#NextNonBlankLine(lnum) " {{{ + let numlines = line('$') + let current = a:lnum + 1 + + while current <= numlines + if getline(current) =~? '\v\S' + return current + endif + + let current += 1 + endwhile + + return -2 +endfunction " }}} + +function! eclim#display#fold#TreeFoldText() " {{{ + let line = substitute(getline(v:foldstart), '▾', '▸', 'g') + return line +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/display/menu.vim b/bundle/eclim/eclim/autoload/eclim/display/menu.vim new file mode 100644 index 0000000..add50f8 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/display/menu.vim @@ -0,0 +1,103 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" Plugin to generate gvim eclim menus. +" +" License: +" +" Copyright (C) 2005 - 2013 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Script Variables {{{ + +let s:eclim_menus_root = [] +let s:eclim_menus = {} + +" }}} + +" Generate() {{{ +" Generate gvim menu items for available eclim commands. +function! eclim#display#menu#Generate() + " check that the menu bar is enabled or that we are running in a mac gui where + " the menu bar always exists regardless of guioptions + if &guioptions !~ 'm' && !has('gui_macvim') + if exists('b:eclim_menus') + unlet b:eclim_menus + endif + return + endif + + redir => commands + silent exec 'command' + redir END + + if !exists('b:eclim_menus') + let b:eclim_menus = {} + + let pattern = '\. +" +" }}} + +" Script Variables {{{ + + let s:sign_levels = { + \ 'trace': 5, + \ 'debug': 4, + \ 'info': 3, + \ 'warning': 2, + \ 'error': 1, + \ 'off': 0, + \ } + + let s:sign_ids = {} + +" }}} + +function! eclim#display#signs#Define(name, text, highlight, ...) " {{{ + " Defines a new sign name or updates an existing one. + " Optional arg: + " linehl: The highlight to use for the line with this sign applied. + call s:Define(a:name) + let command = "sign define " . a:name . " text=" . a:text . " texthl=" . a:highlight + if a:0 + let command .= " linehl=" . a:1 + endif + exec command +endfunction " }}} + +function! s:Define(name) " {{{ + " Defines a new sign name and assignes it a base id. + if !has_key(s:sign_ids, a:name) + let sid = 0 + let index = 0 + let name = 'eclim' . a:name + while index < len(name) + let sid += char2nr(name[index]) + let index += 1 + endwhile + let sid = sid * 1000 + for [key, value] in items(s:sign_ids) + if value == sid + throw printf('Sign id for "%s" clashes with "%s".', a:name, key) + endif + endfor + let s:sign_ids[a:name] = sid + endif +endfunction " }}} + +function! eclim#display#signs#Id(name, line) " {{{ + return s:sign_ids[a:name] + a:line +endfunction " }}} + +function! eclim#display#signs#Place(name, line) " {{{ + " Places a sign in the current buffer. + call eclim#display#signs#PlaceInBuffer(a:name, bufnr('%'), a:line) +endfunction " }}} + +function! eclim#display#signs#PlaceInBuffer(name, buffer_num, line) " {{{ + " Places a sign in the given buffer. + if a:line > 0 + let lastline = line('$') + let line = a:line <= lastline ? a:line : lastline + let id = eclim#display#signs#Id(a:name, line) + exec "sign place " . id . " line=" . line . " name=" . a:name . + \ " buffer=" . a:buffer_num + endif +endfunction " }}} + +function! eclim#display#signs#PlaceAll(name, list) " {{{ + " Places a sign in the current buffer for each line in the list. + + let lastline = line('$') + for line in a:list + if line > 0 + let line = line <= lastline ? line : lastline + exec "sign place " . line . " line=" . line . " name=" . a:name . + \ " buffer=" . bufnr('%') + endif + endfor +endfunction " }}} + +function! eclim#display#signs#Undefine(name) " {{{ + " Undefines a sign name. + exec "sign undefine " . a:name +endfunction " }}} + +function! eclim#display#signs#Unplace(id) " {{{ + " Un-places a sign in the current buffer. + call eclim#display#signs#UnplaceFromBuffer(a:id, bufnr('%')) +endfunction " }}} + +function! eclim#display#signs#UnplaceFromBuffer(id, buffer_num) " {{{ + " Un-places a sign from the given buffer + exec 'sign unplace ' . a:id . ' buffer=' . a:buffer_num +endfunction " }}} + +function! eclim#display#signs#UnplaceAll(list) " {{{ + " Un-places all signs in the supplied list from the current buffer. + " The list may be a list of ids or a list of dictionaries as returned by + " GetExisting() + + for sign in a:list + if type(sign) == g:DICT_TYPE + call eclim#display#signs#Unplace(sign.id) + else + call eclim#display#signs#Unplace(sign) + endif + endfor +endfunction " }}} + +function! eclim#display#signs#Toggle(name, line) " {{{ + if g:EclimSignLevel == 'off' + call eclim#util#Echo('Eclim signs have been disabled.') + return + endif + + " Toggle a sign on the current line. + if a:line > 0 + let existing = eclim#display#signs#GetExisting(a:name) + let exists = filter(existing, "v:val['line'] == a:line") + if len(exists) + call eclim#display#signs#Unplace(exists[0].id) + else + call eclim#display#signs#Place(a:name, a:line) + endif + endif +endfunction " }}} + +function! s:CompareSigns(s1, s2) " {{{ + " Used by ViewSigns to sort list of sign dictionaries. + + if a:s1.line == a:s2.line + return 0 + endif + if a:s1.line > a:s2.line + return 1 + endif + return -1 +endfunction " }}} + +function! eclim#display#signs#ViewSigns(name) " {{{ + " Open a window to view all placed signs with the given name in the current + " buffer. + + if g:EclimSignLevel == 'off' + call eclim#util#Echo('Eclim signs have been disabled.') + return + endif + + let filename = expand('%:p') + let signs = eclim#display#signs#GetExisting(a:name) + call sort(signs, 's:CompareSigns') + let content = map(signs, "v:val.line . '|' . getline(v:val.line)") + + call eclim#util#TempWindow('[Sign List]', content) + + set ft=qf + nnoremap :call JumpToSign() + + " Store filename so that plugins can use it if necessary. + let b:filename = filename + augroup temp_window + autocmd! BufWinLeave + call eclim#util#GoToBufferWindowRegister(filename) + augroup END +endfunction " }}} + +function! s:JumpToSign() " {{{ + let winnr = bufwinnr(bufnr('^' . b:filename)) + if winnr != -1 + let line = substitute(getline('.'), '^\(\d\+\)|.*', '\1', '') + exec winnr . "winc w" + call cursor(line, 1) + endif +endfunction " }}} + +function! eclim#display#signs#GetDefined() " {{{ + " Gets a list of defined sign names. + + redir => list + silent exec 'sign list' + redir END + + let names = [] + for name in split(list, '\n') + let name = substitute(name, 'sign\s\(.\{-}\)\s.*', '\1', '') + call add(names, name) + endfor + return names +endfunction " }}} + +function! eclim#display#signs#GetExisting(...) " {{{ + " Gets a list of existing signs for the current buffer. + " The list consists of dictionaries with the following keys: + " id: The sign id. + " line: The line number. + " name: The sign name (erorr, warning, etc.) + " + " Optionally one or more sign names may be supplied to only retrieve signs + " for those names. + + if !has('signs') || g:EclimSignLevel == 'off' + return [] + endif + + let bufnr = bufnr('%') + + redir => signs + silent exec 'sign place buffer=' . bufnr + redir END + + let existing = [] + for line in split(signs, '\n') + if line =~ '.\{-}=.\{-}=' " only two equals to account for swedish output + call add(existing, s:ParseSign(line)) + endif + endfor + + if len(a:000) > 0 + let pattern = '^\(' . join(a:000, '\|') . '\)$' + call filter(existing, "v:val['name'] =~ pattern") + endif + + return existing +endfunction " }}} + +function! eclim#display#signs#HasExisting(...) " {{{ + " Determines if there are any existing signs. + " Optionally a sign name may be supplied to only test for signs of that name. + + if !has('signs') || g:EclimSignLevel == 'off' + return 0 + endif + + let bufnr = bufnr('%') + + redir => results + silent exec 'sign place buffer=' . bufnr + redir END + + for line in split(results, '\n') + if line =~ '.\{-}=.\{-}=' " only two equals to account for swedish output + if len(a:000) == 0 + return 1 + endif + let sign = s:ParseSign(line) + if sign.name == a:000[0] + return 1 + endif + endif + endfor + + return 0 +endfunction " }}} + +function! s:ParseSign(raw) " {{{ + let attrs = split(a:raw) + + exec 'let line = ' . split(attrs[0], '=')[1] + + let id = split(attrs[1], '=')[1] + " hack for the italian localization + if id =~ ',$' + let id = id[:-2] + endif + + " hack for the swedish localization + if attrs[2] =~ '^namn' + let name = substitute(attrs[2], 'namn=\?', '', '') + else + let name = split(attrs[2], '=')[1] + endif + + return {'id': id, 'line': line, 'name': name} +endfunction " }}} + +function! eclim#display#signs#Update() " {{{ + " Updates the signs for the current buffer. This function will read both the + " location list and the quickfix list and place a sign for any entries for the + " current file. + " This function supports a severity level by examining the 'type' key of the + " dictionaries in the location or quickfix list. It supports 'i' (info), 'w' + " (warning), and 'e' (error). + + if !has('signs') || g:EclimSignLevel == 'off' || &ft == 'qf' + return + endif + + let save_lazy = &lazyredraw + set lazyredraw + + let placeholder = eclim#display#signs#SetPlaceholder() + + " remove all existing signs + let existing = eclim#display#signs#GetExisting() + for exists in existing + if exists.name =~ '^\(qf_\)\?\(error\|info\|warning\)$' + call eclim#display#signs#Unplace(exists.id) + endif + endfor + + let qflist = filter(g:EclimShowQuickfixSigns ? getqflist() : [], + \ 'bufnr("%") == v:val.bufnr') + let show_loclist = g:EclimShowLoclistSigns && exists('b:eclim_loclist') + let loclist = filter(show_loclist ? getloclist(0) : [], + \ 'bufnr("%") == v:val.bufnr') + + for [list, marker, prefix] in [ + \ [qflist, g:EclimQuickfixSignText, 'qf_'], + \ [loclist, g:EclimLoclistSignText, '']] + if s:sign_levels[g:EclimSignLevel] >= 3 + let info = filter(copy(list), 'v:val.type == "" || tolower(v:val.type) == "i"') + call eclim#display#signs#Define(prefix . 'info', marker, g:EclimHighlightInfo) + call eclim#display#signs#PlaceAll(prefix . 'info', map(info, 'v:val.lnum')) + endif + + if s:sign_levels[g:EclimSignLevel] >= 2 + let warnings = filter(copy(list), 'tolower(v:val.type) == "w"') + call eclim#display#signs#Define(prefix . 'warning', marker, g:EclimHighlightWarning) + call eclim#display#signs#PlaceAll(prefix . 'warning', map(warnings, 'v:val.lnum')) + endif + + if s:sign_levels[g:EclimSignLevel] >= 1 + let errors = filter(copy(list), 'tolower(v:val.type) == "e"') + call eclim#display#signs#Define(prefix . 'error', marker, g:EclimHighlightError) + call eclim#display#signs#PlaceAll(prefix . 'error', map(errors, 'v:val.lnum')) + endif + endfor + + if placeholder + call eclim#display#signs#RemovePlaceholder() + endif + + let &lazyredraw = save_lazy +endfunction " }}} + +function! eclim#display#signs#QuickFixCmdPost() " {{{ + " Force 'make' results to be of type error if no type set. + if expand('') == 'make' + let newentries = [] + for entry in getqflist() + if entry['type'] == '' + let entry['type'] = 'e' + endif + call add(newentries, entry) + endfor + call setqflist(newentries, 'r') + endif + call eclim#display#signs#Update() + redraw! +endfunction " }}} + +function! eclim#display#signs#SetPlaceholder(...) " {{{ + " Set sign at line 1 to prevent sign column from collapsing, and subsiquent + " screen redraw. + " Optional args: + " only_if_necessary: if 1, only set a placeholder if there are no existing + " signs + + if !has('signs') || g:EclimSignLevel == 'off' + return + endif + + if len(a:000) > 0 && a:000[0] + let existing = eclim#display#signs#GetExisting() + if !len(existing) + return + endif + endif + + call eclim#display#signs#Define('placeholder', '_ ', g:EclimHighlightInfo) + let existing = eclim#display#signs#GetExisting('placeholder') + if len(existing) == 0 && eclim#display#signs#HasExisting() + call eclim#display#signs#Place('placeholder', 1) + return 1 + endif + return +endfunction " }}} + +function! eclim#display#signs#RemovePlaceholder() " {{{ + if !has('signs') || g:EclimSignLevel == 'off' + return + endif + + let existing = eclim#display#signs#GetExisting('placeholder') + for exists in existing + call eclim#display#signs#Unplace(exists.id) + endfor +endfunction " }}} + +" define signs for manually added user marks. +if has('signs') + call eclim#display#signs#Define( + \ 'user', g:EclimUserSignText, g:EclimHighlightUserSign) +endif + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/display/window.vim b/bundle/eclim/eclim/autoload/eclim/display/window.vim new file mode 100644 index 0000000..8e79b17 --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/display/window.vim @@ -0,0 +1,350 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" +" Copyright (C) 2005 - 2014 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" GlobalVariables {{{ +let g:VerticalToolBuffers = {} + +if !exists('g:VerticalToolWindowSide') + let g:VerticalToolWindowSide = 'left' +endif + +if g:VerticalToolWindowSide == 'right' + let g:VerticalToolWindowPosition = 'botright vertical' +else + let g:VerticalToolWindowPosition = 'topleft vertical' +endif + +if !exists('g:VerticalToolWindowWidth') + let g:VerticalToolWindowWidth = 30 +endif +" }}} + +function! eclim#display#window#VerticalToolWindowOpen(name, weight, ...) " {{{ + " Handles opening windows in the vertical tool window on the left (taglist, + " project tree, etc.) + + let taglist_window = -1 + if exists('g:TagList_title') + let taglist_window = bufwinnr(eclim#util#EscapeBufferName(g:TagList_title)) + let taglist_position = 'left' + if exists('g:Tlist_Use_Horiz_Window') && g:Tlist_Use_Horiz_Window + let taglist_position = 'horizontal' + elseif exists('g:TaglistTooPosition') + let taglist_position = g:TaglistTooPosition + elseif exists('g:Tlist_Use_Right_Window') && g:Tlist_Use_Right_Window + let taglist_position = 'right' + endif + endif + if taglist_window == -1 && exists(':TagbarOpen') + let taglist_window = bufwinnr('__Tagbar__') + let taglist_position = 'right' + if exists('g:tagbar_left') && g:tagbar_left + let taglist_position = 'left' + endif + endif + if taglist_window != -1 + " don't consider horizontal taglist, or taglist configured to display + " opposite the tool windows as a tool window member. + if taglist_position != g:VerticalToolWindowSide + let taglist_window = -1 + endif + endif + + let relative_window = 0 + let relative_window_loc = 'below' + if taglist_window != -1 || len(g:VerticalToolBuffers) > 0 + if taglist_window != -1 + let relative_window = taglist_window + endif + for toolbuf in keys(g:VerticalToolBuffers) + exec 'let toolbuf = ' . toolbuf + if bufwinnr(toolbuf) != -1 + if relative_window == 0 + let relative_window = bufwinnr(toolbuf) + if getbufvar(toolbuf, 'weight') > a:weight + let relative_window_loc = 'below' + else + let relative_window_loc = 'above' + endif + elseif getbufvar(toolbuf, 'weight') > a:weight + let relative_window = bufwinnr(toolbuf) + let relative_window_loc = 'below' + elseif getbufvar(toolbuf, 'weight') < a:weight + let relative_window = bufwinnr(toolbuf) + let relative_window_loc = 'above' + endif + endif + endfor + endif + + if relative_window != 0 + let wincmd = relative_window . 'winc w | keepalt ' . relative_window_loc . ' ' + else + let wincmd = 'keepalt ' . g:VerticalToolWindowPosition . ' ' . g:VerticalToolWindowWidth + endif + + let escaped = substitute( + \ a:name, '\(.\{-}\)\[\(.\{-}\)\]\(.\{-}\)', '\1[[]\2[]]\3', 'g') + if a:0 && a:1 + let bufnum = -1 + for bnr in tabpagebuflist() + if bufname(bnr) == a:name + let bufnum = bnr + break + endif + endfor + else + let bufnum = bufnr(escaped) + endif + let name = bufnum == -1 ? a:name : '+buffer' . bufnum + silent call eclim#util#ExecWithoutAutocmds(wincmd . ' split ' . name) + + doautocmd BufWinEnter + setlocal winfixwidth + setlocal nonumber + setlocal nospell norelativenumber + + let b:weight = a:weight + let bufnum = bufnr('%') + let g:VerticalToolBuffers[bufnum] = a:name + augroup eclim_vertical_tool_windows + autocmd! + autocmd BufDelete * call s:PreventCloseOnBufferDelete() + autocmd BufEnter * nested call s:CloseIfLastWindow() + augroup END + + if exists('g:TagList_title') && + \ (!exists('g:Tlist_Use_Horiz_Window') || !g:Tlist_Use_Horiz_Window) + augroup eclim_vertical_tool_windows_move_taglist + autocmd! + autocmd BufWinEnter * if bufname('%') == g:TagList_title | call s:MoveRelativeTo() | endif + augroup END + endif + if exists(':TagbarOpen') + augroup eclim_vertical_tool_windows_move_tagbar + autocmd! + autocmd BufWinEnter __Tagbar__ call s:MoveRelativeTo() + augroup END + endif + augroup eclim_vertical_tool_windows_buffer + exec 'autocmd BufWinLeave ' . + \ 'silent! call remove(g:VerticalToolBuffers, ' . bufnum . ') | ' . + \ 'autocmd! eclim_vertical_tool_windows_buffer * ' + augroup END +endfunction " }}} + +function! eclim#display#window#VerticalToolWindowRestore() " {{{ + " Used to restore the tool windows to their proper width if some action + " altered them. + + for toolbuf in keys(g:VerticalToolBuffers) + exec 'let toolbuf = ' . toolbuf + if bufwinnr(toolbuf) != -1 + exec 'vertical ' . bufwinnr(toolbuf) . 'resize ' . g:VerticalToolWindowWidth + endif + endfor +endfunction " }}} + +function! eclim#display#window#GetWindowOptions(winnum) " {{{ + " Gets a dictionary containing all the localy set options for the specified + " window. + + let curwin = winnr() + try + exec a:winnum . 'winc w' + redir => list + silent exec 'setlocal' + redir END + finally + exec curwin . 'winc w' + endtry + + let list = substitute(list, '---.\{-}---', '', '') + let winopts = {} + for wopt in split(list, '\(\n\|\s\s\+\)')[1:] + if wopt =~ '^[a-z]' + if wopt =~ '=' + let key = substitute(wopt, '\(.\{-}\)=.*', '\1', '') + let value = substitute(wopt, '.\{-}=\(.*\)', '\1', '') + let winopts[key] = value + else + let winopts[wopt] = '' + endif + endif + endfor + return winopts +endfunction " }}} + +function! eclim#display#window#SetWindowOptions(winnum, options) " {{{ + " Given a dictionary of options, sets each as local options for the specified + " window. + + let curwin = winnr() + try + exec a:winnum . 'winc w' + for key in keys(a:options) + if key =~ '^no' + silent! exec 'setlocal ' . key + else + silent! exec 'setlocal ' . key . '=' . escape(a:options[key], ' ') + endif + endfor + finally + exec curwin . 'winc w' + endtry +endfunction " }}} + +function! s:CloseIfLastWindow() " {{{ + if histget(':', -1) !~ '^bd' + let close = 1 + for bufnr in tabpagebuflist() + if has_key(g:VerticalToolBuffers, bufnr) + continue + endif + if exists('g:TagList_title') && bufname(bufnr) == g:TagList_title + continue + endif + if exists('g:BufExplorer_title') && bufname(bufnr) == '[BufExplorer]' + let close = 0 + break + endif + + let buftype = getbufvar(bufnr, '&buftype') + if buftype != '' && buftype != 'help' + continue + endif + + let close = 0 + break + endfor + + if close + if tabpagenr('$') > 1 + tabclose + else + quitall + endif + endif + endif +endfunction " }}} + +function! s:MoveRelativeTo() " {{{ + " get the buffer that the taglist was opened from + let curwin = winnr() + let list_buffer = bufnr('%') + winc p + let orig_buffer = bufnr('%') + exec curwin . 'winc p' + + for toolbuf in keys(g:VerticalToolBuffers) + exec 'let toolbuf = ' . toolbuf + if bufwinnr(toolbuf) != -1 + call setwinvar(bufwinnr(toolbuf), 'marked_for_removal', 1) + let winoptions = eclim#display#window#GetWindowOptions(bufwinnr(toolbuf)) + call remove(winoptions, 'filetype') + call remove(winoptions, 'syntax') + call eclim#display#window#VerticalToolWindowOpen( + \ g:VerticalToolBuffers[toolbuf], getbufvar(toolbuf, 'weight')) + call eclim#display#window#SetWindowOptions(winnr(), winoptions) + endif + endfor + + let winnum = 1 + while winnum <= winnr('$') + if getwinvar(winnum, 'marked_for_removal') == 1 + exec winnum . 'winc w' + close + else + let winnum += 1 + endif + endwhile + call eclim#display#window#VerticalToolWindowRestore() + + " some window juggling so that winc p from taglist goes back to the original + " buffer + exec bufwinnr(orig_buffer) . 'winc w' + exec bufwinnr(list_buffer) . 'winc w' +endfunction " }}} + +function! s:PreventCloseOnBufferDelete() " {{{ + let index = 1 + let numtoolwindows = 0 + let numtempwindows = 0 + let tempbuffersbot = [] + while index <= winnr('$') + let buf = winbufnr(index) + let bufname = bufname(buf) + if index(keys(g:VerticalToolBuffers), string(buf)) != -1 + let numtoolwindows += 1 + elseif getwinvar(index, '&winfixheight') || getwinvar(index, '&winfixwidth') + let numtempwindows += 1 + if getwinvar(index, '&winfixheight') + call add(tempbuffersbot, buf) + endif + endif + let index += 1 + endwhile + + if winnr('$') == (numtoolwindows + numtempwindows) + let toolbuf = bufnr('%') + if g:VerticalToolWindowSide == 'right' + vertical topleft new + else + vertical botright new + endif + setlocal noreadonly modifiable + let curbuf = bufnr('%') + let removed = str2nr(expand('')) + let next = eclim#common#buffers#OpenNextHiddenTabBuffer(removed) + if next != 0 + let curbuf = next + endif + + " resize windows + exec bufwinnr(toolbuf) . 'winc w' + exec 'vertical resize ' . g:VerticalToolWindowWidth + + " fix the position of the temp windows + for buf in tempbuffersbot + " open the buffer in the temp window position + botright 10new + exec 'buffer ' . buf + setlocal winfixheight + + " close the old window + let winnr = winnr() + let index = 1 + while index <= winnr('$') + if winbufnr(index) == buf && index != winnr + exec index . 'winc w' + close + winc p + break + endif + let index += 1 + endwhile + endfor + + exec bufwinnr(curbuf) . 'winc w' + endif +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/help.vim b/bundle/eclim/eclim/autoload/eclim/help.vim new file mode 100644 index 0000000..5d2dc1b --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/help.vim @@ -0,0 +1,169 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" Commands view / search eclim help files. +" +" License: +" +" Copyright (C) 2005 - 2013 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" Global Variables {{{ + let g:EclimHelpDir = g:EclimBaseDir . '/eclim/doc' +" }}} + +" Help(tag) {{{ +function! eclim#help#Help(tag, link) + if !filereadable(substitute(g:EclimHelpDir, '\\\s', ' ', 'g') . '/tags') + call eclim#util#Echo('indexing eclim help files...') + exec 'helptags ' . g:EclimHelpDir + let paths = split(glob(g:EclimHelpDir . '/**/*'), '\n') + call filter(paths, 'isdirectory(v:val)') + for path in paths + exec 'helptags ' . path + endfor + call eclim#util#Echo('eclim help files indexed') + endif + + let savetags = &tags + exec 'set tags=' . escape(escape(g:EclimHelpDir, ' '), ' ') . '/**/tags' + try + let tag = a:tag + if tag == '' && !a:link + let tag = 'index' + elseif tag =='' + let line = getline('.') + let tag = substitute( + \ line, '.*|\(\S\{-}\%' . col('.') . 'c\S\{-}\)|.*', '\1', '') + if tag == line + return + endif + endif + + call s:HelpWindow() + exec 'tag ' . tag + let w:eclim_help = 1 + + " needed to ensure taglist is updated if open + doautocmd BufEnter + catch /^Vim\%((\a\+)\)\=:E426/ + if !exists('w:eclim_help') + close + endif + call eclim#util#EchoError('Sorry no eclim help for ' . tag) + finally + let &tags = savetags + endtry +endfunction " }}} + +" HelpGrep() {{{ +function! eclim#help#HelpGrep(args) + exec 'vimgrep ' a:args . ' ' . g:EclimHelpDir . '/**/*.txt' +endfunction " }}} + +" s:HelpWindow() {{{ +function s:HelpWindow() + let max = winnr('$') + let index = 1 + while index <= max + if getwinvar(index, 'eclim_help') + exec index . 'winc w' + return + endif + let index += 1 + endwhile + + new +endfunction " }}} + +" BufferHelp(lines, orientation, size) {{{ +" Function to display a help window for the current buffer. +function! eclim#help#BufferHelp(lines, orientation, size) + let orig_bufnr = bufnr('%') + let name = expand('%') + if name =~ '^\W.*\W$' + let name = name[:-2] . ' Help' . name[len(name) - 1] + else + let name .= ' Help' + endif + + let bname = eclim#util#EscapeBufferName(name) + + let orient = a:orientation == 'vertical' ? 'v' : '' + if bufwinnr(bname) != -1 + exec 'bd ' . bufnr(bname) + return + endif + + silent! noautocmd exec a:size . orient . "new " . escape(name, ' ') + if a:orientation == 'vertical' + setlocal winfixwidth + else + setlocal winfixheight + endif + setlocal nowrap + setlocal noswapfile nobuflisted nonumber + setlocal nospell norelativenumber + setlocal buftype=nofile bufhidden=delete + nnoremap ? :bd + nnoremap q :bd + + setlocal modifiable noreadonly + silent 1,$delete _ + call append(1, a:lines) + retab + silent 1,1delete _ + + if len(a:000) == 0 || a:000[0] + setlocal nomodified nomodifiable readonly + endif + + let help_bufnr = bufnr('%') + augroup eclim_help_buffer + autocmd! BufWinLeave + autocmd BufWinLeave nested autocmd! eclim_help_buffer * + exec 'autocmd BufWinLeave nested ' . + \ 'autocmd! eclim_help_buffer * ' + exec 'autocmd! BufWinLeave ' + exec 'autocmd BufWinLeave nested bd ' . help_bufnr + augroup END + + return help_bufnr +endfunction " }}} + +" CommandComplete(argLead, cmdLine, cursorPos) {{{ +function! eclim#help#CommandCompleteTag(argLead, cmdLine, cursorPos) + let cmdTail = strpart(a:cmdLine, a:cursorPos) + let argLead = substitute(a:argLead, cmdTail . '$', '', '') + + let savetags = &tags + exec 'set tags=' . escape(escape(g:EclimHelpDir, ' '), ' ') . '/**/tags' + try + let tags = sort(map(taglist(argLead . '.*'), "v:val['name']")) + let results = [] + for tag in tags + if index(results, tag) == -1 + call add(results, tag) + endif + endfor + return results + finally + let &tags = savetags + endtry +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/bundle/eclim/eclim/autoload/eclim/html/util.vim b/bundle/eclim/eclim/autoload/eclim/html/util.vim new file mode 100644 index 0000000..251ab0c --- /dev/null +++ b/bundle/eclim/eclim/autoload/eclim/html/util.vim @@ -0,0 +1,135 @@ +" Author: Eric Van Dewoestine +" +" Description: {{{ +" Various html relatd functions. +" +" License: +" +" Copyright (C) 2005 - 2009 Eric Van Dewoestine +" +" This program is free software: you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation, either version 3 of the License, or +" (at your option) any later version. +" +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" +" You should have received a copy of the GNU General Public License +" along with this program. If not, see . +" +" }}} + +" HtmlToText() {{{ +" Converts the supplied basic html to text. +function! eclim#html#util#HtmlToText(html) + let text = a:html + let text = substitute(text, '
\c', '\n', 'g') + let text = substitute(text, '\c', '', 'g') + let text = substitute(text, '\c', '', 'g') + let text = substitute(text, '
  • \c', '- ', 'g') + let text = substitute(text, '
  • \c', '', 'g') + let text = substitute(text, '\c', '', 'g') + let text = substitute(text, '\c', '', 'g') + let text = substitute(text, '\c', '', 'g') + let text = substitute(text, '\c', '', 'g') + let text = substitute(text, '', '', 'g') + let text = substitute(text, '"\c', '"', 'g') + let text = substitute(text, '&\c', '&', 'g') + let text = substitute(text, '<\c', '<', 'g') + let text = substitute(text, '>\c', '>', 'g') + + return text +endfunction " }}} + +" InCssBlock() {{{ +" Determines if the cusor is inside of