├── colors ├── paradox.vim ├── seoul256-light.vim ├── desert.vim ├── eclipse2.vim ├── oceanblack256.vim ├── monokai.vim ├── desert256.vim ├── dracula.vim └── seoul256.vim ├── .vimrc ├── tools └── conf │ ├── flake8.conf │ ├── splint.conf │ ├── CustomSample.tkm │ ├── xshell.xcs │ ├── CustomKeyMap.ckm │ ├── .ycm_extra_conf.py │ ├── securecrt.key │ └── pylint.conf ├── _vimrc ├── init ├── init-tabsize.vim ├── init-build.vim ├── init-basic.vim ├── init-config.vim ├── init-text.vim ├── init-style.vim ├── init-keymaps.vim └── init-plugins.vim ├── LICENSE ├── init.vim ├── syntax └── quickmenu.vim ├── README.md └── plugin ├── commentary.vim ├── txt.vim ├── indent-object.vim ├── mark.vim └── argtextobj.vim /colors/paradox.vim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckelsel/vim-init/HEAD/colors/paradox.vim -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | source ~/.vim/vim-init/init.vim 2 | 3 | let g:ycm_global_ycm_extra_conf = '~/.vim/vim-init/tools/conf/.ycm_extra_conf.py' 4 | 5 | set runtimepath+=~/.vim/bundles/YouCompleteMe 6 | 7 | -------------------------------------------------------------------------------- /tools/conf/flake8.conf: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = W191,E265,W291,E211,E251,E401,E201,E701,W391,E302,E303,E228,E202,E231,E128,E301,E722,E305,E306,W293,E731,E101,E221 3 | max-line-length = 160 4 | 5 | -------------------------------------------------------------------------------- /_vimrc: -------------------------------------------------------------------------------- 1 | set encoding=utf-8 2 | 3 | source ~/.vim/vim-init/init.vim 4 | 5 | let g:ycm_global_ycm_extra_conf = 'c:/users/v/.vim/vim-init/tools/conf/.ycm_extra_conf.py' 6 | 7 | set runtimepath+=C:/Users/v/.vim/bundles/YouCompleteMe 8 | 9 | let g:ycm_server_python_interpreter = 'c:/python27/python.exe' 10 | 11 | -------------------------------------------------------------------------------- /tools/conf/splint.conf: -------------------------------------------------------------------------------- 1 | -I. 2 | -Id:\dev\mingw\include 3 | -D_M_IX86=400 4 | -DWIN32 5 | -D_NTSYSTEM 6 | -D_WIN32_WINNT=0x0400 7 | -DWINVER=600 8 | -DNOGDI 9 | -DNOKERNEL 10 | -DNOUSER 11 | -DWIN32_LEAN_AND_MEAN 12 | -likelybool 13 | -D__int64=long 14 | -D_int64=int 15 | -D_wtoi=atoi 16 | -DSTRICT 17 | -temptrans 18 | -castfcnptr 19 | -nullret 20 | -compdef 21 | -mustfreeonly 22 | -nullstate 23 | -nullassign 24 | -preproc 25 | -------------------------------------------------------------------------------- /tools/conf/CustomSample.tkm: -------------------------------------------------------------------------------- 1 | [FUNCKEY] 2 | F1=^[OP 3 | F2=^[OQ 4 | F3=^[OR 5 | F4=^[OS 6 | F5=^[[15~ 7 | F6=^[[17~ 8 | F7=^[[18~ 9 | F8=^[[19~ 10 | F9=^[[20~ 11 | F10=^[[21~ 12 | F11=^[[23~ 13 | F12=^[[24~ 14 | S_F1=^[[1;2P 15 | S_F2=^[[1;2Q 16 | S_F3=^[[1;2R 17 | S_F4=^[[1;2S 18 | S_F5=^[[15;2~ 19 | S_F6=^[[17;2~ 20 | S_F7=^[[18;2~ 21 | S_F8=^[[19;2~ 22 | S_F9=^[[20;2~ 23 | S_F10=^[[21;2~ 24 | S_F11=^[[23;2~ 25 | S_F12=^[[24;2~ 26 | -------------------------------------------------------------------------------- /init/init-tabsize.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-tabsize.vim - 大部分人对 tabsize 都有自己的设置,改这里即可 4 | " 5 | " Created by skywind on 2018/05/30 6 | " Last Modified: 2018/05/30 22:05:44 7 | " 8 | "====================================================================== 9 | " vim: set ts=4 sw=4 tw=78 noet : 10 | 11 | 12 | "---------------------------------------------------------------------- 13 | " 默认缩进模式(可以后期覆盖) 14 | "---------------------------------------------------------------------- 15 | 16 | " 设置缩进宽度 17 | set sw=4 18 | 19 | " 设置 TAB 宽度 20 | set ts=4 21 | 22 | " 展开 tab 23 | set expandtab 24 | 25 | " 如果后面设置了 expandtab 那么展开 tab 为多少字符 26 | set softtabstop=4 27 | 28 | 29 | augroup PythonTab 30 | au! 31 | " 如果你需要 python 里用 tab,那么反注释下面这行字,否则vim会在打开py文件 32 | " 时自动设置成空格缩进。 33 | "au FileType python setlocal shiftwidth=4 tabstop=4 noexpandtab 34 | augroup END 35 | 36 | 37 | -------------------------------------------------------------------------------- /init/init-build.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-build.vim 4 | " 5 | " Created by XieKunming on 2020/01/20 6 | " 7 | "====================================================================== 8 | function BuildATRDPTool() 9 | cd install 10 | AsyncRun build.bat 11 | cd .. 12 | endf 13 | map make :call BuildATRDPTool() 14 | 15 | function BuildHSR() 16 | cd install 17 | AsyncRun build-agent-fulllog.bat 18 | cd .. 19 | endf 20 | " map make :call BuildHSR() 21 | 22 | function LaunchHSRClient() 23 | " C:\Users\v\Downloads\0\0_as\winc\install\setup\x86\bin\r-old.bat 24 | silent !start C:\Users\v\Downloads\0\0_as\winc\install\setup\x86\bin\HSRClient.exe --host 192.168.3.210 --port 5701 --username v --password 1 --hostname dsy3 -c certificate.der --enable_log 1 25 | endf 26 | map test :call LaunchHSRClient() 27 | 28 | " 加载工程配置文件 29 | if filereadable(".workspace.vim") 30 | source .workspace.vim 31 | endif 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Linwei 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /init.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init.vim - initialize config 4 | " 5 | " Created by skywind on 2018/05/30 6 | " Last Modified: 2018/05/30 18:26:34 7 | " 8 | "====================================================================== 9 | 10 | " 防止重复加载 11 | if get(s:, 'loaded', 0) != 0 12 | finish 13 | else 14 | let s:loaded = 1 15 | endif 16 | 17 | " 取得本文件所在的目录 18 | let s:home = fnamemodify(resolve(expand(':p')), ':h') 19 | 20 | " 定义一个命令用来加载文件 21 | command! -nargs=1 LoadScript exec 'so '.s:home.'/'.'' 22 | 23 | " 将 vim-init 目录加入 runtimepath 24 | exec 'set rtp+='.s:home 25 | 26 | " 将 ~/.vim 目录加入 runtimepath (有时候 vim 不会自动帮你加入) 27 | set rtp+=~/.vim 28 | 29 | 30 | "---------------------------------------------------------------------- 31 | " 模块加载 32 | "---------------------------------------------------------------------- 33 | 34 | " 加载基础配置 35 | LoadScript init/init-basic.vim 36 | 37 | " 加载扩展配置 38 | LoadScript init/init-config.vim 39 | 40 | " 设定 tabsize 41 | LoadScript init/init-tabsize.vim 42 | 43 | " 插件加载 44 | LoadScript init/init-plugins.vim 45 | 46 | " 界面样式 47 | LoadScript init/init-style.vim 48 | 49 | " 自定义按键 50 | LoadScript init/init-keymaps.vim 51 | 52 | " 自定义Text 53 | LoadScript init/init-text.vim 54 | 55 | " 自定义编译 56 | LoadScript init/init-build.vim 57 | -------------------------------------------------------------------------------- /syntax/quickmenu.vim: -------------------------------------------------------------------------------- 1 | if exists('b:current_syntax') 2 | endif 3 | 4 | let s:padding_left = repeat(' ', get(g:, 'quickmenu_padding_left', 3)) 5 | 6 | syntax sync fromstart 7 | 8 | if exists('b:quickmenu.option_lines') 9 | let s:col = len(s:padding_left) + 4 10 | for line in b:quickmenu.option_lines 11 | exec 'syntax region QuickmenuOption start=/\%'. line . 12 | \ 'l'.''. '/ end=/$/' 13 | endfor 14 | endif 15 | 16 | execute 'syntax match QuickmenuBracket /.*\%'. (len(s:padding_left) + 5) .'c/ contains= 17 | \ QuickmenuNumber, 18 | \ QuickmenuSelect' 19 | 20 | syntax match QuickmenuNumber /^\s*\[\zs[^BSVT]\{-}\ze\]/ 21 | syntax match QuickmenuSelect /^\s*\[\zs[BSVT]\{-}\ze\]/ 22 | syntax match QuickmenuSpecial /\V\|/ 23 | 24 | 25 | if exists('b:quickmenu.section_lines') 26 | for line in b:quickmenu.section_lines 27 | exec 'syntax region QuickmenuSection start=/\%'. line .'l/ end=/$/' 28 | endfor 29 | endif 30 | 31 | if exists('b:quickmenu.text_lines') 32 | for line in b:quickmenu.text_lines 33 | exec 'syntax region QuickmenuText start=/\%'. line .'l/ end=/$/' 34 | endfor 35 | endif 36 | 37 | if exists('b:quickmenu.header_lines') 38 | for line in b:quickmenu.header_lines 39 | exec 'syntax region QuickmenuHeader start=/\%'. line .'l/ end=/$/' 40 | endfor 41 | endif 42 | 43 | 44 | 45 | 46 | function! s:hllink(name, dest, alternative) 47 | let tohl = a:dest 48 | if hlexists(a:alternative) 49 | let tohl = a:alternative 50 | endif 51 | if v:version < 508 52 | exec "hi link ".a:name.' '.tohl 53 | else 54 | exec "hi def link ".a:name.' '.tohl 55 | endif 56 | endfunc 57 | 58 | command! -nargs=* HighLink call s:hllink() 59 | 60 | 61 | HighLink QuickmenuBracket Delimiter StartifyBracket 62 | HighLink QuickmenuSection Statement StartifySection 63 | HighLink QuickmenuSelect Title StartifySelect 64 | HighLink QuickmenuNumber Number StartifyNumber 65 | HighLink QuickmenuSpecial Comment StartifySpecial 66 | HighLink QuickmenuHeader Title StartifyHeader 67 | HighLink QuickmenuOption Identifier StartifyFile 68 | HighLink QuickmenuHelp Comment StartifySpecial 69 | 70 | -------------------------------------------------------------------------------- /colors/seoul256-light.vim: -------------------------------------------------------------------------------- 1 | " " _____ _ ___ ___ ___ " 2 | " " | __|___ ___ _ _| |_ | _| _| " 3 | " " |__ | -_| . | | | | _|_ | . | " 4 | " " |_____|___|___|___|_|___|___|___|-light.vim " 5 | " 6 | " " Low-contrast light Vim color scheme using Seoul Colors " 7 | " 8 | " File: seoul256-light.vim 9 | " URL: github.com/junegunn/seoul256.vim 10 | " Author: Junegunn Choi (junegunn.c@gmail.com) 11 | " Version: 1.4.0 12 | " Last Updated: July 6, 2014 13 | " License: MIT 14 | " 15 | " Copyright (c) 2013 Junegunn Choi 16 | " 17 | " MIT License 18 | " 19 | " Permission is hereby granted, free of charge, to any person obtaining 20 | " a copy of this software and associated documentation files (the 21 | " "Software"), to deal in the Software without restriction, including 22 | " without limitation the rights to use, copy, modify, merge, publish, 23 | " distribute, sublicense, and/or sell copies of the Software, and to 24 | " permit persons to whom the Software is furnished to do so, subject to 25 | " the following conditions: 26 | " 27 | " The above copyright notice and this permission notice shall be 28 | " included in all copies or substantial portions of the Software. 29 | " 30 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 31 | " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 32 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 33 | " NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 34 | " LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 35 | " OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 36 | " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | let s:master = get(split(globpath(&rtp, 'colors/seoul256.vim'), '\n'), 0, '') 39 | let s:custom_bg = get(g:, 'seoul256_light_background', get(g:, 'seoul256_background', 253)) 40 | let s:light = s:custom_bg >= 252 && s:custom_bg <= 256 41 | let s:var_found = exists('g:seoul256_background') 42 | let s:light_var_found = exists('g:seoul256_light_background') 43 | 44 | if !empty(s:master) 45 | try 46 | " Backup current g:seoul256_background 47 | if s:var_found 48 | let s:backup = g:seoul256_background 49 | endif 50 | 51 | " Invalid range. Force the default light version. 52 | if !s:light && s:var_found 53 | unlet g:seoul256_background 54 | endif 55 | 56 | " g:seoul256_light_background is found, use it 57 | if s:light && s:light_var_found 58 | let g:seoul256_background = s:custom_bg 59 | endif 60 | 61 | if get(g:, 'colors_name', '') == 'seoul256-light' && &background == 'dark' 62 | set background=dark 63 | else 64 | set background=light 65 | endif 66 | let g:colors_name = 'seoul256' 67 | execute 'silent source '.s:master 68 | let g:colors_name = &background == 'dark' ? 'seoul256' : 'seoul256-light' 69 | finally 70 | " Revert g:seoul256_background 71 | if s:var_found 72 | let g:seoul256_background = s:backup 73 | endif 74 | endtry 75 | else 76 | echom 'seoul256.vim not found' 77 | endif 78 | 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim版本要求 2 | 只支持vim8及以上版本,如果是vim7的版本,需要手动升级vim 3 | 4 | # 前言 5 | 轻量级 Vim 配置框架,全中文注释,这既是一份合理的轻量级配置,更是一份简明教程。话说,网上的 Vim 配置多的数不过来,这里又做一个干嘛?这些配置都有一些问题: 6 | 7 | - 注释不够,很多配置就是劈里啪啦一堆 VimScript 看的人一头雾水,新人顶多只能 “用”,没法跟着 “学”。 8 | - 大部分都是针对 Vim 7 以前的版本,太过陈旧,对 8.0/8.1 以后的各种现代编辑器特征支持不足。 9 | - 模块化不够好,全部塞在一个几百行的 `vimrc` 文件里,各部分搅在一起,增改都比较麻烦。 10 | - 插件没有分组,不能根据需要灵活选择功能组,所有插件一上就全上了,要禁止就是进去注释代码。 11 | - 它们有很多错误的地方,比如中文编码都没设对,很多 Windows 下的 PowerShell 脚本都打开不了。 12 | - 错误的习惯,比如把 jk 映射成 ESC 的,顺着从 a 打倒 z 都打不流畅,输入个 `Dijkstra` 都输入不了。 13 | - 对 C/C++ 开发支持不足。 14 | 15 | 还有不少插件自己给设置门槛的,比如把方向键禁用掉,我见过很多才用 Vim 的新人,大部分都呆在插入模式下,保存文件才会退出一下,至少人家开始用了,等到熟练了,该用 hjkl 的时候自然会去用。你这上来就把方向键和鼠标禁止了,除了阻挡新人外,我不知道有什么作用。 16 | 17 | 总之,山寨居多,还有某些著名的广为流传的 Vim 配置,我都不想点名了,把 Leader 键映射成逗号了,它不知道逗号/分号在 Vim 里是用来定位 f/t 搜索的下一个/上一个结果的么?就和 n/N 定位斜杠搜索一样。把 Leader 定义成空格我都还觉得挺科学,定义成逗号和分号的这些配置,是在把错误的用法源源不断的交给未来的新用户。 18 | 19 | 所以网上缺一份合理的轻量级配置,适合新人学习那种,于是有了这个项目。 20 | 21 | 22 | # 安装 23 | 24 | ## 下载仓库 25 | 将项目克隆到你喜欢的目录内,比如 `~/.vim` 内: 26 | 27 | ```bash 28 | mkdir ~/.vim 29 | cd ~/.vim 30 | git clone https://github.com/ckelsel/vim-init.git 31 | cp ~/.vim/vim-init/.vimrc ~ 32 | ``` 33 | 请调整你的终端软件,确保对 ALT 键的支持,以及 Backspace 键发送正确扫描码: 34 | 35 | [终端软件下正确支持 ALT 键和 Backspace 键](https://github.com/skywind3000/vim-init/wiki/Setup-terminals-to-support-ALT-and-Backspace-correctly) 36 | 37 | ## 安装插件 38 | 然后启动 Vim,在命令行运行 `:PlugInstall` 安装依赖插件即可。 39 | 40 | ## 手动安装YouCompleteMe 41 | ##(从gitee下载YouCompleteMe,解决github下载慢的问题,已克隆YouCompleteMe的仓库及子模块到gitee上,2020年3月7日10:22:24) 42 | ```bash 43 | sudo apt-get install cmake 44 | cd ~/.vim/bundles 45 | git clone https://gitee.com/zhuixixi/YouCompleteMe.git --depth=1 46 | cd ~/.vim/bundles/YouCompleteMe 47 | python3 install.py --clang-completer 48 | ``` 49 | 50 | ## 安装插件需要的第三方工具 51 | ```bash 52 | sudo apt-get install clang-format-6.0 53 | sudo apt-get install silversearcher-ag ctags 54 | 55 | // clang-format建软连接 56 | cd /usr/bin 57 | sudo ln -s clang-format-6.0 clang-format 58 | ``` 59 | 60 | 61 | 62 | # 结构 63 | 64 | 本配置按顺序,由如下几个主要模块组成: 65 | 66 | - `init.vim`: 配置入口,设置 runtimepath 检测脚本路径,加载其他脚本。 67 | - `init-basic.vim`: 所有人都能同意的基础配置,去除任何按键和样式定义,保证能用于 `tiny` 模式(没有 `+eval`)。 68 | - `init-config.vim`: 支持 +eval 的非 tiny 配置,初始化 ALT 键支持,功能键键盘码,备份,终端兼容等 69 | - `init-tabsize.vim`: 制表符宽度,是否展开空格等,因为个人差异太大,单独一个文件好更改。 70 | - `init-plugin.vim`: 插件,使用 vim-plug,按照设定的插件分组进行配置。 71 | - `init-style.vim`: 色彩主题,高亮优化,状态栏,更紧凑的标签栏文字等和显示相关的东西。 72 | - `init-keymaps.vim`: 快捷键定义。 73 | 74 | 最好 fork 一份到你自己的仓库,然后不断修改,把它修改成你自己的东西,平时要更新时到这里同步下上游仓库,然后自己合并一下即可。 75 | 76 | 除去 vim-plug 额外安装的插件外,本配置自带一些依赖较大的[插件](https://github.com/skywind3000/vim-init/wiki/Integrated-Plugins),保证内网连不了网的情况下,把本配置压缩包解压一下就能跑得起来,且基本功能可用,它们都比较简单,往往一两个文件,分布于 `plugin` 和 `autoload` 两个目录中,你可以根据自己需要增改。 77 | 78 | # 帮助 79 | 80 | 既然时全中文注释,帮助主要看 [init-keymaps.vim](https://github.com/skywind3000/vim-init/blob/master/init/init-keymaps.vim) 和 [init-plugins.vim](https://github.com/skywind3000/vim-init/blob/master/init/init-plugins.vim) 两个文件,每个点我都写满了注释了,也是未来你自己可能修改的最多的两个文件。每次你修改或者调试了单个 .vim 配置文件后,命令行输入 `:so %` 即可重新载入,so 是 `source` 的简写,意思是加载脚本,`%` 代表当前正在编辑脚本的名字。 81 | 82 | # Credit 83 | 84 | TODO 85 | -------------------------------------------------------------------------------- /tools/conf/xshell.xcs: -------------------------------------------------------------------------------- 1 | [3024 Day] 2 | text(bold)=4a4543 3 | magenta(bold)=a16a94 4 | text=4a4543 5 | white(bold)=a5a2a2 6 | green=3a3432 7 | red(bold)=db2d20 8 | green(bold)=01a252 9 | black(bold)=090300 10 | red=e8bbd0 11 | blue=807d7c 12 | black=5c5855 13 | blue(bold)=01a0e4 14 | yellow(bold)=fded02 15 | cyan(bold)=b5e4f4 16 | yellow=4a4543 17 | magenta=d6d5d4 18 | background=f7f7f7 19 | white=f7f7f7 20 | cyan=cdab53 21 | [Dark Solarized] 22 | text(bold)=839496 23 | magenta(bold)=6c71c4 24 | text=839496 25 | white(bold)=fdf6e3 26 | green=859900 27 | red(bold)=cb4b16 28 | green(bold)=586e75 29 | black(bold)=073642 30 | red=dc322f 31 | blue=268bd2 32 | black=002b36 33 | blue(bold)=839496 34 | yellow(bold)=657b83 35 | cyan(bold)=93a1a1 36 | yellow=b58900 37 | magenta=dd3682 38 | background=042028 39 | white=eee8d5 40 | cyan=2aa198 41 | [3024 Night] 42 | text(bold)=a5a2a2 43 | magenta(bold)=a16a94 44 | text=a5a2a2 45 | white(bold)=a5a2a2 46 | green=3a3432 47 | red(bold)=db2d20 48 | green(bold)=01a252 49 | black(bold)=090300 50 | red=e8bbd0 51 | blue=807d7c 52 | black=5c5855 53 | blue(bold)=01a0e4 54 | yellow(bold)=fded02 55 | cyan(bold)=b5e4f4 56 | yellow=4a4543 57 | magenta=d6d5d4 58 | background=090300 59 | white=f7f7f7 60 | cyan=cdab53 61 | [Dark ubuntu] 62 | text(bold)=ffffff 63 | magenta(bold)=ad7fa8 64 | text=ffffff 65 | white(bold)=eeeeec 66 | green=4e9a06 67 | red(bold)=ef2929 68 | green(bold)=8ae234 69 | black(bold)=555753 70 | red=cc0000 71 | blue=3465a4 72 | black=000000 73 | blue(bold)=729fcf 74 | yellow(bold)=fce94f 75 | cyan(bold)=34e2e2 76 | yellow=c4a000 77 | magenta=75507b 78 | background=300a24 79 | white=d3d7cf 80 | cyan=06989a 81 | [Dark isayme] 82 | text(bold)=eaeaea 83 | magenta(bold)=ff00ff 84 | text=ffffff 85 | white(bold)=eaeaea 86 | green=00c000 87 | red(bold)=d20000 88 | green(bold)=00ff00 89 | black(bold)=808080 90 | red=c00000 91 | blue=113fcc 92 | black=000000 93 | blue(bold)=0080ff 94 | yellow(bold)=ffff00 95 | cyan(bold)=00ffff 96 | yellow=c0c000 97 | magenta=c000c0 98 | background=222222 99 | white=c0c0c0 100 | cyan=00c0c0 101 | [Dark Linwei] 102 | text(bold)=eaeaea 103 | magenta(bold)=ff00ff 104 | text=ffffff 105 | white(bold)=eaeaea 106 | green=00c000 107 | red(bold)=ef0000 108 | green(bold)=00ff00 109 | black(bold)=808080 110 | red=c00000 111 | blue=113fcc 112 | black=000000 113 | blue(bold)=0080ff 114 | yellow(bold)=ffff00 115 | cyan(bold)=00ffff 116 | yellow=c0c000 117 | magenta=c000c0 118 | background=111111 119 | white=c0c0c0 120 | cyan=00c0c0 121 | [Names] 122 | count=7 123 | name6=Apprentice 124 | name5=3024 Day 125 | name4=3024 Night 126 | name3=Dark Solarized 127 | name2=Dark Linwei 128 | name1=Dark isayme 129 | name0=Dark ubuntu 130 | [Apprentice] 131 | text(bold)=ffffff 132 | magenta(bold)=8787af 133 | text=ffffff 134 | white(bold)=ffffff 135 | green=5f875f 136 | red(bold)=ff8700 137 | green(bold)=87af87 138 | black(bold)=444444 139 | red=af5f5f 140 | blue=5f87af 141 | black=1c1c1c 142 | blue(bold)=8fafd7 143 | yellow(bold)=ffffaf 144 | cyan(bold)=5fafaf 145 | yellow=87875f 146 | magenta=5f5f87 147 | background=000000 148 | white=6c6c6c 149 | cyan=5f8787 150 | -------------------------------------------------------------------------------- /colors/desert.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Hans Fugal 3 | " Last Change: $Date: 2003/06/02 19:28:15 $ 4 | " URL: http://hans.fugal.net/vim/colors/desert.vim 5 | 6 | " cool help screens 7 | " :he group-name 8 | " :he highlight-groups 9 | " :he cterm-colors 10 | 11 | set background=dark 12 | if version > 580 13 | " no guarantees for version 5.8 and below, but this makes it stop 14 | " complaining 15 | hi clear 16 | if exists("syntax_on") 17 | syntax reset 18 | endif 19 | endif 20 | let g:colors_name="desert" 21 | 22 | hi Normal guifg=White guibg=grey20 23 | 24 | " highlight groups 25 | hi Cursor guibg=khaki guifg=slategrey 26 | "hi CursorIM 27 | "hi Directory 28 | "hi DiffAdd 29 | "hi DiffChange 30 | "hi DiffDelete 31 | "hi DiffText 32 | "hi ErrorMsg 33 | hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none 34 | hi Folded guibg=grey30 guifg=gold 35 | hi FoldColumn guibg=grey30 guifg=tan 36 | hi IncSearch guifg=slategrey guibg=khaki 37 | "hi LineNr 38 | hi ModeMsg guifg=goldenrod 39 | hi MoreMsg guifg=SeaGreen 40 | hi NonText guifg=LightBlue guibg=grey30 41 | hi Question guifg=springgreen 42 | hi Search guibg=peru guifg=wheat 43 | hi SpecialKey guifg=yellowgreen 44 | hi StatusLine guibg=#c2bfa5 guifg=black gui=none 45 | hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none 46 | hi Title guifg=indianred 47 | hi Visual gui=none guifg=khaki guibg=olivedrab 48 | "hi VisualNOS 49 | hi WarningMsg guifg=salmon 50 | "hi WildMenu 51 | "hi Menu 52 | "hi Scrollbar 53 | "hi Tooltip 54 | 55 | " syntax highlighting groups 56 | hi Comment guifg=SkyBlue 57 | hi Constant guifg=#ffa0a0 58 | hi Identifier guifg=palegreen 59 | hi Statement guifg=khaki 60 | hi PreProc guifg=indianred 61 | hi Type guifg=darkkhaki 62 | hi Special guifg=navajowhite 63 | "hi Underlined 64 | hi Ignore guifg=grey40 65 | "hi Error 66 | hi Todo guifg=orangered guibg=yellow2 67 | 68 | " color terminal definitions 69 | hi SpecialKey ctermfg=darkgreen 70 | hi NonText cterm=bold ctermfg=darkblue 71 | hi Directory ctermfg=darkcyan 72 | hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 73 | hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green 74 | hi Search cterm=NONE ctermfg=grey ctermbg=blue 75 | hi MoreMsg ctermfg=darkgreen 76 | hi ModeMsg cterm=NONE ctermfg=brown 77 | hi LineNr ctermfg=3 78 | hi Question ctermfg=green 79 | hi StatusLine cterm=bold,reverse 80 | hi StatusLineNC cterm=reverse 81 | hi VertSplit cterm=reverse 82 | hi Title ctermfg=5 83 | hi Visual cterm=reverse 84 | hi VisualNOS cterm=bold,underline 85 | hi WarningMsg ctermfg=1 86 | hi WildMenu ctermfg=0 ctermbg=3 87 | hi Folded ctermfg=darkgrey ctermbg=NONE 88 | hi FoldColumn ctermfg=darkgrey ctermbg=NONE 89 | hi DiffAdd ctermbg=4 90 | hi DiffChange ctermbg=5 91 | hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 92 | hi DiffText cterm=bold ctermbg=1 93 | hi Comment ctermfg=darkcyan 94 | hi Constant ctermfg=brown 95 | hi Special ctermfg=5 96 | hi Identifier ctermfg=6 97 | hi Statement ctermfg=3 98 | hi PreProc ctermfg=5 99 | hi Type ctermfg=2 100 | hi Underlined cterm=underline ctermfg=5 101 | hi Ignore ctermfg=darkgrey 102 | hi Error cterm=bold ctermfg=7 ctermbg=1 103 | 104 | 105 | "vim: sw=4 106 | -------------------------------------------------------------------------------- /plugin/commentary.vim: -------------------------------------------------------------------------------- 1 | " commentary.vim - Comment stuff out 2 | " Maintainer: Tim Pope 3 | " Version: 1.3 4 | " GetLatestVimScripts: 3695 1 :AutoInstall: commentary.vim 5 | 6 | if exists("g:loaded_commentary") || v:version < 700 7 | finish 8 | endif 9 | let g:loaded_commentary = 1 10 | 11 | function! s:surroundings() abort 12 | return split(get(b:, 'commentary_format', substitute(substitute( 13 | \ &commentstring, '\S\zs%s',' %s','') ,'%s\ze\S', '%s ', '')), '%s', 1) 14 | endfunction 15 | 16 | function! s:strip_white_space(l,r,line) abort 17 | let [l, r] = [a:l, a:r] 18 | if l[-1:] ==# ' ' && stridx(a:line,l) == -1 && stridx(a:line,l[0:-2]) == 0 19 | let l = l[:-2] 20 | endif 21 | if r[0] ==# ' ' && a:line[-strlen(r):] != r && a:line[1-strlen(r):] == r[1:] 22 | let r = r[1:] 23 | endif 24 | return [l, r] 25 | endfunction 26 | 27 | function! s:go(...) abort 28 | if !a:0 29 | let &operatorfunc = matchstr(expand(''), '[^. ]*$') 30 | return 'g@' 31 | elseif a:0 > 1 32 | let [lnum1, lnum2] = [a:1, a:2] 33 | else 34 | let [lnum1, lnum2] = [line("'["), line("']")] 35 | endif 36 | 37 | let [l, r] = s:surroundings() 38 | let uncomment = 2 39 | for lnum in range(lnum1,lnum2) 40 | let line = matchstr(getline(lnum),'\S.*\s\@ 2 && l.r !~# '\\' 50 | let line = substitute(line, 51 | \'\M'.r[0:-2].'\zs\d\*\ze'.r[-1:-1].'\|'.l[0].'\zs\d\*\ze'.l[1:-1], 52 | \'\=substitute(submatch(0)+1-uncomment,"^0$\\|^-\\d*$","","")','g') 53 | endif 54 | if uncomment 55 | let line = substitute(line,'\S.*\s\@,) 93 | xnoremap Commentary go() 94 | nnoremap Commentary go() 95 | nnoremap CommentaryLine go() . '_' 96 | onoremap Commentary :call textobject(0) 97 | nnoremap ChangeCommentary c:call textobject(1) 98 | nmap CommentaryUndo :echoerr "Change your CommentaryUndo map to CommentaryCommentary" 99 | 100 | if !hasmapto('Commentary') || maparg('gc','n') ==# '' 101 | xmap gc Commentary 102 | nmap gc Commentary 103 | omap gc Commentary 104 | nmap gcc CommentaryLine 105 | if maparg('c','n') ==# '' 106 | nmap cgc ChangeCommentary 107 | endif 108 | nmap gcu CommentaryCommentary 109 | endif 110 | 111 | " vim:set et sw=2: 112 | -------------------------------------------------------------------------------- /colors/eclipse2.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Juan frias 3 | " Last Change: 2007 Feb 25 4 | " Version: 1.0.1 5 | " URL: http://www.axisym3.net/jdany/vim-the-editor/#eclipse 6 | set background=light 7 | highlight clear 8 | if exists("syntax_on") 9 | syntax reset 10 | endif 11 | 12 | let g:colors_name = "eclipse" 13 | 14 | highlight Normal gui=none guifg=#000000 guibg=#ffffff ctermfg=Gray 15 | 16 | " Search 17 | highlight IncSearch gui=underline guifg=#404040 guibg=#e0e040 18 | highlight Search gui=none guifg=#544060 guibg=#f0c0ff ctermbg=1 19 | 20 | " Messages 21 | highlight ErrorMsg gui=none guifg=#f8f8f8 guibg=#4040ff 22 | highlight WarningMsg gui=none guifg=#f8f8f8 guibg=#4040ff 23 | highlight ModeMsg gui=none guifg=#d06000 guibg=bg 24 | highlight MoreMsg gui=none guifg=#0090a0 guibg=bg 25 | highlight Question gui=none guifg=#8000ff guibg=bg 26 | 27 | " Split area 28 | highlight StatusLine gui=none guifg=#ffffff guibg=#4570aa cterm=bold ctermbg=blue ctermfg=white 29 | highlight StatusLineNC gui=none guifg=#ffffff guibg=#75a0da cterm=none ctermfg=darkgrey ctermbg=blue 30 | highlight VertSplit gui=none guifg=#f8f8f8 guibg=#904838 ctermfg=darkgrey cterm=none ctermbg=blue 31 | highlight WildMenu gui=none guifg=#f8f8f8 guibg=#ff3030 32 | 33 | " Diff 34 | highlight DiffText gui=none guifg=red guibg=#ffd0d0 cterm=bold ctermbg=5 ctermfg=3 35 | highlight DiffChange gui=none guifg=black guibg=#ffe7e7 cterm=none ctermbg=5 ctermfg=7 36 | highlight DiffDelete gui=none guifg=bg guibg=#e7e7ff ctermbg=black 37 | highlight DiffAdd gui=none guifg=blue guibg=#e7e7ff ctermbg=green cterm=bold 38 | 39 | " Cursor 40 | highlight Cursor gui=none guifg=#ffffff guibg=#0080f0 41 | highlight lCursor gui=none guifg=#ffffff guibg=#8040ff 42 | highlight CursorIM gui=none guifg=#ffffff guibg=#8040ff 43 | 44 | " Fold 45 | highlight Folded gui=none guifg=#804030 guibg=#fff0d0 ctermbg=black ctermfg=black cterm=bold 46 | highlight FoldColumn gui=none guifg=#6b6b6b guibg=#e7e7e7 ctermfg=black ctermbg=white 47 | 48 | " Popup Menu 49 | highlight PMenu ctermbg=green ctermfg=white 50 | highlight PMenuSel ctermbg=white ctermfg=black 51 | highlight PMenuSBar ctermbg=red ctermfg=white 52 | highlight PMenuThumb ctermbg=white ctermfg=red 53 | 54 | " Other 55 | highlight Directory gui=none guifg=#7050ff guibg=bg 56 | highlight LineNr gui=none guifg=#6b6b6b guibg=#eeeeee 57 | " highlight NonText gui=none guifg=#707070 guibg=#e7e7e7 58 | highlight NonText gui=none guifg=#707070 guibg=bg 59 | highlight SpecialKey gui=none guifg=#c0c0c0 guibg=bg cterm=none ctermfg=4 60 | highlight Title gui=bold guifg=#0033cc guibg=bg 61 | highlight Visual gui=none guifg=#804020 guibg=#ffc0a0 ctermfg=DarkCyan 62 | 63 | " Syntax group 64 | highlight Comment gui=none guifg=#236e25 guibg=bg ctermfg=2 65 | highlight Constant gui=none guifg=#00884c guibg=bg ctermfg=White 66 | highlight Error gui=none guifg=#f8f8f8 guibg=#4040ff term=reverse ctermbg=Red ctermfg=White 67 | highlight Identifier gui=none guifg=#b07800 guibg=bg ctermfg=Green 68 | highlight Ignore gui=none guifg=bg guibg=bg ctermfg=black 69 | highlight PreProc gui=none guifg=#683821 guibg=bg ctermfg=Green 70 | highlight Special gui=none guifg=#8040f0 guibg=bg ctermfg=DarkMagenta 71 | highlight Statement gui=none guifg=#b64f90 guibg=bg ctermfg=White 72 | highlight Todo gui=none guifg=#ff5050 guibg=white term=standout ctermbg=Yellow ctermfg=Black 73 | highlight Type gui=bold guifg=#7f0055 guibg=bg ctermfg=LightGreen 74 | highlight Underlined gui=none guifg=blue guibg=bg 75 | highlight String gui=none guifg=#8010a0 guibg=bg ctermfg=Yellow 76 | highlight Number gui=none guifg=#0000ff guibg=bg ctermfg=White 77 | 78 | if !has("gui_running") 79 | hi link Float Number 80 | hi link Conditional Repeat 81 | hi link Include PreProc 82 | hi link Macro PreProc 83 | hi link PreCondit PreProc 84 | hi link StorageClass Type 85 | hi link Structure Type 86 | hi link Typedef Type 87 | hi link Tag Special 88 | hi link Delimiter Normal 89 | hi link SpecialComment Special 90 | hi link Debug Special 91 | endif 92 | 93 | " vim:ff=unix: 94 | -------------------------------------------------------------------------------- /tools/conf/CustomKeyMap.ckm: -------------------------------------------------------------------------------- 1 | [KeyMap] 2 | Alt+9=[0]ID_VIEW_SESSION_9 3 | Alt+8=[0]ID_VIEW_SESSION_8 4 | Alt+7=[0]ID_VIEW_SESSION_7 5 | Alt+6=[0]ID_VIEW_SESSION_6 6 | Alt+5=[0]ID_VIEW_SESSION_5 7 | Alt+4=[0]ID_VIEW_SESSION_4 8 | Alt+3=[0]ID_VIEW_SESSION_3 9 | Alt+2=[0]ID_VIEW_SESSION_2 10 | Alt+1=[0]ID_VIEW_SESSION_1 11 | Alt+0=[0]ID_VIEW_SESSION_10 12 | Shift+Up=[0]ID_SCROLL_UP 13 | Shift+Tab=[0]ID_VIEW_RECENT_SESSION 14 | Shift+Page Up=[0]ID_SCROLL_PAGEUP 15 | Shift+Page Down=[0]ID_SCROLL_PAGEDOWN 16 | Shift+Insert=[0]ID_EDIT_PASTE 17 | Shift+Home=[0]ID_SCROLL_TOP 18 | Shift+End=[0]ID_SCROLL_BOTTOM 19 | Shift+Down=[0]ID_SCROLL_DOWN 20 | Pause=[0]ID_EDIT_SEND_BREAK 21 | Ctrl+-=[1]\037 22 | Ctrl+S=[1] 23 | Ctrl+Tab=[0]ID_VIEW_NEXT_SESSION 24 | Ctrl+Shift+Tab=[0]ID_VIEW_PREV_SESSION 25 | Ctrl+Shift+Alt+]=[0]ID_FONT_SIZE_INCREASE 26 | Ctrl+Shift+Alt+[=[0]ID_FONT_SIZE_DECREASE 27 | Ctrl+Pause=[0]ID_EDIT_SEND_BREAK 28 | Ctrl+Insert=[0]ID_EDIT_COPY 29 | Ctrl+F1=[1]\033[1;5P 30 | Ctrl+F2=[1]\033[1;5Q 31 | Ctrl+F3=[1]\033[1;5R 32 | Ctrl+F4=[1]\033[1;5S 33 | Ctrl+F5=[1]\033[15;5~ 34 | Ctrl+F6=[1]\033[17;5~ 35 | Ctrl+F7=[1]\033[18;5~ 36 | Ctrl+F8=[1]\033[19;5~ 37 | Ctrl+F9=[1]\033[20;5~ 38 | Ctrl+F10=[1]\033[21;5~ 39 | Ctrl+F11=[1]\033[23;5~ 40 | Ctrl+F12=[1]\033[24;5~ 41 | Shift+F1=[1]\033[1;2P 42 | Shift+F2=[1]\033[1;2Q 43 | Shift+F3=[1]\033[1;2R 44 | Shift+F4=[1]\033[1;2S 45 | Shift+F5=[1]\033[15;2~ 46 | Shift+F6=[1]\033[17;2~ 47 | Shift+F7=[1]\033[18;2~ 48 | Shift+F8=[1]\033[19;2~ 49 | Shift+F9=[1]\033[20;2~ 50 | Shift+F10=[1]\033[21;2~ 51 | Shift+F11=[1]\033[23;2~ 52 | Shift+F12=[1]\033[24;2~ 53 | Ctrl+Alt+T=[0]ID_FILE_OPEN_AS_TERM 54 | Ctrl+Alt+N=[0]ID_WINDOW_OPEN_NEW 55 | Ctrl+Alt+F=[0]ID_FILE_OPEN_AS_FTP 56 | Ctrl+Alt+]=[0]ID_ESCAPE_TO_LOCALSHELL 57 | Alt+Right=[0]ID_WINDOW_NEXT 58 | Alt+R=[0]ID_VIEW_TRANSPARENT 59 | Alt+P=[0]ID_FILE_PROPERTIES 60 | Alt+O=[0]ID_FILE_OPEN 61 | Alt+N=[0]ID_FILE_NEW 62 | Alt+Left=[0]ID_WINDOW_PREV 63 | Alt+Insert=[0]ID_EDIT_PASTE_SELECTION 64 | Alt+Enter=[0]ID_VIEW_FULLSCREEN 65 | Alt+A=[1]\033]{0}a~ 66 | Alt+B=[1]\033]{0}b~ 67 | Alt+C=[1]\033]{0}c~ 68 | Alt+D=[1]\033]{0}d~ 69 | Alt+E=[1]\033]{0}e~ 70 | Alt+F=[1]\033]{0}f~ 71 | Alt+G=[1]\033]{0}g~ 72 | Alt+H=[1]\033]{0}h~ 73 | Alt+I=[1]\033]{0}i~ 74 | Alt+J=[1]\033]{0}j~ 75 | Alt+K=[1]\033]{0}k~ 76 | Alt+L=[1]\033]{0}l~ 77 | Alt+M=[1]\033]{0}m~ 78 | Alt+N=[0]ID_FILE_NEW 79 | Alt+O=[0]ID_FILE_OPEN 80 | Alt+P=[0]ID_FILE_PROPERTIES 81 | Alt+Q=[1]\033]{0}q~ 82 | Alt+R=[0]ID_VIEW_TRANSPARENT 83 | Alt+S=[1]\033]{0}s~ 84 | Alt+T=[1]\033]{0}t~ 85 | Alt+U=[1]\033]{0}u~ 86 | Alt+V=[1]\033]{0}v~ 87 | Alt+W=[1]\033]{0}w~ 88 | Alt+X=[1]\033]{0}x~ 89 | Alt+Y=[1]\033]{0}y~ 90 | Alt+Z=[1]\033]{0}z~ 91 | Shift+Alt+0=[1]\033]{0}0~ 92 | Shift+Alt+1=[1]\033]{0}1~ 93 | Shift+Alt+2=[1]\033]{0}2~ 94 | Shift+Alt+3=[1]\033]{0}3~ 95 | Shift+Alt+4=[1]\033]{0}4~ 96 | Shift+Alt+5=[1]\033]{0}5~ 97 | Shift+Alt+6=[1]\033]{0}6~ 98 | Shift+Alt+7=[1]\033]{0}7~ 99 | Shift+Alt+8=[1]\033]{0}8~ 100 | Shift+Alt+9=[1]\033]{0}9~ 101 | Shift+Alt+A=[1]\033]{0}A~ 102 | Shift+Alt+B=[1]\033]{0}B~ 103 | Shift+Alt+C=[1]\033]{0}C~ 104 | Shift+Alt+D=[1]\033]{0}D~ 105 | Shift+Alt+E=[1]\033]{0}E~ 106 | Shift+Alt+F=[1]\033]{0}F~ 107 | Shift+Alt+G=[1]\033]{0}G~ 108 | Shift+Alt+H=[1]\033]{0}H~ 109 | Shift+Alt+I=[1]\033]{0}I~ 110 | Shift+Alt+J=[1]\033]{0}J~ 111 | Shift+Alt+K=[1]\033]{0}K~ 112 | Shift+Alt+L=[1]\033]{0}L~ 113 | Shift+Alt+M=[1]\033]{0}M~ 114 | Shift+Alt+N=[0]ID_FILE_OPEN_LOCALSHELL 115 | Shift+Alt+O=[1]\033]{0}O~ 116 | Shift+Alt+P=[1]\033]{0}P~ 117 | Shift+Alt+Q=[1]\033]{0}Q~ 118 | Shift+Alt+R=[1]\033]{0}R~ 119 | Shift+Alt+S=[1]\033]{0}S~ 120 | Shift+Alt+T=[0]ID_DUP_CUR_SESSION 121 | Shift+Alt+U=[1]\033]{0}U~ 122 | Shift+Alt+V=[1]\033]{0}V~ 123 | Shift+Alt+W=[1]\033]{0}W~ 124 | Shift+Alt+X=[1]\033]{0}X~ 125 | Shift+Alt+Y=[1]\033]{0}Y~ 126 | Shift+Alt+Z=[1]\033]{0}Z~ 127 | Alt+,=[1]\033]{0},~ 128 | Alt+.=[1]\033]{0}.~ 129 | Alt+/=[1]\033]{0}/~ 130 | Alt+;=[1]\033]{0};~ 131 | Alt+[=[1]\033]{0}[~ 132 | Alt+]=[1]\033]{0}]~ 133 | Alt+-=[1]\033]{0}-~ 134 | Shift+Alt+,=[1]\033]{0}<~ 135 | Shift+Alt+.=[1]\033]{0}>~ 136 | Shift+Alt+/=[1]\033]{0}?~ 137 | Shift+Alt+;=[1]\033]{0}:~ 138 | Shift+Alt+[=[1]\033]{0}{~ 139 | Shift+Alt+]=[1]\033]{0}}~ 140 | Shift+Alt+-=[1]\033]{0}_~ 141 | Alt+Page Up=[1]\033]{0}pu~ 142 | Alt+Page Down=[1]\033]{0}pd~ 143 | Alt+Home=[1]\033]{0}hm~ 144 | Alt+End=[1]\033]{0}ed~ 145 | -------------------------------------------------------------------------------- /plugin/txt.vim: -------------------------------------------------------------------------------- 1 | " Vim universal .txt syntax file 2 | " Language: txt 1.2 3 | " Maintainer: Tomasz Kalkosiński 4 | " Last change: 3 Jan 2007 5 | " 6 | " This is an universal syntax script for all text documents, logs, changelogs, readmes 7 | " and all other strange and undetected filetypes. 8 | " The goal is to keep it very simple. It colors numbers, operators, signs, 9 | " cites, brackets, delimiters, comments, TODOs, errors, debug, changelog tags 10 | " and basic smileys ;] 11 | " 12 | " Changelog: 13 | " 1.2 (03-01-2007) 14 | " Add: Changelog tags: add, chg, fix, rem, del linked with Keyword 15 | " Add: note to txtTodo group 16 | " 17 | " 1.1 (01-07-2006) Add: International cites 18 | " Chg: txtString color to Normal 19 | " Chg: Simplified number coloring working better now 20 | " 21 | " 1.0 (28-04-2006) Initial upload 22 | " 23 | " For version 5.x: Clear all syntax items 24 | " For version 6.x: Quit when a syntax file was already loaded 25 | if version < 600 26 | syntax clear 27 | elseif exists("b:current_syntax") 28 | finish 29 | endif 30 | 31 | syn case ignore 32 | 33 | syn cluster txtAlwaysContains add=txtTodo,txtError 34 | 35 | syn cluster txtContains add=txtNumber,txtOperator,txtLink 36 | 37 | syn match txtOperator "[~\-_+*<>\[\]{}=|#@$%&\\/:&\^\.,!?]" 38 | 39 | " Common strings 40 | syn match txtString "[[:alpha:]]" contains=txtOperator 41 | 42 | " Numbers 43 | "syn match txtNumber "\d\(\.\d\+\)\?" 44 | syn match txtNumber "\d" 45 | 46 | " Cites 47 | syn region txtCite matchgroup=txtOperator start="\"" end="\"" contains=@txtContains,@txtAlwaysContains 48 | 49 | " utf8 international cites: 50 | " ‚ ’ U+201A (8218), U+2019 (8217) Polish single quotation 51 | " „ ” U+201E (8222), U+201d (8221) Polish double quotation 52 | " « » U+00AB (171), U+00BB (187) French quotes 53 | " ‘ ’ U+2018 (8216), U+2019 (8217) British quotes 54 | " „ “ U+201E (8222), U+2019 (8217) German quotes 55 | " ‹ › U+2039 (8249), U+203A (8250) French quotes 56 | syn region txtCite matchgroup=txtOperator start="[‚„«‘„‹]" end="[’”»’“›]" contains=@txtContains,@txtAlwaysContains 57 | 58 | syn region txtCite matchgroup=txtOperator start="\(\s\|^\)\@<='" end="'" contains=@txtContains,@txtAlwaysContains 59 | 60 | " Comments 61 | syn region txtComment start="(" end=")" contains=@txtContains,txtCite,@txtAlwaysContains 62 | syn region txtComments matchgroup=txtComments start="\/\/" end="$" contains=@txtAlwaysContains oneline 63 | syn region txtComments start="\/\*" end="\*\/" contains=@txtAlwaysContains 64 | 65 | syn region txtDelims matchgroup=txtOperator start="<" end=">" contains=@txtContains,@txtAlwaysContains oneline 66 | syn region txtDelims matchgroup=txtOperator start="{" end="}" contains=@txtContains,@txtAlwaysContains oneline 67 | syn region txtDelims matchgroup=txtOperator start="\[" end="\]" contains=@txtContains,@txtAlwaysContains oneline 68 | 69 | syn match txtLink "\(http\|https\|ftp\)\(\w\|[\-&=,?\:\.\/]\)*" contains=txtOperator 70 | 71 | " Basic smileys 72 | syn match txtSmile "[:;=8][\-]\?\([(\/\\)\[\]]\+\|[OoPpDdFf]\+\)" 73 | 74 | " Changelog tags: add, chg, rem, fix 75 | syn match txtChangelogs "\\s*:" contains=txtOperator 76 | syn match txtChangelogs "\\s*:" contains=txtOperator 77 | syn match txtChangelogs "\\s*:" contains=txtOperator 78 | syn match txtChangelogs "\\s*:" contains=txtOperator 79 | syn match txtChangelogs "\\s*:" contains=txtOperator 80 | 81 | syn keyword txtTodo todo fixme xxx note 82 | 83 | syn keyword txtError error bug 84 | 85 | syn keyword txtDebug debug 86 | 87 | syn case match 88 | 89 | " Define the default highlighting. 90 | " For version 5.7 and earlier: only when not done already 91 | " For version 5.8 and later: only when an item doesn't have highlighting yet 92 | if version < 508 93 | command -nargs=+ HiLink hi link 94 | else 95 | command -nargs=+ HiLink hi def link 96 | endif 97 | 98 | HiLink txtNumber Number 99 | HiLink txtString Normal 100 | HiLink txtOperator Operator 101 | HiLink txtCite String 102 | HiLink txtComments Comment 103 | HiLink txtComment Comment 104 | HiLink txtDelims Delimiter 105 | HiLink txtLink Special 106 | HiLink txtSmile PreProc 107 | HiLink txtError Error 108 | HiLink txtTodo Todo 109 | HiLink txtDebug Debug 110 | HiLink txtChangelogs Keyword 111 | 112 | delcommand HiLink 113 | 114 | let b:current_syntax = "txt" 115 | " vim: ts=8 116 | -------------------------------------------------------------------------------- /colors/oceanblack256.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Juan frias 3 | " Last Change: 2007 Mar 29 4 | " Version: 1.0.0 5 | " URL: http://www.axisym3.net/jdany/vim-the-editor/#oceanblack256 6 | " 7 | " These are the colors of the "OceanBlack" theme by Chris Vertonghen modified 8 | " to work on 256-color xterms. 9 | " 10 | set background=dark 11 | 12 | highlight clear 13 | if exists("syntax_on") 14 | syntax reset 15 | endif 16 | 17 | let g:colors_name = "oceanblack256" 18 | 19 | highlight Normal cterm=none ctermfg=7 ctermbg=0 20 | highlight NonText cterm=none ctermfg=117 ctermbg=0 21 | 22 | highlight Visual cterm=reverse ctermfg=72 ctermbg=15 23 | highlight VisualNOS cterm=bold,underline ctermfg=151 ctermbg=0 24 | 25 | highlight Cursor cterm=none ctermfg=15 ctermbg=152 26 | highlight CursorIM cterm=bold ctermfg=15 ctermbg=152 27 | "highlight CursorColumn 28 | "highlight CursorLine 29 | 30 | highlight Directory ctermfg=5 ctermbg=0 31 | 32 | highlight DiffAdd cterm=none ctermfg=15 ctermbg=22 33 | highlight DiffChange cterm=none ctermfg=207 ctermbg=90 34 | highlight DiffDelete cterm=none ctermfg=19 ctermbg=17 35 | highlight DiffText cterm=bold ctermfg=226 ctermbg=90 36 | 37 | highlight Question cterm=bold ctermfg=85 ctermbg=0 38 | highlight ErrorMsg ctermfg=230 ctermbg=167 39 | highlight ModeMsg ctermfg=77 ctermbg=22 40 | highlight MoreMsg cterm=bold ctermfg=72 ctermbg=0 41 | highlight WarningMsg cterm=bold ctermfg=203 ctermbg=0 42 | 43 | highlight LineNr ctermfg=243 ctermbg=233 44 | highlight Folded cterm=none ctermfg=152 ctermbg=66 45 | highlight FoldColumn cterm=none ctermfg=152 ctermbg=66 46 | "highlight SignColumn 47 | 48 | highlight Search cterm=none ctermfg=16 ctermbg=66 49 | highlight IncSearch cterm=reverse ctermfg=151 ctermbg=0 50 | "highlight MatchParen 51 | 52 | "highlight PMenu 53 | "highlight PMenuSBar 54 | "highlight PMenuSel 55 | "highlight PMenuThumb 56 | 57 | highlight SpecialKey ctermfg=60 ctermbg=0 58 | 59 | "highlight SpellBad 60 | "highlight SpellCap 61 | "highlight SpellLocal 62 | "highlight SpellRare 63 | 64 | highlight StatusLine cterm=none ctermfg=0 ctermbg=254 65 | highlight StatusLineNC cterm=none ctermfg=234 ctermbg=247 66 | highlight VertSplit cterm=none ctermfg=0 ctermbg=247 67 | 68 | highlight WildMenu cterm=bold ctermfg=0 ctermbg=118 69 | 70 | "highlight TabLine 71 | "highlight TabLineFill 72 | "highlight TabLineSel 73 | 74 | highlight Title cterm=bold ctermfg=171 ctermbg=0 75 | 76 | "highlight Menu 77 | "highlight Scrollbar 78 | "highlight Tooltip 79 | 80 | " Syntax Groups 81 | highlight Comment cterm=none ctermfg=95 82 | 83 | highlight Constant ctermfg=6 ctermbg=0 84 | highlight String cterm=none ctermfg=111 ctermbg=0 85 | "highlight Character 86 | highlight Number cterm=none ctermfg=51 ctermbg=0 87 | highlight Boolean cterm=none ctermfg=51 ctermbg=0 88 | "highlight Float 89 | 90 | highlight Identifier ctermfg=152 91 | highlight Function cterm=none ctermfg=151 ctermbg=0 92 | 93 | highlight Statement cterm=none ctermfg=77 94 | highlight Conditional cterm=none ctermfg=77 ctermbg=0 95 | highlight Repeat cterm=none ctermfg=85 ctermbg=0 96 | "highlight Label 97 | highlight Operator cterm=none ctermfg=118 ctermbg=0 98 | highlight Keyword cterm=none ctermfg=77 ctermbg=0 99 | highlight Exception cterm=none ctermfg=77 ctermbg=0 100 | 101 | highlight PreProc ctermfg=117 102 | highlight Include cterm=none ctermfg=146 ctermbg=0 103 | highlight Define cterm=none ctermfg=110 ctermbg=0 104 | highlight Macro cterm=none ctermfg=152 ctermbg=0 105 | highlight PreCondit cterm=none ctermfg=74 ctermbg=0 106 | 107 | highlight Type cterm=none ctermfg=110 108 | highlight StorageClass cterm=none ctermfg=110 ctermbg=0 109 | highlight Structure cterm=none ctermfg=110 ctermbg=0 110 | highlight Typedef cterm=none ctermfg=110 ctermbg=0 111 | 112 | highlight Special ctermfg=247 113 | "highlight SpecialChar 114 | "highlight Tag 115 | "highlight Delimiter 116 | "highlight SpecialComment 117 | "highlight Debug 118 | 119 | highlight Underlined cterm=underline ctermfg=102 ctermbg=0 120 | 121 | highlight Ignore ctermfg=67 122 | 123 | highlight Error ctermfg=230 ctermbg=167 124 | 125 | highlight Todo ctermfg=51 ctermbg=66 126 | -------------------------------------------------------------------------------- /init/init-basic.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-basic.vim - 基础配置,该配置需要兼容 vim tiny 模式 4 | " 5 | " 所有人都能接受的配置,不掺渣任何 keymap, 和偏好设置 6 | " 7 | " Created by skywind on 2018/05/30 8 | " Last Modified: 2018/05/30 16:53:18 9 | " 10 | "====================================================================== 11 | " vim: set ts=4 sw=4 tw=78 noet : 12 | 13 | "---------------------------------------------------------------------- 14 | " 基础设置 15 | "---------------------------------------------------------------------- 16 | 17 | " 禁用 vi 兼容模式 18 | set nocompatible 19 | 20 | " 设置 Backspace 键模式 21 | set bs=eol,start,indent 22 | 23 | " 自动缩进 24 | set autoindent 25 | 26 | " 打开 C/C++ 语言缩进优化 27 | set cindent 28 | 29 | " Windows 禁用 ALT 操作菜单(使得 ALT 可以用到 Vim里) 30 | set winaltkeys=no 31 | 32 | " 关闭自动换行 33 | set nowrap 34 | 35 | " 打开功能键超时检测(终端下功能键为一串 ESC 开头的字符串) 36 | set ttimeout 37 | 38 | " 功能键超时检测 50 毫秒 39 | set ttimeoutlen=50 40 | 41 | " 显示光标位置 42 | set ruler 43 | 44 | " 插入模式下可以使用鼠标 45 | set mouse=i 46 | 47 | "---------------------------------------------------------------------- 48 | " 搜索设置 49 | "---------------------------------------------------------------------- 50 | 51 | " 搜索时忽略大小写 52 | set ignorecase 53 | 54 | " 智能搜索大小写判断,默认忽略大小写,除非搜索内容包含大写字母 55 | set smartcase 56 | 57 | " 高亮搜索内容 58 | set hlsearch 59 | 60 | " 查找输入时动态增量显示查找结果 61 | set incsearch 62 | 63 | 64 | "---------------------------------------------------------------------- 65 | " 编码设置 66 | "---------------------------------------------------------------------- 67 | if has('multi_byte') 68 | " 内部工作编码 69 | set encoding=utf-8 70 | 71 | " 文件默认编码 72 | set fileencoding=utf-8 73 | 74 | " 打开文件时自动尝试下面顺序的编码 75 | set fileencodings=ucs-bom,utf-8,gbk,gb18030,big5,euc-jp,latin1 76 | endif 77 | 78 | 79 | "---------------------------------------------------------------------- 80 | " 允许 Vim 自带脚本根据文件类型自动设置缩进等 81 | "---------------------------------------------------------------------- 82 | if has('autocmd') 83 | filetype plugin indent on 84 | endif 85 | 86 | 87 | "---------------------------------------------------------------------- 88 | " 语法高亮设置 89 | "---------------------------------------------------------------------- 90 | if has('syntax') 91 | syntax enable 92 | syntax on 93 | endif 94 | 95 | 96 | "---------------------------------------------------------------------- 97 | " 其他设置 98 | "---------------------------------------------------------------------- 99 | 100 | " 显示匹配的括号 101 | set showmatch 102 | 103 | " 显示括号匹配的时间 104 | set matchtime=2 105 | 106 | " 显示最后一行 107 | set display=lastline 108 | 109 | " 允许下方显示目录 110 | set wildmenu 111 | 112 | " 延迟绘制(提升性能) 113 | set lazyredraw 114 | 115 | " 错误格式 116 | set errorformat+=[%f:%l]\ ->\ %m,[%f:%l]:%m 117 | 118 | " 设置分隔符可视 119 | " set listchars=tab:\|\ ,trail:.,extends:>,precedes:< 120 | 121 | 122 | " 设置 tags:当前文件所在目录往上向根目录搜索直到碰到 .tags 文件 123 | " 或者 Vim 当前目录包含 .tags 文件 124 | set tags=./.tags;,.tags 125 | 126 | " 如遇Unicode值大于255的文本,不必等到空格再折行 127 | set formatoptions+=m 128 | 129 | " 合并两行中文时,不在中间加空格 130 | set formatoptions+=B 131 | 132 | " 文件换行符,默认使用 unix 换行符 133 | set ffs=unix,dos,mac 134 | 135 | 136 | "---------------------------------------------------------------------- 137 | " 设置代码折叠 138 | "---------------------------------------------------------------------- 139 | if has('folding') 140 | " 允许代码折叠 141 | set foldenable 142 | 143 | " 代码折叠默认使用缩进 144 | set fdm=indent 145 | 146 | " 默认打开所有缩进 147 | set foldlevel=99 148 | endif 149 | 150 | 151 | "---------------------------------------------------------------------- 152 | " 文件搜索和补全时忽略下面扩展名 153 | "---------------------------------------------------------------------- 154 | set suffixes=.bak,~,.o,.h,.info,.swp,.obj,.pyc,.pyo,.egg-info,.class 155 | 156 | set wildignore=*.o,*.obj,*~,*.exe,*.a,*.pdb,*.lib "stuff to ignore when tab completing 157 | set wildignore+=*.so,*.dll,*.swp,*.egg,*.jar,*.class,*.pyc,*.pyo,*.bin,*.dex 158 | set wildignore+=*.zip,*.7z,*.rar,*.gz,*.tar,*.gzip,*.bz2,*.tgz,*.xz " MacOSX/Linux 159 | set wildignore+=*DS_Store*,*.ipch 160 | set wildignore+=*.gem 161 | set wildignore+=*.png,*.jpg,*.gif,*.bmp,*.tga,*.pcx,*.ppm,*.img,*.iso 162 | set wildignore+=*.so,*.swp,*.zip,*/.Trash/**,*.pdf,*.dmg,*/.rbenv/** 163 | set wildignore+=*/.nx/**,*.app,*.git,.git 164 | set wildignore+=*.wav,*.mp3,*.ogg,*.pcm 165 | set wildignore+=*.mht,*.suo,*.sdf,*.jnlp 166 | set wildignore+=*.chm,*.epub,*.pdf,*.mobi,*.ttf 167 | set wildignore+=*.mp4,*.avi,*.flv,*.mov,*.mkv,*.swf,*.swc 168 | set wildignore+=*.ppt,*.pptx,*.docx,*.xlt,*.xls,*.xlsx,*.odt,*.wps 169 | set wildignore+=*.msi,*.crx,*.deb,*.vfd,*.apk,*.ipa,*.bin,*.msu 170 | set wildignore+=*.gba,*.sfc,*.078,*.nds,*.smd,*.smc 171 | set wildignore+=*.linux2,*.win32,*.darwin,*.freebsd,*.linux,*.android 172 | 173 | 174 | "---------------------------------------------------------------------- 175 | " gvim启动最大化 176 | "---------------------------------------------------------------------- 177 | if has('win32') 178 | au GUIEnter * simalt ~x 179 | endif 180 | 181 | -------------------------------------------------------------------------------- /init/init-config.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-config.vim - 正常模式下的配置,在 init-basic.vim 后调用 4 | " 5 | " Created by skywind on 2018/05/30 6 | " Last Modified: 2018/05/30 19:20:46 7 | " 8 | "====================================================================== 9 | " vim: set ts=4 sw=4 tw=78 noet : 10 | 11 | 12 | "---------------------------------------------------------------------- 13 | " 有 tmux 何没有的功能键超时(毫秒) 14 | "---------------------------------------------------------------------- 15 | if $TMUX != '' 16 | set ttimeoutlen=30 17 | elseif &ttimeoutlen > 80 || &ttimeoutlen <= 0 18 | set ttimeoutlen=80 19 | endif 20 | 21 | 22 | "---------------------------------------------------------------------- 23 | " 终端下允许 ALT,详见:http://www.skywind.me/blog/archives/2021 24 | " 记得设置 ttimeout (见 init-basic.vim) 和 ttimeoutlen (上面) 25 | "---------------------------------------------------------------------- 26 | if has('nvim') == 0 && has('gui_running') == 0 27 | function! s:metacode(key) 28 | exec "set =\e".a:key 29 | endfunc 30 | for i in range(10) 31 | call s:metacode(nr2char(char2nr('0') + i)) 32 | endfor 33 | for i in range(26) 34 | call s:metacode(nr2char(char2nr('a') + i)) 35 | call s:metacode(nr2char(char2nr('A') + i)) 36 | endfor 37 | for c in [',', '.', '/', ';', '{', '}'] 38 | call s:metacode(c) 39 | endfor 40 | for c in ['?', ':', '-', '_', '+', '=', "'"] 41 | call s:metacode(c) 42 | endfor 43 | endif 44 | 45 | 46 | "---------------------------------------------------------------------- 47 | " 终端下功能键设置 48 | "---------------------------------------------------------------------- 49 | function! s:key_escape(name, code) 50 | if has('nvim') == 0 && has('gui_running') == 0 51 | exec "set ".a:name."=\e".a:code 52 | endif 53 | endfunc 54 | 55 | 56 | "---------------------------------------------------------------------- 57 | " 功能键终端码矫正 58 | "---------------------------------------------------------------------- 59 | call s:key_escape('', 'OP') 60 | call s:key_escape('', 'OQ') 61 | call s:key_escape('', 'OR') 62 | call s:key_escape('', 'OS') 63 | call s:key_escape('', '[1;2P') 64 | call s:key_escape('', '[1;2Q') 65 | call s:key_escape('', '[1;2R') 66 | call s:key_escape('', '[1;2S') 67 | call s:key_escape('', '[15;2~') 68 | call s:key_escape('', '[17;2~') 69 | call s:key_escape('', '[18;2~') 70 | call s:key_escape('', '[19;2~') 71 | call s:key_escape('', '[20;2~') 72 | call s:key_escape('', '[21;2~') 73 | call s:key_escape('', '[23;2~') 74 | call s:key_escape('', '[24;2~') 75 | 76 | 77 | "---------------------------------------------------------------------- 78 | " 防止tmux下vim的背景色显示异常 79 | " Refer: http://sunaku.github.io/vim-256color-bce.html 80 | "---------------------------------------------------------------------- 81 | if &term =~ '256color' && $TMUX != '' 82 | " disable Background Color Erase (BCE) so that color schemes 83 | " render properly when inside 256-color tmux and GNU screen. 84 | " see also http://snk.tuxfamily.org/log/vim-256color-bce.html 85 | set t_ut= 86 | endif 87 | 88 | 89 | "---------------------------------------------------------------------- 90 | " 备份设置 91 | "---------------------------------------------------------------------- 92 | 93 | " 允许备份 94 | set backup 95 | 96 | " 保存时备份 97 | set writebackup 98 | 99 | " 备份文件地址,统一管理 100 | set backupdir=~/.vim/tmp 101 | 102 | " 备份文件扩展名 103 | set backupext=.bak 104 | 105 | " 禁用交换文件 106 | set noswapfile 107 | 108 | " 禁用 undo文件 109 | set noundofile 110 | 111 | " 创建目录,并且忽略可能出现的警告 112 | silent! call mkdir(expand('~/.vim/tmp'), "p", 0755) 113 | 114 | 115 | "---------------------------------------------------------------------- 116 | " 配置微调 117 | "---------------------------------------------------------------------- 118 | 119 | " 修正 ScureCRT/XShell 以及某些终端乱码问题,主要原因是不支持一些 120 | " 终端控制命令,比如 cursor shaping 这类更改光标形状的 xterm 终端命令 121 | " 会令一些支持 xterm 不完全的终端解析错误,显示为错误的字符,比如 q 字符 122 | " 如果你确认你的终端支持,不会在一些不兼容的终端上运行该配置,可以注释 123 | if has('nvim') 124 | set guicursor= 125 | elseif (!has('gui_running')) && has('terminal') && has('patch-8.0.1200') 126 | let g:termcap_guicursor = &guicursor 127 | let g:termcap_t_RS = &t_RS 128 | let g:termcap_t_SH = &t_SH 129 | set guicursor= 130 | set t_RS= 131 | set t_SH= 132 | endif 133 | 134 | " 打开文件时恢复上一次光标所在位置 135 | autocmd BufReadPost * 136 | \ if line("'\"") > 1 && line("'\"") <= line("$") | 137 | \ exe "normal! g`\"" | 138 | \ endif 139 | 140 | " 定义一个 DiffOrig 命令用于查看文件改动 141 | if !exists(":DiffOrig") 142 | command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis 143 | \ | wincmd p | diffthis 144 | endif 145 | 146 | 147 | 148 | "---------------------------------------------------------------------- 149 | " 文件类型微调 150 | "---------------------------------------------------------------------- 151 | augroup InitFileTypesGroup 152 | 153 | " 清除同组的历史 autocommand 154 | au! 155 | 156 | " C/C++ 文件使用 // 作为注释 157 | au FileType c,cpp setlocal commentstring=//\ %s 158 | 159 | " markdown 允许自动换行 160 | au FileType markdown setlocal wrap 161 | 162 | " lisp 进行微调 163 | au FileType lisp setlocal ts=8 sts=2 sw=2 et 164 | 165 | " scala 微调 166 | au FileType scala setlocal sts=4 sw=4 noet 167 | 168 | " haskell 进行微调 169 | au FileType haskell setlocal et 170 | 171 | " quickfix 隐藏行号 172 | au FileType qf setlocal nonumber 173 | 174 | " 强制对某些扩展名的 filetype 进行纠正 175 | au BufNewFile,BufRead *.as setlocal filetype=actionscript 176 | au BufNewFile,BufRead *.pro setlocal filetype=prolog 177 | au BufNewFile,BufRead *.es setlocal filetype=erlang 178 | au BufNewFile,BufRead *.asc setlocal filetype=asciidoc 179 | au BufNewFile,BufRead *.vl setlocal filetype=verilog 180 | 181 | augroup END 182 | 183 | 184 | -------------------------------------------------------------------------------- /init/init-text.vim: -------------------------------------------------------------------------------- 1 | function GPLV2() 2 | call setline(1,"/**-------------------------------------------------------------------------") 3 | call append (2, " * ") 4 | call append (3, " * Copyright (C) 2020 KunMing Xie ") 5 | call append (4, " * ") 6 | call append (5, " * This program is free software; you can redistribute it and/or modify") 7 | call append (6, " * it under the terms of the GNU General Public License as published by") 8 | call append (7, " * the Free Software Foundation; either version 2 of the License, or") 9 | call append (8, " * (at your option) any later version.") 10 | call append (9, " * ") 11 | call append (10, " * This program is distributed in the hope that it will be useful,") 12 | call append (11, " * but WITHOUT ANY WARRANTY; without even the implied warranty of") 13 | call append (12, " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the") 14 | call append (13, " * GNU General Public License for more details.") 15 | call append (14, " * ") 16 | call append (15, " * You should have received a copy of the GNU General Public License along") 17 | call append (16, " * with this program; if not, write to the Free Software Foundation, Inc.,") 18 | call append (17, " * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.") 19 | call append (18, " */") 20 | endf 21 | map gpl :call GPLV2() 22 | 23 | 24 | function Apache() 25 | call setline(1,"/* Copyright 2020 kunming.xie") 26 | call append (1, " *") 27 | call append (2, " * Licensed under the Apache License, Version 2.0 (the \"License\");") 28 | call append (3, " * you may not use this file except in compliance with the License.") 29 | call append (4, " * You may obtain a copy of the License at") 30 | call append (5, " *") 31 | call append (6, " * http://www.apache.org/licenses/LICENSE-2.0") 32 | call append (7, " *") 33 | call append (8, " * Unless required by applicable law or agreed to in writing, software") 34 | call append (9, " * distributed under the License is distributed on an \"AS IS\" BASIS,") 35 | call append (10, " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.") 36 | call append (11, " * See the License for the specific language governing permissions and") 37 | call append (12, " * limitations under the License.") 38 | call append (13, " */") 39 | endf 40 | map apl :call Apache() 41 | 42 | 43 | function AddAstute() 44 | call setline(1, "\/\/") 45 | call append( 1, "\/\/ " . expand("%:t")) 46 | call append( 2, "\/\/") 47 | call append( 3, "\/\/ Created by XieKunming on " . strftime("%Y/%m/%d")) 48 | call append( 4, "\/\/ Copyright (C) 2020 Nanjing Astute Software Technology Co., Ltd. All rights reserved.") 49 | call append( 5, "\/\/") 50 | call append( 6, "") 51 | endf 52 | map hsr :call AddAstute() 53 | 54 | 55 | function AddCdemo() 56 | call setline(1,"#include ") 57 | call append (1,"#include ") 58 | call append (2,"#include ") 59 | call append (3,"") 60 | call append (4,"int main(int argc, char **argv)") 61 | call append (5,"{") 62 | call append (6," return 0;") 63 | call append (7,"}") 64 | endf 65 | map cdm :call AddCdemo() 66 | 67 | 68 | function AddCxxdemo() 69 | call setline(1,"#include ") 70 | call append (1,"using namespace std;") 71 | call append (2,"") 72 | call append (3,"int main(int argc, char **argv)") 73 | call append (4,"{") 74 | call append (5," return 0;") 75 | call append (6,"}") 76 | endf 77 | map cxdm :call AddCxxdemo() 78 | 79 | 80 | function AddPlantUML() 81 | call setline(1,"@startuml") 82 | call append (1,"@enduml") 83 | endf 84 | map uml :call AddPlantUML() 85 | 86 | 87 | function TensorflowDemo() 88 | call setline(1,"# Copyright 2020 kunming.xie") 89 | call append (1, "#") 90 | call append (2, "# Licensed under the Apache License, Version 2.0 (the \"License\");") 91 | call append (3, "# you may not use this file except in compliance with the License.") 92 | call append (4, "# You may obtain a copy of the License at") 93 | call append (5, "#") 94 | call append (6, "# http://www.apache.org/licenses/LICENSE-2.0") 95 | call append (7, "#") 96 | call append (8, "# Unless required by applicable law or agreed to in writing, software") 97 | call append (9, "# distributed under the License is distributed on an \"AS IS\" BASIS,") 98 | call append (10, "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.") 99 | call append (11, "# See the License for the specific language governing permissions and") 100 | call append (12, "# limitations under the License.") 101 | call append (13, "# ==============================================================================") 102 | call append (14, "import tensorflow as tf ") 103 | call append (15, "") 104 | call append (16, "with tf.Session() as sess:") 105 | endf 106 | map tdm :call TensorflowDemo() 107 | 108 | function MachineLearning() 109 | call setline(1,"# Copyright 2020 kunming.xie") 110 | call append (1, "#") 111 | call append (2, "# Licensed under the Apache License, Version 2.0 (the \"License\");") 112 | call append (3, "# you may not use this file except in compliance with the License.") 113 | call append (4, "# You may obtain a copy of the License at") 114 | call append (5, "#") 115 | call append (6, "# http://www.apache.org/licenses/LICENSE-2.0") 116 | call append (7, "#") 117 | call append (8, "# Unless required by applicable law or agreed to in writing, software") 118 | call append (9, "# distributed under the License is distributed on an \"AS IS\" BASIS,") 119 | call append (10, "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.") 120 | call append (11, "# See the License for the specific language governing permissions and") 121 | call append (12, "# limitations under the License.") 122 | call append (13, "# ==============================================================================") 123 | call append (14, "博客地址:https://blog.csdn.net/kelsel") 124 | call append (15, "[代码](https://github.com/tensorflow123/python_tutorial/tree/master/" . expand('%:p')[34:] . ")") 125 | endf 126 | map ai :call MachineLearning() 127 | -------------------------------------------------------------------------------- /tools/conf/.ycm_extra_conf.py: -------------------------------------------------------------------------------- 1 | # This file is NOT licensed under the GPLv3, which is the license for the rest 2 | # of YouCompleteMe. 3 | # 4 | # Here's the license text for this file: 5 | # 6 | # This is free and unencumbered software released into the public domain. 7 | # 8 | # Anyone is free to copy, modify, publish, use, compile, sell, or 9 | # distribute this software, either in source code form or as a compiled 10 | # binary, for any purpose, commercial or non-commercial, and by any 11 | # means. 12 | # 13 | # In jurisdictions that recognize copyright laws, the author or authors 14 | # of this software dedicate any and all copyright interest in the 15 | # software to the public domain. We make this dedication for the benefit 16 | # of the public at large and to the detriment of our heirs and 17 | # successors. We intend this dedication to be an overt act of 18 | # relinquishment in perpetuity of all present and future rights to this 19 | # software under copyright law. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | # OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # For more information, please refer to 30 | 31 | from distutils.sysconfig import get_python_inc 32 | import platform 33 | import os 34 | import ycm_core 35 | 36 | # These are the compilation flags that will be used in case there's no 37 | # compilation database set (by default, one is not set). 38 | # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. 39 | flags = [ 40 | '-Wall', 41 | '-Wextra', 42 | '-Werror', 43 | '-Wno-long-long', 44 | '-Wno-variadic-macros', 45 | '-fexceptions', 46 | '-DNDEBUG', 47 | # You 100% do NOT need -DUSE_CLANG_COMPLETER and/or -DYCM_EXPORT in your flags; 48 | # only the YCM source code needs it. 49 | '-DUSE_CLANG_COMPLETER', 50 | '-DYCM_EXPORT=', 51 | # THIS IS IMPORTANT! Without the '-x' flag, Clang won't know which language to 52 | # use when compiling headers. So it will guess. Badly. So C++ headers will be 53 | # compiled as C headers. You don't want that so ALWAYS specify the '-x' flag. 54 | # For a C project, you would set this to 'c' instead of 'c++'. 55 | '-x', 56 | 'c++', 57 | '-isystem', 58 | '../pybind11', 59 | '-isystem', 60 | '../BoostParts', 61 | '-isystem', 62 | get_python_inc(), 63 | '-isystem', 64 | '../llvm/include', 65 | '-isystem', 66 | '../llvm/tools/clang/include', 67 | '-I', 68 | '.', 69 | '-I', 70 | './ClangCompleter', 71 | '-isystem', 72 | './tests/gmock/gtest', 73 | '-isystem', 74 | './tests/gmock/gtest/include', 75 | '-isystem', 76 | './tests/gmock', 77 | '-isystem', 78 | './tests/gmock/include', 79 | '-isystem', 80 | './benchmarks/benchmark/include', 81 | ] 82 | 83 | # Clang automatically sets the '-std=' flag to 'c++14' for MSVC 2015 or later, 84 | # which is required for compiling the standard library, and to 'c++11' for older 85 | # versions. 86 | if platform.system() != 'Windows': 87 | flags.append( '-std=c++11' ) 88 | 89 | 90 | # Set this to the absolute path to the folder (NOT the file!) containing the 91 | # compile_commands.json file to use that instead of 'flags'. See here for 92 | # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html 93 | # 94 | # You can get CMake to generate this file for you by adding: 95 | # set( CMAKE_EXPORT_COMPILE_COMMANDS 1 ) 96 | # to your CMakeLists.txt file. 97 | # 98 | # Most projects will NOT need to set this to anything; you can just change the 99 | # 'flags' list of compilation flags. Notice that YCM itself uses that approach. 100 | compilation_database_folder = '' 101 | 102 | if os.path.exists( compilation_database_folder ): 103 | database = ycm_core.CompilationDatabase( compilation_database_folder ) 104 | else: 105 | database = None 106 | 107 | SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] 108 | 109 | def DirectoryOfThisScript(): 110 | return os.path.dirname( os.path.abspath( __file__ ) ) 111 | 112 | 113 | def IsHeaderFile( filename ): 114 | extension = os.path.splitext( filename )[ 1 ] 115 | return extension in [ '.h', '.hxx', '.hpp', '.hh' ] 116 | 117 | 118 | def FindCorrespondingSourceFile( filename ): 119 | if IsHeaderFile( filename ): 120 | basename = os.path.splitext( filename )[ 0 ] 121 | for extension in SOURCE_EXTENSIONS: 122 | replacement_file = basename + extension 123 | if os.path.exists( replacement_file ): 124 | return replacement_file 125 | return filename 126 | 127 | 128 | def FlagsForFile( filename, **kwargs ): 129 | # If the file is a header, try to find the corresponding source file and 130 | # retrieve its flags from the compilation database if using one. This is 131 | # necessary since compilation databases don't have entries for header files. 132 | # In addition, use this source file as the translation unit. This makes it 133 | # possible to jump from a declaration in the header file to its definition in 134 | # the corresponding source file. 135 | filename = FindCorrespondingSourceFile( filename ) 136 | 137 | if not database: 138 | return { 139 | 'flags': flags, 140 | 'include_paths_relative_to_dir': DirectoryOfThisScript(), 141 | 'override_filename': filename 142 | } 143 | 144 | compilation_info = database.GetCompilationInfoForFile( filename ) 145 | if not compilation_info.compiler_flags_: 146 | return None 147 | 148 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a 149 | # python list, but a "list-like" StringVec object. 150 | final_flags = list( compilation_info.compiler_flags_ ) 151 | 152 | # NOTE: This is just for YouCompleteMe; it's highly likely that your project 153 | # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR 154 | # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT. 155 | try: 156 | final_flags.remove( '-stdlib=libc++' ) 157 | except ValueError: 158 | pass 159 | 160 | return { 161 | 'flags': final_flags, 162 | 'include_paths_relative_to_dir': compilation_info.compiler_working_dir_, 163 | 'override_filename': filename 164 | } 165 | -------------------------------------------------------------------------------- /colors/monokai.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Converted from Textmate theme Monokai using Coloration v0.3.2 (http://github.com/sickill/coloration) 3 | 4 | set background=dark 5 | highlight clear 6 | 7 | if exists("syntax_on") 8 | syntax reset 9 | endif 10 | 11 | set t_Co=256 12 | let g:colors_name = "monokai" 13 | 14 | hi Cursor ctermfg=235 ctermbg=231 cterm=NONE guifg=#272822 guibg=#f8f8f0 gui=NONE 15 | hi Visual ctermfg=NONE ctermbg=59 cterm=NONE guifg=NONE guibg=#49483e gui=NONE 16 | hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE 17 | hi CursorColumn ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE 18 | hi ColorColumn ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE 19 | hi LineNr ctermfg=102 ctermbg=237 cterm=NONE guifg=#90908a guibg=#3c3d37 gui=NONE 20 | hi VertSplit ctermfg=241 ctermbg=241 cterm=NONE guifg=#64645e guibg=#64645e gui=NONE 21 | hi MatchParen ctermfg=197 ctermbg=NONE cterm=underline guifg=#f92672 guibg=NONE gui=underline 22 | hi StatusLine ctermfg=231 ctermbg=241 cterm=bold guifg=#f8f8f2 guibg=#64645e gui=bold 23 | hi StatusLineNC ctermfg=231 ctermbg=241 cterm=NONE guifg=#f8f8f2 guibg=#64645e gui=NONE 24 | hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 25 | hi PmenuSel ctermfg=NONE ctermbg=59 cterm=NONE guifg=NONE guibg=#49483e gui=NONE 26 | hi IncSearch term=reverse cterm=reverse ctermfg=193 ctermbg=16 gui=reverse guifg=#C4BE89 guibg=#000000 27 | hi Search term=reverse cterm=NONE ctermfg=231 ctermbg=24 gui=NONE guifg=#f8f8f2 guibg=#204a87 28 | hi Directory ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 29 | hi Folded ctermfg=242 ctermbg=235 cterm=NONE guifg=#75715e guibg=#272822 gui=NONE 30 | hi SignColumn ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE 31 | hi Normal ctermfg=231 ctermbg=235 cterm=NONE guifg=#f8f8f2 guibg=#272822 gui=NONE 32 | hi Boolean ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 33 | hi Character ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 34 | hi Comment ctermfg=242 ctermbg=NONE cterm=NONE guifg=#75715e guibg=NONE gui=NONE 35 | hi Conditional ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 36 | hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 37 | hi Define ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 38 | hi DiffAdd ctermfg=231 ctermbg=64 cterm=bold guifg=#f8f8f2 guibg=#46830c gui=bold 39 | hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8b0807 guibg=NONE gui=NONE 40 | hi DiffChange ctermfg=NONE ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=#243955 gui=NONE 41 | hi DiffText ctermfg=231 ctermbg=24 cterm=bold guifg=#f8f8f2 guibg=#204a87 gui=bold 42 | hi ErrorMsg ctermfg=231 ctermbg=197 cterm=NONE guifg=#f8f8f0 guibg=#f92672 gui=NONE 43 | hi WarningMsg ctermfg=231 ctermbg=197 cterm=NONE guifg=#f8f8f0 guibg=#f92672 gui=NONE 44 | hi Float ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 45 | hi Function ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE 46 | hi Identifier ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 47 | hi Keyword ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 48 | hi Label ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE 49 | hi NonText ctermfg=59 ctermbg=236 cterm=NONE guifg=#49483e guibg=#31322c gui=NONE 50 | hi Number ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 51 | hi Operator ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 52 | hi PreProc ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 53 | hi Special ctermfg=231 ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=NONE gui=NONE 54 | hi SpecialComment ctermfg=242 ctermbg=NONE cterm=NONE guifg=#75715e guibg=NONE gui=NONE 55 | hi SpecialKey ctermfg=59 ctermbg=237 cterm=NONE guifg=#49483e guibg=#3c3d37 gui=NONE 56 | hi Statement ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 57 | hi StorageClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 58 | hi String ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE 59 | hi Tag ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 60 | hi Title ctermfg=231 ctermbg=NONE cterm=bold guifg=#f8f8f2 guibg=NONE gui=bold 61 | hi Todo ctermfg=95 ctermbg=NONE cterm=inverse,bold guifg=#75715e guibg=NONE gui=inverse,bold 62 | hi Type ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 63 | hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline 64 | hi rubyClass ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 65 | hi rubyFunction ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE 66 | hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 67 | hi rubySymbol ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 68 | hi rubyConstant ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 69 | hi rubyStringDelimiter ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE 70 | hi rubyBlockParameter ctermfg=208 ctermbg=NONE cterm=NONE guifg=#fd971f guibg=NONE gui=italic 71 | hi rubyInstanceVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 72 | hi rubyInclude ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 73 | hi rubyGlobalVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 74 | hi rubyRegexp ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE 75 | hi rubyRegexpDelimiter ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE 76 | hi rubyEscape ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 77 | hi rubyControl ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 78 | hi rubyClassVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 79 | hi rubyOperator ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 80 | hi rubyException ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 81 | hi rubyPseudoVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 82 | hi rubyRailsUserClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 83 | hi rubyRailsARAssociationMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 84 | hi rubyRailsARMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 85 | hi rubyRailsRenderMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 86 | hi rubyRailsMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 87 | hi erubyDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 88 | hi erubyComment ctermfg=95 ctermbg=NONE cterm=NONE guifg=#75715e guibg=NONE gui=NONE 89 | hi erubyRailsMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 90 | hi htmlTag ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE 91 | hi htmlEndTag ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE 92 | hi htmlTagName ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 93 | hi htmlArg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 94 | hi htmlSpecialChar ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 95 | hi javaScriptFunction ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 96 | hi javaScriptRailsFunction ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 97 | hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 98 | hi yamlKey ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE 99 | hi yamlAnchor ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 100 | hi yamlAlias ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 101 | hi yamlDocumentHeader ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE 102 | hi cssURL ctermfg=208 ctermbg=NONE cterm=NONE guifg=#fd971f guibg=NONE gui=italic 103 | hi cssFunctionName ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 104 | hi cssColor ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 105 | hi cssPseudoClassId ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE 106 | hi cssClassName ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE 107 | hi cssValueLength ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE 108 | hi cssCommonAttr ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE 109 | hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 110 | -------------------------------------------------------------------------------- /plugin/indent-object.vim: -------------------------------------------------------------------------------- 1 | "-------------------------------------------------------------------------------- 2 | " 3 | " Copyright (c) 2010 Michael Smith 4 | " 5 | " http://github.com/michaeljsmith/vim-indent-object 6 | " 7 | " Permission is hereby granted, free of charge, to any person obtaining a copy 8 | " of this software and associated documentation files (the "Software"), to 9 | " deal in the Software without restriction, including without limitation the 10 | " rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11 | " sell copies of the Software, and to permit persons to whom the Software is 12 | " furnished to do so, subject to the following conditions: 13 | " 14 | " The above copyright notice and this permission notice shall be included in 15 | " all copies or substantial portions of the Software. 16 | " 17 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | " FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23 | " IN THE SOFTWARE. 24 | " 25 | "-------------------------------------------------------------------------------- 26 | 27 | " Mappings excluding line below. 28 | onoremap ai :cal HandleTextObjectMapping(0, 0, 0, [line("."), line("."), col("."), col(".")]) 29 | onoremap ii :cal HandleTextObjectMapping(1, 0, 0, [line("."), line("."), col("."), col(".")]) 30 | vnoremap ai :cal HandleTextObjectMapping(0, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])gv 31 | vnoremap ii :cal HandleTextObjectMapping(1, 0, 1, [line("'<"), line("'>"), col("'<"), col("'>")])gv 32 | 33 | " Mappings including line below. 34 | onoremap aI :cal HandleTextObjectMapping(0, 1, 0, [line("."), line("."), col("."), col(".")]) 35 | onoremap iI :cal HandleTextObjectMapping(1, 1, 0, [line("."), line("."), col("."), col(".")]) 36 | vnoremap aI :cal HandleTextObjectMapping(0, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])gv 37 | vnoremap iI :cal HandleTextObjectMapping(1, 1, 1, [line("'<"), line("'>"), col("'<"), col("'>")])gv 38 | 39 | let s:l0 = -1 40 | let s:l1 = -1 41 | let s:c0 = -1 42 | let s:c1 = -1 43 | 44 | if !exists("g:indent_object_except_first_level") 45 | let g:indent_object_except_first_level = 1 46 | endif 47 | 48 | function! TextObject(inner, incbelow, vis, range, count) 49 | 50 | " Record the current state of the visual region. 51 | let vismode = "V" 52 | 53 | " Detect if this is a completely new visual selction session. 54 | let new_vis = 0 55 | let new_vis = new_vis || s:l0 != a:range[0] 56 | let new_vis = new_vis || s:l1 != a:range[1] 57 | let new_vis = new_vis || s:c0 != a:range[2] 58 | let new_vis = new_vis || s:c1 != a:range[3] 59 | 60 | let s:l0 = a:range[0] 61 | let s:l1 = a:range[1] 62 | let s:c0 = a:range[2] 63 | let s:c1 = a:range[3] 64 | 65 | " Repeatedly increase the scope of the selection. 66 | let itr_cnt = 0 67 | let cnt = a:count 68 | while cnt > 0 69 | 70 | " Look for the minimum indentation in the current visual region. 71 | let l = s:l0 72 | let idnt_invalid = 1000 73 | let idnt = idnt_invalid 74 | while l <= s:l1 75 | if !(getline(l) =~ "^\\s*$") 76 | let idnt = min([idnt, indent(l)]) 77 | endif 78 | let l += 1 79 | endwhile 80 | 81 | " Keep track of where the range should be expanded to. 82 | let l_1 = s:l0 83 | let l_1o = l_1 84 | let l2 = s:l1 85 | let l2o = l2 86 | 87 | " If we are highlighting only blank lines, we may not have found a 88 | " valid indent. In this case we need to look for the next and previous 89 | " non blank lines and check which of those has the largest indent. 90 | if idnt == idnt_invalid 91 | let idnt = 0 92 | let pnb = prevnonblank(s:l0) 93 | if pnb 94 | let idnt = max([idnt, indent(pnb)]) 95 | let l_1 = pnb 96 | endif 97 | let nnb = nextnonblank(s:l0) 98 | if nnb 99 | let idnt = max([idnt, indent(nnb)]) 100 | endif 101 | 102 | " If we are in whitespace at the beginning of a block, skip over 103 | " it when we are selecting the range. Similarly, if we are in 104 | " whitespace at the end, ignore it. 105 | if idnt > indent(pnb) 106 | let l_1 = nnb 107 | endif 108 | if idnt > indent(nnb) 109 | let l2 = pnb 110 | endif 111 | endif 112 | 113 | " Search backward for the first line with less indent than the target 114 | " indent (skipping blank lines). 115 | let blnk = getline(l_1) =~ "^\\s*$" 116 | while l_1 > 0 && (blnk || indent(l_1) >= idnt) 117 | if g:indent_object_except_first_level && idnt == 0 && blnk 118 | break 119 | endif 120 | if !blnk || !a:inner 121 | let l_1o = l_1 122 | endif 123 | let l_1 -= 1 124 | let blnk = getline(l_1) =~ "^\\s*$" 125 | endwhile 126 | 127 | " Search forward for the first line with more indent than the target 128 | " indent (skipping blank lines). 129 | let line_cnt = line("$") 130 | let blnk = getline(l2) =~ "^\\s*$" 131 | while l2 <= line_cnt && (blnk || indent(l2) >= idnt) 132 | if g:indent_object_except_first_level && idnt == 0 && blnk 133 | break 134 | endif 135 | if !blnk || !a:inner 136 | let l2o = l2 137 | endif 138 | let l2 += 1 139 | let blnk = getline(l2) =~ "^\\s*$" 140 | endwhile 141 | 142 | " Determine which of these extensions to include. Include neither if 143 | " we are selecting an 'inner' object. Exclude the bottom unless are 144 | " told to include it. 145 | let idnt2 = max([indent(l_1), indent(l2)]) 146 | if indent(l_1) < idnt2 || a:inner 147 | let l_1 = l_1o 148 | endif 149 | if indent(l2) < idnt2 || a:inner || !a:incbelow 150 | let l2 = l2o 151 | endif 152 | let l_1 = max([l_1, 1]) 153 | let l2 = min([l2, line("$")]) 154 | 155 | " Extend the columns to the start and end. 156 | " If inner is selected, set the final cursor pos to the start 157 | " of the text in the line. 158 | let c_1 = 1 159 | if a:inner 160 | let c_1 = match(getline(l_1), "\\c\\S") + 1 161 | endif 162 | let c2 = len(getline(l2)) 163 | if !a:inner 164 | let c2 += 1 165 | endif 166 | 167 | " Make sure there's no change if we haven't really made a 168 | " significant change in linewise mode - this makes sure that 169 | " we can iteratively increase selection in linewise mode. 170 | if itr_cnt == 0 && vismode ==# 'V' && s:l0 == l_1 && s:l1 == l2 171 | let c_1 = s:c0 172 | let c2 = s:c1 173 | endif 174 | 175 | " Check whether the visual region has changed. 176 | let chg = 0 177 | let chg = chg || s:l0 != l_1 178 | let chg = chg || s:l1 != l2 179 | let chg = chg || s:c0 != c_1 180 | let chg = chg || s:c1 != c2 181 | 182 | if vismode ==# 'V' && new_vis 183 | let chg = 1 184 | endif 185 | 186 | " Update the vars. 187 | let s:l0 = l_1 188 | let s:l1 = l2 189 | let s:c0 = c_1 190 | let s:c1 = c2 191 | 192 | " If there was no change, then don't decrement the count (it didn't 193 | " count because it didn't do anything). 194 | if chg 195 | let cnt = cnt - 1 196 | else 197 | " Since this didn't work, push the selection back one char. This 198 | " will have the effect of getting the enclosing block. Do it at 199 | " the beginning rather than the end - the beginning is very likely 200 | " to be only one indentation level different. 201 | if s:l0 == 0 202 | return 203 | endif 204 | let s:l0 -= 1 205 | let s:c0 = len(getline(s:l0)) 206 | endif 207 | 208 | let itr_cnt += 1 209 | 210 | endwhile 211 | 212 | " Apply the range we have found. Make sure to use the current visual mode. 213 | call cursor(s:l0, s:c0) 214 | exe "normal! " . vismode 215 | call cursor(s:l1, s:c1) 216 | normal! o 217 | 218 | " Update these static variables - we need to keep these up-to-date between 219 | " invocations because it's the only way we can detect whether it's a new 220 | " visual mode. We need to know if it's a new visual mode because otherwise 221 | " if there's a single line block in visual line mode and we select it with 222 | " "V", we can't tell whether it's already been selected using Vii. 223 | exe "normal! \" 224 | let s:l0 = line("'<") 225 | let s:l1 = line("'>") 226 | let s:c0 = col("'<") 227 | let s:c1 = col("'>") 228 | normal gv0o0 229 | 230 | endfunction 231 | 232 | function! HandleTextObjectMapping(inner, incbelow, vis, range) 233 | call TextObject(a:inner, a:incbelow, a:vis, a:range, v:count1) 234 | endfunction 235 | -------------------------------------------------------------------------------- /init/init-style.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-style.vim - 显示样式设置 4 | " 5 | " Created by skywind on 2018/05/30 6 | " Last Modified: 2018/05/30 20:29:07 7 | " 8 | "====================================================================== 9 | " vim: set ts=4 sw=4 tw=78 noet : 10 | 11 | 12 | "---------------------------------------------------------------------- 13 | " 显示设置 14 | "---------------------------------------------------------------------- 15 | 16 | " 总是显示状态栏 17 | set laststatus=2 18 | 19 | " 总是显示行号 20 | set nonumber 21 | 22 | " 总是显示侧边栏(用于显示 mark/gitdiff/诊断信息) 23 | set signcolumn=yes 24 | 25 | " 总是显示标签栏 26 | set showtabline=2 27 | 28 | " 设置显示制表符等隐藏字符 29 | " set list 30 | 31 | " 右下角显示命令 32 | set showcmd 33 | 34 | " 插入模式在状态栏下面显示 -- INSERT --, 35 | " 先注释掉,默认已经为真了,如果这里再设置一遍会影响 echodoc 插件 36 | " set showmode 37 | 38 | " 水平切割窗口时,默认在右边显示新窗口 39 | set splitright 40 | 41 | 42 | "---------------------------------------------------------------------- 43 | " 颜色主题:色彩文件位于 colors 目录中 44 | "---------------------------------------------------------------------- 45 | 46 | " 设置黑色背景 47 | set background=dark 48 | 49 | " 允许 256 色 50 | set t_Co=256 51 | 52 | " 设置颜色主题,会在所有 runtimepaths 的 colors 目录寻找同名配置 53 | color desert256 54 | 55 | 56 | "---------------------------------------------------------------------- 57 | " 状态栏设置 58 | "---------------------------------------------------------------------- 59 | set statusline= " 清空状态了 60 | set statusline+=\ %F " 文件名 61 | set statusline+=\ [%1*%M%*%n%R%H] " buffer 编号和状态 62 | set statusline+=%= " 向右对齐 63 | set statusline+=\ %y " 文件类型 64 | 65 | " 最右边显示文件编码和行号等信息,并且固定在一个 group 中,优先占位 66 | set statusline+=\ %0(%{&fileformat}\ [%{(&fenc==\"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]\ %v:%l/%L%) 67 | 68 | 69 | "---------------------------------------------------------------------- 70 | " 更改样式 71 | "---------------------------------------------------------------------- 72 | 73 | " 更清晰的错误标注:默认一片红色背景,语法高亮都被搞没了 74 | " 只显示红色或者蓝色下划线或者波浪线 75 | hi! clear SpellBad 76 | hi! clear SpellCap 77 | hi! clear SpellRare 78 | hi! clear SpellLocal 79 | if has('gui_running') 80 | hi! SpellBad gui=undercurl guisp=red 81 | hi! SpellCap gui=undercurl guisp=blue 82 | hi! SpellRare gui=undercurl guisp=magenta 83 | hi! SpellRare gui=undercurl guisp=cyan 84 | else 85 | hi! SpellBad term=standout ctermfg=1 term=underline cterm=underline 86 | hi! SpellCap term=underline cterm=underline 87 | hi! SpellRare term=underline cterm=underline 88 | hi! SpellLocal term=underline cterm=underline 89 | endif 90 | 91 | " 去掉 sign column 的白色背景 92 | hi! SignColumn guibg=NONE ctermbg=NONE 93 | 94 | " 修改行号为浅灰色,默认主题的黄色行号很难看,换主题可以仿照修改 95 | highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE 96 | \ gui=NONE guifg=DarkGrey guibg=NONE 97 | 98 | " 修正补全目录的色彩:默认太难看 99 | hi! Pmenu guibg=gray guifg=black ctermbg=gray ctermfg=black 100 | hi! PmenuSel guibg=gray guifg=brown ctermbg=brown ctermfg=gray 101 | 102 | 103 | "---------------------------------------------------------------------- 104 | " 终端设置,隐藏行号和侧边栏 105 | "---------------------------------------------------------------------- 106 | if has('terminal') && exists(':terminal') == 2 107 | if exists('##TerminalOpen') 108 | augroup VimUnixTerminalGroup 109 | au! 110 | au TerminalOpen * setlocal nonumber signcolumn=no 111 | augroup END 112 | endif 113 | endif 114 | 115 | 116 | "---------------------------------------------------------------------- 117 | " quickfix 设置,隐藏行号 118 | "---------------------------------------------------------------------- 119 | augroup VimInitStyle 120 | au! 121 | au FileType qf setlocal nonumber 122 | augroup END 123 | 124 | 125 | "---------------------------------------------------------------------- 126 | " 标签栏文字风格:默认为零,GUI 模式下空间大,按风格 3显示 127 | " 0: filename.txt 128 | " 2: 1 - filename.txt 129 | " 3: [1] filename.txt 130 | "---------------------------------------------------------------------- 131 | if has('gui_running') 132 | let g:config_vim_tab_style = 3 133 | endif 134 | 135 | 136 | "---------------------------------------------------------------------- 137 | " 终端下的 tabline 138 | "---------------------------------------------------------------------- 139 | function! Vim_NeatTabLine() 140 | let s = '' 141 | for i in range(tabpagenr('$')) 142 | " select the highlighting 143 | if i + 1 == tabpagenr() 144 | let s .= '%#TabLineSel#' 145 | else 146 | let s .= '%#TabLine#' 147 | endif 148 | 149 | " set the tab page number (for mouse clicks) 150 | let s .= '%' . (i + 1) . 'T' 151 | 152 | " the label is made by MyTabLabel() 153 | let s .= ' %{Vim_NeatTabLabel(' . (i + 1) . ')} ' 154 | endfor 155 | 156 | " after the last tab fill with TabLineFill and reset tab page nr 157 | let s .= '%#TabLineFill#%T' 158 | 159 | " right-align the label to close the current tab page 160 | if tabpagenr('$') > 1 161 | let s .= '%=%#TabLine#%999XX' 162 | endif 163 | 164 | return s 165 | endfunc 166 | 167 | 168 | "---------------------------------------------------------------------- 169 | " 需要显示到标签上的文件名 170 | "---------------------------------------------------------------------- 171 | function! Vim_NeatBuffer(bufnr, fullname) 172 | let l:name = bufname(a:bufnr) 173 | if getbufvar(a:bufnr, '&modifiable') 174 | if l:name == '' 175 | return '[No Name]' 176 | else 177 | if a:fullname 178 | return fnamemodify(l:name, ':p') 179 | else 180 | let aname = fnamemodify(l:name, ':p') 181 | let sname = fnamemodify(aname, ':t') 182 | if sname == '' 183 | let test = fnamemodify(aname, ':h:t') 184 | if test != '' 185 | return '<'. test . '>' 186 | endif 187 | endif 188 | return sname 189 | endif 190 | endif 191 | else 192 | let l:buftype = getbufvar(a:bufnr, '&buftype') 193 | if l:buftype == 'quickfix' 194 | return '[Quickfix]' 195 | elseif l:name != '' 196 | if a:fullname 197 | return '-'.fnamemodify(l:name, ':p') 198 | else 199 | return '-'.fnamemodify(l:name, ':t') 200 | endif 201 | else 202 | endif 203 | return '[No Name]' 204 | endif 205 | endfunc 206 | 207 | 208 | "---------------------------------------------------------------------- 209 | " 标签栏文字,使用 [1] filename 的模式 210 | "---------------------------------------------------------------------- 211 | function! Vim_NeatTabLabel(n) 212 | let l:buflist = tabpagebuflist(a:n) 213 | let l:winnr = tabpagewinnr(a:n) 214 | let l:bufnr = l:buflist[l:winnr - 1] 215 | let l:fname = Vim_NeatBuffer(l:bufnr, 0) 216 | let l:num = a:n 217 | let style = get(g:, 'config_vim_tab_style', 0) 218 | if style == 0 219 | return l:fname 220 | elseif style == 1 221 | return "[".l:num."] ".l:fname 222 | elseif style == 2 223 | return "".l:num." - ".l:fname 224 | endif 225 | if getbufvar(l:bufnr, '&modified') 226 | return "[".l:num."] ".l:fname." +" 227 | endif 228 | return "[".l:num."] ".l:fname 229 | endfunc 230 | 231 | 232 | "---------------------------------------------------------------------- 233 | " GUI 下的标签文字,使用 [1] filename 的模式 234 | "---------------------------------------------------------------------- 235 | function! Vim_NeatGuiTabLabel() 236 | let l:num = v:lnum 237 | let l:buflist = tabpagebuflist(l:num) 238 | let l:winnr = tabpagewinnr(l:num) 239 | let l:bufnr = l:buflist[l:winnr - 1] 240 | let l:fname = Vim_NeatBuffer(l:bufnr, 0) 241 | let style = get(g:, 'config_vim_tab_style', 0) 242 | if style == 0 243 | return l:fname 244 | elseif style == 1 245 | return "[".l:num."] ".l:fname 246 | elseif style == 2 247 | return "".l:num." - ".l:fname 248 | endif 249 | if getbufvar(l:bufnr, '&modified') 250 | return "[".l:num."] ".l:fname." +" 251 | endif 252 | return "[".l:num."] ".l:fname 253 | endfunc 254 | 255 | 256 | 257 | "---------------------------------------------------------------------- 258 | " 设置 GUI 标签的 tips: 显示当前标签有哪些窗口 259 | "---------------------------------------------------------------------- 260 | function! Vim_NeatGuiTabTip() 261 | let tip = '' 262 | let bufnrlist = tabpagebuflist(v:lnum) 263 | for bufnr in bufnrlist 264 | " separate buffer entries 265 | if tip != '' 266 | let tip .= " \n" 267 | endif 268 | " Add name of buffer 269 | let name = Vim_NeatBuffer(bufnr, 1) 270 | let tip .= name 271 | " add modified/modifiable flags 272 | if getbufvar(bufnr, "&modified") 273 | let tip .= ' [+]' 274 | endif 275 | if getbufvar(bufnr, "&modifiable")==0 276 | let tip .= ' [-]' 277 | endif 278 | endfor 279 | return tip 280 | endfunc 281 | 282 | 283 | "---------------------------------------------------------------------- 284 | " 标签栏最终设置 285 | "---------------------------------------------------------------------- 286 | set tabline=%!Vim_NeatTabLine() 287 | set guitablabel=%{Vim_NeatGuiTabLabel()} 288 | set guitabtooltip=%{Vim_NeatGuiTabTip()} 289 | 290 | " GVim去掉菜单栏和工具栏 291 | if has('win32') 292 | set guioptions-=m 293 | set guioptions-=T 294 | endif 295 | 296 | -------------------------------------------------------------------------------- /init/init-keymaps.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-keymaps.vim - 按键设置,按你喜欢更改 4 | " 5 | " - 快速移动 6 | " - 标签切换 7 | " - 窗口切换 8 | " - 终端支持 9 | " - 编译运行 10 | " - 符号搜索 11 | " 12 | " Created by skywind on 2018/05/30 13 | " Last Modified: 2018/05/30 17:59:31 14 | " 15 | "====================================================================== 16 | " vim: set ts=4 sw=4 tw=78 noet : 17 | 18 | "---------------------------------------------------------------------- 19 | " type to enter command model 20 | "---------------------------------------------------------------------- 21 | nmap : 22 | 23 | "---------------------------------------------------------------------- 24 | " INSERT 模式下使用 EMACS 键位 25 | "---------------------------------------------------------------------- 26 | inoremap 27 | inoremap 28 | inoremap 29 | inoremap 30 | 31 | 32 | "---------------------------------------------------------------------- 33 | " 设置 CTRL+HJKL 移动光标(INSERT 模式偶尔需要移动的方便些) 34 | " 使用 SecureCRT/XShell 等终端软件需设置:Backspace sends delete 35 | " 详见:http://www.skywind.me/blog/archives/2021 36 | "---------------------------------------------------------------------- 37 | noremap 38 | noremap 39 | noremap 40 | noremap 41 | inoremap 42 | inoremap 43 | inoremap 44 | inoremap 45 | 46 | 47 | "---------------------------------------------------------------------- 48 | " 命令模式的快速移动 49 | "---------------------------------------------------------------------- 50 | cnoremap 51 | cnoremap 52 | cnoremap 53 | cnoremap 54 | cnoremap 55 | cnoremap 56 | cnoremap 57 | cnoremap 58 | cnoremap 59 | cnoremap 60 | 61 | 62 | "---------------------------------------------------------------------- 63 | " +数字键 切换tab 64 | "---------------------------------------------------------------------- 65 | noremap 1 1gt 66 | noremap 2 2gt 67 | noremap 3 3gt 68 | noremap 4 4gt 69 | noremap 5 5gt 70 | noremap 6 6gt 71 | noremap 7 7gt 72 | noremap 8 8gt 73 | noremap 9 9gt 74 | noremap 0 10gt 75 | 76 | 77 | "---------------------------------------------------------------------- 78 | " ALT+N 切换 tab 79 | "---------------------------------------------------------------------- 80 | noremap :tabn 1 81 | noremap :tabn 2 82 | noremap :tabn 3 83 | noremap :tabn 4 84 | noremap :tabn 5 85 | noremap :tabn 6 86 | noremap :tabn 7 87 | noremap :tabn 8 88 | noremap :tabn 9 89 | noremap :tabn 10 90 | inoremap :tabn 1 91 | inoremap :tabn 2 92 | inoremap :tabn 3 93 | inoremap :tabn 4 94 | inoremap :tabn 5 95 | inoremap :tabn 6 96 | inoremap :tabn 7 97 | inoremap :tabn 8 98 | inoremap :tabn 9 99 | inoremap :tabn 10 100 | 101 | 102 | " MacVim 允许 CMD+数字键快速切换标签 103 | if has("gui_macvim") 104 | set macmeta 105 | noremap :tabn 1 106 | noremap :tabn 2 107 | noremap :tabn 3 108 | noremap :tabn 4 109 | noremap :tabn 5 110 | noremap :tabn 6 111 | noremap :tabn 7 112 | noremap :tabn 8 113 | noremap :tabn 9 114 | noremap :tabn 10 115 | inoremap :tabn 1 116 | inoremap :tabn 2 117 | inoremap :tabn 3 118 | inoremap :tabn 4 119 | inoremap :tabn 5 120 | inoremap :tabn 6 121 | inoremap :tabn 7 122 | inoremap :tabn 8 123 | inoremap :tabn 9 124 | inoremap :tabn 10 125 | endif 126 | 127 | 128 | 129 | "---------------------------------------------------------------------- 130 | " 缓存:插件 unimpaired 中定义了 [b, ]b 来切换缓存 131 | "---------------------------------------------------------------------- 132 | noremap bn :bn 133 | noremap bp :bp 134 | 135 | 136 | "---------------------------------------------------------------------- 137 | " TAB:创建,关闭,上一个,下一个,左移,右移 138 | " 其实还可以用原生的 CTRL+PageUp, CTRL+PageDown 来切换标签 139 | "---------------------------------------------------------------------- 140 | 141 | noremap tc :tabnew 142 | noremap tq :tabclose 143 | noremap tn :tabnext 144 | noremap tp :tabprev 145 | 146 | 147 | " 左移 tab 148 | function! Tab_MoveLeft() 149 | let l:tabnr = tabpagenr() - 2 150 | if l:tabnr >= 0 151 | exec 'tabmove '.l:tabnr 152 | endif 153 | endfunc 154 | 155 | " 右移 tab 156 | function! Tab_MoveRight() 157 | let l:tabnr = tabpagenr() + 1 158 | if l:tabnr <= tabpagenr('$') 159 | exec 'tabmove '.l:tabnr 160 | endif 161 | endfunc 162 | 163 | noremap tl :call Tab_MoveLeft() 164 | noremap tr :call Tab_MoveRight() 165 | noremap :call Tab_MoveLeft() 166 | noremap :call Tab_MoveRight() 167 | 168 | 169 | "---------------------------------------------------------------------- 170 | " ALT 键移动增强 171 | "---------------------------------------------------------------------- 172 | 173 | " ALT+h/l 快速左右按单词移动(正常模式+插入模式) 174 | noremap b 175 | noremap w 176 | inoremap 177 | inoremap 178 | 179 | " ALT+j/k 逻辑跳转下一行/上一行(按 wrap 逻辑换行进行跳转) 180 | noremap gj 181 | noremap gk 182 | inoremap gj 183 | inoremap gk 184 | 185 | " 命令模式下的相同快捷 186 | cnoremap 187 | cnoremap 188 | 189 | " ALT+y 删除到行末 190 | noremap d$ 191 | inoremap d$ 192 | 193 | 194 | "---------------------------------------------------------------------- 195 | " 窗口切换:ALT+SHIFT+hjkl 196 | " 传统的 CTRL+hjkl 移动窗口不适用于 vim 8.1 的终端模式,CTRL+hjkl 在 197 | " bash/zsh 及带文本界面的程序中都是重要键位需要保留,不能 tnoremap 的 198 | "---------------------------------------------------------------------- 199 | noremap h 200 | noremap l 201 | noremap j 202 | noremap k 203 | inoremap h 204 | inoremap l 205 | inoremap j 206 | inoremap k 207 | 208 | if has('terminal') && exists(':terminal') == 2 && has('patch-8.1.1') 209 | " vim 8.1 支持 termwinkey ,不需要把 terminal 切换成 normal 模式 210 | " 设置 termwinkey 为 CTRL 加减号(GVIM),有些终端下是 CTRL+? 211 | " 后面四个键位是搭配 termwinkey 的,如果 termwinkey 更改,也要改 212 | set termwinkey= 213 | tnoremap h 214 | tnoremap l 215 | tnoremap j 216 | tnoremap k 217 | tnoremap 218 | elseif has('nvim') 219 | " neovim 没有 termwinkey 支持,必须把 terminal 切换回 normal 模式 220 | tnoremap h 221 | tnoremap l 222 | tnoremap j 223 | tnoremap k 224 | tnoremap 225 | endif 226 | 227 | 228 | 229 | "---------------------------------------------------------------------- 230 | " 编译运行 C/C++ 项目 231 | " 详细见:http://www.skywind.me/blog/archives/2084 232 | "---------------------------------------------------------------------- 233 | 234 | " 自动打开 quickfix window ,高度为 6 235 | let g:asyncrun_open = 6 236 | 237 | " 任务结束时候响铃提醒 238 | let g:asyncrun_bell = 1 239 | 240 | " 设置 F10 打开/关闭 Quickfix 窗口 241 | nnoremap :call asyncrun#quickfix_toggle(6) 242 | 243 | " F9 编译 C/C++ 文件 244 | nnoremap :AsyncRun gcc -Wall -O2 "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/$(VIM_FILENOEXT)" 245 | 246 | " F5 运行文件 247 | nnoremap :call ExecuteFile() 248 | 249 | " F7 编译项目 250 | nnoremap :AsyncRun -cwd= make 251 | 252 | " F8 运行项目 253 | nnoremap :AsyncRun -cwd= -raw make run 254 | 255 | " F6 测试项目 256 | nnoremap :AsyncRun -cwd= -raw make test 257 | 258 | " 更新 cmake 259 | nnoremap :AsyncRun -cwd= cmake . 260 | 261 | " Windows 下支持直接打开新 cmd 窗口运行 262 | if has('win32') || has('win64') 263 | nnoremap :AsyncRun -cwd= -mode=4 make run 264 | endif 265 | 266 | 267 | "---------------------------------------------------------------------- 268 | " F5 运行当前文件:根据文件类型判断方法,并且输出到 quickfix 窗口 269 | "---------------------------------------------------------------------- 270 | function! ExecuteFile() 271 | let cmd = '' 272 | if index(['c', 'cpp', 'rs', 'go'], &ft) >= 0 273 | " native 语言,把当前文件名去掉扩展名后作为可执行运行 274 | " 写全路径名是因为后面 -cwd=? 会改变运行时的当前路径,所以写全路径 275 | " 加双引号是为了避免路径中包含空格 276 | let cmd = '"$(VIM_FILEDIR)/$(VIM_FILENOEXT)"' 277 | elseif &ft == 'python' 278 | let $PYTHONUNBUFFERED=1 " 关闭 python 缓存,实时看到输出 279 | let cmd = 'python "$(VIM_FILEPATH)"' 280 | elseif &ft == 'javascript' 281 | let cmd = 'node "$(VIM_FILEPATH)"' 282 | elseif &ft == 'perl' 283 | let cmd = 'perl "$(VIM_FILEPATH)"' 284 | elseif &ft == 'ruby' 285 | let cmd = 'ruby "$(VIM_FILEPATH)"' 286 | elseif &ft == 'php' 287 | let cmd = 'php "$(VIM_FILEPATH)"' 288 | elseif &ft == 'lua' 289 | let cmd = 'lua "$(VIM_FILEPATH)"' 290 | elseif &ft == 'zsh' 291 | let cmd = 'zsh "$(VIM_FILEPATH)"' 292 | elseif &ft == 'ps1' 293 | let cmd = 'powershell -file "$(VIM_FILEPATH)"' 294 | elseif &ft == 'vbs' 295 | let cmd = 'cscript -nologo "$(VIM_FILEPATH)"' 296 | elseif &ft == 'sh' 297 | let cmd = 'bash "$(VIM_FILEPATH)"' 298 | else 299 | return 300 | endif 301 | " Windows 下打开新的窗口 (-mode=4) 运行程序,其他系统在 quickfix 运行 302 | " -raw: 输出内容直接显示到 quickfix window 不匹配 errorformat 303 | " -save=2: 保存所有改动过的文件 304 | " -cwd=$(VIM_FILEDIR): 运行初始化目录为文件所在目录 305 | if has('win32') || has('win64') 306 | exec 'AsyncRun -cwd=$(VIM_FILEDIR) -raw -save=2 -mode=4 '. cmd 307 | else 308 | exec 'AsyncRun -cwd=$(VIM_FILEDIR) -raw -save=2 -mode=0 '. cmd 309 | endif 310 | endfunc 311 | 312 | 313 | 314 | "---------------------------------------------------------------------- 315 | " F2 在项目目录下 Grep 光标下单词,默认 C/C++/Py/Js ,扩展名自己扩充 316 | " 支持 rg/grep/findstr ,其他类型可以自己扩充 317 | " 不是在当前目录 grep,而是会去到当前文件所属的项目目录 project root 318 | " 下面进行 grep,这样能方便的对相关项目进行搜索 319 | "---------------------------------------------------------------------- 320 | if executable('rg') 321 | noremap :AsyncRun! -cwd= rg -n --no-heading 322 | \ --color never -g *.h -g *.c* -g *.py -g *.js -g *.vim 323 | \ "" 324 | elseif has('win32') || has('win64') 325 | noremap :AsyncRun! -cwd= findstr /n /s /C:"" 326 | \ "\%CD\%\*.h" "\%CD\%\*.c*" "\%CD\%\*.py" "\%CD\%\*.js" 327 | \ "\%CD\%\*.vim" 328 | \ 329 | else 330 | noremap :AsyncRun! -cwd= grep -n -s -R 331 | \ --include='*.h' --include='*.c*' --include='*.py' 332 | \ --include='*.js' --include='*.vim' 333 | \ '' 334 | endif 335 | 336 | 337 | -------------------------------------------------------------------------------- /plugin/mark.vim: -------------------------------------------------------------------------------- 1 | " Script Name: mark.vim 2 | " Description: Highlight several words in different colors simultaneously. 3 | " 4 | " Copyright: (C) 2005-2008 by Yuheng Xie 5 | " (C) 2008-2011 by Ingo Karkat 6 | " The VIM LICENSE applies to this script; see ':help copyright'. 7 | " 8 | " Maintainer: Ingo Karkat 9 | " modify by yangrz, base 2.51 version 10 | " 11 | " Avoid installing twice or when in unsupported Vim version. 12 | if exists('g:loaded_mark') || (v:version == 701 && ! exists('*matchadd')) || (v:version < 702) 13 | finish 14 | endif 15 | let g:loaded_mark = 1 16 | 17 | "- functions ------------------------------------------------------------------ 18 | function! s:EscapeText( text ) 19 | return substitute( escape(a:text, '\' . '^$.*[~'), "\n", '\\n', 'ge' ) 20 | endfunction 21 | 22 | " Mark the current word, like the built-in star command. 23 | " If the cursor is on an existing mark, remove it. 24 | function! mark#MarkCurrentWord() 25 | let l:regexp = mark#CurrentMark()[0] 26 | if empty(l:regexp) 27 | let l:cword = expand('') 28 | if ! empty(l:cword) 29 | let l:regexp = s:EscapeText(l:cword) 30 | " The star command only creates a \ search pattern if the 31 | " actually only consists of keyword characters. 32 | if l:cword =~# '^\k\+$' 33 | let l:regexp = '\<' . l:regexp . '\>' 34 | endif 35 | endif 36 | endif 37 | 38 | if ! empty(l:regexp) 39 | let @/ = l:regexp 40 | call mark#DoMark(l:regexp) 41 | endif 42 | endfunction 43 | 44 | function! s:Cycle( ... ) 45 | let l:currentCycle = s:cycle 46 | let l:newCycle = (a:0 ? a:1 : s:cycle) + 1 47 | let s:cycle = (l:newCycle < s:markNum ? l:newCycle : 0) 48 | return l:currentCycle 49 | endfunction 50 | 51 | " Set match / clear matches in the current window. 52 | function! s:MarkMatch( indices, expr ) 53 | if ! exists('w:mwMatch') || len(w:mwMatch) == 0 54 | let w:mwMatch = repeat([0], s:markNum) 55 | endif 56 | 57 | for l:index in a:indices 58 | if w:mwMatch[l:index] > 0 59 | silent! call matchdelete(w:mwMatch[l:index]) 60 | let w:mwMatch[l:index] = 0 61 | endif 62 | endfor 63 | 64 | if ! empty(a:expr) 65 | let l:index = a:indices[0] " Can only set one index for now. 66 | 67 | " Info: matchadd() does not consider the 'magic' (it's always on), 68 | " 'ignorecase' and 'smartcase' settings. 69 | " Make the match according to the 'ignorecase' setting, like the star command. 70 | " (But honor an explicit case-sensitive regexp via the /\C/ atom.) 71 | let l:expr = ((&ignorecase && a:expr !~# '\\\@ 0 ? l:markCnt . ' ' : '') . 'marks' 157 | endif 158 | endfunction 159 | 160 | 161 | " Mark or unmark a regular expression. 162 | function! s:SetPattern( index, pattern ) 163 | let s:pattern[a:index] = a:pattern 164 | endfunction 165 | 166 | function! mark#ClearAll() 167 | let i = 0 168 | let indices = [] 169 | while i < s:markNum 170 | if ! empty(s:pattern[i]) 171 | call s:SetPattern(i, '') 172 | call add(indices, i) 173 | endif 174 | let i += 1 175 | endwhile 176 | let s:lastSearch = '' 177 | 178 | " Re-enable marks; not strictly necessary, since all marks have just been 179 | " cleared, and marks will be re-enabled, anyway, when the first mark is added. 180 | " It's just more consistent for mark persistence. But save the full refresh, as 181 | " we do the update ourselves. 182 | call s:MarkEnable(0, 0) 183 | 184 | call s:MarkScope(l:indices, '') 185 | 186 | if len(indices) > 0 187 | echo 'Cleared all' len(indices) 'marks' 188 | else 189 | echo 'All marks cleared' 190 | endif 191 | endfunction 192 | 193 | function! mark#DoMark(...) " DoMark(regexp) 194 | let regexp = (a:0 ? a:1 : '') 195 | 196 | " Disable marks if regexp is empty. Otherwise, we will be either removing a 197 | " mark or adding one, so marks will be re-enabled. 198 | if empty(regexp) 199 | call mark#Toggle() 200 | return 201 | endif 202 | 203 | " clear the mark if it has been marked 204 | let i = 0 205 | while i < s:markNum 206 | if regexp ==# s:pattern[i] 207 | if s:lastSearch ==# s:pattern[i] 208 | let s:lastSearch = '' 209 | endif 210 | call s:SetPattern(i, '') 211 | call s:EnableAndMarkScope([i], '') 212 | return 213 | endif 214 | let i += 1 215 | endwhile 216 | 217 | if s:markNum <= 0 218 | " Uh, somehow no mark highlightings were defined. Try to detect them again. 219 | call mark#Init() 220 | if s:markNum <= 0 221 | " Still no mark highlightings; complain. 222 | let v:errmsg = 'No mark highlightings defined' 223 | echohl ErrorMsg 224 | echomsg v:errmsg 225 | echohl None 226 | return 227 | endif 228 | endif 229 | 230 | " add to history 231 | if stridx(g:mwHistAdd, '/') >= 0 232 | call histadd('/', regexp) 233 | endif 234 | if stridx(g:mwHistAdd, '@') >= 0 235 | call histadd('@', regexp) 236 | endif 237 | 238 | " choose an unused mark group 239 | let i = 0 240 | while i < s:markNum 241 | if empty(s:pattern[i]) 242 | call s:SetPattern(i, regexp) 243 | call s:Cycle(i) 244 | call s:EnableAndMarkScope([i], regexp) 245 | return 246 | endif 247 | let i += 1 248 | endwhile 249 | 250 | " choose a mark group by cycle 251 | let i = s:Cycle() 252 | if s:lastSearch ==# s:pattern[i] 253 | let s:lastSearch = '' 254 | endif 255 | call s:SetPattern(i, regexp) 256 | call s:EnableAndMarkScope([i], regexp) 257 | endfunction 258 | 259 | " Return [mark text, mark start position] of the mark under the cursor (or 260 | " ['', []] if there is no mark). 261 | " The mark can include the trailing newline character that concludes the line, 262 | " but marks that span multiple lines are not supported. 263 | function! mark#CurrentMark() 264 | let line = getline('.') . "\n" 265 | 266 | " Highlighting groups with higher numbers take precedence over lower numbers, 267 | " and therefore its marks appear "above" other marks. To retrieve the visible 268 | " mark in case of overlapping marks, we need to check from highest to lowest 269 | " highlighting group. 270 | let i = s:markNum - 1 271 | while i >= 0 272 | if ! empty(s:pattern[i]) 273 | " Note: col() is 1-based, all other indexes zero-based! 274 | let start = 0 275 | while start >= 0 && start < strlen(line) && start < col('.') 276 | let b = match(line, s:pattern[i], start) 277 | let e = matchend(line, s:pattern[i], start) 278 | if b < col('.') && col('.') <= e 279 | return [s:pattern[i], [line('.'), (b + 1)]] 280 | endif 281 | if b == e 282 | break 283 | endif 284 | let start = e 285 | endwhile 286 | endif 287 | let i -= 1 288 | endwhile 289 | return ['', []] 290 | endfunction 291 | 292 | "- initializations ------------------------------------------------------------ 293 | augroup Mark 294 | autocmd! 295 | autocmd WinEnter * if ! exists('w:mwMatch') | call mark#UpdateMark() | endif 296 | autocmd TabEnter * call mark#UpdateScope() 297 | augroup END 298 | 299 | " Define global variables and initialize current scope. 300 | function! mark#Init() 301 | let s:markNum = 0 302 | while hlexists('MarkWord' . (s:markNum + 1)) 303 | let s:markNum += 1 304 | endwhile 305 | let s:pattern = repeat([''], s:markNum) 306 | let s:cycle = 0 307 | let s:lastSearch = '' 308 | let s:enabled = 1 309 | endfunction 310 | 311 | "- configuration -------------------------------------------------------------- 312 | if ! exists('g:mwHistAdd') 313 | let g:mwHistAdd = '/@' 314 | endif 315 | 316 | call mark#Init() 317 | call mark#UpdateScope() 318 | 319 | "- default highlightings ------------------------------------------------------ 320 | function! s:DefaultHighlightings() 321 | " You may define your own colors in your vimrc file, in the form as below: 322 | highlight def MarkWord1 ctermbg=Red ctermfg=White guibg=Red guifg=White 323 | highlight def MarkWord2 ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black 324 | highlight def MarkWord3 ctermbg=Blue ctermfg=Black guibg=Blue guifg=Black 325 | highlight def MarkWord4 ctermbg=Green ctermfg=Black guibg=Green guifg=Black 326 | highlight def MarkWord5 ctermbg=Magenta ctermfg=White guibg=Magenta guifg=White 327 | highlight def MarkWord6 ctermbg=Cyan ctermfg=Black guibg=Cyan guifg=Black 328 | highlight def MarkWord7 ctermbg=Gray ctermfg=Black guibg=Gray guifg=Black 329 | highlight def MarkWord8 ctermbg=Brown ctermfg=Black guibg=Brown guifg=Black 330 | endfunction 331 | 332 | call s:DefaultHighlightings() 333 | autocmd ColorScheme * call DefaultHighlightings() 334 | 335 | "- mappings ------------------------------------------------------------------- 336 | nnoremap MarkSet :call mark#MarkCurrentWord():noh 337 | nnoremap MarkAllClear :call mark#ClearAll():noh 338 | 339 | if !hasmapto('MarkSet', 'n') 340 | nmap mm MarkSet 341 | nmap mc MarkAllClear 342 | endif 343 | 344 | command! -nargs=? Mark call mark#DoMark() 345 | command! -bar MarkClear call mark#ClearAll() 346 | -------------------------------------------------------------------------------- /colors/desert256.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Henry So, Jr. 3 | 4 | " These are the colors of the "desert" theme by Hans Fugal with a few small 5 | " modifications (namely that I lowered the intensity of the normal white and 6 | " made the normal and nontext backgrounds black), modified to work with 88- 7 | " and 256-color xterms. 8 | " 9 | " The original "desert" theme is available as part of the vim distribution or 10 | " at http://hans.fugal.net/vim/colors/. 11 | " 12 | " The real feature of this color scheme, with a wink to the "inkpot" theme, is 13 | " the programmatic approximation of the gui colors to the palettes of 88- and 14 | " 256- color xterms. The functions that do this (folded away, for 15 | " readability) are calibrated to the colors used for Thomas E. Dickey's xterm 16 | " (version 200), which is available at http://dickey.his.com/xterm/xterm.html. 17 | " 18 | " I struggled with trying to parse the rgb.txt file to avoid the necessity of 19 | " converting color names to #rrggbb form, but decided it was just not worth 20 | " the effort. Maybe someone seeing this may decide otherwise... 21 | 22 | set background=dark 23 | if version > 580 24 | " no guarantees for version 5.8 and below, but this makes it stop 25 | " complaining 26 | hi clear 27 | if exists("syntax_on") 28 | syntax reset 29 | endif 30 | endif 31 | let g:colors_name="desert256" 32 | 33 | if has("gui_running") || &t_Co == 88 || &t_Co == 256 34 | " functions {{{ 35 | " returns an approximate grey index for the given grey level 36 | fun grey_number(x) 37 | if &t_Co == 88 38 | if a:x < 23 39 | return 0 40 | elseif a:x < 69 41 | return 1 42 | elseif a:x < 103 43 | return 2 44 | elseif a:x < 127 45 | return 3 46 | elseif a:x < 150 47 | return 4 48 | elseif a:x < 173 49 | return 5 50 | elseif a:x < 196 51 | return 6 52 | elseif a:x < 219 53 | return 7 54 | elseif a:x < 243 55 | return 8 56 | else 57 | return 9 58 | endif 59 | else 60 | if a:x < 14 61 | return 0 62 | else 63 | let l:n = (a:x - 8) / 10 64 | let l:m = (a:x - 8) % 10 65 | if l:m < 5 66 | return l:n 67 | else 68 | return l:n + 1 69 | endif 70 | endif 71 | endif 72 | endfun 73 | 74 | " returns the actual grey level represented by the grey index 75 | fun grey_level(n) 76 | if &t_Co == 88 77 | if a:n == 0 78 | return 0 79 | elseif a:n == 1 80 | return 46 81 | elseif a:n == 2 82 | return 92 83 | elseif a:n == 3 84 | return 115 85 | elseif a:n == 4 86 | return 139 87 | elseif a:n == 5 88 | return 162 89 | elseif a:n == 6 90 | return 185 91 | elseif a:n == 7 92 | return 208 93 | elseif a:n == 8 94 | return 231 95 | else 96 | return 255 97 | endif 98 | else 99 | if a:n == 0 100 | return 0 101 | else 102 | return 8 + (a:n * 10) 103 | endif 104 | endif 105 | endfun 106 | 107 | " returns the palette index for the given grey index 108 | fun grey_color(n) 109 | if &t_Co == 88 110 | if a:n == 0 111 | return 16 112 | elseif a:n == 9 113 | return 79 114 | else 115 | return 79 + a:n 116 | endif 117 | else 118 | if a:n == 0 119 | return 16 120 | elseif a:n == 25 121 | return 231 122 | else 123 | return 231 + a:n 124 | endif 125 | endif 126 | endfun 127 | 128 | " returns an approximate color index for the given color level 129 | fun rgb_number(x) 130 | if &t_Co == 88 131 | if a:x < 69 132 | return 0 133 | elseif a:x < 172 134 | return 1 135 | elseif a:x < 230 136 | return 2 137 | else 138 | return 3 139 | endif 140 | else 141 | if a:x < 75 142 | return 0 143 | else 144 | let l:n = (a:x - 55) / 40 145 | let l:m = (a:x - 55) % 40 146 | if l:m < 20 147 | return l:n 148 | else 149 | return l:n + 1 150 | endif 151 | endif 152 | endif 153 | endfun 154 | 155 | " returns the actual color level for the given color index 156 | fun rgb_level(n) 157 | if &t_Co == 88 158 | if a:n == 0 159 | return 0 160 | elseif a:n == 1 161 | return 139 162 | elseif a:n == 2 163 | return 205 164 | else 165 | return 255 166 | endif 167 | else 168 | if a:n == 0 169 | return 0 170 | else 171 | return 55 + (a:n * 40) 172 | endif 173 | endif 174 | endfun 175 | 176 | " returns the palette index for the given R/G/B color indices 177 | fun rgb_color(x, y, z) 178 | if &t_Co == 88 179 | return 16 + (a:x * 16) + (a:y * 4) + a:z 180 | else 181 | return 16 + (a:x * 36) + (a:y * 6) + a:z 182 | endif 183 | endfun 184 | 185 | " returns the palette index to approximate the given R/G/B color levels 186 | fun color(r, g, b) 187 | " get the closest grey 188 | let l:gx = grey_number(a:r) 189 | let l:gy = grey_number(a:g) 190 | let l:gz = grey_number(a:b) 191 | 192 | " get the closest color 193 | let l:x = rgb_number(a:r) 194 | let l:y = rgb_number(a:g) 195 | let l:z = rgb_number(a:b) 196 | 197 | if l:gx == l:gy && l:gy == l:gz 198 | " there are two possibilities 199 | let l:dgr = grey_level(l:gx) - a:r 200 | let l:dgg = grey_level(l:gy) - a:g 201 | let l:dgb = grey_level(l:gz) - a:b 202 | let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) 203 | let l:dr = rgb_level(l:gx) - a:r 204 | let l:dg = rgb_level(l:gy) - a:g 205 | let l:db = rgb_level(l:gz) - a:b 206 | let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) 207 | if l:dgrey < l:drgb 208 | " use the grey 209 | return grey_color(l:gx) 210 | else 211 | " use the color 212 | return rgb_color(l:x, l:y, l:z) 213 | endif 214 | else 215 | " only one possibility 216 | return rgb_color(l:x, l:y, l:z) 217 | endif 218 | endfun 219 | 220 | " returns the palette index to approximate the 'rrggbb' hex string 221 | fun rgb(rgb) 222 | let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 223 | let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 224 | let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 225 | 226 | return color(l:r, l:g, l:b) 227 | endfun 228 | 229 | " sets the highlighting for the given group 230 | fun X(group, fg, bg, attr) 231 | if a:fg != "" 232 | exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) 233 | endif 234 | if a:bg != "" 235 | exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) 236 | endif 237 | if a:attr != "" 238 | exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr 239 | endif 240 | endfun 241 | " }}} 242 | 243 | call X("Normal", "cccccc", "000000", "") 244 | 245 | " highlight groups 246 | call X("Cursor", "708090", "f0e68c", "") 247 | "CursorIM 248 | "Directory 249 | "DiffAdd 250 | "DiffChange 251 | "DiffDelete 252 | "DiffText 253 | "ErrorMsg 254 | call X("VertSplit", "c2bfa5", "7f7f7f", "reverse") 255 | call X("Folded", "ffd700", "4d4d4d", "") 256 | call X("FoldColumn", "d2b48c", "4d4d4d", "") 257 | call X("IncSearch", "708090", "f0e68c", "") 258 | "LineNr 259 | call X("ModeMsg", "daa520", "", "") 260 | call X("MoreMsg", "2e8b57", "", "") 261 | call X("NonText", "addbe7", "000000", "bold") 262 | call X("Question", "00ff7f", "", "") 263 | call X("Search", "f5deb3", "cd853f", "") 264 | call X("SpecialKey", "9acd32", "", "") 265 | call X("StatusLine", "c2bfa5", "000000", "reverse") 266 | call X("StatusLineNC", "c2bfa5", "7f7f7f", "reverse") 267 | call X("Title", "cd5c5c", "", "") 268 | call X("Visual", "6b8e23", "f0e68c", "reverse") 269 | "VisualNOS 270 | call X("WarningMsg", "fa8072", "", "") 271 | "WildMenu 272 | "Menu 273 | "Scrollbar 274 | "Tooltip 275 | 276 | " syntax highlighting groups 277 | call X("Comment", "87ceeb", "", "") 278 | call X("Constant", "ffa0a0", "", "") 279 | call X("Identifier", "98fb98", "", "none") 280 | call X("Statement", "f0e68c", "", "bold") 281 | call X("PreProc", "cd5c5c", "", "") 282 | call X("Type", "bdb76b", "", "bold") 283 | call X("Special", "ffdead", "", "") 284 | "Underlined 285 | call X("Ignore", "666666", "", "") 286 | "Error 287 | call X("Todo", "ff4500", "eeee00", "") 288 | 289 | " delete functions {{{ 290 | delf X 291 | delf rgb 292 | delf color 293 | delf rgb_color 294 | delf rgb_level 295 | delf rgb_number 296 | delf grey_color 297 | delf grey_level 298 | delf grey_number 299 | " }}} 300 | else 301 | " color terminal definitions 302 | hi SpecialKey ctermfg=darkgreen 303 | hi NonText cterm=bold ctermfg=darkblue 304 | hi Directory ctermfg=darkcyan 305 | hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 306 | hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green 307 | hi Search cterm=NONE ctermfg=grey ctermbg=blue 308 | hi MoreMsg ctermfg=darkgreen 309 | hi ModeMsg cterm=NONE ctermfg=brown 310 | hi LineNr ctermfg=3 311 | hi Question ctermfg=green 312 | hi StatusLine cterm=bold,reverse 313 | hi StatusLineNC cterm=reverse 314 | hi VertSplit cterm=reverse 315 | hi Title ctermfg=5 316 | hi Visual cterm=reverse 317 | hi VisualNOS cterm=bold,underline 318 | hi WarningMsg ctermfg=1 319 | hi WildMenu ctermfg=0 ctermbg=3 320 | hi Folded ctermfg=darkgrey ctermbg=NONE 321 | hi FoldColumn ctermfg=darkgrey ctermbg=NONE 322 | hi DiffAdd ctermbg=4 323 | hi DiffChange ctermbg=5 324 | hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 325 | hi DiffText cterm=bold ctermbg=1 326 | hi Comment ctermfg=darkcyan 327 | hi Constant ctermfg=brown 328 | hi Special ctermfg=5 329 | hi Identifier ctermfg=6 330 | hi Statement ctermfg=3 331 | hi PreProc ctermfg=5 332 | hi Type ctermfg=2 333 | hi Underlined cterm=underline ctermfg=5 334 | hi Ignore ctermfg=darkgrey 335 | hi Error cterm=bold ctermfg=7 ctermbg=1 336 | endif 337 | 338 | " vim: set fdl=0 fdm=marker: 339 | -------------------------------------------------------------------------------- /colors/dracula.vim: -------------------------------------------------------------------------------- 1 | " Dracula Theme v1.2.7 2 | " 3 | " https://github.com/zenorocha/dracula-theme 4 | " 5 | " Copyright 2016, All rights reserved 6 | " 7 | " Code licensed under the MIT license 8 | " http://zenorocha.mit-license.org 9 | " 10 | " @author Trevor Heins <@heinst> 11 | " @author Éverton Ribeiro 12 | " @author Zeno Rocha 13 | 14 | set background=dark 15 | highlight clear 16 | 17 | if exists("syntax_on") 18 | syntax reset 19 | endif 20 | 21 | let g:colors_name = "dracula" 22 | 23 | hi Cursor ctermfg=17 ctermbg=231 cterm=NONE guifg=#282a36 guibg=#f8f8f0 gui=NONE 24 | hi Visual ctermfg=NONE ctermbg=241 cterm=NONE guifg=NONE guibg=#44475a gui=NONE 25 | hi CursorLine ctermbg=234 cterm=NONE guifg=NONE guibg=#44475a gui=NONE 26 | hi CursorColumn ctermbg=234 cterm=NONE guifg=NONE guibg=#44475a gui=NONE 27 | hi ColorColumn ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE 28 | hi LineNr ctermfg=60 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE 29 | hi CursorLineNr ctermfg=228 ctermbg=234 cterm=NONE guifg=#f1fa8c guibg=#44475a gui=NONE 30 | hi VertSplit ctermfg=231 ctermbg=236 cterm=bold guifg=#64666d guibg=#64666d gui=bold 31 | hi MatchParen ctermfg=212 ctermbg=NONE cterm=underline guifg=#ff79c6 guibg=NONE gui=underline 32 | hi StatusLine ctermfg=231 ctermbg=236 cterm=bold guifg=#f8f8f2 guibg=#64666d gui=bold 33 | hi StatusLineNC ctermfg=231 ctermbg=236 cterm=NONE guifg=#f8f8f2 guibg=#64666d gui=NONE 34 | hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 35 | hi PmenuSel ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#44475a gui=NONE 36 | hi IncSearch ctermfg=17 ctermbg=215 cterm=none guifg=#282a36 guibg=#ffb86c gui=none 37 | hi Search ctermfg=17 ctermbg=84 cterm=none guifg=#282a36 guibg=#50fa7b gui=none 38 | hi Directory ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 39 | hi Folded ctermfg=61 ctermbg=235 cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE 40 | hi SignColumn ctermfg=246 ctermbg=235 cterm=NONE guifg=#909194 guibg=#44475a gui=NONE 41 | hi FoldColmun ctermfg=246 ctermbg=235 cterm=NONE guifg=#909194 guibg=#44475a gui=NONE 42 | hi Normal guifg=#f8f8f2 guibg=#282a36 gui=NONE 43 | hi Boolean ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 44 | hi Character ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 45 | hi Comment ctermfg=61 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=NONE gui=NONE 46 | hi Conditional ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 47 | hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 48 | hi Define ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 49 | hi DiffAdd ctermfg=231 ctermbg=64 cterm=bold guifg=#f8f8f2 guibg=#468410 gui=bold 50 | hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8b080b guibg=NONE gui=NONE 51 | hi DiffChange ctermfg=231 ctermbg=23 cterm=NONE guifg=#f8f8f2 guibg=#243a5f gui=NONE 52 | hi DiffText ctermfg=231 ctermbg=24 cterm=bold guifg=#f8f8f2 guibg=#204a87 gui=bold 53 | hi ErrorMsg ctermfg=231 ctermbg=212 cterm=NONE guifg=#f8f8f0 guibg=#ff79c6 gui=NONE 54 | hi WarningMsg ctermfg=231 ctermbg=212 cterm=NONE guifg=#f8f8f0 guibg=#ff79c6 gui=NONE 55 | hi Float ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 56 | hi Function ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 57 | hi Identifier ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic 58 | hi Keyword ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 59 | hi Label ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 60 | hi NonText ctermfg=231 ctermbg=NONE cterm=NONE guifg=#525563 guibg=NONE gui=NONE 61 | hi Number ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 62 | hi Operator ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 63 | hi PreProc ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 64 | hi Special ctermfg=231 ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=NONE gui=NONE 65 | hi SpecialKey ctermfg=231 ctermbg=235 cterm=NONE guifg=#525563 guibg=NONE gui=NONE 66 | hi Statement ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 67 | hi StorageClass ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic 68 | hi String ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 69 | hi Tag ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 70 | hi Title ctermfg=231 ctermbg=NONE cterm=bold guifg=#f8f8f2 guibg=NONE gui=bold 71 | hi Todo ctermfg=61 ctermbg=NONE cterm=inverse,bold guifg=#6272a4 guibg=NONE gui=inverse,bold 72 | hi Type ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 73 | hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline 74 | hi rubyClass ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 75 | hi rubyFunction ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 76 | hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 77 | hi rubySymbol ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 78 | hi rubyConstant ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 79 | hi rubyStringDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 80 | hi rubyBlockParameter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic 81 | hi rubyInstanceVariable ctermfg=203 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=NONE 82 | hi rubyInclude ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 83 | hi rubyGlobalVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 84 | hi rubyRegexp ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 85 | hi rubyRegexpDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 86 | hi rubyEscape ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 87 | hi rubyControl ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 88 | hi rubyClassVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 89 | hi rubyOperator ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 90 | hi rubyException ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 91 | hi rubyPseudoVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 92 | hi rubyRailsUserClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 93 | hi rubyRailsARAssociationMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 94 | hi rubyRailsARMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 95 | hi rubyRailsRenderMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 96 | hi rubyRailsMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 97 | hi erubyDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 98 | hi erubyComment ctermfg=61 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=NONE gui=NONE 99 | hi erubyRailsMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 100 | hi htmlTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 101 | hi htmlEndTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 102 | hi htmlTagName ctermfg=NONE ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 103 | hi htmlArg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 104 | hi htmlSpecialChar ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 105 | hi javaScriptFunction ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic 106 | hi javaScriptRailsFunction ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 107 | hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 108 | hi yamlKey ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 109 | hi yamlAnchor ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 110 | hi yamlAlias ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 111 | hi yamlDocumentHeader ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 112 | hi cssURL ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic 113 | hi cssFunctionName ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 114 | hi cssColor ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 115 | hi cssPseudoClassId ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 116 | hi cssClassName ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 117 | hi cssValueLength ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 118 | hi cssCommonAttr ctermfg=81 ctermbg=NONE cterm=NONE guifg=#6be5fd guibg=NONE gui=NONE 119 | hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 120 | hi TabLineFill guifg=#333333 guibg=#282a36 gui=none 121 | hi TabLine guifg=#666666 guibg=#282a36 gui=none 122 | hi TabLineSel guifg=WHITE guibg=#282a36 gui=none 123 | 124 | " Elixir {{{ 125 | hi elixirAtom ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic" 126 | hi elixirModuleDeclaration ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic" 127 | hi elixirAlias ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic" 128 | hi elixirInterpolationDelimiter ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 129 | hi elixirStringDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 130 | "}}} 131 | " 132 | " Vim Script {{{ 133 | hi vimGroupName ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE 134 | hi vimGroup ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE 135 | hi vimOption ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE 136 | hi vimHiCtermFgBg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE 137 | hi vimHiGuiFgBg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE 138 | " }}} 139 | " Markdown: {{{ 140 | hi markdownH1 ctermfg=141 ctermbg=NONE cterm=bold guifg=#bd93f9 guibg=NONE gui=bold" 141 | hi markdownH2 ctermfg=141 ctermbg=NONE cterm=bold guifg=#bd93f9 guibg=NONE gui=bold" 142 | hi markdownH3 ctermfg=212 ctermbg=NONE cterm=bold guifg=#ff79c6 guibg=NONE gui=bold" 143 | hi markdownH4 ctermfg=212 ctermbg=NONE cterm=bold guifg=#ff79c6 guibg=NONE gui=bold" 144 | hi markdownH5 ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 145 | hi markdownH6 ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 146 | 147 | hi markdownCode ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 148 | hi markdownCodeBlock ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 149 | hi markdownCodeDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 150 | 151 | hi markdownBlockquote ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 152 | hi markdownListMarker ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 153 | hi markdownOrderedListMarker ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 154 | hi markdownRule ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 155 | hi markdownHeadingRule ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 156 | 157 | hi markdownUrlDelimiter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic" 158 | hi markdownLinkDelimiter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic" 159 | hi markdownLinkTextDelimiter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic" 160 | 161 | hi markdownHeadingDelimiter ctermfg=117 ctermbg=NONE cterm=bold guifg=#8be9fd guibg=NONE gui=bold" 162 | hi markdownUrl ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 163 | hi markdownUrlTitleDelimiter ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 164 | " }}} 165 | 166 | 167 | " 168 | "cygwin has an annoying behavior where it resets background to light 169 | "regardless of what is set above, so we force it yet again 170 | " 171 | "add these to get cygwin shell working when used to ssh into a centos6 vm 172 | "this requires your TERM=xterm-256color in the guest vm 173 | "- one way to do this is to append to /home/vagrant/.bash_profile ala: 174 | " TERM=xterm-256color 175 | " export $TERM 176 | 177 | execute "set background=dark" 178 | "------------------- 179 | -------------------------------------------------------------------------------- /colors/seoul256.vim: -------------------------------------------------------------------------------- 1 | " " _____ _ ___ ___ ___ " 2 | " " | __|___ ___ _ _| |_ | _| _| " 3 | " " |__ | -_| . | | | | _|_ | . | " 4 | " " |_____|___|___|___|_|___|___|___|.vim " 5 | " 6 | " " Low-contrast dark Vim color scheme using Seoul Colors " 7 | " 8 | " File: seoul256.vim 9 | " URL: github.com/junegunn/seoul256.vim 10 | " Author: Junegunn Choi (junegunn.c@gmail.com) 11 | " Version: 1.5.3 12 | " Last Updated: Aug 4, 2014 13 | " License: MIT 14 | " 15 | " Copyright (c) 2013 Junegunn Choi 16 | " 17 | " MIT License 18 | " 19 | " Permission is hereby granted, free of charge, to any person obtaining 20 | " a copy of this software and associated documentation files (the 21 | " "Software"), to deal in the Software without restriction, including 22 | " without limitation the rights to use, copy, modify, merge, publish, 23 | " distribute, sublicense, and/or sell copies of the Software, and to 24 | " permit persons to whom the Software is furnished to do so, subject to 25 | " the following conditions: 26 | " 27 | " The above copyright notice and this permission notice shall be 28 | " included in all copies or substantial portions of the Software. 29 | " 30 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 31 | " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 32 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 33 | " NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 34 | " LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 35 | " OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 36 | " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | if !exists('s:rgb_map') 39 | let s:rgb_map = 40 | \{ 22: '#006F00', 23: '#007173', 24: '#007299', 25: '#0074BE', 30: '#009799', 41 | \ 31: '#0099BD', 38: '#00BDDF', 52: '#730B00', 58: '#727100', 59: '#727272', 42 | \ 65: '#719872', 66: '#719899', 67: '#7299BC', 68: '#719CDF', 73: '#6FBCBD', 43 | \ 74: '#70BDDF', 88: '#9B1300', 89: '#9B1D72', 94: '#9A7200', 95: '#9A7372', 44 | \ 96: '#9A7599', 101: '#999872', 103: '#999ABD', 108: '#98BC99', 109: '#98BCBD', 45 | \ 110: '#98BEDE', 116: '#97DDDF', 125: '#BF2172', 131: '#BE7572', 137: '#BE9873', 46 | \ 143: '#BDBB72', 144: '#BDBC98', 145: '#BDBDBD', 151: '#BCDDBD', 152: '#BCDEDE', 47 | \ 153: '#BCE0FF', 161: '#E12672', 168: '#E17899', 173: '#E19972', 174: '#E09B99', 48 | \ 179: '#DFBC72', 181: '#E0BEBC', 184: '#DEDC00', 186: '#DEDD99', 187: '#DFDEBD', 49 | \ 189: '#DFDFFF', 216: '#FFBD98', 217: '#FFBFBD', 218: '#FFC0DE', 220: '#FFDD00', 50 | \ 222: '#FFDE99', 224: '#FFDFDF', 230: '#FFFFDF', 231: '#FFFFFF', 232: '#060606', 51 | \ 233: '#171717', 234: '#252525', 235: '#333233', 236: '#3F3F3F', 237: '#4B4B4B', 52 | \ 238: '#565656', 239: '#616161', 240: '#6B6B6B', 241: '#757575', 249: '#BFBFBF', 53 | \ 250: '#C8C8C8', 251: '#D1D0D1', 252: '#D9D9D9', 253: '#E1E1E1', 254: '#E9E9E9', 54 | \ 255: '#F1F1F1' } 55 | endif 56 | 57 | let s:background = &background 58 | let s:colors_name = get(g:, 'colors_name', '') 59 | 60 | silent! unlet s:style s:seoul256_background 61 | 62 | " 1. If g:seoul256_background is found 63 | if exists('g:seoul256_background') 64 | let s:seoul256_background = g:seoul256_background 65 | if s:seoul256_background >= 233 && s:seoul256_background <= 239 66 | let s:style = 'dark' 67 | elseif s:seoul256_background >= 252 && s:seoul256_background <= 256 68 | let s:style = 'light' 69 | else 70 | unlet s:seoul256_background 71 | endif 72 | endif 73 | 74 | if !exists('s:style') 75 | " 2. If g:colors_name is NOT 'seoul256' -> dark version 76 | if s:colors_name != 'seoul256' 77 | let s:style = 'dark' 78 | " 3. Follow &background setting 79 | else 80 | let s:style = &background 81 | endif 82 | endif 83 | let s:style_idx = s:style == 'light' 84 | 85 | " Background colors 86 | if s:style == 'dark' 87 | let s:dark_bg = get(s:, 'seoul256_background', 237) 88 | let s:light_bg = 253 89 | else 90 | let s:dark_bg = 237 91 | let s:light_bg = get(s:, 'seoul256_background', 253) 92 | endif 93 | let s:dark_bg_2 = s:dark_bg > 233 ? s:dark_bg - 2 : 16 94 | let s:light_bg_1 = min([s:light_bg + 1, 256]) 95 | let s:light_bg_2 = min([s:light_bg + 2, 256]) 96 | 97 | " Foreground colors 98 | let s:dark_fg = 252 99 | let s:light_fg = 239 100 | 101 | function! s:hi(item, fg, bg) 102 | let fg = a:fg[s:style_idx] > 255 ? 231 : a:fg[s:style_idx] 103 | let bg = a:bg[s:style_idx] > 255 ? 231 : a:bg[s:style_idx] 104 | 105 | if !empty(fg) 106 | execute printf("highlight %s ctermfg=%s guifg=%s", a:item, fg, get(s:rgb_map, fg, 'NONE')) 107 | endif 108 | if !empty(bg) 109 | execute printf("highlight %s ctermbg=%s guibg=%s", a:item, bg, get(s:rgb_map, bg, 'NONE')) 110 | endif 111 | endfunction 112 | 113 | let s:gui = has('gui_running') 114 | if !s:gui 115 | set t_Co=256 116 | end 117 | 118 | silent! unlet g:colors_name 119 | hi clear 120 | if exists("syntax_on") 121 | syntax reset 122 | endif 123 | 124 | call s:hi('Normal', [s:dark_fg, s:light_fg], [s:dark_bg, s:light_bg]) 125 | 126 | call s:hi('LineNr', [101, 101], [s:dark_bg + 1, s:light_bg - 2]) 127 | call s:hi('Visual', ['', ''], [23, 152]) 128 | call s:hi('VisualNOS', ['', ''], [23, 152]) 129 | 130 | call s:hi('Comment', [65, 65], ['', '']) 131 | call s:hi('Number', [222, 95], ['', '']) 132 | call s:hi('Float', [222, 95], ['', '']) 133 | call s:hi('Boolean', [103, 168], ['', '']) 134 | call s:hi('String', [109, 30], ['', '']) 135 | call s:hi('Constant', [73, 23], ['', '']) 136 | call s:hi('Character', [174, 168], ['', '']) 137 | call s:hi('Delimiter', [137, 94], ['', '']) 138 | call s:hi('StringDelimiter', [137, 94], ['', '']) 139 | call s:hi('Statement', [108, 66], ['', '']) 140 | " case, default, etc. 141 | " hi Label ctermfg= 142 | 143 | " if else end 144 | call s:hi('Conditional', [110, 31], ['', '']) 145 | 146 | " while end 147 | call s:hi('Repeat', [68, 67], ['', '']) 148 | call s:hi('Todo', [161, 125], [s:dark_bg_2, s:light_bg_2]) 149 | call s:hi('Function', [187, 58], ['', '']) 150 | 151 | " Macros 152 | call s:hi('Define', [173, 131], ['', '']) 153 | call s:hi('Macro', [173, 131], ['', '']) 154 | call s:hi('Include', [173, 131], ['', '']) 155 | call s:hi('PreCondit', [173, 131], ['', '']) 156 | 157 | 158 | " #! 159 | call s:hi('PreProc', [143, 58], ['', '']) 160 | 161 | " @abc 162 | call s:hi('Identifier', [217, 96], ['', '']) 163 | 164 | " AAA Abc 165 | call s:hi('Type', [179, 94], ['', '']) 166 | 167 | " + - * / << 168 | call s:hi('Operator', [186, 131], ['', '']) 169 | 170 | " super yield 171 | call s:hi('Keyword', [168, 168], ['', '']) 172 | 173 | " raise 174 | call s:hi('Exception', [161, 161], ['', '']) 175 | " 176 | " hi StorageClass ctermfg= 177 | call s:hi('Structure', [116, 23], ['', '']) 178 | " hi Typedef ctermfg= 179 | 180 | call s:hi('Error', [s:dark_fg, s:light_bg_1], [52, 174]) 181 | call s:hi('ErrorMsg', [s:dark_fg, s:light_bg_1], [52, 168]) 182 | call s:hi('Underlined', [181, 168], ['', '']) 183 | 184 | " set textwidth=80 185 | " set colorcolumn=+1 186 | call s:hi('ColorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 2]) 187 | 188 | " GVIM only 189 | " hi Cursor ctermfg= 190 | " hi CursorIM ctermfg= 191 | 192 | " set cursorline cursorcolumn 193 | call s:hi('CursorLine', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) 194 | call s:hi('CursorLineNr', [131, 131], [s:dark_bg - 1, s:light_bg - 1]) 195 | call s:hi('CursorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) 196 | 197 | call s:hi('Directory', [187, 95], ['', '']) 198 | 199 | call s:hi('DiffAdd', ['NONE', 'NONE'], [22, 151]) 200 | call s:hi('DiffDelete', ['NONE', 'NONE'], [95, 181]) 201 | call s:hi('DiffChange', ['NONE', 'NONE'], [s:dark_bg + 3, 189]) 202 | call s:hi('DiffText', ['NONE', 'NONE'], [52, 224]) 203 | 204 | call s:hi('VertSplit', [s:dark_bg_2, s:light_bg - 3], [s:dark_bg_2, s:light_bg - 3]) 205 | call s:hi('Folded', [101, 101], [s:dark_bg + 1, s:light_bg - 2]) 206 | 207 | " set foldcolumn=1 208 | call s:hi('FoldColumn', [144, 94], [s:dark_bg + 1, s:light_bg - 2]) 209 | 210 | call s:hi('MatchParen', ['', ''], [s:dark_bg + 3, s:light_bg - 3]) 211 | 212 | " -- INSERT -- 213 | call s:hi('ModeMsg', [173, 173], ['', '']) 214 | 215 | " let &showbreak = '> ' 216 | call s:hi('NonText', [101, 101], ['', '']) 217 | 218 | call s:hi('MoreMsg', [173, 173], ['', '']) 219 | 220 | " Popup menu 221 | call s:hi('Pmenu', [s:dark_bg + 1, 238], [224, 224]) 222 | call s:hi('PmenuSel', [s:dark_fg, s:dark_fg], [89, 89]) 223 | call s:hi('PmenuSbar', ['', ''], [65, 65]) 224 | call s:hi('PmenuThumb', ['', ''], [23, 23]) 225 | 226 | call s:hi('Search', [s:dark_fg, 255], [24, 74]) 227 | call s:hi('IncSearch', [220, 220], [s:dark_bg + 1, 238]) 228 | 229 | " String delimiter, interpolation 230 | call s:hi('Special', [216, 173], ['', '']) 231 | " hi SpecialChar ctermfg= 232 | " hi SpecialComment ctermfg= 233 | " hi Tag ctermfg= 234 | " hi Debug ctermfg= 235 | 236 | " :map, listchars 237 | call s:hi('SpecialKey', [59, 145], ['', '']) 238 | 239 | if !s:gui 240 | " Red / Blue / Cyan / Magenta 241 | if s:style_idx == 0 242 | hi SpellBad ctermbg=NONE cterm=underline ctermfg=168 243 | hi SpellCap ctermbg=NONE cterm=underline ctermfg=110 244 | hi SpellLocal ctermbg=NONE cterm=underline ctermfg=153 245 | hi SpellRare ctermbg=NONE cterm=underline ctermfg=218 246 | else 247 | hi SpellBad ctermbg=NONE cterm=underline ctermfg=125 248 | hi SpellCap ctermbg=NONE cterm=underline ctermfg=25 249 | hi SpellLocal ctermbg=NONE cterm=underline ctermfg=31 250 | hi SpellRare ctermbg=NONE cterm=underline ctermfg=96 251 | endif 252 | else 253 | if s:style_idx == 0 254 | execute 'hi SpellBad gui=undercurl guisp=' . s:rgb_map[168] 255 | execute 'hi SpellCap gui=undercurl guisp=' . s:rgb_map[110] 256 | execute 'hi SpellLocal gui=undercurl guisp=' . s:rgb_map[153] 257 | execute 'hi SpellRare gui=undercurl guisp=' . s:rgb_map[218] 258 | else 259 | execute 'hi SpellBad gui=undercurl guisp=' . s:rgb_map[125] 260 | execute 'hi SpellCap gui=undercurl guisp=' . s:rgb_map[25] 261 | execute 'hi SpellLocal gui=undercurl guisp=' . s:rgb_map[31] 262 | execute 'hi SpellRare gui=undercurl guisp=' . s:rgb_map[96] 263 | endif 264 | endif 265 | 266 | " 267 | call s:hi('StatusLine', [95, 95], [187, 187]) 268 | call s:hi('StatusLineNC', [s:dark_bg + 2, s:light_bg - 2], [187, 238]) 269 | call s:hi('TabLineFill', [s:dark_bg + 2, s:light_bg - 2], ['', '']) 270 | call s:hi('TabLineSel', [187, 187], [23, 66]) 271 | call s:hi('TabLine', [s:dark_bg + 12, s:light_bg - 12], [s:dark_bg + 4, s:light_bg - 4]) 272 | call s:hi('WildMenu', [95, 95], [184, 184]) 273 | 274 | " :set all 275 | call s:hi('Title', [181, 88], ['', '']) 276 | 277 | " TODO 278 | call s:hi('Question', [179, 88], ['', '']) 279 | 280 | " Search hit bottom 281 | call s:hi('WarningMsg', [179, 88], ['', '']) 282 | 283 | " Sign column 284 | call s:hi('SignColumn', [173, 173], [s:dark_bg, s:light_bg]) 285 | 286 | " Diff 287 | call s:hi('diffAdded', [108, 65], ['', '']) 288 | call s:hi('diffRemoved', [174, 131], ['', '']) 289 | hi link diffLine Constant 290 | 291 | call s:hi('Conceal', [s:dark_fg + 2, s:light_fg - 2], [s:dark_bg - 1, s:light_bg + 2]) 292 | call s:hi('Ignore', [s:dark_bg + 3, s:light_bg - 3], [s:dark_bg, s:light_bg]) 293 | 294 | """"""""""""""""""""""""""""""""""""""""""""""""" 295 | " Plugins 296 | """"""""""""""""""""""""""""""""""""""""""""""""" 297 | 298 | " vim-indent-guides 299 | " ----------------- 300 | let g:indent_guides_auto_colors = 0 301 | call s:hi('IndentGuidesOdd', ['', ''], [s:dark_bg - 1, s:light_bg + 1]) 302 | call s:hi('IndentGuidesEven', ['', ''], [s:dark_bg + 1, s:light_bg - 1]) 303 | 304 | " vim-gitgutter 305 | " ------------- 306 | call s:hi('GitGutterAdd', [108, 65], [s:dark_bg + 1, s:light_bg - 2]) 307 | call s:hi('GitGutterChange', [68, 68], [s:dark_bg + 1, s:light_bg - 2]) 308 | call s:hi('GitGutterDelete', [161, 161], [s:dark_bg + 1, s:light_bg -2 ]) 309 | call s:hi('GitGutterChangeDelete', [168, 168], [s:dark_bg + 1, s:light_bg - 2]) 310 | 311 | " http://vim.wikia.com/wiki/Highlight_unwanted_spaces 312 | " ---------------------------------------------------^^^^^ 313 | call s:hi('ExtraWhitespace', ['', ''], [s:dark_bg - 1, s:light_bg - 2]) 314 | 315 | " vim-ruby 316 | " -------- 317 | " " rubySymbol 318 | let ruby_operators = 1 319 | call s:hi('rubyClass', [31, 31], ['', '']) 320 | " call s:hi('rubyInstanceVariable', [189, 189], ['', '']) 321 | call s:hi('rubyRegexp', [186, 101], ['', '']) 322 | call s:hi('rubyRegexpDelimiter', [168, 168], ['', '']) 323 | call s:hi('rubyArrayDelimiter', [67, 38], ['', '']) 324 | call s:hi('rubyBlockParameterList', [186, 94], ['', '']) 325 | call s:hi('rubyCurlyBlockDelimiter', [144, 101], ['', '']) 326 | 327 | " ARGV $stdout 328 | call s:hi('rubyPredefinedIdentifier', [230, 52], ['', '']) 329 | " hi rubyRegexpSpecial 330 | 331 | hi CursorLine cterm=NONE 332 | hi CursorLineNr cterm=NONE 333 | 334 | let g:seoul256_current_fg = [s:dark_fg, s:light_fg][s:style_idx] 335 | let g:seoul256_current_bg = [s:dark_bg, s:light_bg][s:style_idx] 336 | let g:colors_name = 'seoul256' 337 | if s:colors_name != g:colors_name || s:background == s:style 338 | let &background = s:style 339 | else 340 | let &background = s:background 341 | endif 342 | -------------------------------------------------------------------------------- /tools/conf/securecrt.key: -------------------------------------------------------------------------------- 1 | N VK_CLEAR "\e[E" 2 | N VK_PRIOR "\e[5~" 3 | N VK_NEXT "\e[6~" 4 | N VK_END "\e[4~" 5 | N VK_HOME "\e[1~" 6 | N VK_LEFT VT_CURSOR_LEFT 7 | N VK_UP VT_CURSOR_UP 8 | N VK_RIGHT VT_CURSOR_RIGHT 9 | N VK_DOWN VT_CURSOR_DOWN 10 | N VK_INSERT "\e[2~" 11 | N VK_DELETE "\e[3~" 12 | N VK_NUMPAD0 VT_KEYPAD_0 13 | N VK_NUMPAD1 VT_KEYPAD_1 14 | N VK_NUMPAD2 VT_KEYPAD_2 15 | N VK_NUMPAD3 VT_KEYPAD_3 16 | N VK_NUMPAD4 VT_KEYPAD_4 17 | N VK_NUMPAD5 VT_KEYPAD_5 18 | N VK_NUMPAD6 VT_KEYPAD_6 19 | N VK_NUMPAD7 VT_KEYPAD_7 20 | N VK_NUMPAD8 VT_KEYPAD_8 21 | N VK_NUMPAD9 VT_KEYPAD_9 22 | N VK_MULTIPLY "*" 23 | N VK_ADD "+" 24 | N VK_SUBTRACT "-" 25 | N VK_DECIMAL VT_KEYPAD_PERIOD 26 | N VK_F1 VT_PF1 27 | N VK_F2 VT_PF2 28 | N VK_F3 VT_PF3 29 | N VK_F4 VT_PF4 30 | N VK_F5 "\e[15~" 31 | N VK_F6 "\e[17~" 32 | N VK_F7 "\e[18~" 33 | N VK_F8 "\e[19~" 34 | N VK_F9 "\e[20~" 35 | N VK_F10 "\e[21~" 36 | N VK_F11 "\e[23~" 37 | N VK_F12 "\e[24~" 38 | N VK_F13 VT_F13 39 | N VK_F14 VT_F14 40 | N VK_F15 VT_F15 41 | N VK_F16 VT_F16 42 | N VK_F17 VT_F17 43 | N VK_F18 VT_F18 44 | N VK_F19 VT_F19 45 | N VK_F20 VT_F20 46 | E VK_RETURN VT_KEYPAD_ENTER 47 | E VK_PRIOR "\e[5~" 48 | E VK_NEXT "\e[6~" 49 | E VK_END "\e[4~" 50 | E VK_HOME "\e[1~" 51 | E VK_LEFT VT_CURSOR_LEFT 52 | E VK_UP VT_CURSOR_UP 53 | E VK_RIGHT VT_CURSOR_RIGHT 54 | E VK_DOWN VT_CURSOR_DOWN 55 | E VK_INSERT "\e[2~" 56 | E VK_DELETE "\e[3~" 57 | E VK_ADD VT_KEYPAD_COMMA 58 | E VK_DIVIDE "/" 59 | E VK_NUMLOCK DISABLED 60 | C VK_LEFT "\e[1;5D" 61 | C VK_UP "\e[1;5A" 62 | C VK_RIGHT "\e[1;5C" 63 | C VK_DOWN "\e[1;5B" 64 | C VK_F1 "\e[1;5P" 65 | C VK_F2 "\e[1;5Q" 66 | C VK_F3 "\e[1;5R" 67 | C VK_F5 "\e[15;5~" 68 | C VK_F6 "\e[17;5~" 69 | C VK_F7 "\e[18;5~" 70 | C VK_F8 "\e[19;5~" 71 | C VK_F9 "\e[20;5~" 72 | C VK_F10 "\e[21;5~" 73 | C VK_F11 "\e[23;5~" 74 | C VK_F12 "\e[24;5~" 75 | C VK_F13 "\e[25;5~" 76 | C VK_F14 "\e[26;5~" 77 | C VK_F15 "\e[28;5~" 78 | C VK_F16 "\e[29;5~" 79 | C VK_F17 "\e[31;5~" 80 | C VK_F18 "\e[32;5~" 81 | C VK_F19 "\e[33;5~" 82 | C VK_F20 "\e[34;5~" 83 | C 0xBD "\037" 84 | CE VK_PAUSE VT_PF1 85 | CE VK_PRIOR "\033[5;5~" 86 | CE VK_NEXT "\033[6;5~" 87 | CE VK_LEFT "\e[1;5D" 88 | CE VK_UP "\e[1;5A" 89 | CE VK_RIGHT "\e[1;5C" 90 | CE VK_DOWN "\e[1;5B" 91 | S VK_TAB "\033[Z" 92 | S VK_LEFT "\e[1;2D" 93 | S VK_UP "\e[1;2A" 94 | S VK_RIGHT "\e[1;2C" 95 | S VK_DOWN "\e[1;2B" 96 | S VK_F1 "\e[1;2P" 97 | S VK_F2 "\e[1;2Q" 98 | S VK_F3 "\e[1;2R" 99 | S VK_F4 "\e[1;2S" 100 | S VK_F5 "\e[15;2~" 101 | S VK_F6 "\e[17;2~" 102 | S VK_F7 "\e[18;2~" 103 | S VK_F8 "\e[19;2~" 104 | S VK_F9 "\e[20;2~" 105 | S VK_F10 "\e[21;2~" 106 | S VK_F11 "\e[23;2~" 107 | S VK_F12 "\e[24;2~" 108 | S VK_F13 "\e[25;2~" 109 | S VK_F14 "\e[26;2~" 110 | S VK_F15 "\e[28;2~" 111 | S VK_F16 "\e[29;2~" 112 | S VK_F17 "\e[31;2~" 113 | S VK_F18 "\e[32;2~" 114 | S VK_F19 "\e[33;2~" 115 | S VK_F20 "\e[34;2~" 116 | SE VK_LEFT "\e[1;2D" 117 | SE VK_UP "\e[1;2A" 118 | SE VK_RIGHT "\e[1;2C" 119 | SE VK_DOWN "\e[1;2B" 120 | SE VK_NUMLOCK VT_PF1 121 | CS VK_LEFT "\e[1;6D" 122 | CS VK_UP "\e[1;6A" 123 | CS VK_RIGHT "\e[1;6C" 124 | CS VK_DOWN "\e[1;6B" 125 | CS VK_F1 "\e[1;6P" 126 | CS VK_F2 "\e[1;6Q" 127 | CS VK_F3 "\e[1;6R" 128 | CS VK_F4 "\e[1;6S" 129 | CS VK_F5 "\e[15;6~" 130 | CS VK_F6 "\e[17;6~" 131 | CS VK_F7 "\e[18;6~" 132 | CS VK_F8 "\e[19;6~" 133 | CS VK_F9 "\e[20;6~" 134 | CS VK_F10 "\e[21;6~" 135 | CS VK_F11 "\e[23;6~" 136 | CS VK_F12 "\e[24;6~" 137 | CS VK_F13 "\e[25;6~" 138 | CS VK_F14 "\e[26;6~" 139 | CS VK_F15 "\e[28;6~" 140 | CS VK_F16 "\e[29;6~" 141 | CS VK_F17 "\e[31;6~" 142 | CS VK_F18 "\e[32;6~" 143 | CS VK_F19 "\e[33;6~" 144 | CS VK_F20 "\e[34;6~" 145 | CSE VK_LEFT "\e[1;6D" 146 | CSE VK_UP "\e[1;6A" 147 | CSE VK_RIGHT "\e[1;6C" 148 | CSE VK_DOWN "\e[1;6B" 149 | CSE VK_NUMLOCK VT_PF1 150 | A VK_BACK "\033\177" 151 | A VK_LEFT "\e[1;3D" 152 | A VK_UP "\e[1;3A" 153 | A VK_RIGHT "\e[1;3C" 154 | A VK_DOWN "\e[1;3B" 155 | A VK_A "\033a" 156 | A VK_D "\033d" 157 | A VK_E "\033e" 158 | A VK_G "\033g" 159 | A VK_H "\033h" 160 | A VK_J "\033j" 161 | A VK_K "\033k" 162 | A VK_L "\033l" 163 | A VK_M "\033m" 164 | A VK_N "\033n" 165 | A VK_O "\033o" 166 | A VK_P "\033p" 167 | A VK_Q "\033q" 168 | A VK_S "\033s" 169 | A VK_T "\033t" 170 | A VK_U "\033u" 171 | A VK_V "\033v" 172 | A VK_W "\033w" 173 | A VK_X "\033x" 174 | A VK_Y "\033y" 175 | A VK_Z "\033z" 176 | A VK_F1 "" 177 | A VK_F2 "\e[1;3Q" 178 | A VK_F3 "\e[1;3R" 179 | A VK_F5 "\e[15;3~" 180 | A VK_F6 "\e[17;3~" 181 | A VK_F7 "\e[18;3~" 182 | A VK_F8 "\e[19;3~" 183 | A VK_F9 "\e[20;3~" 184 | A VK_F10 "\e[21;3~" 185 | A VK_F11 "\e[23;3~" 186 | A VK_F12 "\e[24;3~" 187 | A VK_F13 "\e[25;3~" 188 | A VK_F14 "\e[26;3~" 189 | A VK_F15 "\e[28;3~" 190 | A VK_F16 "\e[29;3~" 191 | A VK_F17 "\e[31;3~" 192 | A VK_F18 "\e[32;3~" 193 | A VK_F19 "\e[33;3~" 194 | A VK_F20 "\e[34;3~" 195 | A 0xBA "\033;" 196 | A 0xBB "\033=" 197 | A 0xBC "\033," 198 | A 0xBD "\033-" 199 | A 0xBE "\033." 200 | A 0xBF "\033/" 201 | A 0xC0 "\033`" 202 | A 0xDB "\033[" 203 | A 0xDD "\033]" 204 | A 0xDE "\033'" 205 | AE VK_PRIOR "\033[5;3~" 206 | AE VK_NEXT "\033[6;3~" 207 | AE VK_LEFT "\e[1;3D" 208 | AE VK_UP "\e[1;3A" 209 | AE VK_RIGHT "\e[1;3C" 210 | AE VK_DOWN "\e[1;3B" 211 | AC VK_LEFT "\e[1;7D" 212 | AC VK_UP "\e[1;7A" 213 | AC VK_RIGHT "\e[1;7C" 214 | AC VK_DOWN "\e[1;7B" 215 | AC VK_A "\033\001" 216 | AC VK_B "\033\002" 217 | AC VK_C "\033\003" 218 | AC VK_D "\033\004" 219 | AC VK_E "\033\005" 220 | AC VK_F "\033\006" 221 | AC VK_G "\033\007" 222 | AC VK_H "\033\010" 223 | AC VK_I "\033\011" 224 | AC VK_J "\033\012" 225 | AC VK_K "\033\013" 226 | AC VK_L "\033\014" 227 | AC VK_M "\033\015" 228 | AC VK_N "\033\016" 229 | AC VK_O "\033\017" 230 | AC VK_P "\033\020" 231 | AC VK_Q "\033\021" 232 | AC VK_R "\033\022" 233 | AC VK_S "\033\023" 234 | AC VK_T "\033\024" 235 | AC VK_U "\033\025" 236 | AC VK_V "\033\026" 237 | AC VK_W "\033\027" 238 | AC VK_X "\033\030" 239 | AC VK_Y "\033\031" 240 | AC VK_Z "\033\032" 241 | AC VK_F1 "\e[1;7P" 242 | AC VK_F2 "\e[1;7Q" 243 | AC VK_F3 "\e[1;7R" 244 | AC VK_F4 "\e[1;7S" 245 | AC VK_F5 "\e[15;7~" 246 | AC VK_F6 "\e[17;7~" 247 | AC VK_F7 "\e[18;7~" 248 | AC VK_F8 "\e[19;7~" 249 | AC VK_F9 "\e[20;7~" 250 | AC VK_F10 "\e[21;7~" 251 | AC VK_F11 "\e[23;7~" 252 | AC VK_F12 "\e[24;7~" 253 | AC VK_F13 "\e[25;7~" 254 | AC VK_F14 "\e[26;7~" 255 | AC VK_F15 "\e[28;7~" 256 | AC VK_F16 "\e[29;7~" 257 | AC VK_F17 "\e[31;7~" 258 | AC VK_F18 "\e[32;7~" 259 | AC VK_F19 "\e[33;7~" 260 | AC VK_F20 "\e[34;7~" 261 | ACE VK_LEFT "\e[1;7D" 262 | ACE VK_UP "\e[1;7A" 263 | ACE VK_RIGHT "\e[1;7C" 264 | ACE VK_DOWN "\e[1;7B" 265 | AS VK_LEFT "\e[1;4D" 266 | AS VK_UP "\e[1;4A" 267 | AS VK_RIGHT "\e[1;4C" 268 | AS VK_DOWN "\e[1;4B" 269 | AS VK_0 "\0330" 270 | AS VK_1 "\0331" 271 | AS VK_2 "\0332" 272 | AS VK_3 "\0333" 273 | AS VK_4 "\0334" 274 | AS VK_5 "\0335" 275 | AS VK_6 "\0336" 276 | AS VK_7 "\0337" 277 | AS VK_8 "\0338" 278 | AS VK_9 "\0339" 279 | AS VK_A "\033A" 280 | AS VK_B "\033B" 281 | AS VK_C "\033C" 282 | AS VK_D "\033D" 283 | AS VK_E "\033E" 284 | AS VK_F "\033F" 285 | AS VK_G "\033G" 286 | AS VK_H "\033H" 287 | AS VK_I "\033I" 288 | AS VK_J "\033J" 289 | AS VK_K "\033K" 290 | AS VK_L "\033L" 291 | AS VK_M "\033M" 292 | AS VK_N "\033N" 293 | AS VK_O "\033O" 294 | AS VK_P "\033P" 295 | AS VK_Q "\033Q" 296 | AS VK_R "\033R" 297 | AS VK_S "\033S" 298 | AS VK_T "\033T" 299 | AS VK_U "\033U" 300 | AS VK_V "\033V" 301 | AS VK_W "\033W" 302 | AS VK_X "\033X" 303 | AS VK_Y "\033Y" 304 | AS VK_Z "\033Z" 305 | AS VK_F1 "\e[1;4P" 306 | AS VK_F2 "\e[1;4Q" 307 | AS VK_F3 "\e[1;4R" 308 | AS VK_F4 "\e[1;4S" 309 | AS VK_F5 "\e[15;4~" 310 | AS VK_F6 "\e[17;4~" 311 | AS VK_F7 "\e[18;4~" 312 | AS VK_F8 "\e[19;4~" 313 | AS VK_F9 "\e[20;4~" 314 | AS VK_F10 "\e[21;4~" 315 | AS VK_F11 "\e[23;4~" 316 | AS VK_F12 "\e[24;4~" 317 | AS VK_F13 "\e[25;4~" 318 | AS VK_F14 "\e[26;4~" 319 | AS VK_F15 "\e[28;4~" 320 | AS VK_F16 "\e[29;4~" 321 | AS VK_F17 "\e[31;4~" 322 | AS VK_F18 "\e[32;4~" 323 | AS VK_F19 "\e[33;4~" 324 | AS VK_F20 "\e[34;4~" 325 | AS 0xBA "\033:" 326 | AS 0xBB "\033+" 327 | AS 0xBC "\033<" 328 | AS 0xBD "\033_" 329 | AS 0xBE "\033>" 330 | AS 0xBF "\033?" 331 | AS 0xC0 "\033~" 332 | AS 0xDB "\033{" 333 | AS 0xDD "\033}" 334 | ASE VK_LEFT "\e[1;4D" 335 | ASE VK_UP "\e[1;4A" 336 | ASE VK_RIGHT "\e[1;4C" 337 | ASE VK_DOWN "\e[1;4B" 338 | ACS VK_LEFT "\e[1;8D" 339 | ACS VK_UP "\e[1;8A" 340 | ACS VK_RIGHT "\e[1;8C" 341 | ACS VK_DOWN "\e[1;8B" 342 | ACS VK_F1 "\e[1;8P" 343 | ACS VK_F2 "\e[1;8Q" 344 | ACS VK_F3 "\e[1;8R" 345 | ACS VK_F4 "\e[1;8S" 346 | ACS VK_F5 "\e[15;8~" 347 | ACS VK_F6 "\e[17;8~" 348 | ACS VK_F7 "\e[18;8~" 349 | ACS VK_F8 "\e[19;8~" 350 | ACS VK_F9 "\e[20;8~" 351 | ACS VK_F10 "\e[21;8~" 352 | ACS VK_F11 "\e[23;8~" 353 | ACS VK_F12 "\e[24;8~" 354 | ACS VK_F13 "\e[25;8~" 355 | ACS VK_F14 "\e[26;8~" 356 | ACS VK_F15 "\e[28;8~" 357 | ACS VK_F16 "\e[29;8~" 358 | ACS VK_F17 "\e[31;8~" 359 | ACS VK_F18 "\e[32;8~" 360 | ACS VK_F19 "\e[33;8~" 361 | ACS VK_F20 "\e[34;8~" 362 | ACSE VK_LEFT "\e[1;8D" 363 | ACSE VK_UP "\e[1;8A" 364 | ACSE VK_RIGHT "\e[1;8C" 365 | ACSE VK_DOWN "\e[1;8B" 366 | -------------------------------------------------------------------------------- /tools/conf/pylint.conf: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | 3 | # Specify a configuration file. 4 | #rcfile= 5 | 6 | # Python code to execute, usually for sys.path manipulation such as 7 | # pygtk.require(). 8 | #init-hook= 9 | 10 | # Add files or directories to the blacklist. They should be base names, not 11 | # paths. 12 | ignore=CVS 13 | 14 | # Add files or directories matching the regex patterns to the blacklist. The 15 | # regex matches against base names, not paths. 16 | ignore-patterns= 17 | 18 | # Pickle collected data for later comparisons. 19 | persistent=yes 20 | 21 | # List of plugins (as comma separated values of python modules names) to load, 22 | # usually to register additional checkers. 23 | load-plugins= 24 | 25 | # Use multiple processes to speed up Pylint. 26 | jobs=1 27 | 28 | # Allow loading of arbitrary C extensions. Extensions are imported into the 29 | # active Python interpreter and may run arbitrary code. 30 | unsafe-load-any-extension=no 31 | 32 | # A comma-separated list of package or module names from where C extensions may 33 | # be loaded. Extensions are loading into the active Python interpreter and may 34 | # run arbitrary code 35 | extension-pkg-whitelist= 36 | 37 | # Allow optimization of some AST trees. This will activate a peephole AST 38 | # optimizer, which will apply various small optimizations. For instance, it can 39 | # be used to obtain the result of joining multiple strings with the addition 40 | # operator. Joining a lot of strings can lead to a maximum recursion error in 41 | # Pylint and this flag can prevent that. It has one side effect, the resulting 42 | # AST will be different than the one from reality. This option is deprecated 43 | # and it will be removed in Pylint 2.0. 44 | optimize-ast=no 45 | 46 | 47 | [MESSAGES CONTROL] 48 | 49 | # Only show warnings with the listed confidence levels. Leave empty to show 50 | # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED 51 | confidence= 52 | 53 | # Enable the message, report, category or checker with the given id(s). You can 54 | # either give multiple identifier separated by comma (,) or put this option 55 | # multiple time (only on the command line, not in the configuration file where 56 | # it should appear only once). See also the "--disable" option for examples. 57 | #enable= 58 | 59 | # Disable the message, report, category or checker with the given id(s). You 60 | # can either give multiple identifiers separated by comma (,) or put this 61 | # option multiple times (only on the command line, not in the configuration 62 | # file where it should appear only once).You can also use "--disable=all" to 63 | # disable everything first and then reenable specific checks. For example, if 64 | # you want to run only the similarities checker, you can use "--disable=all 65 | # --enable=similarities". If you want to run only the classes checker, but have 66 | # no Warning level messages displayed, use"--disable=all --enable=classes 67 | # --disable=W" 68 | disable=W0302,C0303,C0326,C0330,C0302,C0305,C0111,C0410,R0914,C0410,C0321,R0912,R0915,C0103,R0902,R0911,R1706,R0201,C0325,R0611,E0401,E1101,R1701,E0611,R0903,E0611,R0913,C1801,R1704,R0904 69 | 70 | 71 | [REPORTS] 72 | 73 | # Set the output format. Available formats are text, parseable, colorized, msvs 74 | # (visual studio) and html. You can also give a reporter class, eg 75 | # mypackage.mymodule.MyReporterClass. 76 | output-format=parseable 77 | 78 | # Put messages in a separate file for each module / package specified on the 79 | # command line instead of printing them on stdout. Reports (if any) will be 80 | # written in a file name "pylint_global.[txt|html]". This option is deprecated 81 | # and it will be removed in Pylint 2.0. 82 | files-output=no 83 | 84 | # Tells whether to display a full report or only the messages 85 | reports=yes 86 | 87 | # Python expression which should return a note less than 10 (10 is the highest 88 | # note). You have access to the variables errors warning, statement which 89 | # respectively contain the number of errors / warnings messages and the total 90 | # number of statements analyzed. This is used by the global evaluation report 91 | # (RP0004). 92 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 93 | 94 | # Template used to display messages. This is a python new-style format string 95 | # used to format the message information. See doc for all details 96 | #msg-template= 97 | 98 | 99 | [BASIC] 100 | 101 | # Good variable names which should always be accepted, separated by a comma 102 | good-names=i,j,k,ex,Run,_ 103 | 104 | # Bad variable names which should always be refused, separated by a comma 105 | bad-names=foo,bar,baz,toto,tutu,tata 106 | 107 | # Colon-delimited sets of names that determine each other's naming style when 108 | # the name regexes allow several styles. 109 | name-group= 110 | 111 | # Include a hint for the correct naming format with invalid-name 112 | include-naming-hint=no 113 | 114 | # List of decorators that produce properties, such as abc.abstractproperty. Add 115 | # to this list to register other decorators that produce valid properties. 116 | property-classes=abc.abstractproperty 117 | 118 | # Regular expression matching correct function names 119 | function-rgx=[a-z_][a-z0-9_]{2,30}$ 120 | 121 | # Naming hint for function names 122 | function-name-hint=[a-z_][a-z0-9_]{2,30}$ 123 | 124 | # Regular expression matching correct variable names 125 | variable-rgx=[a-z_][a-z0-9_]{2,30}$ 126 | 127 | # Naming hint for variable names 128 | variable-name-hint=[a-z_][a-z0-9_]{2,30}$ 129 | 130 | # Regular expression matching correct constant names 131 | const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 132 | 133 | # Naming hint for constant names 134 | const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ 135 | 136 | # Regular expression matching correct attribute names 137 | attr-rgx=[a-z_][a-z0-9_]{2,30}$ 138 | 139 | # Naming hint for attribute names 140 | attr-name-hint=[a-z_][a-z0-9_]{2,30}$ 141 | 142 | # Regular expression matching correct argument names 143 | argument-rgx=[a-z_][a-z0-9_]{2,30}$ 144 | 145 | # Naming hint for argument names 146 | argument-name-hint=[a-z_][a-z0-9_]{2,30}$ 147 | 148 | # Regular expression matching correct class attribute names 149 | class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 150 | 151 | # Naming hint for class attribute names 152 | class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ 153 | 154 | # Regular expression matching correct inline iteration names 155 | inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ 156 | 157 | # Naming hint for inline iteration names 158 | inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ 159 | 160 | # Regular expression matching correct class names 161 | class-rgx=[A-Z_][a-zA-Z0-9]+$ 162 | 163 | # Naming hint for class names 164 | class-name-hint=[A-Z_][a-zA-Z0-9]+$ 165 | 166 | # Regular expression matching correct module names 167 | module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 168 | 169 | # Naming hint for module names 170 | module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ 171 | 172 | # Regular expression matching correct method names 173 | method-rgx=[a-z_][a-z0-9_]{2,30}$ 174 | 175 | # Naming hint for method names 176 | method-name-hint=[a-z_][a-z0-9_]{2,30}$ 177 | 178 | # Regular expression which should only match function or class names that do 179 | # not require a docstring. 180 | no-docstring-rgx=^_ 181 | 182 | # Minimum line length for functions/classes that require docstrings, shorter 183 | # ones are exempt. 184 | docstring-min-length=-1 185 | 186 | 187 | [ELIF] 188 | 189 | # Maximum number of nested blocks for function / method body 190 | max-nested-blocks=5 191 | 192 | 193 | [FORMAT] 194 | 195 | # Maximum number of characters on a single line. 196 | max-line-length=100 197 | 198 | # Regexp for a line that is allowed to be longer than the limit. 199 | ignore-long-lines=^\s*(# )??$ 200 | 201 | # Allow the body of an if to be on the same line as the test if there is no 202 | # else. 203 | single-line-if-stmt=no 204 | 205 | # List of optional constructs for which whitespace checking is disabled. `dict- 206 | # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. 207 | # `trailing-comma` allows a space between comma and closing bracket: (a, ). 208 | # `empty-line` allows space-only lines. 209 | no-space-check=trailing-comma,dict-separator 210 | 211 | # Maximum number of lines in a module 212 | max-module-lines=1000 213 | 214 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 215 | # tab). 216 | indent-string=' ' 217 | 218 | # Number of spaces of indent required inside a hanging or continued line. 219 | indent-after-paren=4 220 | 221 | # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 222 | expected-line-ending-format= 223 | 224 | 225 | [LOGGING] 226 | 227 | # Logging modules to check that the string format arguments are in logging 228 | # function parameter format 229 | logging-modules=logging 230 | 231 | 232 | [MISCELLANEOUS] 233 | 234 | # List of note tags to take in consideration, separated by a comma. 235 | notes=FIXME,XXX,TODO 236 | 237 | 238 | [SIMILARITIES] 239 | 240 | # Minimum lines number of a similarity. 241 | min-similarity-lines=4 242 | 243 | # Ignore comments when computing similarities. 244 | ignore-comments=yes 245 | 246 | # Ignore docstrings when computing similarities. 247 | ignore-docstrings=yes 248 | 249 | # Ignore imports when computing similarities. 250 | ignore-imports=no 251 | 252 | 253 | [SPELLING] 254 | 255 | # Spelling dictionary name. Available dictionaries: none. To make it working 256 | # install python-enchant package. 257 | spelling-dict= 258 | 259 | # List of comma separated words that should not be checked. 260 | spelling-ignore-words= 261 | 262 | # A path to a file that contains private dictionary; one word per line. 263 | spelling-private-dict-file= 264 | 265 | # Tells whether to store unknown words to indicated private dictionary in 266 | # --spelling-private-dict-file option instead of raising a message. 267 | spelling-store-unknown-words=no 268 | 269 | 270 | [TYPECHECK] 271 | 272 | # Tells whether missing members accessed in mixin class should be ignored. A 273 | # mixin class is detected if its name ends with "mixin" (case insensitive). 274 | ignore-mixin-members=yes 275 | 276 | # List of module names for which member attributes should not be checked 277 | # (useful for modules/projects where namespaces are manipulated during runtime 278 | # and thus existing member attributes cannot be deduced by static analysis. It 279 | # supports qualified module names, as well as Unix pattern matching. 280 | ignored-modules= 281 | 282 | # List of class names for which member attributes should not be checked (useful 283 | # for classes with dynamically set attributes). This supports the use of 284 | # qualified names. 285 | ignored-classes=optparse.Values,thread._local,_thread._local 286 | 287 | # List of members which are set dynamically and missed by pylint inference 288 | # system, and so shouldn't trigger E1101 when accessed. Python regular 289 | # expressions are accepted. 290 | generated-members= 291 | 292 | # List of decorators that produce context managers, such as 293 | # contextlib.contextmanager. Add to this list to register other decorators that 294 | # produce valid context managers. 295 | contextmanager-decorators=contextlib.contextmanager 296 | 297 | 298 | [VARIABLES] 299 | 300 | # Tells whether we should check for unused import in __init__ files. 301 | init-import=no 302 | 303 | # A regular expression matching the name of dummy variables (i.e. expectedly 304 | # not used). 305 | dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy 306 | 307 | # List of additional names supposed to be defined in builtins. Remember that 308 | # you should avoid to define new builtins when possible. 309 | additional-builtins= 310 | 311 | # List of strings which can identify a callback function by name. A callback 312 | # name must start or end with one of those strings. 313 | callbacks=cb_,_cb 314 | 315 | # List of qualified module names which can have objects that can redefine 316 | # builtins. 317 | redefining-builtins-modules=six.moves,future.builtins 318 | 319 | 320 | [CLASSES] 321 | 322 | # List of method names used to declare (i.e. assign) instance attributes. 323 | defining-attr-methods=__init__,__new__,setUp 324 | 325 | # List of valid names for the first argument in a class method. 326 | valid-classmethod-first-arg=cls 327 | 328 | # List of valid names for the first argument in a metaclass class method. 329 | valid-metaclass-classmethod-first-arg=mcs 330 | 331 | # List of member names, which should be excluded from the protected access 332 | # warning. 333 | exclude-protected=_asdict,_fields,_replace,_source,_make 334 | 335 | 336 | [DESIGN] 337 | 338 | # Maximum number of arguments for function / method 339 | max-args=5 340 | 341 | # Argument names that match this expression will be ignored. Default to name 342 | # with leading underscore 343 | ignored-argument-names=_.* 344 | 345 | # Maximum number of locals for function / method body 346 | max-locals=15 347 | 348 | # Maximum number of return / yield for function / method body 349 | max-returns=6 350 | 351 | # Maximum number of branch for function / method body 352 | max-branches=12 353 | 354 | # Maximum number of statements in function / method body 355 | max-statements=50 356 | 357 | # Maximum number of parents for a class (see R0901). 358 | max-parents=7 359 | 360 | # Maximum number of attributes for a class (see R0902). 361 | max-attributes=7 362 | 363 | # Minimum number of public methods for a class (see R0903). 364 | min-public-methods=2 365 | 366 | # Maximum number of public methods for a class (see R0904). 367 | max-public-methods=20 368 | 369 | # Maximum number of boolean expressions in a if statement 370 | max-bool-expr=5 371 | 372 | 373 | [IMPORTS] 374 | 375 | # Deprecated modules which should not be used, separated by a comma 376 | deprecated-modules=regsub,TERMIOS,Bastion,rexec 377 | 378 | # Create a graph of every (i.e. internal and external) dependencies in the 379 | # given file (report RP0402 must not be disabled) 380 | import-graph= 381 | 382 | # Create a graph of external dependencies in the given file (report RP0402 must 383 | # not be disabled) 384 | ext-import-graph= 385 | 386 | # Create a graph of internal dependencies in the given file (report RP0402 must 387 | # not be disabled) 388 | int-import-graph= 389 | 390 | # Force import order to recognize a module as part of the standard 391 | # compatibility libraries. 392 | known-standard-library= 393 | 394 | # Force import order to recognize a module as part of a third party library. 395 | known-third-party=enchant 396 | 397 | # Analyse import fallback blocks. This can be used to support both Python 2 and 398 | # 3 compatible code, which means that the block might have code that exists 399 | # only in one or another interpreter, leading to false positives when analysed. 400 | analyse-fallback-blocks=no 401 | 402 | 403 | [EXCEPTIONS] 404 | 405 | # Exceptions that will emit a warning when being caught. Defaults to 406 | # "Exception" 407 | overgeneral-exceptions=Exception 408 | -------------------------------------------------------------------------------- /plugin/argtextobj.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " argtextobj.vim - Text-Object like motion for arguments 3 | "============================================================================= 4 | " 5 | " Author: Takahiro SUZUKI 6 | " Version: 1.1.1 (Vim 7.1, 2009), forked and patched by inkarkat (2010-2014) 7 | " https://github.com/inkarkat/argtextobj.vim 8 | " 9 | " Licence: MIT Licence 10 | " 11 | "============================================================================= 12 | " Document: {{{1 13 | " 14 | "----------------------------------------------------------------------------- 15 | " Description: 16 | " This plugin installes a text-object like motion 'a' (argument). You can 17 | " d(elete), c(hange), v(select)... an argument or inner argument in familiar 18 | " ways, such as 'daa'(delete-an-argument), 'cia'(change-inner-argument) 19 | " or 'via'(select-inner-argument). 20 | " 21 | " What this script do is more than just typing 22 | " F,dt, 23 | " because it recognizes inclusion relationship of parentheses. 24 | " 25 | " There is an option to descide whether the motion should go out to toplevel 26 | " function or not in nested function application. 27 | 28 | " 29 | "----------------------------------------------------------------------------- 30 | " Installation: 31 | " Place this file in /usr/share/vim/vim*/plugin or ~/.vim/plugin/ 32 | " Now text-object like argument motion 'ia' and 'aa' is enabled by default. 33 | " 34 | "----------------------------------------------------------------------------- 35 | " Options: 36 | " Write below in your .vimrc if you want to apply motions to the toplevel 37 | " function. 38 | " let g:argumentobject_force_toplevel = 1 39 | " By default, this options is set to 0, which means your operation affects 40 | " to the most inner level 41 | " 42 | "----------------------------------------------------------------------------- 43 | " Examples: 44 | " case 1: delete an argument 45 | " function(int arg1, char* arg2="a,b,c(d,e)") 46 | " [N] daa 47 | " function(int arg1) 48 | " [N] daa 49 | " function() 50 | " [N] 51 | " 52 | " case 2: delete inner argument 53 | " function(int arg1, char* arg2="a,b,c(d,e)") 54 | " [N] cia 55 | " function(int arg1, ) 56 | " [I] 57 | " 58 | " case 3: smart argument recognition (g:argumentobject_force_toplevel = 0) 59 | " function(1, (20*30)+40, somefunc2(3, 4)) 60 | " [N] cia 61 | " function(1, , somefunc2(3, 4)) 62 | " [I] 63 | " function(1, (20*30)+40, somefunc2(3, 4)) 64 | " [N] caa 65 | " function(1, (20*30)+40, somefunc2(4)) 66 | " [I] 67 | " 68 | " case 4: smart argument recognition (g:argumentobject_force_toplevel = 1) 69 | " function(1, (20*30)+40, somefunc2(3, 4)) 70 | " [N] cia 71 | " function(1, , somefunc2(3, 4)) 72 | " [I] 73 | " function(1, (20*30)+40, somefunc2(3, 4)) 74 | " [N] caa 75 | " function(1, (20*30)+40) 76 | " [I] 77 | " 78 | "----------------------------------------------------------------------------- 79 | " ToDo: 80 | " - do nothing on null parentheses '()' 81 | " 82 | "----------------------------------------------------------------------------- 83 | " ChangeLog: 84 | " 1.1.1: 85 | " - debug (stop beeping on using text objects). Thanks to Nadav Samet. 86 | " 87 | " 1.1.unreleased: 88 | " - support for commas in <..> (for cpp templates) 89 | " 90 | " 1.1: 91 | " - support for commas in quoted string (".."), array ([..]) 92 | " do nothing outside a function declaration/call 93 | " 94 | " 1.0: 95 | " - Initial release 96 | " }}}1 97 | "============================================================================= 98 | 99 | " ChangeLog in https://github.com/inkarkat/argtextobj.vim 100 | " 101 | " 2014-06-02 o [master] ENH: Support repeat of operator-pending text objects. 102 | " 2014-05-07 M─┐ Merge pull request #2 from UnrealQuester/master 103 | " 2014-05-03 │ o Fixing empty function arguments bug 104 | " 2014-05-03 │ o Fixed bug with trailing whitespace 105 | " 2014-05-03 │ o Removed debug 106 | " 2014-05-03 │ o Return to old position when no matching parenthesis is found 107 | " 2014-05-02 │ o Trying to fix empty argument list bug 108 | " 2014-05-02 │ o Removed now unused option argument_mapping 109 | " 2014-04-30 o─┘ Fixed bug in multiline arguments 110 | " 2014-04-30 o Removed debug 111 | " 2014-04-30 M─┐ Merge pull request #1 from inkarkat/master 112 | " 2014-04-29 │ o Use proper syntax for help tag definitions. 113 | " 2014-04-29 │ o Use canonical (argtextobj...) mappings to allow remapping. 114 | " 2014-04-29 o─┘ Added docs 115 | " 2014-03-26 o Put most of the stuff in autoload 116 | " 2014-03-26 o Made mapping configurable 117 | " 2014-03-25 o Added include guard again 118 | " 2012-01-20 o FIX: Don't define text objects for select mode. 119 | " 2011-11-15 o ENH: Support whitespace other than (i.e. ). 120 | " 2011-11-15 o ENH: Support arguments spread over multiple lines. 121 | " 2011-11-15 o FIX: Prevent yank message when args are distributed over multi-lines. 122 | " 2011-11-15 o ENH: Beep when no or too few arguments found. 123 | " 2011-11-15 o ENH: Support [count] to select multiple arguments. 124 | " 2011-11-15 o ENH: Avoid clobbering the regtype, selection and clipboard registers. 125 | " 2011-11-15 o ENH: Avoid modification of buffer in s:GetOutOfDoubleQuote(). 126 | " 2011-11-15 o ENH: Handle selection=exclusive. 127 | " 2011-11-15 o FIX: Use :normal! everywhere to avoid interference with custom mappings. 128 | " 2009-12-30 o <1.1.1> Version 1.1.1: debug (stop beeping) 129 | " 2009-07-04 o <1.1> Version 1.1 130 | " 2009-07-04 I <1.0> Version 1.0: Initial upload 131 | " 132 | " if exists('loaded_argtextobj') || &cp || version < 700 133 | " finish 134 | " endif 135 | 136 | " let loaded_argtextobj = 1 137 | 138 | function! s:GetOutOfDoubleQuote() 139 | " get out of double quoteed string (one letter before the beginning) 140 | let line = getline('.') 141 | let pos_save = getpos('.') 142 | let mark_b = getpos("'<") 143 | let mark_e = getpos("'>") 144 | let repl='_' 145 | let did_modify = 0 146 | if getline('.')[getpos('.')[2]-1]=='_' 147 | let repl='?' 148 | endif 149 | 150 | while 1 151 | exe 'silent! normal! ^va"' 152 | normal! :\\ 153 | if getpos("'<")==getpos("'>") 154 | break 155 | endif 156 | exe 'normal! gvr' . repl 157 | let did_modify = 1 158 | endwhile 159 | 160 | call setpos('.', pos_save) 161 | if getline('.')[getpos('.')[2]-1]==repl 162 | " in double quote 163 | if did_modify 164 | silent undo 165 | call setpos('.', pos_save) 166 | endif 167 | if getpos('.')==getpos("'<") 168 | normal! h 169 | else 170 | normal! F" 171 | endif 172 | elseif did_modify 173 | silent undo 174 | call setpos('.', pos_save) 175 | endif 176 | endfunction 177 | 178 | function! s:GetOuterFunctionParenthesis() 179 | let pos_save = getpos('.') 180 | let rightup_before = pos_save 181 | silent! normal! [( 182 | let rightup_p = getpos('.') 183 | if rightup_p == rightup_before 184 | return [] 185 | endif 186 | while rightup_p != rightup_before 187 | if ! g:argumentobject_force_toplevel && getline('.')[getpos('.')[2]-1-1] =~ '[a-zA-Z0-9_]' 188 | " found a function 189 | break 190 | endif 191 | let rightup_before = rightup_p 192 | silent! normal! [( 193 | let rightup_p = getpos('.') 194 | endwhile 195 | call setpos('.', pos_save) 196 | return rightup_p 197 | endfunction 198 | 199 | function! s:GetPair(pos) 200 | let pos_save = getpos('.') 201 | call setpos('.', a:pos) 202 | normal! % 203 | if a:pos == getpos('.') 204 | call setpos('.', pos_save) 205 | return [] 206 | endif 207 | normal! h 208 | let pair_pos = getpos('.') 209 | call setpos('.', pos_save) 210 | return pair_pos 211 | endfunction 212 | 213 | function! s:GetInnerText(r1, r2) 214 | let pos_save = getpos('.') 215 | let cb_save = &clipboard 216 | set clipboard= " Avoid clobbering the selection and clipboard registers. 217 | let reg_save = @@ 218 | let regtype_save = getregtype('"') 219 | call setpos('.', a:r1) 220 | normal! lv 221 | call setpos('.', a:r2) 222 | if &selection ==# 'exclusive' 223 | normal! l 224 | endif 225 | silent normal! y 226 | let val = @@ 227 | call setpos('.', pos_save) 228 | call setreg('"', reg_save, regtype_save) 229 | let &clipboard = cb_save 230 | return val 231 | endfunction 232 | 233 | function! s:GetPrevCommaOrBeginArgs(arglist, offset) 234 | let commapos = strridx(a:arglist, ',', a:offset) 235 | return max([commapos+1, 0]) 236 | endfunction 237 | 238 | function! s:GetNextCommaOrEndArgs(arglist, offset, count) 239 | let commapos = a:offset - 1 240 | let c = a:count 241 | while c > 0 242 | let commapos = stridx(a:arglist, ',', commapos + 1) 243 | if commapos == -1 244 | if c > 1 245 | execute "normal! \\\" | " Beep. 246 | endif 247 | return strlen(a:arglist)-1 248 | endif 249 | let c -= 1 250 | endwhile 251 | return commapos-1 252 | endfunction 253 | 254 | function! s:MoveToNextNonSpace() 255 | let oldp = getpos('.') 256 | let moved = 0 257 | while getline('.')[getpos('.')[2]-1]=~'\s' 258 | normal! l 259 | if oldp == getpos('.') 260 | break 261 | endif 262 | let oldp = getpos('.') 263 | let moved += 1 264 | endwhile 265 | return moved 266 | endfunction 267 | 268 | function! s:MoveLeft(num) 269 | if a:num>0 270 | exe 'normal! ' . a:num . 'h' 271 | endif 272 | endfunction 273 | 274 | function! s:MoveRight(num) 275 | if a:num>0 276 | exe 'normal! ' . a:num . 'l' 277 | endif 278 | endfunction 279 | 280 | function! s:MotionArgument(inner, visual) 281 | let cnt = v:count1 282 | let operator = v:operator 283 | let current_c = getline('.')[getpos('.')[2]-1] 284 | if current_c==',' || current_c=='(' 285 | normal! l 286 | endif 287 | 288 | " get out of "double quoted string" because [( does not take effect in it 289 | call GetOutOfDoubleQuote() 290 | 291 | let rightup = GetOuterFunctionParenthesis() " on ( 292 | if empty(rightup) 293 | " no left parenthesis found, not inside function arguments 294 | execute "normal! \\\" | " Beep. 295 | return 296 | endif 297 | let rightup_pair = GetPair(rightup) " before ) 298 | if empty(rightup_pair) 299 | " no matching right parenthesis found, search for incomplete function 300 | " definition until end of current line. 301 | let rightup_pair = [0, line('.'), col('$'), 0] 302 | " empty function argument 303 | elseif rightup_pair == rightup 304 | " select both parenthesis 305 | if !a:inner 306 | normal! vh 307 | elseif !a:visual 308 | if current_c == '(' 309 | " insert single space and visually select it 310 | silent! execute "normal! i \v" 311 | endif 312 | endif 313 | return s:Repeat(cnt, a:inner, a:visual, operator) 314 | endif 315 | let arglist_str = GetInnerText(rightup, rightup_pair) " inside () 316 | if line('.')==rightup[1] 317 | " left parenthesis in the current line 318 | " cursor offset from rightup 319 | let offset = getpos('.')[2] - rightup[2] - 1 " -1 for the removed parenthesis 320 | else 321 | " left parenthesis in a previous line; retrieve the (partial when there's a 322 | " matching right parenthesis) current line from the arglist_str. 323 | for line in split(arglist_str, "\n") 324 | if stridx(getline('.'), line) == 0 325 | let arglist_str = line 326 | break 327 | endif 328 | endfor 329 | let offset = getpos('.')[2] - 1 330 | endif 331 | " replace all parentheses and commas inside them to '_' 332 | let arglist_sub = arglist_str 333 | let arglist_sub = substitute(arglist_sub, "'".'\([^'."'".']\{-}\)'."'", '\="(".substitute(submatch(1), ".", "_", "g").")"', 'g') " replace '..' => (__) 334 | let arglist_sub = substitute(arglist_sub, '\[\([^'."'".']\{-}\)\]', '\="(".substitute(submatch(1), ".", "_", "g").")"', 'g') " replace [..] => (__) 335 | let arglist_sub = substitute(arglist_sub, '<\([^'."'".']\{-}\)>', '\="(".substitute(submatch(1), ".", "_", "g").")"', 'g') " replace <..> => (__) 336 | let arglist_sub = substitute(arglist_sub, '"\([^'."'".']\{-}\)"', '(\1)', 'g') " replace ''..'' => (..) 337 | while stridx(arglist_sub, '(')>=0 && stridx(arglist_sub, ')')>=0 338 | let arglist_sub = substitute(arglist_sub , '(\([^()]\{-}\))', '\="<".substitute(submatch(1), ",", "_", "g").">"', 'g') 339 | endwhile 340 | " the beginning/end of this argument 341 | let thisargbegin = GetPrevCommaOrBeginArgs(arglist_sub, offset) 342 | let thisargend = GetNextCommaOrEndArgs(arglist_sub, offset, cnt) 343 | 344 | " function(..., the_nth_arg, ...) 345 | " [^left] [^right] 346 | let left = offset - thisargbegin 347 | let right = thisargend - thisargbegin 348 | 349 | let delete_trailing_space = 0 350 | " only do inner matching when argument list is not empty 351 | if a:inner && arglist_sub !~# "^\s\+$" 352 | " ia 353 | call MoveLeft(left) 354 | let right -= MoveToNextNonSpace() 355 | else 356 | " aa 357 | if thisargbegin==0 && thisargend==strlen(arglist_sub)-1 358 | " only single argument 359 | call MoveLeft(left) 360 | elseif thisargbegin==0 361 | " head of the list (do not delete '(') 362 | call MoveLeft(left) 363 | let right += 1 364 | let delete_trailing_space = 1 365 | else 366 | " normal or tail of the list 367 | call MoveLeft(left+1) 368 | let right += 1 369 | endif 370 | endif 371 | 372 | exe 'normal! v' 373 | 374 | call MoveRight(right) 375 | if delete_trailing_space 376 | exe 'normal! l' 377 | call MoveToNextNonSpace() 378 | exe 'normal! h' 379 | endif 380 | 381 | if &selection ==# 'exclusive' 382 | normal! l 383 | endif 384 | 385 | call s:Repeat(cnt, a:inner, a:visual, operator) 386 | endfunction 387 | 388 | function! s:Repeat(cnt, inner, visual, operator) 389 | let l:mapping = (a:inner ? "\(argtextobjI)" : "\(argtextobjA)") 390 | if !a:visual 391 | silent! call ingo#motion#omap#repeat(l:mapping, a:operator, a:cnt) 392 | endif 393 | endfunction 394 | 395 | 396 | 397 | 398 | " option. turn 1 to search the most toplevel function 399 | let g:argumentobject_force_toplevel = 400 | \ get(g:, 'argumentobject_force_toplevel', 0) 401 | 402 | vnoremap (argtextobjI) :call MotionArgument(1, 1) 403 | vnoremap (argtextobjA) :call MotionArgument(0, 1) 404 | onoremap (argtextobjI) :call MotionArgument(1, 0) 405 | onoremap (argtextobjA) :call MotionArgument(0, 0) 406 | if ! hasmapto('(argtextobjI)', 'v') 407 | xmap ia (argtextobjI) 408 | endif 409 | if ! hasmapto('(argtextobjA)', 'v') 410 | xmap aa (argtextobjA) 411 | endif 412 | if ! hasmapto('(argtextobjI)', 'o') 413 | omap ia (argtextobjI) 414 | endif 415 | if ! hasmapto('(argtextobjA)', 'o') 416 | omap aa (argtextobjA) 417 | endif 418 | 419 | " vim: set foldmethod=marker et ts=2 sts=2 sw=2: 420 | 421 | -------------------------------------------------------------------------------- /init/init-plugins.vim: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | " 3 | " init-plugins.vim - 4 | " 5 | " Created by skywind on 2018/05/31 6 | " Last Modified: 2018/06/10 23:11 7 | " 8 | "====================================================================== 9 | " vim: set ts=4 sw=4 tw=78 noet : 10 | 11 | 12 | 13 | "---------------------------------------------------------------------- 14 | " 默认情况下的分组,可以再前面覆盖之 15 | "---------------------------------------------------------------------- 16 | if !exists('g:bundle_group') 17 | let g:bundle_group = ['basic', 'tags', 'enhanced', 'filetypes', 'textobj'] 18 | let g:bundle_group += ['airline', 'nerdcommenter', 'ale', 'echodoc'] 19 | let g:bundle_group += ['leaderf'] 20 | " let g:bundle_group += ['plantuml'] 21 | endif 22 | 23 | 24 | "---------------------------------------------------------------------- 25 | " 计算当前 vim-init 的子路径 26 | "---------------------------------------------------------------------- 27 | let s:home = fnamemodify(resolve(expand(':p')), ':h:h') 28 | 29 | function! s:path(path) 30 | let path = expand(s:home . '/' . a:path ) 31 | return substitute(path, '\\', '/', 'g') 32 | endfunc 33 | 34 | 35 | "---------------------------------------------------------------------- 36 | " 在 ~/.vim/bundles 下安装插件 37 | "---------------------------------------------------------------------- 38 | call plug#begin(get(g:, 'bundle_home', '~/.vim/bundles')) 39 | 40 | 41 | "---------------------------------------------------------------------- 42 | " 默认插件 43 | "---------------------------------------------------------------------- 44 | 45 | " 全文快速移动,f{char} 即可触发 46 | Plug 'easymotion/vim-easymotion' 47 | 48 | " 文件浏览器,代替 netrw 49 | Plug 'justinmk/vim-dirvish' 50 | 51 | " 表格对齐,使用命令 Tabularize 52 | Plug 'godlygeek/tabular', { 'on': 'Tabularize' } 53 | 54 | " Diff 增强,支持 histogram / patience 等更科学的 diff 算法 55 | Plug 'chrisbra/vim-diff-enhanced' 56 | 57 | 58 | "---------------------------------------------------------------------- 59 | " Dirvish 设置:自动排序并隐藏文件,同时定位到相关文件 60 | " 这个排序函数可以将目录排在前面,文件排在后面,并且按照字母顺序排序 61 | " 比默认的纯按照字母排序更友好点。 62 | "---------------------------------------------------------------------- 63 | function! s:setup_dirvish() 64 | if &buftype != 'nofile' && &filetype != 'dirvish' 65 | return 66 | endif 67 | if has('nvim') 68 | return 69 | endif 70 | " 取得光标所在行的文本(当前选中的文件名) 71 | let text = getline('.') 72 | if ! get(g:, 'dirvish_hide_visible', 0) 73 | exec 'silent keeppatterns g@\v[\/]\.[^\/]+[\/]?$@d _' 74 | endif 75 | " 排序文件名 76 | exec 'sort ,^.*[\/],' 77 | let name = '^' . escape(text, '.*[]~\') . '[/*|@=|\\*]\=\%($\|\s\+\)' 78 | " 定位到之前光标处的文件 79 | call search(name, 'wc') 80 | noremap ~ :Dirvish ~ 81 | noremap % :e % 82 | endfunc 83 | 84 | augroup MyPluginSetup 85 | autocmd! 86 | autocmd FileType dirvish call s:setup_dirvish() 87 | augroup END 88 | 89 | 90 | "---------------------------------------------------------------------- 91 | " 基础插件 92 | "---------------------------------------------------------------------- 93 | if index(g:bundle_group, 'basic') >= 0 94 | " 黑客屏保 95 | Plug 'vim-scripts/matrix.vim--Yang' 96 | 97 | " Alternate Files quickly (.c --> .h etc) 98 | Plug 'vim-scripts/a.vim' 99 | 100 | " 展示开始画面,显示最近编辑过的文件 101 | " Plug 'mhinz/vim-startify' 102 | 103 | " 一次性安装一大堆 colorscheme 104 | Plug 'flazz/vim-colorschemes' 105 | 106 | " 支持库,给其他插件用的函数库 107 | Plug 'xolox/vim-misc' 108 | 109 | " 用于在侧边符号栏显示 marks (ma-mz 记录的位置) 110 | " Plug 'kshenoy/vim-signature' 111 | 112 | " 用于在侧边符号栏显示 git/svn 的 diff 113 | Plug 'mhinz/vim-signify' 114 | 115 | " 根据 quickfix 中匹配到的错误信息,高亮对应文件的错误行 116 | " 使用 :RemoveErrorMarkers 命令 117 | Plug 'mh21/errormarker.vim' 118 | 119 | " 使用 ALT+e 会在不同窗口/标签上显示 A/B/C 等编号,然后字母直接跳转 120 | Plug 't9md/vim-choosewin' 121 | 122 | " 提供基于 TAGS 的定义预览,函数参数预览,quickfix 预览 123 | Plug 'skywind3000/vim-preview' 124 | 125 | " Git 支持 126 | Plug 'tpope/vim-fugitive' 127 | 128 | " 使用 ALT+E 来选择窗口 129 | nmap (choosewin) 130 | 131 | " 默认不显示 startify 132 | " let g:startify_disable_at_vimenter = 1 133 | let g:startify_session_dir = '~/.vim/session' 134 | 135 | " signify 调优 136 | let g:signify_vcs_list = ['git', 'svn'] 137 | let g:signify_sign_add = '+' 138 | let g:signify_sign_delete = '_' 139 | let g:signify_sign_delete_first_line = '‾' 140 | let g:signify_sign_change = '~' 141 | let g:signify_sign_changedelete = g:signify_sign_change 142 | 143 | " git 仓库使用 histogram 算法进行 diff 144 | let g:signify_vcs_cmds = { 145 | \ 'git': 'git diff --no-color --diff-algorithm=histogram --no-ext-diff -U0 -- %f', 146 | \} 147 | endif 148 | 149 | 150 | "---------------------------------------------------------------------- 151 | " 增强插件 152 | "---------------------------------------------------------------------- 153 | if index(g:bundle_group, 'enhanced') >= 0 154 | " Simplify Doxygen documentation in C, C++, Python. 155 | Plug 'vim-scripts/DoxygenToolkit.vim' 156 | 157 | " 会话管理 158 | Plug 'tpope/vim-obsession' 159 | 160 | " format code 161 | Plug 'rhysd/vim-clang-format' 162 | 163 | " 多个选中 [跟LeaderF冲突] 164 | " Plug 'terryma/vim-multiple-cursors' 165 | 166 | " 显示空格 167 | Plug 'ntpeters/vim-better-whitespace' 168 | 169 | " 用 v 选中一个区域后,ALT_+/- 按分隔符扩大/缩小选区 170 | " Plug 'terryma/vim-expand-region' 171 | 172 | " 快速文件搜索 173 | " Plug 'junegunn/fzf' 174 | 175 | " 给不同语言提供字典补全,插入模式下 c-x c-k 触发 176 | Plug 'asins/vim-dict' 177 | 178 | " 使用 :FlyGrep 命令进行实时 grep 179 | Plug 'wsdjeg/FlyGrep.vim' 180 | 181 | " 使用 :CtrlSF 命令进行模仿 sublime 的 grep 182 | Plug 'dyng/ctrlsf.vim' 183 | 184 | " 配对括号和引号自动补全 185 | Plug 'Raimondi/delimitMate' 186 | 187 | " 提供 gist 接口 188 | " Plug 'lambdalisue/vim-gista', { 'on': 'Gista' } 189 | 190 | " ALT_+/- 用于按分隔符扩大缩小 v 选区 191 | " map (expand_region_expand) 192 | " map (expand_region_shrink) 193 | 194 | let g:clang_format#style_options = { 195 | \ "AccessModifierOffset" : -4, 196 | \ "AllowShortIfStatementsOnASingleLine" : "true", 197 | \ "AlwaysBreakTemplateDeclarations" : "true", 198 | \ "Standard" : "C++11", 199 | \ "BreakBeforeBraces" : "Stroustrup"} 200 | endif 201 | 202 | 203 | "---------------------------------------------------------------------- 204 | " 自动生成 ctags/gtags,并提供自动索引功能 205 | " 不在 git/svn 内的项目,需要在项目根目录 touch 一个空的 .root 文件 206 | " 详细用法见:https://zhuanlan.zhihu.com/p/36279445 207 | "---------------------------------------------------------------------- 208 | if index(g:bundle_group, 'tags') >= 0 209 | 210 | " 提供 ctags/gtags 后台数据库自动更新功能 211 | Plug 'ludovicchabant/vim-gutentags' 212 | 213 | " 提供 GscopeFind 命令并自动处理好 gtags 数据库切换 214 | " 支持光标移动到符号名上:cg 查看定义,cs 查看引用 215 | Plug 'skywind3000/gutentags_plus' 216 | 217 | " 设定项目目录标志:除了 .git/.svn 外,还有 .root 文件 218 | let g:gutentags_project_root = ['.root'] 219 | let g:gutentags_ctags_tagfile = '.tags' 220 | 221 | " 默认生成的数据文件集中到 ~/.cache/tags 避免污染项目目录,好清理 222 | let g:gutentags_cache_dir = expand('~/.cache/tags') 223 | 224 | " 默认禁用自动生成 225 | let g:gutentags_modules = [] 226 | 227 | " 如果有 ctags 可执行就允许动态生成 ctags 文件 228 | if executable('ctags') 229 | let g:gutentags_modules += ['ctags'] 230 | endif 231 | 232 | " 如果有 gtags 可执行就允许动态生成 gtags 数据库 233 | if executable('gtags') && executable('gtags-cscope') 234 | let g:gutentags_modules += ['gtags_cscope'] 235 | endif 236 | 237 | " 设置 ctags 的参数 238 | let g:gutentags_ctags_extra_args = [] 239 | let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q'] 240 | let g:gutentags_ctags_extra_args += ['--c++-kinds=+px'] 241 | let g:gutentags_ctags_extra_args += ['--c-kinds=+px'] 242 | 243 | " 使用 universal-ctags 的话需要下面这行,请反注释 244 | " let g:gutentags_ctags_extra_args += ['--output-format=e-ctags'] 245 | 246 | " 禁止 gutentags 自动链接 gtags 数据库 247 | let g:gutentags_auto_add_gtags_cscope = 0 248 | endif 249 | 250 | 251 | "---------------------------------------------------------------------- 252 | " 文本对象:textobj 全家桶 253 | "---------------------------------------------------------------------- 254 | if index(g:bundle_group, 'textobj') >= 0 255 | 256 | " 基础插件:提供让用户方便的自定义文本对象的接口 257 | Plug 'kana/vim-textobj-user' 258 | 259 | " indent 文本对象:ii/ai 表示当前缩进,vii 选中当缩进,cii 改写缩进 260 | Plug 'kana/vim-textobj-indent' 261 | 262 | " 语法文本对象:iy/ay 基于语法的文本对象 263 | Plug 'kana/vim-textobj-syntax' 264 | 265 | " 函数文本对象:if/af 支持 c/c++/vim/java 266 | Plug 'kana/vim-textobj-function', { 'for':['c', 'cpp', 'vim', 'java'] } 267 | 268 | " 参数文本对象:i,/a, 包括参数或者列表元素 269 | Plug 'sgur/vim-textobj-parameter' 270 | 271 | " 提供 python 相关文本对象,if/af 表示函数,ic/ac 表示类 272 | Plug 'bps/vim-textobj-python', {'for': 'python'} 273 | 274 | " 提供 uri/url 的文本对象,iu/au 表示 275 | Plug 'jceb/vim-textobj-uri' 276 | endif 277 | 278 | 279 | "---------------------------------------------------------------------- 280 | " 文件类型扩展 281 | "---------------------------------------------------------------------- 282 | if index(g:bundle_group, 'filetypes') >= 0 283 | 284 | " powershell 脚本文件的语法高亮 285 | Plug 'pprovost/vim-ps1', { 'for': 'ps1' } 286 | 287 | " lua 语法高亮增强 288 | Plug 'tbastos/vim-lua', { 'for': 'lua' } 289 | 290 | " C++ 语法高亮增强,支持 11/14/17 标准 291 | Plug 'octol/vim-cpp-enhanced-highlight', { 'for': ['c', 'cpp'] } 292 | 293 | " 额外语法文件 294 | Plug 'justinmk/vim-syntax-extra', { 'for': ['c', 'bison', 'flex', 'cpp'] } 295 | 296 | " python 语法文件增强 297 | Plug 'vim-python/python-syntax', { 'for': ['python'] } 298 | 299 | " rust 语法增强 300 | Plug 'rust-lang/rust.vim', { 'for': 'rust' } 301 | 302 | " vim org-mode 303 | Plug 'jceb/vim-orgmode', { 'for': 'org' } 304 | 305 | " 代码格式化 306 | Plug 'Chiel92/vim-autoformat' 307 | endif 308 | 309 | 310 | "---------------------------------------------------------------------- 311 | " airline 312 | "---------------------------------------------------------------------- 313 | if index(g:bundle_group, 'airline') >= 0 314 | Plug 'vim-airline/vim-airline' 315 | Plug 'vim-airline/vim-airline-themes' 316 | let g:airline_left_sep = '' 317 | let g:airline_left_alt_sep = '' 318 | let g:airline_right_sep = '' 319 | let g:airline_right_alt_sep = '' 320 | let g:airline_powerline_fonts = 0 321 | let g:airline_exclude_preview = 1 322 | let g:airline_section_b = '%n' 323 | let g:airline_theme='deus' 324 | let g:airline#extensions#branch#enabled = 0 325 | let g:airline#extensions#syntastic#enabled = 0 326 | let g:airline#extensions#fugitiveline#enabled = 0 327 | let g:airline#extensions#csv#enabled = 0 328 | let g:airline#extensions#vimagit#enabled = 0 329 | endif 330 | 331 | 332 | "---------------------------------------------------------------------- 333 | " NERDTree 334 | "---------------------------------------------------------------------- 335 | if index(g:bundle_group, 'nerdtree') >= 0 336 | Plug 'scrooloose/nerdtree', {'on': ['NERDTree', 'NERDTreeFocus', 'NERDTreeToggle', 'NERDTreeCWD', 'NERDTreeFind'] } 337 | Plug 'tiagofumo/vim-nerdtree-syntax-highlight' 338 | let g:NERDTreeMinimalUI = 1 339 | let g:NERDTreeDirArrows = 1 340 | let g:NERDTreeHijackNetrw = 0 341 | noremap nn :NERDTree 342 | noremap no :NERDTreeFocus 343 | noremap nm :NERDTreeMirror 344 | noremap nt :NERDTreeToggle 345 | endif 346 | 347 | 348 | "---------------------------------------------------------------------- 349 | " NERDCommenter 350 | "---------------------------------------------------------------------- 351 | if index(g:bundle_group, 'nerdcommenter') >= 0 352 | Plug 'scrooloose/nerdcommenter' 353 | " Add spaces after comment delimiters by default 354 | let g:NERDSpaceDelims = 1 355 | " Use compact syntax for prettified multi-line comments 356 | let g:NERDCompactSexyComs = 1 357 | " Align line-wise comment delimiters flush left instead of following code indentation 358 | let g:NERDDefaultAlign = 'left' 359 | " Set a language to use its alternate delimiters by default 360 | let g:NERDAltDelims_java = 1 361 | " Allow commenting and inverting empty lines (useful when commenting a region) 362 | let g:NERDCommentEmptyLines = 1 363 | " Enable trimming of trailing whitespace when uncommenting 364 | let g:NERDTrimTrailingWhitespace = 1 365 | " Enable NERDCommenterToggle to check all selected lines is commented or not 366 | let g:NERDToggleCheckAllLines = 1 367 | endif 368 | 369 | 370 | "---------------------------------------------------------------------- 371 | " LanguageTool 语法检查 372 | "---------------------------------------------------------------------- 373 | if index(g:bundle_group, 'grammer') >= 0 374 | Plug 'rhysd/vim-grammarous' 375 | noremap rg :GrammarousCheck --lang=en-US --no-move-to-first-error --no-preview 376 | map rr (grammarous-open-info-window) 377 | map rv (grammarous-move-to-info-window) 378 | map rs (grammarous-reset) 379 | map rx (grammarous-close-info-window) 380 | map rm (grammarous-remove-error) 381 | map rd (grammarous-disable-rule) 382 | map rn (grammarous-move-to-next-error) 383 | map rp (grammarous-move-to-previous-error) 384 | endif 385 | 386 | 387 | "---------------------------------------------------------------------- 388 | " ale:动态语法检查 389 | "---------------------------------------------------------------------- 390 | if index(g:bundle_group, 'ale') >= 0 391 | Plug 'dense-analysis/ale' 392 | 393 | " 设定延迟和提示信息 394 | let g:ale_completion_delay = 500 395 | let g:ale_echo_delay = 20 396 | let g:ale_lint_delay = 500 397 | let g:ale_echo_msg_format = '[%linter%] %code: %%s' 398 | 399 | " 设定检测的时机:normal 模式文字改变,或者离开 insert模式 400 | " 禁用默认 INSERT 模式下改变文字也触发的设置,太频繁外,还会让补全窗闪烁 401 | let g:ale_lint_on_text_changed = 'normal' 402 | let g:ale_lint_on_insert_leave = 1 403 | 404 | " 在 linux/mac 下降低语法检查程序的进程优先级(不要卡到前台进程) 405 | if has('win32') == 0 && has('win64') == 0 && has('win32unix') == 0 406 | let g:ale_command_wrapper = 'nice -n5' 407 | endif 408 | 409 | " 允许 airline 集成 410 | let g:airline#extensions#ale#enabled = 1 411 | 412 | " 编辑不同文件类型需要的语法检查器 413 | let g:ale_linters = { 414 | \ 'c': ['gcc', 'cppcheck'], 415 | \ 'cpp': ['gcc', 'cppcheck'], 416 | \ 'python': ['flake8', 'pylint'], 417 | \ 'lua': ['luac'], 418 | \ 'go': ['go build', 'gofmt'], 419 | \ 'java': ['javac'], 420 | \ 'javascript': ['eslint'], 421 | \ } 422 | 423 | 424 | " 获取 pylint, flake8 的配置文件,在 vim-init/tools/conf 下面 425 | function s:lintcfg(name) 426 | let conf = s:path('tools/conf/') 427 | let path1 = conf . a:name 428 | let path2 = expand('~/.vim/linter/'. a:name) 429 | if filereadable(path2) 430 | return path2 431 | endif 432 | return shellescape(filereadable(path2)? path2 : path1) 433 | endfunc 434 | 435 | " 设置 flake8/pylint 的参数 436 | let g:ale_python_flake8_options = '--conf='.s:lintcfg('flake8.conf') 437 | let g:ale_python_pylint_options = '--rcfile='.s:lintcfg('pylint.conf') 438 | let g:ale_python_pylint_options .= ' --disable=W' 439 | let g:ale_c_gcc_options = '-Wall -O2 -std=c99' 440 | let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14' 441 | let g:ale_c_cppcheck_options = '' 442 | let g:ale_cpp_cppcheck_options = '' 443 | 444 | let g:ale_linters.text = ['textlint', 'write-good', 'languagetool'] 445 | 446 | " 如果没有 gcc 只有 clang 时(FreeBSD) 447 | if executable('gcc') == 0 && executable('clang') 448 | let g:ale_linters.c += ['clang'] 449 | let g:ale_linters.cpp += ['clang'] 450 | endif 451 | endif 452 | 453 | "---------------------------------------------------------------------- 454 | " echodoc:搭配 YCM/deoplete 在底部显示函数参数 455 | "---------------------------------------------------------------------- 456 | if index(g:bundle_group, 'echodoc') >= 0 457 | Plug 'Shougo/echodoc.vim' 458 | set noshowmode 459 | let g:echodoc#enable_at_startup = 1 460 | endif 461 | 462 | "---------------------------------------------------------------------- 463 | " plantuml : 生成UML图 464 | "---------------------------------------------------------------------- 465 | if index(g:bundle_group, 'plantuml') >= 0 466 | " Inline previews for Plantuml sequence diagrams. OMG! 467 | Plug 'scrooloose/vim-slumlord' 468 | 469 | " vim syntax file for plantuml 470 | Plug 'aklt/plantuml-syntax' 471 | endif 472 | 473 | 474 | "---------------------------------------------------------------------- 475 | " LeaderF:CtrlP / FZF 的超级代替者,文件模糊匹配,tags/函数名 选择 476 | "---------------------------------------------------------------------- 477 | if index(g:bundle_group, 'leaderf') >= 0 478 | " 如果 vim 支持 python 则启用 Leaderf 479 | if has('python') || has('python3') 480 | Plug 'Yggdroot/LeaderF' 481 | 482 | " CTRL+p 打开文件模糊匹配 483 | let g:Lf_ShortcutF = '' 484 | 485 | " ALT+n 打开 buffer 模糊匹配 486 | let g:Lf_ShortcutB = '' 487 | 488 | " CTRL+n 打开最近使用的文件 MRU,进行模糊匹配 489 | noremap :LeaderfMru 490 | 491 | " ALT+p 打开函数列表,按 i 进入模糊匹配,ESC 退出 492 | noremap :LeaderfFunction! 493 | 494 | " ALT+SHIFT+p 打开 tag 列表,i 进入模糊匹配,ESC退出 495 | noremap :LeaderfBufTag! 496 | 497 | " ALT+n 打开 buffer 列表进行模糊匹配 498 | noremap :LeaderfBuffer 499 | 500 | " ALT+m 全局 tags 模糊匹配 501 | noremap :LeaderfTag 502 | 503 | " 最大历史文件保存 2048 个 504 | let g:Lf_MruMaxFiles = 2048 505 | 506 | " ui 定制 507 | let g:Lf_StlSeparator = { 'left': '', 'right': '', 'font': '' } 508 | 509 | " 如何识别项目目录,从当前文件目录向父目录递归知道碰到下面的文件/目录 510 | let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git'] 511 | let g:Lf_WorkingDirectoryMode = 'Ac' 512 | let g:Lf_WindowHeight = 0.30 513 | let g:Lf_CacheDirectory = expand('~/.vim/cache') 514 | 515 | " 显示绝对路径 516 | let g:Lf_ShowRelativePath = 0 517 | 518 | " 隐藏帮助 519 | let g:Lf_HideHelp = 1 520 | 521 | " 模糊匹配忽略扩展名 522 | let g:Lf_WildIgnore = { 523 | \ 'dir': ['.svn','.git','.hg'], 524 | \ 'file': ['*.sw?','~$*','*.bak','*.exe','*.o','*.so','*.py[co]'] 525 | \ } 526 | 527 | " MRU 文件忽略扩展名 528 | let g:Lf_MruFileExclude = ['*.so', '*.exe', '*.py[co]', '*.sw?', '~$*', '*.bak', '*.tmp', '*.dll'] 529 | let g:Lf_StlColorscheme = 'powerline' 530 | 531 | " 禁用 function/buftag 的预览功能,可以手动用 p 预览 532 | let g:Lf_PreviewResult = {'Function':0, 'BufTag':0} 533 | 534 | " 使用 ESC 键可以直接退出 leaderf 的 normal 模式 535 | let g:Lf_NormalMap = { 536 | \ "File": [["", ':exec g:Lf_py "fileExplManager.quit()"']], 537 | \ "Buffer": [["", ':exec g:Lf_py "bufExplManager.quit()"']], 538 | \ "Mru": [["", ':exec g:Lf_py "mruExplManager.quit()"']], 539 | \ "Tag": [["", ':exec g:Lf_py "tagExplManager.quit()"']], 540 | \ "BufTag": [["", ':exec g:Lf_py "bufTagExplManager.quit()"']], 541 | \ "Function": [["", ':exec g:Lf_py "functionExplManager.quit()"']], 542 | \ } 543 | 544 | else 545 | " 不支持 python ,使用 CtrlP 代替 546 | Plug 'ctrlpvim/ctrlp.vim' 547 | 548 | " 显示函数列表的扩展插件 549 | Plug 'tacahiroy/ctrlp-funky' 550 | 551 | " 忽略默认键位 552 | let g:ctrlp_map = '' 553 | 554 | " 模糊匹配忽略 555 | let g:ctrlp_custom_ignore = { 556 | \ 'dir': '\v[\/]\.(git|hg|svn)$', 557 | \ 'file': '\v\.(exe|so|dll|mp3|wav|sdf|suo|mht)$', 558 | \ 'link': 'some_bad_symbolic_links', 559 | \ } 560 | 561 | " 项目标志 562 | let g:ctrlp_root_markers = ['.project', '.root', '.svn', '.git'] 563 | let g:ctrlp_working_path = 0 564 | 565 | " CTRL+p 打开文件模糊匹配 566 | noremap :CtrlP 567 | 568 | " CTRL+n 打开最近访问过的文件的匹配 569 | noremap :CtrlPMRUFiles 570 | 571 | " ALT+p 显示当前文件的函数列表 572 | noremap :CtrlPFunky 573 | 574 | " ALT+n 匹配 buffer 575 | noremap :CtrlPBuffer 576 | endif 577 | endif 578 | 579 | 580 | "---------------------------------------------------------------------- 581 | " 结束插件安装 582 | "---------------------------------------------------------------------- 583 | call plug#end() 584 | 585 | 586 | 587 | "---------------------------------------------------------------------- 588 | " YouCompleteMe 默认设置:YCM 需要你另外手动编译安装 589 | "---------------------------------------------------------------------- 590 | 591 | " 禁用预览功能:扰乱视听 592 | let g:ycm_add_preview_to_completeopt = 0 593 | 594 | " 禁用诊断功能:我们用前面更好用的 ALE 代替 595 | let g:ycm_show_diagnostics_ui = 0 596 | let g:ycm_server_log_level = 'info' 597 | let g:ycm_min_num_identifier_candidate_chars = 2 598 | let g:ycm_collect_identifiers_from_comments_and_strings = 1 599 | let g:ycm_complete_in_strings=1 600 | "let g:ycm_key_invoke_completion = '' 601 | set completeopt=menu,menuone 602 | 603 | " 两个字符自动触发语义补全 604 | let g:ycm_semantic_triggers = { 605 | \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'], 606 | \ 'cs,lua,javascript': ['re!\w{2}'], 607 | \ } 608 | 609 | 610 | "---------------------------------------------------------------------- 611 | " Ycm 白名单(非名单内文件不启用 YCM),避免打开个 1MB 的 txt 分析半天 612 | "---------------------------------------------------------------------- 613 | let g:ycm_filetype_whitelist = { 614 | \ "c":1, 615 | \ "cpp":1, 616 | \ "objc":1, 617 | \ "objcpp":1, 618 | \ "python":1, 619 | \ "java":1, 620 | \ "javascript":1, 621 | \ "coffee":1, 622 | \ "vim":1, 623 | \ "go":1, 624 | \ "cs":1, 625 | \ "lua":1, 626 | \ "perl":1, 627 | \ "perl6":1, 628 | \ "php":1, 629 | \ "ruby":1, 630 | \ "rust":1, 631 | \ "erlang":1, 632 | \ "asm":1, 633 | \ "nasm":1, 634 | \ "masm":1, 635 | \ "tasm":1, 636 | \ "asm68k":1, 637 | \ "asmh8300":1, 638 | \ "asciidoc":1, 639 | \ "basic":1, 640 | \ "vb":1, 641 | \ "make":1, 642 | \ "cmake":1, 643 | \ "html":1, 644 | \ "css":1, 645 | \ "less":1, 646 | \ "json":1, 647 | \ "cson":1, 648 | \ "typedscript":1, 649 | \ "haskell":1, 650 | \ "lhaskell":1, 651 | \ "lisp":1, 652 | \ "scheme":1, 653 | \ "sdl":1, 654 | \ "sh":1, 655 | \ "zsh":1, 656 | \ "bash":1, 657 | \ "man":1, 658 | \ "markdown":1, 659 | \ "matlab":1, 660 | \ "maxima":1, 661 | \ "dosini":1, 662 | \ "conf":1, 663 | \ "config":1, 664 | \ "zimbu":1, 665 | \ "ps1":1, 666 | \ } 667 | 668 | 669 | --------------------------------------------------------------------------------