├── .github └── FUNDING.yml ├── .gitignore ├── .vimrc ├── .vimrc.custom.config ├── .vimrc.custom.plugins ├── .ycm_extra_conf.py ├── LICENSE ├── README.md ├── autoload └── plug.vim ├── colors ├── badwolf.vim ├── dracula.vim ├── gruvbox.vim ├── monokai.vim ├── onedark.vim └── seoul256.vim ├── fonts ├── DejaVu.ttf └── Droid Sans Mono Nerd Font Complete.otf ├── ftplugin └── vim │ ├── vim.vim │ ├── vimplus_logo_black.txt │ └── vimplus_logo_light.txt ├── help.md ├── install.sh ├── install_to_user.sh ├── screenshots ├── alipay.png ├── main.png ├── vimplus-logo.png └── wechat.png ├── uninstall.sh └── update.sh /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: https://github.com/chxuan/vimplus#%E6%94%AF%E6%8C%81%E5%BC%80%E6%BA%90 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " . . . . . . . S@t.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 2 | " . ..t%SXSS%:;t.X8S% . . . . . . . . . . . . . 3 | " . %St8;8:X;8:8:8%8;%%:@S: . . . . .... . . . . . . . . . . . . . . . .... 4 | " . 8: %.;t;S;%@88:X.8X8%;8S t@@% . %@@t .X88X . . . %@@@@@@@@@X: . . . . . 5 | " ..X.;X%8t8%8ttX.88;8.8%:;% ;8:SX%. SX.8S. St88: . . . . ..XS.@%SSS88S@:. X@@% . . . . . . ...... 6 | " . X;:;8SS888;8tt;8:8:8; t:t8S 8:Xt. :8888: .%888:. .SSSSSSSSSSS%: .S888t @@8X: .%.88 .SSt .:SS; .%SSSSSSSS%. 7 | " :t8 :;X8S;8.8S;8S.8.t8:%8XS.. S8.8:.S8;8; :@;@88 . S:88 X.88@88:@t..%S. .. X;8@: :%:;8. X%:X;. 8;.; %S8@XXSXSS8.. 8 | " .t88; X;8S8888;8S8t 8S88SSStt:. @.%8St;@8X . t .8S S:88:%888%;8t8:..S.S@%SSS8S88t .% @; X:.X. 88t :.t@t8@ ....... 9 | " 8; :888XSStS;88;88X%;;tt::;;8@ ..%X88:88Xt .S@.::. S@8% X8.@;S888X .%;88SSSS.SX.:. 8S88: @;88t. 8.S8 t;@8@88@88S.. 10 | " S. :tX: ;%8S8 : .::. %8t %S 8. @88t8 8t. . . .@8; 8888 @@%S;t8.8S .:SX8; .:.... . S8; ..8888:..8:8@: ;St@@888.@@.. 11 | " :8:;888888 .; . 8%8@ .8X.@8X . X%8@ .t@8S X88X:%888X .@8@8t .. . SX%X .X;;S@%tS8; ;..SttSXS8888S. 12 | " t.8XX;;8X% XX. . %8X8; . :tX8@t . t8X8: %@@S X8@@:t8tXt...:%t.. . X:8X X8@@88@888t. %88t888 888t. 13 | " . :8;S: . S@. t8;8:: . .;:;. . . .%@%: t%%; .%%;..: t. .; : . . . %;8. ;X;X%.:.: t ;t ;:: :t;.. 14 | " :%@t%8 88. . . :: . .. . . . . .. . .. . . . . ... . . . . .. 15 | " .. 8888 .. ... . . . . . . . .. . . . . . . .. . . . . . . .... 16 | " 17 | " Author: chxuan <787280310@qq.com> 18 | " Repository: https://github.com/chxuan/vimplus 19 | " Create Date: 2016-04-10 20 | " License: MIT 21 | 22 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 23 | " 通用设置 24 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 25 | let mapleader = "," " 定义键 26 | set nocompatible " 设置不兼容原始vi模式 27 | filetype on " 设置开启文件类型侦测 28 | filetype plugin on " 设置加载对应文件类型的插件 29 | set noeb " 关闭错误的提示 30 | syntax enable " 开启语法高亮功能 31 | syntax on " 自动语法高亮 32 | set t_Co=256 " 开启256色支持 33 | set cmdheight=2 " 设置命令行的高度 34 | set showcmd " select模式下显示选中的行数 35 | set ruler " 总是显示光标位置 36 | set laststatus=2 " 总是显示状态栏 37 | set number " 开启行号显示 38 | set cursorline " 高亮显示当前行 39 | set whichwrap+=<,>,h,l " 设置光标键跨行 40 | set ttimeoutlen=0 " 设置键响应时间 41 | set virtualedit=block,onemore " 允许光标出现在最后一个字符的后面 42 | 43 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 44 | " 代码缩进和排版 45 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 46 | set autoindent " 设置自动缩进 47 | set cindent " 设置使用C/C++语言的自动缩进方式 48 | set cinoptions=g0,:0,N-s,(0 " 设置C/C++语言的具体缩进方式 49 | set smartindent " 智能的选择对其方式 50 | filetype indent on " 自适应不同语言的智能缩进 51 | set expandtab " 将制表符扩展为空格 52 | set tabstop=4 " 设置编辑时制表符占用空格数 53 | set shiftwidth=4 " 设置格式化时制表符占用空格数 54 | set softtabstop=4 " 设置4个空格为制表符 55 | set smarttab " 在行和段开始处使用制表符 56 | set nowrap " 禁止折行 57 | set backspace=2 " 使用回车键正常处理indent,eol,start等 58 | set sidescroll=10 " 设置向右滚动字符数 59 | set nofoldenable " 禁用折叠代码 60 | 61 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 62 | " 代码补全 63 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 64 | set wildmenu " vim自身命名行模式智能补全 65 | set completeopt-=preview " 补全时不显示窗口,只显示补全列表 66 | 67 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 68 | " 搜索设置 69 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 70 | set hlsearch " 高亮显示搜索结果 71 | set incsearch " 开启实时搜索功能 72 | set ignorecase " 搜索时大小写不敏感 73 | 74 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 75 | " 缓存设置 76 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 77 | set nobackup " 设置不备份 78 | set noswapfile " 禁止生成临时文件 79 | set autoread " 文件在vim之外修改过,自动重新读入 80 | set autowrite " 设置自动保存 81 | set confirm " 在处理未保存或只读文件的时候,弹出确认 82 | 83 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 84 | " 编码设置 85 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 86 | set langmenu=zh_CN.UTF-8 87 | set helplang=cn 88 | set termencoding=utf-8 89 | set encoding=utf8 90 | set fileencodings=utf8,ucs-bom,gbk,cp936,gb2312,gb18030 91 | 92 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 93 | " gvim/macvim设置 94 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 95 | if has("gui_running") 96 | let system = system('uname -s') 97 | if system == "Darwin\n" 98 | set guifont=Droid\ Sans\ Mono\ Nerd\ Font\ Complete:h18 " 设置字体 99 | else 100 | set guifont=DroidSansMono\ Nerd\ Font\ Regular\ 18 " 设置字体 101 | endif 102 | set guioptions-=m " 隐藏菜单栏 103 | set guioptions-=T " 隐藏工具栏 104 | set guioptions-=L " 隐藏左侧滚动条 105 | set guioptions-=r " 隐藏右侧滚动条 106 | set guioptions-=b " 隐藏底部滚动条 107 | set showtabline=0 " 隐藏Tab栏 108 | set guicursor=n-v-c:ver5 " 设置光标为竖线 109 | endif 110 | 111 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 112 | " 卸载默认插件UnPlug 113 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 114 | function! s:deregister(repo) 115 | let repo = substitute(a:repo, '[\/]\+$', '', '') 116 | let name = fnamemodify(repo, ':t:s?\.git$??') 117 | call remove(g:plugs, name) 118 | endfunction 119 | command! -nargs=1 -bar UnPlug call s:deregister() 120 | 121 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 122 | " 插件列表 123 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 124 | call plug#begin('~/.vim/plugged') 125 | 126 | Plug 'chxuan/cpp-mode' 127 | Plug 'chxuan/vim-edit' 128 | Plug 'chxuan/change-colorscheme' 129 | Plug 'chxuan/prepare-code' 130 | Plug 'chxuan/vim-buffer' 131 | Plug 'chxuan/vimplus-startify' 132 | Plug 'preservim/tagbar' 133 | Plug 'Valloric/YouCompleteMe' 134 | Plug 'Yggdroot/LeaderF' 135 | Plug 'mileszs/ack.vim' 136 | Plug 'easymotion/vim-easymotion' 137 | Plug 'haya14busa/incsearch.vim' 138 | Plug 'jiangmiao/auto-pairs' 139 | Plug 'preservim/nerdtree' 140 | Plug 'tiagofumo/vim-nerdtree-syntax-highlight' 141 | Plug 'Xuyuanp/nerdtree-git-plugin' 142 | Plug 'godlygeek/tabular' 143 | Plug 'tpope/vim-fugitive' 144 | Plug 'tpope/vim-surround' 145 | Plug 'tpope/vim-commentary' 146 | Plug 'tpope/vim-repeat' 147 | Plug 'tpope/vim-endwise' 148 | Plug 'octol/vim-cpp-enhanced-highlight' 149 | Plug 'vim-airline/vim-airline' 150 | Plug 'vim-airline/vim-airline-themes' 151 | Plug 'ryanoasis/vim-devicons' 152 | Plug 'junegunn/vim-slash' 153 | Plug 'junegunn/gv.vim' 154 | Plug 'kana/vim-textobj-user' 155 | Plug 'kana/vim-textobj-indent' 156 | Plug 'kana/vim-textobj-syntax' 157 | Plug 'kana/vim-textobj-function' 158 | Plug 'sgur/vim-textobj-parameter' 159 | Plug 'Shougo/echodoc.vim' 160 | Plug 'terryma/vim-smooth-scroll' 161 | Plug 'rhysd/clever-f.vim' 162 | Plug 'vim-scripts/indentpython.vim' 163 | 164 | " 加载自定义插件 165 | if filereadable(expand($HOME . '/.vimrc.custom.plugins')) 166 | source $HOME/.vimrc.custom.plugins 167 | endif 168 | 169 | call plug#end() 170 | 171 | " load vim default plugin 172 | runtime macros/matchit.vim 173 | 174 | " 编辑vimrc相关配置文件 175 | nnoremap e :edit $MYVIMRC 176 | nnoremap vc :edit ~/.vimrc.custom.config 177 | nnoremap vp :edit ~/.vimrc.custom.plugins 178 | 179 | " 查看vimplus的help文件 180 | nnoremap h :view +let\ &l:modifiable=0 ~/.vimplus/help.md 181 | 182 | " 打开当前光标所在单词的vim帮助文档 183 | nnoremap H :execute ":help " . expand("") 184 | 185 | " 重新加载vimrc文件 186 | nnoremap s :source $MYVIMRC 187 | 188 | " 安装、更新、删除插件 189 | nnoremap i :PlugInstall 190 | nnoremap u :PlugUpdate 191 | nnoremap c :PlugClean 192 | 193 | " 分屏窗口移动 194 | nnoremap j 195 | nnoremap k 196 | nnoremap h 197 | nnoremap l 198 | 199 | " 复制当前选中到系统剪切板 200 | vmap y "+y 201 | 202 | " 将系统剪切板内容粘贴到vim 203 | nnoremap p "+p 204 | 205 | " 打开文件自动定位到最后编辑的位置 206 | autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | execute "normal! g'\"" | endif 207 | 208 | " 主题设置 209 | set background=dark 210 | let g:onedark_termcolors=256 211 | colorscheme onedark 212 | 213 | " airline 214 | let g:airline_theme="onedark" 215 | let g:airline_powerline_fonts = 1 216 | let g:airline#extensions#tabline#enabled = 1 217 | if !exists('g:airline_symbols') 218 | let g:airline_symbols = {} 219 | endif 220 | let g:airline_left_sep = '' 221 | let g:airline_left_alt_sep = '' 222 | let g:airline_right_sep = '' 223 | let g:airline_right_alt_sep = '' 224 | 225 | " cpp-mode 226 | nnoremap y :CopyCode 227 | nnoremap p :PasteCode 228 | nnoremap U :GoToFunImpl 229 | nnoremap a :Switch 230 | nnoremap fp :FormatFunParam 231 | nnoremap if :FormatIf 232 | nnoremap t dd :GenTryCatch 233 | xnoremap t d :GenTryCatch 234 | 235 | " change-colorscheme 236 | nnoremap :PreviousColorScheme 237 | inoremap :PreviousColorScheme 238 | nnoremap :NextColorScheme 239 | inoremap :NextColorScheme 240 | nnoremap :RandomColorScheme 241 | inoremap :RandomColorScheme 242 | nnoremap :ShowColorScheme 243 | inoremap :ShowColorScheme 244 | 245 | " prepare-code 246 | let g:prepare_code_plugin_path = expand($HOME . "/.vim/plugged/prepare-code") 247 | 248 | " vim-buffer 249 | nnoremap :PreviousBuffer 250 | nnoremap :NextBuffer 251 | nnoremap d :CloseBuffer 252 | nnoremap D :BufOnly 253 | 254 | " vim-edit 255 | nnoremap Y :CopyText 256 | nnoremap D :DeleteText 257 | nnoremap C :ChangeText 258 | nnoremap r :ReplaceTo 259 | 260 | " nerdtree 261 | nnoremap n :NERDTreeToggle 262 | let g:NERDTreeFileExtensionHighlightFullName = 1 263 | let g:NERDTreeExactMatchHighlightFullName = 1 264 | let g:NERDTreePatternMatchHighlightFullName = 1 265 | let g:NERDTreeHighlightFolders = 1 266 | let g:NERDTreeHighlightFoldersFullName = 1 267 | let g:NERDTreeDirArrowExpandable='▷' 268 | let g:NERDTreeDirArrowCollapsible='▼' 269 | 270 | " YCM 271 | " 如果不指定python解释器路径,ycm会自己搜索一个合适的(与编译ycm时使用的python版本匹配) 272 | " let g:ycm_server_python_interpreter = '/usr/bin/python2.7' 273 | let g:ycm_confirm_extra_conf = 0 274 | let g:ycm_error_symbol = '✗' 275 | let g:ycm_warning_symbol = '✹' 276 | let g:ycm_seed_identifiers_with_syntax = 1 277 | let g:ycm_complete_in_comments = 1 278 | let g:ycm_complete_in_strings = 1 279 | let g:ycm_collect_identifiers_from_tags_files = 1 280 | let g:ycm_semantic_triggers = { 281 | \ 'c' : ['->', '.','re![_a-zA-z0-9]'], 282 | \ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s', 283 | \ 're!\[.*\]\s'], 284 | \ 'ocaml' : ['.', '#'], 285 | \ 'cpp,objcpp' : ['->', '.', '::','re![_a-zA-Z0-9]'], 286 | \ 'perl' : ['->'], 287 | \ 'php' : ['->', '::'], 288 | \ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'], 289 | \ 'ruby' : ['.', '::'], 290 | \ 'lua' : ['.', ':'], 291 | \ 'erlang' : [':'], 292 | \ } 293 | nnoremap u :YcmCompleter GoToDeclaration 294 | " 已经使用cpp-mode插件提供的转到函数实现的功能 295 | " nnoremap i :YcmCompleter GoToDefinition 296 | nnoremap o :YcmCompleter GoToInclude 297 | nnoremap ff :YcmCompleter FixIt 298 | nmap :YcmDiags 299 | 300 | " tagbar 301 | let g:tagbar_width = 30 302 | nnoremap t :TagbarToggle 303 | 304 | " incsearch.vim 305 | map / (incsearch-forward) 306 | map ? (incsearch-backward) 307 | map g/ (incsearch-stay) 308 | 309 | " vim-easymotion 310 | let g:EasyMotion_smartcase = 1 311 | map w (easymotion-bd-w) 312 | nmap w (easymotion-overwin-w) 313 | 314 | " nerdtree-git-plugin 315 | let g:NERDTreeGitStatusIndicatorMapCustom = { 316 | \ "Modified" : "✹", 317 | \ "Staged" : "✚", 318 | \ "Untracked" : "✭", 319 | \ "Renamed" : "➜", 320 | \ "Unmerged" : "═", 321 | \ "Deleted" : "✖", 322 | \ "Dirty" : "✗", 323 | \ "Clean" : "✔︎", 324 | \ 'Ignored' : '☒', 325 | \ "Unknown" : "?" 326 | \ } 327 | 328 | " LeaderF 329 | nnoremap f :LeaderfFile . 330 | let g:Lf_WildIgnore = { 331 | \ 'dir': ['.svn','.git','.hg','.vscode','.wine','.deepinwine','.oh-my-zsh'], 332 | \ 'file': ['*.sw?','~$*','*.bak','*.exe','*.o','*.so','*.py[co]'] 333 | \} 334 | let g:Lf_UseCache = 0 335 | 336 | " ack 337 | nnoremap F :Ack! 338 | 339 | " echodoc.vim 340 | let g:echodoc_enable_at_startup = 1 341 | 342 | " tabular 343 | nnoremap l :Tab /\| 344 | nnoremap = :Tab /= 345 | 346 | " vim-smooth-scroll 347 | noremap :call smooth_scroll#up(&scroll, 0, 2) 348 | noremap :call smooth_scroll#down(&scroll, 0, 2) 349 | noremap :call smooth_scroll#up(&scroll*2, 0, 4) 350 | noremap :call smooth_scroll#down(&scroll*2, 0, 4) 351 | 352 | " gv 353 | nnoremap g :GV 354 | nnoremap G :GV! 355 | nnoremap gg :GV? 356 | 357 | " 加载自定义配置 358 | if filereadable(expand($HOME . '/.vimrc.custom.config')) 359 | source $HOME/.vimrc.custom.config 360 | endif 361 | 362 | 363 | -------------------------------------------------------------------------------- /.vimrc.custom.config: -------------------------------------------------------------------------------- 1 | 2 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 3 | " 用户自定义配置(该文件放一般性配置,可覆盖~/.vimrc里的配置,若要增加、卸载插件,请放入~/.vimrc.custom.plugins) 4 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 5 | 6 | " 开启相对行号 7 | " set relativenumber 8 | 9 | " 开启鼠标 10 | " set mouse=a 11 | 12 | " 设置光标所在列高亮 13 | " set cursorcolumn 14 | 15 | " indentLine 开启代码对齐线 16 | " let g:indentLine_enabled = 1 17 | 18 | " markdown 19 | " let system = system('uname -s') 20 | " if system == "Darwin\n" 21 | " let g:mkdp_path_to_chrome = "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome" 22 | " else 23 | " let g:mkdp_path_to_chrome = '/usr/bin/google-chrome-stable %U' 24 | " endif 25 | " nmap MarkdownPreview 26 | " imap MarkdownPreview 27 | " nmap StopMarkdownPreview 28 | " imap StopMarkdownPreview 29 | 30 | " Doxygen 31 | " let g:DoxygenToolkit_authorName="chxuan, 787280310@qq.com" 32 | " let s:licenseTag = "Copyright(C)\" 33 | " let s:licenseTag = s:licenseTag . "For free\" 34 | " let s:licenseTag = s:licenseTag . "All right reserved\" 35 | " let g:DoxygenToolkit_licenseTag = s:licenseTag 36 | " let g:DoxygenToolkit_briefTag_funcName="yes" 37 | " let g:doxygen_enhanced_color=1 38 | " let g:DoxygenToolkit_commentType="Qt" 39 | 40 | 41 | -------------------------------------------------------------------------------- /.vimrc.custom.plugins: -------------------------------------------------------------------------------- 1 | 2 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 3 | " 用户自定义插件列表(该文件只放插件,若要增加其他配置,请放入~/.vimrc.custom.config) 4 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 5 | 6 | " 增加~/.vimrc里没有的插件 7 | " 增加插件后需要进行插件安装,安装步骤如下: 8 | " 1.执行:w保存修改 9 | " 2.执行,s重新加载vim配置 10 | " 3.执行,,i进行插件安装 11 | " Plug 'iamcco/mathjax-support-for-mkdp' 12 | " (需要自己安装nodejs和yarn) Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } 13 | " Plug 'Yggdroot/indentLine' 14 | " Plug 'gorodinskiy/vim-coloresque' 15 | " Plug 'vim-scripts/DoxygenToolkit.vim' 16 | 17 | " 卸载/禁用~/.vimrc里的默认插件 18 | " UnPlug 'chxuan/prepare-code' 19 | -------------------------------------------------------------------------------- /.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 | import os 32 | import ycm_core 33 | 34 | # These are the compilation flags that will be used in case there's no 35 | # compilation database set (by default, one is not set). 36 | # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. 37 | flags = [ 38 | '-Wall', 39 | '-Wextra', 40 | # '-Werror', 41 | '-Wno-long-long', 42 | '-Wno-variadic-macros', 43 | '-fexceptions', 44 | '-DNDEBUG', 45 | # You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM 46 | # source code needs it. 47 | '-DUSE_CLANG_COMPLETER', 48 | # THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which 49 | # language to use when compiling headers. So it will guess. Badly. So C++ 50 | # headers will be compiled as C headers. You don't want that so ALWAYS specify 51 | # a "-std=". 52 | # For a C project, you would set this to something like 'c99' instead of 53 | # 'c++11'. 54 | '-std=c++17', 55 | # ...and the same thing goes for the magic -x option which specifies the 56 | # language that the files to be compiled are written in. This is mostly 57 | # relevant for c++ headers. 58 | # For a C project, you would set this to 'c' instead of 'c++'. 59 | '-x', 60 | 'c++', 61 | 62 | # c/c++ include path 63 | '-isystem', 64 | '/usr/include/c++/4.8', 65 | '-isystem', 66 | '/usr/include/c++/4.8.5', 67 | '-isystem', 68 | '/usr/include/c++/4.9.3', 69 | '-isystem', 70 | '/usr/include/c++/5', 71 | '-isystem', 72 | '/usr/include/c++/6', 73 | '-isystem', 74 | '/usr/include/c++/7', 75 | '-isystem', 76 | '/usr/include/c++/8', 77 | '-isystem', 78 | '/usr/include/c++/9', 79 | '-isystem', 80 | '/usr/include/c++/9.1.0', 81 | '-isystem', 82 | '/usr/include/c++/9.3.0', 83 | '-isystem', 84 | '/usr/include/c++/10.2.0', 85 | '-isystem', 86 | '/usr/include', 87 | '-isystem', 88 | '/usr/include/x86_64-linux-gnu', 89 | '-isystem', 90 | '/usr/local/include', 91 | 92 | # Termux 93 | '-isystem', 94 | '/data/data/com.termux/files/usr/include', 95 | '-isystem', 96 | '/data/data/com.termux/files/usr/include/c++/v1', 97 | '-isystem', 98 | '/data/data/com.termux/files/usr/include/c++/v1/experimental', 99 | ] 100 | 101 | 102 | # Set this to the absolute path to the folder (NOT the file!) containing the 103 | # compile_commands.json file to use that instead of 'flags'. See here for 104 | # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html 105 | # 106 | # You can get CMake to generate this file for you by adding: 107 | # set( CMAKE_EXPORT_COMPILE_COMMANDS 1 ) 108 | # to your CMakeLists.txt file. 109 | # 110 | # Most projects will NOT need to set this to anything; you can just change the 111 | # 'flags' list of compilation flags. Notice that YCM itself uses that approach. 112 | compilation_database_folder = '' 113 | 114 | if os.path.exists( compilation_database_folder ): 115 | database = ycm_core.CompilationDatabase( compilation_database_folder ) 116 | else: 117 | database = None 118 | 119 | SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] 120 | 121 | def DirectoryOfThisScript(): 122 | return os.path.dirname( os.path.abspath( __file__ ) ) 123 | 124 | 125 | def IsHeaderFile( filename ): 126 | extension = os.path.splitext( filename )[ 1 ] 127 | return extension in [ '.h', '.hxx', '.hpp', '.hh' ] 128 | 129 | 130 | def GetCompilationInfoForFile( filename ): 131 | # The compilation_commands.json file generated by CMake does not have entries 132 | # for header files. So we do our best by asking the db for flags for a 133 | # corresponding source file, if any. If one exists, the flags for that file 134 | # should be good enough. 135 | if IsHeaderFile( filename ): 136 | basename = os.path.splitext( filename )[ 0 ] 137 | for extension in SOURCE_EXTENSIONS: 138 | replacement_file = basename + extension 139 | if os.path.exists( replacement_file ): 140 | compilation_info = database.GetCompilationInfoForFile( 141 | replacement_file ) 142 | if compilation_info.compiler_flags_: 143 | return compilation_info 144 | return None 145 | return database.GetCompilationInfoForFile( filename ) 146 | 147 | 148 | def FlagsForFile( filename, **kwargs ): 149 | if not database: 150 | return { 151 | 'flags': flags, 152 | 'include_paths_relative_to_dir': DirectoryOfThisScript() 153 | } 154 | 155 | compilation_info = GetCompilationInfoForFile( filename ) 156 | if not compilation_info: 157 | return None 158 | 159 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a 160 | # python list, but a "list-like" StringVec object. 161 | final_flags = list( compilation_info.compiler_flags_ ) 162 | 163 | # NOTE: This is just for YouCompleteMe; it's highly likely that your project 164 | # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR 165 | # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT. 166 | try: 167 | final_flags.remove( '-stdlib=libc++' ) 168 | except ValueError: 169 | pass 170 | 171 | return { 172 | 'flags': final_flags, 173 | 'include_paths_relative_to_dir': compilation_info.compiler_working_dir_ 174 | } 175 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 chxuan 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![vimplus-logo][1] 2 | 3 | An automatic configuration program for vim 4 | =============================================== 5 | 6 |

7 | 8 | 9 | 10 | 11 | 12 | 13 |

14 | 15 | ![main][2] 16 | 17 | ## 安装 18 | 19 | ### Mac OS X 20 | 21 | #### 安装[HomeBrew][3] 22 | 23 | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 24 | 25 | #### 安装vimplus 26 | 27 | git clone https://github.com/chxuan/vimplus.git ~/.vimplus 28 | cd ~/.vimplus 29 | ./install.sh 30 | 31 | 注: apline用户请预先安装git,bash: apk add git bash 32 | 33 | #### 设置Nerd Font 34 | 35 | 为防止vimplus显示乱码,需设置mac终端字体为`Droid Sans Mono Nerd Font`。 36 | 37 | #### 更新vimplus 38 | 39 | 紧跟vimplus的步伐,尝鲜新特性 40 | 41 | ./update.sh 42 | 43 | 44 | ### Linux 64-bit 45 | 46 | #### 支持以下发行版 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |

71 | 72 | 73 | #### 安装vimplus 74 | 75 | git clone https://github.com/chxuan/vimplus.git ~/.vimplus 76 | cd ~/.vimplus 77 | ./install.sh //不加sudo 78 | 79 | #### 设置Nerd Font 80 | 81 | 为防止vimplus显示乱码,需设置linux终端字体为`Droid Sans Mono Nerd Font`。 82 | 83 | #### 多用户支持 84 | 85 | 将vimplus在某个用户下安装好后,若需要在其他用户也能够使用vimplus,则执行 86 | 87 | sudo ./install_to_user.sh username1 username2 //替换为真实用户名 88 | 89 | #### 更新vimplus 90 | 91 | 紧跟vimplus的步伐,尝鲜新特性 92 | 93 | ./update.sh 94 | 95 | 96 | ### Android 64-bit([Termux][87]) 97 | 98 | #### 安装vimplus 99 | 100 | git clone https://github.com/chxuan/vimplus.git ~/.vimplus 101 | cd ~/.vimplus 102 | ./install.sh 103 | 104 | #### 更新vimplus 105 | 106 | 紧跟vimplus的步伐,尝鲜新特性 107 | 108 | ./update.sh 109 | 110 | 111 | ### Docker 112 | 113 | [ubuntu-vimplus][79]是vimplus基于ubuntu18.04的docker镜像,无需安装vimplus,即可快速体验vimplus带来的快乐 114 | 115 | docker run -it chxuan/ubuntu-vimplus 116 | 117 | 118 | ## 自定义 119 | 120 | > * [~/.vimrc][82]为vimplus的默认配置,一般不做修改 121 | > * [~/.vimrc.custom.plugins][83]为用户自定义插件列表,用户增加、卸载插件请修改该文件 122 | > * [~/.vimrc.custom.config][84]为用户自定义配置文件,一般性配置请放入该文件,可覆盖[~/.vimrc][82]里的配置 123 | 124 | 125 | ## 插件列表 126 | 127 | | 插件 | 说明 | 128 | | ------- | ----- | 129 | | [cpp-mode][58] | 提供生成函数实现、函数声明/实现跳转、.h .cpp切换等功能(I'm author:smile:) | 130 | | [vim-edit][72] | 方便的文本编辑插件(I'm author:smile:) | 131 | | [change-colorscheme][27] | 随心所欲切换主题(I'm author:smile:) | 132 | | [prepare-code][67] | 新建文件时,生成预定义代码片段(I'm author:smile:) | 133 | | [vim-buffer][70] | vim缓存操作(I'm author:smile:) | 134 | | [vimplus-startify][66] | vimplus开始页面(修改自[mhinz/vim-startify][25]) | 135 | | [tagbar][13] | 使用[preservim/tagbar][13]的最新版本,[taglist][14]的替代品,显示类/方法/变量 | 136 | | [vim-plug][4] | 比[Vundle][54]下载更快的插件管理软件 | 137 | | [YouCompleteMe][5] | 史上最强大的基于语义的自动补全插件,支持C/C++、C#、Python、PHP等语言 | 138 | | [NerdTree][6] | 代码资源管理器 | 139 | | [vim-nerdtree-syntax-highlight][52] | NerdTree文件类型高亮 | 140 | | [nerdtree-git-plugin][53] | NerdTree显示git状态 | 141 | | [vim-devicons][15] | 显示文件类型图标 | 142 | | [Airline][8] | 可以取代[powerline][9]的状态栏美化插件 | 143 | | [auto-pairs][10] | 自动补全引号、圆括号、花括号等 | 144 | | [LeaderF][56] | 比[ctrlp][12]更强大的文件的模糊搜索工具 | 145 | | [ack][62] | 强大的文本搜索工具 | 146 | | [vim-surround][16] | 自动增加、替换配对符的插件 | 147 | | [vim-commentary][17] | 快速注释代码插件 | 148 | | [vim-repeat][18] | 重复上一次操作 | 149 | | [vim-endwise][19] | if/end/endif/endfunction补全 | 150 | | [tabular][20] | 代码、注释、表格对齐 | 151 | | [vim-easymotion][23] | 强大的光标快速移动工具,强大到颠覆你的插件观 | 152 | | [incsearch.vim][24] | 模糊字符搜索插件 | 153 | | [vim-fugitive][36] | 集成Git | 154 | | [gv][64] | 显示git提交记录 | 155 | | [vim-slash][50] | 优化搜索,移动光标后清除高亮 | 156 | | [echodoc][57] | 补全函数时在命令栏显示函数签名 | 157 | | [vim-smooth-scroll][60] | 让翻页更顺畅 | 158 | | [clever-f.vim][68] | 强化f和F键 | 159 | 160 | 161 | ## 快捷键 162 | 163 | 以下是部分快捷键,可通过vimplus的`,h`命令查看[vimplus帮助文档][59]。 164 | 165 | | 快捷键 | 说明 | 166 | | ------- | ----- | 167 | | `,` | Leader Key | 168 | | `n` | 打开/关闭代码资源管理器 | 169 | | `t` | 打开/关闭函数列表 | 170 | | `a` | .h .cpp 文件切换 | 171 | | `u` | 转到函数声明 | 172 | | `U` | 转到函数实现 | 173 | | `u` | 转到变量声明 | 174 | | `o` | 打开include文件 | 175 | | `y` | 拷贝函数声明 | 176 | | `p` | 生成函数实现 | 177 | | `w` | 单词跳转 | 178 | | `f` | 搜索~目录下的文件 | 179 | | `F` | 搜索当前目录下的文本 | 180 | | `g` | 显示git仓库提交记录 | 181 | | `G` | 显示当前文件提交记录 | 182 | | `gg` | 显示当前文件在某个commit下的完整内容 | 183 | | `ff` | 语法错误自动修复(FixIt) | 184 | | `` | 切换到上一个buffer | 185 | | `` | 切换到下一个buffer | 186 | | `d` | 删除当前buffer | 187 | | `D` | 删除当前buffer外的所有buffer | 188 | | `vim` | 运行vim编辑器时,默认启动开始页面 | 189 | | `` | 显示语法错误提示窗口 | 190 | | `` | 显示上一主题 | 191 | | `` | 显示下一主题 | 192 | | `l` | 按竖线对齐 | 193 | | `=` | 按等号对齐 | 194 | | `Ya` | 复制行文本到字母a | 195 | | `Da` | 剪切行文本到字母a | 196 | | `Ca` | 改写行文本到字母a | 197 | | `rr` | 替换文本 | 198 | | `r` | 全局替换,目前只支持单个文件 | 199 | | `rev` | 翻转当前光标下的单词或使用V模式选择的文本 | 200 | | `gcc` | 注释代码 | 201 | | `gcap` | 注释段落 | 202 | | `vif` | 选中函数内容 | 203 | | `dif` | 删除函数内容 | 204 | | `cif` | 改写函数内容 | 205 | | `vaf` | 选中函数内容(包括函数名 花括号) | 206 | | `daf` | 删除函数内容(包括函数名 花括号) | 207 | | `caf` | 改写函数内容(包括函数名 花括号) | 208 | | `fa` | 查找字母a,然后再按f键查找下一个 | 209 | | `e` | 快速编辑~/.vimrc文件 | 210 | | `s` | 重新加载~/.vimrc文件 | 211 | | `vp` | 快速编辑~/.vimrc.custom.plugins文件 | 212 | | `vc` | 快速编辑~/.vimrc.custom.config文件 | 213 | | `h` | 打开vimplus帮助文档 | 214 | | `H` | 打开当前光标所在单词的vim帮助文档 | 215 | | `t` | 生成try-catch代码块 | 216 | | `y` | 复制当前选中到系统剪切板 | 217 | | `i` | 安装插件 | 218 | | `u` | 更新插件 | 219 | | `c` | 删除插件 | 220 | 221 | 222 | ## FAQ 223 | 224 | - **`vimplus怎么安装新插件?`** 225 | 226 | 编辑[~/.vimrc.custom.plugins][83],添加自定义插件。 227 | 228 | - **`vimplus怎么添加自定义配置?`** 229 | 230 | 编辑[~/.vimrc.custom.config][84],添加自定义配置。 231 | 232 | - **`vimplus安装脚本会在自己电脑上安装哪些软件?`** 233 | 234 | 网络良好情况下,vimplus只需30分钟左右即可将vim cpp环境配置好,vimplus真正的做到了一键配置,不让用户操心。vimplus会安装一些必备软件,比如说python、cmake、gcc、fontconfig等,vimplus也考虑到了有些系统的vim不支持python,它会自动去下载vim源码将python支持编译进去,vimplus也会安装nerd-font不让vim显示出现乱码,最最重要的是vimplus实现了ycm自动编译安装,给折腾了几天ycm都没有安装好的用户带来了新的希望,而且vimplus也支持macos和linux众多发行版,让linux发烧友频繁切换发行版而不用操心vim环境配置。最后说了这么多,不如看[vimplus安装脚本][78]来的直接:smile:。 235 | 236 | - **`启动vim报错:RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.`** 237 | 238 | 可以尝试将cryptography删掉,具体见[issues #208][81]。 239 | 240 | - **`vimplus不支持目前用户正在使用的系统怎么办?`** 241 | 242 | 可以给作者提[Issues][39],或者自己fork vimplus来修改,并提交pr,贡献自己的一份力量。 243 | 244 | - **`安装vimplus后Airline等插件有乱码,怎么解决?`** 245 | 246 | linux和mac系统需设置终端字体为`Droid Sans Mono Nerd Font`。 247 | 248 | - **`xshell连接远程主机不能使用vim-devicons或乱码。`** 249 | 250 | windows系统安装[Nerd Font][51]字体后并更改xshell字体即可。 251 | 252 | - **`ubuntu18.04安装了nerd font但通过终端属性并没有看到该字体。`** 253 | 254 | 可以试试dconf-editor软件来设置,可以参考[这里][76]。 255 | 256 | - **`使用第三方库时怎么让ycm补全第三方库API?`** 257 | 258 | vimplus安装完毕之后,`~`目录下将会生成两个隐藏文件分别是.vimrc和.ycm_extra_conf.py,其中.vimrc是vim的配置文件,.ycm_extra_conf.py是ycm插件的配置文件,当你需要创建一个project时,需要将.ycm_extra_conf.py拷贝到project的顶层目录,通过修改该配置文件里面的`flags`变量来添加你的第三方库路径。 259 | 260 | - **`使用vi命令报错:E492: Not an editor command:`** 261 | 262 | vimplus安装完成后,linux下可能会同时存在vi和vim命令,执行vi时,vi加载~/.vimrc文件可能会报错,但不影响使用,如果要消除错误可以设置软链接`ln -s /usr/bin/vim /usr/bin/vi` 263 | 264 | - **`怎么自定义文件头,比如说添加作者、创建时间?`** 265 | 266 | 你可以修改[chxuan/prepare-code][67]插件来达到目的,可以参考[这里][77]。 267 | 268 | - **`安装vimplus在“[ 95%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o”等进度时出现编译报错`** 269 | 270 | 编译ycm需要消耗较大内存,建议内存大于1G,实在不行也可以开启linux swap分区。 271 | 272 | - **`以上没有我遇到的问题怎么办?`** 273 | 274 | 您可以通过上网找解决方法,或提[Issues][39],也可以通过加QQ`787280310`、发邮件方式`787280310@qq.com`一起讨论解决方法。 275 | 276 | - **`vimplus用起来真的太棒了,怎么办?`** 277 | 278 | 那就麻烦您打赏一颗:star::star:吧,给予我继续维护的动力。 279 | 280 | 281 | ## 贡献者 282 | 283 | > 有代码贡献或有好的建议,帮助vimplus发展的小伙伴 284 | 285 | 286 | chxuan 287 | 288 | 289 | dofy 290 | 291 | 292 | urain39 293 | 294 | 295 | freedomDR 296 | 297 | 298 | starifly 299 | 300 | 301 | Shaloc 302 | 303 | 304 | jokerkeny 305 | 306 | 307 | xuthus5 308 | 309 | 310 | zhoumengkang 311 | 312 | 313 | tuberry 314 | 315 | 316 | wyg1997 317 | 318 | 319 | happinesslijian 320 | 321 | 322 | wangling12 323 | 324 | 325 | ardinzh 326 | 327 | 328 | BD7IWD 329 | 330 | 331 | Ro0tk1t 332 | 333 | 334 | 335 | ## 支持开源:heart: 336 | 337 | > 有意愿献爱心的小伙伴,务必将github账号写入捐款备注哦,谢谢大家 338 | 339 | | wechat | alipay | 340 | | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | 341 | | | | 342 | 343 | | 序号 | 支持者 | RMB | 时间 | 344 | | ----- | ------- | ----- | ----- | 345 | | 1 | [zhoumengkang][80] | ¥50 | 2019-09-28 | 346 | | 2 | [zhoumengkang][80] | ¥50 | 2019-09-29 | 347 | | 3 | [zibraque][85] | ¥50 | 2019-11-25 | 348 | | 4 | [gfreewind][86] | ¥20 | 2019-12-27 | 349 | | 5 | [wh656325437][88] | ¥20 | 2020-07-02 | 350 | | 6 | [luguifang][89] | ¥20 | 2020-07-12 | 351 | | 7 | [liyewen521][90] | ¥20 | 2020-07-27 | 352 | | 8 | [xht19980305][91] | ¥20 | 2020-08-14 | 353 | 354 | 355 | ## vimplus:star:趋势图 356 | 357 | ![Stargazers over time](https://starchart.cc/chxuan/vimplus.svg) 358 | 359 | 360 | ## License 361 | 362 | This software is licensed under the [MIT license][75]. © 2016 chxuan 363 | 364 | 365 | [1]: https://raw.githubusercontent.com/chxuan/vimplus/master/screenshots/vimplus-logo.png 366 | [2]: https://raw.githubusercontent.com/chxuan/vimplus/master/screenshots/main.png 367 | [3]: https://brew.sh/ 368 | [4]: https://github.com/junegunn/vim-plug 369 | [5]: https://github.com/Valloric/YouCompleteMe 370 | [6]: https://github.com/preservim/nerdtree 371 | [8]: https://github.com/vim-airline/vim-airline 372 | [9]: https://github.com/powerline/powerline 373 | [10]: https://github.com/jiangmiao/auto-pairs 374 | [12]: https://github.com/ctrlpvim/ctrlp.vim 375 | [13]: https://github.com/preservim/tagbar 376 | [14]: https://github.com/vim-scripts/taglist.vim 377 | [15]: https://github.com/ryanoasis/vim-devicons 378 | [16]: https://github.com/tpope/vim-surround 379 | [17]: https://github.com/tpope/vim-commentary 380 | [18]: https://github.com/tpope/vim-repeat 381 | [19]: https://github.com/tpope/vim-endwise 382 | [20]: https://github.com/godlygeek/tabular 383 | [23]: https://github.com/easymotion/vim-easymotion 384 | [24]: https://github.com/haya14busa/incsearch.vim 385 | [25]: https://github.com/mhinz/vim-startify 386 | [27]: https://github.com/chxuan/change-colorscheme 387 | [36]: https://github.com/tpope/vim-fugitive 388 | [38]: https://github.com/Valloric/YouCompleteMe 389 | [39]: https://github.com/chxuan/vimplus/issues 390 | [50]: https://github.com/junegunn/vim-slash 391 | [51]: https://github.com/ryanoasis/nerd-fonts 392 | [52]: https://github.com/tiagofumo/vim-nerdtree-syntax-highlight 393 | [53]: https://github.com/Xuyuanp/nerdtree-git-plugin 394 | [54]: https://github.com/VundleVim/Vundle.vim 395 | [56]: https://github.com/Yggdroot/LeaderF 396 | [57]: https://github.com/Shougo/echodoc.vim 397 | [58]: https://github.com/chxuan/cpp-mode 398 | [59]: https://github.com/chxuan/vimplus/blob/master/help.md 399 | [60]: https://github.com/terryma/vim-smooth-scroll 400 | [62]: https://github.com/mileszs/ack.vim 401 | [64]: https://github.com/junegunn/gv.vim 402 | [66]: https://github.com/chxuan/vimplus-startify 403 | [67]: https://github.com/chxuan/prepare-code 404 | [68]: https://github.com/rhysd/clever-f.vim 405 | [70]: https://github.com/chxuan/vim-buffer 406 | [72]: https://github.com/chxuan/vim-edit 407 | [75]: https://github.com/chxuan/vimplus/blob/master/LICENSE 408 | [76]: https://blog.csdn.net/wang73ying/article/details/82491993 409 | [77]: https://blog.csdn.net/liuyangbo121/article/details/82971736 410 | [78]: https://github.com/chxuan/vimplus/blob/master/install.sh 411 | [79]: https://hub.docker.com/r/chxuan/ubuntu-vimplus 412 | [80]: https://github.com/zhoumengkang 413 | [81]: https://github.com/chxuan/vimplus/issues/208 414 | [82]: https://github.com/chxuan/vimplus/blob/master/.vimrc 415 | [83]: https://github.com/chxuan/vimplus/blob/master/.vimrc.custom.plugins 416 | [84]: https://github.com/chxuan/vimplus/blob/master/.vimrc.custom.config 417 | [85]: https://github.com/zibraque 418 | [86]: https://github.com/gfreewind 419 | [87]: https://termux.com/ 420 | [88]: https://github.com/wh656325437 421 | [89]: https://github.com/luguifang 422 | [90]: https://github.com/liyewen521 423 | [91]: https://github.com/xht19980305 424 | 425 | -------------------------------------------------------------------------------- /colors/badwolf.vim: -------------------------------------------------------------------------------- 1 | " _ _ _ __ 2 | " | |__ __ _ __| | __ _____ | |/ _| 3 | " | '_ \ / _` |/ _` | \ \ /\ / / _ \| | |_ 4 | " | |_) | (_| | (_| | \ V V / (_) | | _| 5 | " |_.__/ \__,_|\__,_| \_/\_/ \___/|_|_| 6 | " 7 | " I am the Bad Wolf. I create myself. 8 | " I take the words. I scatter them in time and space. 9 | " A message to lead myself here. 10 | " 11 | " A Vim colorscheme pieced together by Steve Losh. 12 | " Available at http://stevelosh.com/projects/badwolf/ 13 | " 14 | " Why? {{{ 15 | " 16 | " After using Molokai for quite a long time, I started longing for 17 | " a replacement. 18 | " 19 | " I love Molokai's high contrast and gooey, saturated tones, but it can be 20 | " a little inconsistent at times. 21 | " 22 | " Also it's winter here in Rochester, so I wanted a color scheme that's a bit 23 | " warmer. A little less blue and a bit more red. 24 | " 25 | " And so Bad Wolf was born. I'm no designer, but designers have been scattering 26 | " beautiful colors through time and space long before I came along. I took 27 | " advantage of that and reused some of my favorites to lead me to this scheme. 28 | " 29 | " }}} 30 | 31 | " Supporting code ------------------------------------------------------------- 32 | " Preamble {{{ 33 | 34 | if !has("gui_running") && &t_Co != 88 && &t_Co != 256 35 | finish 36 | endif 37 | 38 | set background=dark 39 | 40 | if exists("syntax_on") 41 | syntax reset 42 | endif 43 | 44 | let g:colors_name = "badwolf" 45 | 46 | if !exists("g:badwolf_html_link_underline") " {{{ 47 | let g:badwolf_html_link_underline = 1 48 | endif " }}} 49 | 50 | if !exists("g:badwolf_css_props_highlight") " {{{ 51 | let g:badwolf_css_props_highlight = 0 52 | endif " }}} 53 | 54 | " }}} 55 | " Palette {{{ 56 | 57 | let s:bwc = {} 58 | 59 | " The most basic of all our colors is a slightly tweaked version of the Molokai 60 | " Normal text. 61 | let s:bwc.plain = ['f8f6f2', 15] 62 | 63 | " Pure and simple. 64 | let s:bwc.snow = ['ffffff', 15] 65 | let s:bwc.coal = ['000000', 16] 66 | 67 | " All of the Gravel colors are based on a brown from Clouds Midnight. 68 | let s:bwc.brightgravel = ['d9cec3', 252] 69 | let s:bwc.lightgravel = ['998f84', 245] 70 | let s:bwc.gravel = ['857f78', 243] 71 | let s:bwc.mediumgravel = ['666462', 241] 72 | let s:bwc.deepgravel = ['45413b', 238] 73 | let s:bwc.deepergravel = ['35322d', 236] 74 | let s:bwc.darkgravel = ['242321', 235] 75 | let s:bwc.blackgravel = ['1c1b1a', 233] 76 | let s:bwc.blackestgravel = ['141413', 232] 77 | 78 | " A color sampled from a highlight in a photo of a glass of Dale's Pale Ale on 79 | " my desk. 80 | let s:bwc.dalespale = ['fade3e', 221] 81 | 82 | " A beautiful tan from Tomorrow Night. 83 | let s:bwc.dirtyblonde = ['f4cf86', 222] 84 | 85 | " Delicious, chewy red from Made of Code for the poppiest highlights. 86 | let s:bwc.taffy = ['ff2c4b', 196] 87 | 88 | " Another chewy accent, but use sparingly! 89 | let s:bwc.saltwatertaffy = ['8cffba', 121] 90 | 91 | " The star of the show comes straight from Made of Code. 92 | " 93 | " You should almost never use this. It should be used for things that denote 94 | " 'where the user is', which basically consists of: 95 | " 96 | " * The cursor 97 | " * A REPL prompt 98 | let s:bwc.tardis = ['0a9dff', 39] 99 | 100 | " This one's from Mustang, not Florida! 101 | let s:bwc.orange = ['ffa724', 214] 102 | 103 | " A limier green from Getafe. 104 | let s:bwc.lime = ['aeee00', 154] 105 | 106 | " Rose's dress in The Idiot's Lantern. 107 | let s:bwc.dress = ['ff9eb8', 211] 108 | 109 | " Another play on the brown from Clouds Midnight. I love that color. 110 | let s:bwc.toffee = ['b88853', 137] 111 | 112 | " Also based on that Clouds Midnight brown. 113 | let s:bwc.coffee = ['c7915b', 173] 114 | let s:bwc.darkroast = ['88633f', 95] 115 | 116 | " }}} 117 | " Highlighting Function {{{ 118 | function! s:HL(group, fg, ...) 119 | " Arguments: group, guifg, guibg, gui, guisp 120 | 121 | let histring = 'hi ' . a:group . ' ' 122 | 123 | if strlen(a:fg) 124 | if a:fg == 'fg' 125 | let histring .= 'guifg=fg ctermfg=fg ' 126 | else 127 | let c = get(s:bwc, a:fg) 128 | let histring .= 'guifg=#' . c[0] . ' ctermfg=' . c[1] . ' ' 129 | endif 130 | endif 131 | 132 | if a:0 >= 1 && strlen(a:1) 133 | if a:1 == 'bg' 134 | let histring .= 'guibg=bg ctermbg=bg ' 135 | else 136 | let c = get(s:bwc, a:1) 137 | let histring .= 'guibg=#' . c[0] . ' ctermbg=' . c[1] . ' ' 138 | endif 139 | endif 140 | 141 | if a:0 >= 2 && strlen(a:2) 142 | let histring .= 'gui=' . a:2 . ' cterm=' . a:2 . ' ' 143 | endif 144 | 145 | if a:0 >= 3 && strlen(a:3) 146 | let c = get(s:bwc, a:3) 147 | let histring .= 'guisp=#' . c[0] . ' ' 148 | endif 149 | 150 | " echom histring 151 | 152 | execute histring 153 | endfunction 154 | " }}} 155 | " Configuration Options {{{ 156 | 157 | if exists('g:badwolf_darkgutter') && g:badwolf_darkgutter 158 | let s:gutter = 'blackestgravel' 159 | else 160 | let s:gutter = 'blackgravel' 161 | endif 162 | 163 | if exists('g:badwolf_tabline') 164 | if g:badwolf_tabline == 0 165 | let s:tabline = 'blackestgravel' 166 | elseif g:badwolf_tabline == 1 167 | let s:tabline = 'blackgravel' 168 | elseif g:badwolf_tabline == 2 169 | let s:tabline = 'darkgravel' 170 | elseif g:badwolf_tabline == 3 171 | let s:tabline = 'deepgravel' 172 | else 173 | let s:tabline = 'blackestgravel' 174 | endif 175 | else 176 | let s:tabline = 'blackgravel' 177 | endif 178 | 179 | " }}} 180 | 181 | " Actual colorscheme ---------------------------------------------------------- 182 | " Vanilla Vim {{{ 183 | 184 | " General/UI {{{ 185 | 186 | call s:HL('Normal', 'plain', 'blackgravel') 187 | 188 | call s:HL('Folded', 'mediumgravel', 'bg', 'none') 189 | 190 | call s:HL('VertSplit', 'lightgravel', 'bg', 'none') 191 | 192 | call s:HL('CursorLine', '', 'darkgravel', 'none') 193 | call s:HL('CursorColumn', '', 'darkgravel') 194 | call s:HL('ColorColumn', '', 'darkgravel') 195 | 196 | call s:HL('TabLine', 'plain', s:tabline, 'none') 197 | call s:HL('TabLineFill', 'plain', s:tabline, 'none') 198 | call s:HL('TabLineSel', 'coal', 'tardis', 'none') 199 | 200 | call s:HL('MatchParen', 'dalespale', 'darkgravel', 'bold') 201 | 202 | call s:HL('NonText', 'deepgravel', 'bg') 203 | call s:HL('SpecialKey', 'deepgravel', 'bg') 204 | 205 | call s:HL('Visual', '', 'deepgravel') 206 | call s:HL('VisualNOS', '', 'deepgravel') 207 | 208 | call s:HL('Search', 'coal', 'dalespale', 'bold') 209 | call s:HL('IncSearch', 'coal', 'tardis', 'bold') 210 | 211 | call s:HL('Underlined', 'fg', '', 'underline') 212 | 213 | call s:HL('StatusLine', 'coal', 'tardis', 'bold') 214 | call s:HL('StatusLineNC', 'snow', 'deepgravel', 'bold') 215 | 216 | call s:HL('Directory', 'dirtyblonde', '', 'bold') 217 | 218 | call s:HL('Title', 'lime') 219 | 220 | call s:HL('ErrorMsg', 'taffy', 'bg', 'bold') 221 | call s:HL('MoreMsg', 'dalespale', '', 'bold') 222 | call s:HL('ModeMsg', 'dirtyblonde', '', 'bold') 223 | call s:HL('Question', 'dirtyblonde', '', 'bold') 224 | call s:HL('WarningMsg', 'dress', '', 'bold') 225 | 226 | " This is a ctags tag, not an HTML one. 'Something you can use c-] on'. 227 | call s:HL('Tag', '', '', 'bold') 228 | 229 | " hi IndentGuides guibg=#373737 230 | " hi WildMenu guifg=#66D9EF guibg=#000000 231 | 232 | " }}} 233 | " Gutter {{{ 234 | 235 | call s:HL('LineNr', 'mediumgravel', s:gutter) 236 | call s:HL('SignColumn', '', s:gutter) 237 | call s:HL('FoldColumn', 'mediumgravel', s:gutter) 238 | 239 | " }}} 240 | " Cursor {{{ 241 | 242 | call s:HL('Cursor', 'coal', 'tardis', 'bold') 243 | call s:HL('vCursor', 'coal', 'tardis', 'bold') 244 | call s:HL('iCursor', 'coal', 'tardis', 'none') 245 | 246 | " }}} 247 | " Syntax highlighting {{{ 248 | 249 | " Start with a simple base. 250 | call s:HL('Special', 'plain') 251 | 252 | " Comments are slightly brighter than folds, to make 'headers' easier to see. 253 | call s:HL('Comment', 'gravel') 254 | call s:HL('Todo', 'snow', 'bg', 'bold') 255 | call s:HL('SpecialComment', 'snow', 'bg', 'bold') 256 | 257 | " Strings are a nice, pale straw color. Nothing too fancy. 258 | call s:HL('String', 'dirtyblonde') 259 | 260 | " Control flow stuff is taffy. 261 | call s:HL('Statement', 'taffy', '', 'bold') 262 | call s:HL('Keyword', 'taffy', '', 'bold') 263 | call s:HL('Conditional', 'taffy', '', 'bold') 264 | call s:HL('Operator', 'taffy', '', 'none') 265 | call s:HL('Label', 'taffy', '', 'none') 266 | call s:HL('Repeat', 'taffy', '', 'none') 267 | 268 | " Functions and variable declarations are orange, because plain looks weird. 269 | call s:HL('Identifier', 'orange', '', 'none') 270 | call s:HL('Function', 'orange', '', 'none') 271 | 272 | " Preprocessor stuff is lime, to make it pop. 273 | " 274 | " This includes imports in any given language, because they should usually be 275 | " grouped together at the beginning of a file. If they're in the middle of some 276 | " other code they should stand out, because something tricky is 277 | " probably going on. 278 | call s:HL('PreProc', 'lime', '', 'none') 279 | call s:HL('Macro', 'lime', '', 'none') 280 | call s:HL('Define', 'lime', '', 'none') 281 | call s:HL('PreCondit', 'lime', '', 'bold') 282 | 283 | " Constants of all kinds are colored together. 284 | " I'm not really happy with the color yet... 285 | call s:HL('Constant', 'toffee', '', 'bold') 286 | call s:HL('Character', 'toffee', '', 'bold') 287 | call s:HL('Boolean', 'toffee', '', 'bold') 288 | 289 | call s:HL('Number', 'toffee', '', 'bold') 290 | call s:HL('Float', 'toffee', '', 'bold') 291 | 292 | " Not sure what 'special character in a constant' means, but let's make it pop. 293 | call s:HL('SpecialChar', 'dress', '', 'bold') 294 | 295 | call s:HL('Type', 'dress', '', 'none') 296 | call s:HL('StorageClass', 'taffy', '', 'none') 297 | call s:HL('Structure', 'taffy', '', 'none') 298 | call s:HL('Typedef', 'taffy', '', 'bold') 299 | 300 | " Make try/catch blocks stand out. 301 | call s:HL('Exception', 'lime', '', 'bold') 302 | 303 | " Misc 304 | call s:HL('Error', 'snow', 'taffy', 'bold') 305 | call s:HL('Debug', 'snow', '', 'bold') 306 | call s:HL('Ignore', 'gravel', '', '') 307 | 308 | " }}} 309 | " Completion Menu {{{ 310 | 311 | call s:HL('Pmenu', 'plain', 'deepergravel') 312 | call s:HL('PmenuSel', 'coal', 'tardis', 'bold') 313 | call s:HL('PmenuSbar', '', 'deepergravel') 314 | call s:HL('PmenuThumb', 'brightgravel') 315 | 316 | " }}} 317 | " Diffs {{{ 318 | 319 | call s:HL('DiffDelete', 'coal', 'coal') 320 | call s:HL('DiffAdd', '', 'deepergravel') 321 | call s:HL('DiffChange', '', 'darkgravel') 322 | call s:HL('DiffText', 'snow', 'deepergravel', 'bold') 323 | 324 | " }}} 325 | " Spelling {{{ 326 | 327 | if has("spell") 328 | call s:HL('SpellCap', 'dalespale', 'bg', 'undercurl,bold', 'dalespale') 329 | call s:HL('SpellBad', '', 'bg', 'undercurl', 'dalespale') 330 | call s:HL('SpellLocal', '', '', 'undercurl', 'dalespale') 331 | call s:HL('SpellRare', '', '', 'undercurl', 'dalespale') 332 | endif 333 | 334 | " }}} 335 | 336 | " }}} 337 | " Plugins {{{ 338 | 339 | " CtrlP {{{ 340 | 341 | " the message when no match is found 342 | call s:HL('CtrlPNoEntries', 'snow', 'taffy', 'bold') 343 | 344 | " the matched pattern 345 | call s:HL('CtrlPMatch', 'orange', 'bg', 'none') 346 | 347 | " the line prefix '>' in the match window 348 | call s:HL('CtrlPLinePre', 'deepgravel', 'bg', 'none') 349 | 350 | " the prompt’s base 351 | call s:HL('CtrlPPrtBase', 'deepgravel', 'bg', 'none') 352 | 353 | " the prompt’s text 354 | call s:HL('CtrlPPrtText', 'plain', 'bg', 'none') 355 | 356 | " the prompt’s cursor when moving over the text 357 | call s:HL('CtrlPPrtCursor', 'coal', 'tardis', 'bold') 358 | 359 | " 'prt' or 'win', also for 'regex' 360 | call s:HL('CtrlPMode1', 'coal', 'tardis', 'bold') 361 | 362 | " 'file' or 'path', also for the local working dir 363 | call s:HL('CtrlPMode2', 'coal', 'tardis', 'bold') 364 | 365 | " the scanning status 366 | call s:HL('CtrlPStats', 'coal', 'tardis', 'bold') 367 | 368 | " TODO: CtrlP extensions. 369 | " CtrlPTabExtra : the part of each line that’s not matched against (Comment) 370 | " CtrlPqfLineCol : the line and column numbers in quickfix mode (|s:HL-Search|) 371 | " CtrlPUndoT : the elapsed time in undo mode (|s:HL-Directory|) 372 | " CtrlPUndoBr : the square brackets [] in undo mode (Comment) 373 | " CtrlPUndoNr : the undo number inside [] in undo mode (String) 374 | 375 | " }}} 376 | " EasyMotion {{{ 377 | 378 | call s:HL('EasyMotionTarget', 'tardis', 'bg', 'bold') 379 | call s:HL('EasyMotionShade', 'deepgravel', 'bg') 380 | 381 | " }}} 382 | " Interesting Words {{{ 383 | 384 | " These are only used if you're me or have copied the hNUM mappings 385 | " from my Vimrc. 386 | call s:HL('InterestingWord1', 'coal', 'orange') 387 | call s:HL('InterestingWord2', 'coal', 'lime') 388 | call s:HL('InterestingWord3', 'coal', 'saltwatertaffy') 389 | call s:HL('InterestingWord4', 'coal', 'toffee') 390 | call s:HL('InterestingWord5', 'coal', 'dress') 391 | call s:HL('InterestingWord6', 'coal', 'taffy') 392 | 393 | 394 | " }}} 395 | " Makegreen {{{ 396 | 397 | " hi GreenBar term=reverse ctermfg=white ctermbg=green guifg=coal guibg=#9edf1c 398 | " hi RedBar term=reverse ctermfg=white ctermbg=red guifg=white guibg=#C50048 399 | 400 | " }}} 401 | " Rainbow Parentheses {{{ 402 | 403 | call s:HL('level16c', 'mediumgravel', '', 'bold') 404 | call s:HL('level15c', 'dalespale', '', '') 405 | call s:HL('level14c', 'dress', '', '') 406 | call s:HL('level13c', 'orange', '', '') 407 | call s:HL('level12c', 'tardis', '', '') 408 | call s:HL('level11c', 'lime', '', '') 409 | call s:HL('level10c', 'toffee', '', '') 410 | call s:HL('level9c', 'saltwatertaffy', '', '') 411 | call s:HL('level8c', 'coffee', '', '') 412 | call s:HL('level7c', 'dalespale', '', '') 413 | call s:HL('level6c', 'dress', '', '') 414 | call s:HL('level5c', 'orange', '', '') 415 | call s:HL('level4c', 'tardis', '', '') 416 | call s:HL('level3c', 'lime', '', '') 417 | call s:HL('level2c', 'toffee', '', '') 418 | call s:HL('level1c', 'saltwatertaffy', '', '') 419 | 420 | " }}} 421 | " ShowMarks {{{ 422 | 423 | call s:HL('ShowMarksHLl', 'tardis', 'blackgravel') 424 | call s:HL('ShowMarksHLu', 'tardis', 'blackgravel') 425 | call s:HL('ShowMarksHLo', 'tardis', 'blackgravel') 426 | call s:HL('ShowMarksHLm', 'tardis', 'blackgravel') 427 | 428 | " }}} 429 | 430 | " }}} 431 | " Filetype-specific {{{ 432 | 433 | " Clojure {{{ 434 | 435 | call s:HL('clojureSpecial', 'taffy', '', '') 436 | call s:HL('clojureDefn', 'taffy', '', '') 437 | call s:HL('clojureDefMacro', 'taffy', '', '') 438 | call s:HL('clojureDefine', 'taffy', '', '') 439 | call s:HL('clojureMacro', 'taffy', '', '') 440 | call s:HL('clojureCond', 'taffy', '', '') 441 | 442 | call s:HL('clojureKeyword', 'orange', '', 'none') 443 | 444 | call s:HL('clojureFunc', 'dress', '', 'none') 445 | call s:HL('clojureRepeat', 'dress', '', 'none') 446 | 447 | call s:HL('clojureParen0', 'lightgravel', '', 'none') 448 | 449 | call s:HL('clojureAnonArg', 'snow', '', 'bold') 450 | 451 | " }}} 452 | " Common Lisp {{{ 453 | 454 | call s:HL('lispFunc', 'lime', '', 'none') 455 | call s:HL('lispVar', 'orange', '', 'bold') 456 | call s:HL('lispEscapeSpecial', 'orange', '', 'none') 457 | 458 | " }}} 459 | " CSS {{{ 460 | 461 | if g:badwolf_css_props_highlight 462 | call s:HL('cssColorProp', 'taffy', '', 'none') 463 | call s:HL('cssBoxProp', 'taffy', '', 'none') 464 | call s:HL('cssTextProp', 'taffy', '', 'none') 465 | call s:HL('cssRenderProp', 'taffy', '', 'none') 466 | call s:HL('cssGeneratedContentProp', 'taffy', '', 'none') 467 | else 468 | call s:HL('cssColorProp', 'fg', '', 'none') 469 | call s:HL('cssBoxProp', 'fg', '', 'none') 470 | call s:HL('cssTextProp', 'fg', '', 'none') 471 | call s:HL('cssRenderProp', 'fg', '', 'none') 472 | call s:HL('cssGeneratedContentProp', 'fg', '', 'none') 473 | end 474 | 475 | call s:HL('cssValueLength', 'toffee', '', 'bold') 476 | call s:HL('cssColor', 'toffee', '', 'bold') 477 | call s:HL('cssBraces', 'lightgravel', '', 'none') 478 | call s:HL('cssIdentifier', 'orange', '', 'bold') 479 | call s:HL('cssClassName', 'orange', '', 'none') 480 | 481 | " }}} 482 | " Diff {{{ 483 | 484 | call s:HL('gitDiff', 'lightgravel', '',) 485 | 486 | call s:HL('diffRemoved', 'dress', '',) 487 | call s:HL('diffAdded', 'lime', '',) 488 | call s:HL('diffFile', 'coal', 'taffy', 'bold') 489 | call s:HL('diffNewFile', 'coal', 'taffy', 'bold') 490 | 491 | call s:HL('diffLine', 'coal', 'orange', 'bold') 492 | call s:HL('diffSubname', 'orange', '', 'none') 493 | 494 | " }}} 495 | " Django Templates {{{ 496 | 497 | call s:HL('djangoArgument', 'dirtyblonde', '',) 498 | call s:HL('djangoTagBlock', 'orange', '') 499 | call s:HL('djangoVarBlock', 'orange', '') 500 | " hi djangoStatement guifg=#ff3853 gui=bold 501 | " hi djangoVarBlock guifg=#f4cf86 502 | 503 | " }}} 504 | " HTML {{{ 505 | 506 | " Punctuation 507 | call s:HL('htmlTag', 'darkroast', 'bg', 'none') 508 | call s:HL('htmlEndTag', 'darkroast', 'bg', 'none') 509 | 510 | " Tag names 511 | call s:HL('htmlTagName', 'coffee', '', 'bold') 512 | call s:HL('htmlSpecialTagName', 'coffee', '', 'bold') 513 | call s:HL('htmlSpecialChar', 'lime', '', 'none') 514 | 515 | " Attributes 516 | call s:HL('htmlArg', 'coffee', '', 'none') 517 | 518 | " Stuff inside an tag 519 | 520 | if g:badwolf_html_link_underline 521 | call s:HL('htmlLink', 'lightgravel', '', 'underline') 522 | else 523 | call s:HL('htmlLink', 'lightgravel', '', 'none') 524 | endif 525 | 526 | " }}} 527 | " Java {{{ 528 | 529 | call s:HL('javaClassDecl', 'taffy', '', 'bold') 530 | call s:HL('javaScopeDecl', 'taffy', '', 'bold') 531 | call s:HL('javaCommentTitle', 'gravel', '') 532 | call s:HL('javaDocTags', 'snow', '', 'none') 533 | call s:HL('javaDocParam', 'dalespale', '', '') 534 | 535 | " }}} 536 | " LaTeX {{{ 537 | 538 | call s:HL('texStatement', 'tardis', '', 'none') 539 | call s:HL('texMathZoneX', 'orange', '', 'none') 540 | call s:HL('texMathZoneA', 'orange', '', 'none') 541 | call s:HL('texMathZoneB', 'orange', '', 'none') 542 | call s:HL('texMathZoneC', 'orange', '', 'none') 543 | call s:HL('texMathZoneD', 'orange', '', 'none') 544 | call s:HL('texMathZoneE', 'orange', '', 'none') 545 | call s:HL('texMathZoneV', 'orange', '', 'none') 546 | call s:HL('texMathZoneX', 'orange', '', 'none') 547 | call s:HL('texMath', 'orange', '', 'none') 548 | call s:HL('texMathMatcher', 'orange', '', 'none') 549 | call s:HL('texRefLabel', 'dirtyblonde', '', 'none') 550 | call s:HL('texRefZone', 'lime', '', 'none') 551 | call s:HL('texComment', 'darkroast', '', 'none') 552 | call s:HL('texDelimiter', 'orange', '', 'none') 553 | call s:HL('texZone', 'brightgravel', '', 'none') 554 | 555 | augroup badwolf_tex 556 | au! 557 | 558 | au BufRead,BufNewFile *.tex syn region texMathZoneV start="\\(" end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup 559 | au BufRead,BufNewFile *.tex syn region texMathZoneX start="\$" skip="\\\\\|\\\$" end="\$\|%stopzone\>" keepend contains=@texMathZoneGroup 560 | augroup END 561 | 562 | " }}} 563 | " LessCSS {{{ 564 | 565 | call s:HL('lessVariable', 'lime', '', 'none') 566 | 567 | " }}} 568 | " Lispyscript {{{ 569 | 570 | call s:HL('lispyscriptDefMacro', 'lime', '', '') 571 | call s:HL('lispyscriptRepeat', 'dress', '', 'none') 572 | 573 | " }}} 574 | " REPLs {{{ 575 | " This isn't a specific plugin, but just useful highlight classes for anything 576 | " that might want to use them. 577 | 578 | call s:HL('replPrompt', 'tardis', '', 'bold') 579 | 580 | " }}} 581 | " Mail {{{ 582 | 583 | call s:HL('mailSubject', 'orange', '', 'bold') 584 | call s:HL('mailHeader', 'lightgravel', '', '') 585 | call s:HL('mailHeaderKey', 'lightgravel', '', '') 586 | call s:HL('mailHeaderEmail', 'snow', '', '') 587 | call s:HL('mailURL', 'toffee', '', 'underline') 588 | call s:HL('mailSignature', 'gravel', '', 'none') 589 | 590 | call s:HL('mailQuoted1', 'gravel', '', 'none') 591 | call s:HL('mailQuoted2', 'dress', '', 'none') 592 | call s:HL('mailQuoted3', 'dirtyblonde', '', 'none') 593 | call s:HL('mailQuoted4', 'orange', '', 'none') 594 | call s:HL('mailQuoted5', 'lime', '', 'none') 595 | 596 | " }}} 597 | " Markdown {{{ 598 | 599 | call s:HL('markdownHeadingRule', 'lightgravel', '', 'bold') 600 | call s:HL('markdownHeadingDelimiter', 'lightgravel', '', 'bold') 601 | call s:HL('markdownOrderedListMarker', 'lightgravel', '', 'bold') 602 | call s:HL('markdownListMarker', 'lightgravel', '', 'bold') 603 | call s:HL('markdownItalic', 'snow', '', 'bold') 604 | call s:HL('markdownBold', 'snow', '', 'bold') 605 | call s:HL('markdownH1', 'orange', '', 'bold') 606 | call s:HL('markdownH2', 'lime', '', 'bold') 607 | call s:HL('markdownH3', 'lime', '', 'none') 608 | call s:HL('markdownH4', 'lime', '', 'none') 609 | call s:HL('markdownH5', 'lime', '', 'none') 610 | call s:HL('markdownH6', 'lime', '', 'none') 611 | call s:HL('markdownLinkText', 'toffee', '', 'underline') 612 | call s:HL('markdownIdDeclaration', 'toffee') 613 | call s:HL('markdownAutomaticLink', 'toffee', '', 'bold') 614 | call s:HL('markdownUrl', 'toffee', '', 'bold') 615 | call s:HL('markdownUrldelimiter', 'lightgravel', '', 'bold') 616 | call s:HL('markdownLinkDelimiter', 'lightgravel', '', 'bold') 617 | call s:HL('markdownLinkTextDelimiter', 'lightgravel', '', 'bold') 618 | call s:HL('markdownCodeDelimiter', 'dirtyblonde', '', 'bold') 619 | call s:HL('markdownCode', 'dirtyblonde', '', 'none') 620 | call s:HL('markdownCodeBlock', 'dirtyblonde', '', 'none') 621 | 622 | " }}} 623 | " MySQL {{{ 624 | 625 | call s:HL('mysqlSpecial', 'dress', '', 'bold') 626 | 627 | " }}} 628 | " Python {{{ 629 | 630 | hi def link pythonOperator Operator 631 | call s:HL('pythonBuiltin', 'dress') 632 | call s:HL('pythonBuiltinObj', 'dress') 633 | call s:HL('pythonBuiltinFunc', 'dress') 634 | call s:HL('pythonEscape', 'dress') 635 | call s:HL('pythonException', 'lime', '', 'bold') 636 | call s:HL('pythonExceptions', 'lime', '', 'none') 637 | call s:HL('pythonPrecondit', 'lime', '', 'none') 638 | call s:HL('pythonDecorator', 'taffy', '', 'none') 639 | call s:HL('pythonRun', 'gravel', '', 'bold') 640 | call s:HL('pythonCoding', 'gravel', '', 'bold') 641 | 642 | " }}} 643 | " SLIMV {{{ 644 | 645 | " Rainbow parentheses 646 | call s:HL('hlLevel0', 'gravel') 647 | call s:HL('hlLevel1', 'orange') 648 | call s:HL('hlLevel2', 'saltwatertaffy') 649 | call s:HL('hlLevel3', 'dress') 650 | call s:HL('hlLevel4', 'coffee') 651 | call s:HL('hlLevel5', 'dirtyblonde') 652 | call s:HL('hlLevel6', 'orange') 653 | call s:HL('hlLevel7', 'saltwatertaffy') 654 | call s:HL('hlLevel8', 'dress') 655 | call s:HL('hlLevel9', 'coffee') 656 | 657 | " }}} 658 | " Vim {{{ 659 | 660 | call s:HL('VimCommentTitle', 'lightgravel', '', 'bold') 661 | 662 | call s:HL('VimMapMod', 'dress', '', 'none') 663 | call s:HL('VimMapModKey', 'dress', '', 'none') 664 | call s:HL('VimNotation', 'dress', '', 'none') 665 | call s:HL('VimBracket', 'dress', '', 'none') 666 | 667 | " }}} 668 | 669 | " }}} 670 | 671 | -------------------------------------------------------------------------------- /colors/dracula.vim: -------------------------------------------------------------------------------- 1 | " Dracula Theme v1.2.5 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 Éverton Ribeiro 11 | " @author Zeno Rocha 12 | 13 | set background=dark 14 | highlight clear 15 | 16 | if exists("syntax_on") 17 | syntax reset 18 | endif 19 | 20 | let g:colors_name = "dracula" 21 | 22 | hi Cursor ctermfg=17 ctermbg=231 cterm=NONE guifg=#282a36 guibg=#f8f8f0 gui=NONE 23 | hi Visual ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#44475a gui=NONE 24 | hi CursorLine ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE 25 | hi CursorColumn ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE 26 | hi ColorColumn ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE 27 | hi LineNr ctermfg=246 ctermbg=236 cterm=NONE guifg=#909194 guibg=#3d3f49 gui=NONE 28 | hi VertSplit ctermfg=59 ctermbg=236 cterm=NONE guifg=#64666d guibg=#64666d gui=NONE 29 | hi MatchParen ctermfg=212 ctermbg=NONE cterm=underline guifg=#ff79c6 guibg=NONE gui=underline 30 | hi StatusLine ctermfg=231 ctermbg=236 cterm=bold guifg=#f8f8f2 guibg=#64666d gui=bold 31 | hi StatusLineNC ctermfg=231 ctermbg=236 cterm=NONE guifg=#f8f8f2 guibg=#64666d gui=NONE 32 | hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 33 | hi PmenuSel ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#44475a gui=NONE 34 | hi IncSearch ctermfg=17 ctermbg=228 cterm=NONE guifg=#282a36 guibg=#f1fa8c gui=NONE 35 | hi Search ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline 36 | hi Directory ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 37 | hi Folded ctermfg=61 ctermbg=235 cterm=NONE guifg=#6272a4 guibg=#282a36 gui=NONE 38 | hi Normal ctermfg=231 ctermbg=235 cterm=NONE guifg=#f8f8f2 guibg=#282a36 gui=NONE 39 | hi Boolean ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 40 | hi Character ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 41 | hi Comment ctermfg=61 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=NONE gui=NONE 42 | hi Conditional ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 43 | hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 44 | hi Define ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 45 | hi DiffAdd ctermfg=231 ctermbg=64 cterm=bold guifg=#f8f8f2 guibg=#468410 gui=bold 46 | hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8b080b guibg=NONE gui=NONE 47 | hi DiffChange ctermfg=231 ctermbg=23 cterm=NONE guifg=#f8f8f2 guibg=#243a5f gui=NONE 48 | hi DiffText ctermfg=231 ctermbg=24 cterm=bold guifg=#f8f8f2 guibg=#204a87 gui=bold 49 | hi ErrorMsg ctermfg=231 ctermbg=212 cterm=NONE guifg=#f8f8f0 guibg=#ff79c6 gui=NONE 50 | hi WarningMsg ctermfg=231 ctermbg=212 cterm=NONE guifg=#f8f8f0 guibg=#ff79c6 gui=NONE 51 | hi Float ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 52 | hi Function ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 53 | hi Identifier ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic 54 | hi Keyword ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 55 | hi Label ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 56 | hi NonText ctermfg=231 ctermbg=235 cterm=NONE guifg=#525563 guibg=#282a36 gui=NONE 57 | hi Number ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 58 | hi Operator ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 59 | hi PreProc ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 60 | hi Special ctermfg=231 ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=NONE gui=NONE 61 | hi SpecialKey ctermfg=231 ctermbg=235 cterm=NONE guifg=#525563 guibg=#282a36 gui=NONE 62 | hi Statement ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 63 | hi StorageClass ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic 64 | hi String ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 65 | hi Tag ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 66 | hi Title ctermfg=231 ctermbg=NONE cterm=bold guifg=#f8f8f2 guibg=NONE gui=bold 67 | hi Todo ctermfg=61 ctermbg=NONE cterm=inverse,bold guifg=#6272a4 guibg=NONE gui=inverse,bold 68 | hi Type ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 69 | hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline 70 | hi rubyClass ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 71 | hi rubyFunction ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 72 | hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 73 | hi rubySymbol ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 74 | hi rubyConstant ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 75 | hi rubyStringDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 76 | hi rubyBlockParameter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic 77 | hi rubyInstanceVariable ctermfg=203 ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 78 | hi rubyInclude ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 79 | hi rubyGlobalVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 80 | hi rubyRegexp ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 81 | hi rubyRegexpDelimiter ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 82 | hi rubyEscape ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 83 | hi rubyControl ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 84 | hi rubyClassVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 85 | hi rubyOperator ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 86 | hi rubyException ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 87 | hi rubyPseudoVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 88 | hi rubyRailsUserClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic 89 | hi rubyRailsARAssociationMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 90 | hi rubyRailsARMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 91 | hi rubyRailsRenderMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 92 | hi rubyRailsMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 93 | hi erubyDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 94 | hi erubyComment ctermfg=61 ctermbg=NONE cterm=NONE guifg=#6272a4 guibg=NONE gui=NONE 95 | hi erubyRailsMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 96 | hi htmlTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 97 | hi htmlEndTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 98 | hi htmlTagName ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 99 | hi htmlArg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 100 | hi htmlSpecialChar ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 101 | hi javaScriptFunction ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=italic 102 | hi javaScriptRailsFunction ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 103 | hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 104 | hi yamlKey ctermfg=212 ctermbg=NONE cterm=NONE guifg=#ff79c6 guibg=NONE gui=NONE 105 | hi yamlAnchor ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 106 | hi yamlAlias ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 107 | hi yamlDocumentHeader ctermfg=228 ctermbg=NONE cterm=NONE guifg=#f1fa8c guibg=NONE gui=NONE 108 | hi cssURL ctermfg=215 ctermbg=NONE cterm=NONE guifg=#ffb86c guibg=NONE gui=italic 109 | hi cssFunctionName ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 110 | hi cssColor ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 111 | hi cssPseudoClassId ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 112 | hi cssClassName ctermfg=84 ctermbg=NONE cterm=NONE guifg=#50fa7b guibg=NONE gui=NONE 113 | hi cssValueLength ctermfg=141 ctermbg=NONE cterm=NONE guifg=#bd93f9 guibg=NONE gui=NONE 114 | hi cssCommonAttr ctermfg=81 ctermbg=NONE cterm=NONE guifg=#6be5fd guibg=NONE gui=NONE 115 | hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE 116 | 117 | hi goMethod ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 118 | hi goType ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 119 | hi goBuiltins ctermfg=117 ctermbg=NONE cterm=NONE guifg=#8be9fd guibg=NONE gui=NONE 120 | 121 | -------------------------------------------------------------------------------- /colors/monokai.vim: -------------------------------------------------------------------------------- 1 | " File: monokai.vim 2 | " Maintainer: Crusoe Xia (crusoexia) 3 | " URL: https://github.com/crusoexia/vim-monokai 4 | " License: MIT 5 | " 6 | " The colour palette is from http://www.colourlovers.com/ 7 | " The original code is from https://github.com/w0ng/vim-hybrid 8 | " 9 | " Configuration: 10 | " 11 | " * Enable italic: 12 | " 13 | " let g:monokai_term_italic = 1 14 | " 15 | " Initialisation 16 | " -------------- 17 | 18 | if !has("gui_running") && &t_Co < 256 19 | finish 20 | endif 21 | 22 | if ! exists("g:monokai_term_italic") 23 | let g:monokai_term_italic = 0 24 | endif 25 | 26 | let g:monokai_termcolors = 256 " does not support 16 color term right now. 27 | 28 | set background=dark 29 | hi clear 30 | 31 | if exists("syntax_on") 32 | syntax reset 33 | endif 34 | 35 | let colors_name = "monokai" 36 | 37 | function! s:h(group, style) 38 | let s:ctermformat = "NONE" 39 | if g:monokai_term_italic == 0 && has_key(a:style, "format") 40 | let s:ctermformat = substitute(a:style.format, ",italic", "", "") 41 | let s:ctermformat = substitute(s:ctermformat, "italic,", "", "") 42 | let s:ctermformat = substitute(s:ctermformat, "italic", "", "") 43 | endif 44 | if g:monokai_termcolors == 16 45 | let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm16 : "NONE") 46 | let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm16 : "NONE") 47 | else 48 | let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE") 49 | let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE") 50 | end 51 | execute "highlight" a:group 52 | \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE") 53 | \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE") 54 | \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE") 55 | \ "gui=" (has_key(a:style, "format") && !empty(a:style["format"]) ? "NONE,".a:style.format : "NONE") 56 | \ "ctermfg=" . l:ctermfg 57 | \ "ctermbg=" . l:ctermbg 58 | \ "cterm=" (!empty(s:ctermformat) ? s:ctermformat : "NONE") 59 | endfunction 60 | 61 | " Palettes 62 | " -------- 63 | 64 | 65 | let s:white = { "gui": "#E8E8E3", "cterm": "252" } 66 | let s:black = { "gui": "#272822", "cterm": "234" } 67 | let s:lightblack = { "gui": "#2D2E27", "cterm": "235" } 68 | let s:lightblack2 = { "gui": "#383a3e", "cterm": "236" } 69 | let s:darkblack = { "gui": "#211F1C", "cterm": "233" } 70 | let s:grey = { "gui": "#8F908A", "cterm": "243" } 71 | let s:lightgrey = { "gui": "#575b61", "cterm": "237" } 72 | let s:darkgrey = { "gui": "#64645e", "cterm": "239" } 73 | let s:warmgrey = { "gui": "#75715E", "cterm": "59" } 74 | 75 | let s:pink = { "gui": "#F92772", "cterm": "197" } 76 | let s:green = { "gui": "#A6E22D", "cterm": "148" } 77 | let s:aqua = { "gui": "#66d9ef", "cterm": "81" } 78 | let s:yellow = { "gui": "#E6DB74", "cterm": "186" } 79 | let s:orange = { "gui": "#FD9720", "cterm": "208" } 80 | let s:purple = { "gui": "#ae81ff", "cterm": "141" } 81 | let s:red = { "gui": "#e73c50", "cterm": "196" } 82 | let s:darkred = { "gui": "#5f0000", "cterm": "52" } 83 | 84 | let s:addfg = { "gui": "#d7ffaf", "cterm": "193" } 85 | let s:addbg = { "gui": "#5f875f", "cterm": "65" } 86 | let s:delbg = { "gui": "#f75f5f", "cterm": "167" } 87 | let s:changefg = { "gui": "#d7d7ff", "cterm": "189" } 88 | let s:changebg = { "gui": "#5f5f87", "cterm": "60" } 89 | 90 | " Highlighting 91 | " ------------ 92 | 93 | " editor 94 | call s:h("Normal", { "fg": s:white, "bg": s:black }) 95 | call s:h("ColorColumn", { "bg": s:lightblack }) 96 | call s:h("CursorColumn", { "bg": s:lightblack2 }) 97 | call s:h("CursorLine", { "bg": s:lightblack2 }) 98 | call s:h("NonText", { "fg": s:lightgrey }) 99 | call s:h("StatusLine", { "fg": s:warmgrey, "bg": s:black, "format": "reverse" }) 100 | call s:h("StatusLineNC", { "fg": s:darkgrey, "bg": s:warmgrey, "format": "reverse" }) 101 | call s:h("TabLine", { "fg": s:white, "bg": s:darkblack, "format": "reverse" }) 102 | call s:h("Visual", { "bg": s:lightgrey }) 103 | call s:h("Search", { "fg": s:black, "bg": s:yellow }) 104 | call s:h("MatchParen", { "fg": s:black, "bg": s:purple }) 105 | call s:h("Question", { "fg": s:yellow }) 106 | call s:h("ModeMsg", { "fg": s:yellow }) 107 | call s:h("MoreMsg", { "fg": s:yellow }) 108 | call s:h("ErrorMsg", { "fg": s:black, "bg": s:red, "format": "standout" }) 109 | call s:h("WarningMsg", { "fg": s:red }) 110 | call s:h("VertSplit", { "fg": s:darkgrey, "bg": s:darkblack }) 111 | call s:h("LineNr", { "fg": s:grey, "bg": s:lightblack }) 112 | call s:h("CursorLineNr", { "fg": s:orange }) 113 | call s:h("SignColumn", { "bg": s:lightblack }) 114 | 115 | " misc 116 | call s:h("SpecialKey", { "fg": s:pink }) 117 | call s:h("Title", { "fg": s:yellow }) 118 | call s:h("Directory", { "fg": s:aqua }) 119 | 120 | " diff 121 | call s:h("DiffAdd", { "fg": s:addfg, "bg": s:addbg }) 122 | call s:h("DiffDelete", { "fg": s:black, "bg": s:delbg }) 123 | call s:h("DiffChange", { "fg": s:changefg, "bg": s:changebg }) 124 | call s:h("DiffText", { "fg": s:black, "bg": s:aqua }) 125 | 126 | " fold 127 | call s:h("Folded", { "fg": s:warmgrey, "bg": s:darkblack }) 128 | call s:h("FoldColumn", { "bg": s:darkblack }) 129 | " Incsearch" 130 | 131 | " popup menu 132 | call s:h("Pmenu", { "fg": s:lightblack, "bg": s:white }) 133 | call s:h("PmenuSel", { "fg": s:aqua, "bg": s:black, "format": "reverse,bold" }) 134 | call s:h("PmenuThumb", { "fg": s:lightblack, "bg": s:grey }) 135 | " PmenuSbar" 136 | 137 | " Generic Syntax Highlighting 138 | " --------------------------- 139 | 140 | call s:h("Constant", { "fg": s:purple }) 141 | call s:h("Number", { "fg": s:purple }) 142 | call s:h("Float", { "fg": s:purple }) 143 | call s:h("Boolean", { "fg": s:purple }) 144 | call s:h("Character", { "fg": s:yellow }) 145 | call s:h("String", { "fg": s:yellow }) 146 | 147 | call s:h("Type", { "fg": s:aqua }) 148 | call s:h("Structure", { "fg": s:aqua }) 149 | call s:h("StorageClass", { "fg": s:aqua }) 150 | call s:h("Typedef", { "fg": s:aqua }) 151 | 152 | call s:h("Identifier", { "fg": s:green }) 153 | call s:h("Function", { "fg": s:green }) 154 | 155 | call s:h("Statement", { "fg": s:pink }) 156 | call s:h("Operator", { "fg": s:pink }) 157 | call s:h("Label", { "fg": s:pink }) 158 | call s:h("Keyword", { "fg": s:aqua }) 159 | " Conditional" 160 | " Repeat" 161 | " Exception" 162 | 163 | call s:h("PreProc", { "fg": s:green }) 164 | call s:h("Include", { "fg": s:pink }) 165 | call s:h("Define", { "fg": s:pink }) 166 | call s:h("Macro", { "fg": s:green }) 167 | call s:h("PreCondit", { "fg": s:green }) 168 | 169 | call s:h("Special", { "fg": s:purple }) 170 | call s:h("SpecialChar", { "fg": s:pink }) 171 | call s:h("Delimiter", { "fg": s:pink }) 172 | call s:h("SpecialComment",{ "fg": s:aqua }) 173 | call s:h("Tag", { "fg": s:pink }) 174 | " Debug" 175 | 176 | call s:h("Todo", { "fg": s:orange, "format": "bold,italic" }) 177 | call s:h("Comment", { "fg": s:warmgrey, "format": "italic" }) 178 | 179 | call s:h("Underlined", { "fg": s:green }) 180 | call s:h("Ignore", {}) 181 | call s:h("Error", { "fg": s:red, "bg": s:darkred }) 182 | 183 | " NerdTree 184 | " -------- 185 | 186 | call s:h("NERDTreeOpenable", { "fg": s:yellow }) 187 | call s:h("NERDTreeClosable", { "fg": s:yellow }) 188 | call s:h("NERDTreeHelp", { "fg": s:yellow }) 189 | call s:h("NERDTreeBookmarksHeader", { "fg": s:pink }) 190 | call s:h("NERDTreeBookmarksLeader", { "fg": s:black }) 191 | call s:h("NERDTreeBookmarkName", { "fg": s:yellow }) 192 | call s:h("NERDTreeCWD", { "fg": s:pink }) 193 | call s:h("NERDTreeUp", { "fg": s:white }) 194 | call s:h("NERDTreeDirSlash", { "fg": s:grey }) 195 | call s:h("NERDTreeDir", { "fg": s:grey }) 196 | 197 | " Syntastic 198 | " --------- 199 | 200 | hi! link SyntasticErrorSign Error 201 | call s:h("SyntasticWarningSign", { "fg": s:lightblack, "bg": s:orange }) 202 | 203 | " Language highlight 204 | " ------------------ 205 | 206 | " Java properties 207 | call s:h("jpropertiesIdentifier", { "fg": s:pink }) 208 | 209 | " Vim command 210 | call s:h("vimCommand", { "fg": s:pink }) 211 | 212 | " Javascript 213 | call s:h("jsFuncName", { "fg": s:green }) 214 | call s:h("jsThis", { "fg": s:pink }) 215 | call s:h("jsFunctionKey", { "fg": s:green }) 216 | call s:h("jsPrototype", { "fg": s:aqua }) 217 | call s:h("jsExceptions", { "fg": s:aqua }) 218 | call s:h("jsFutureKeys", { "fg": s:aqua }) 219 | call s:h("jsBuiltins", { "fg": s:aqua }) 220 | call s:h("jsArgsObj", { "fg": s:aqua }) 221 | call s:h("jsStatic", { "fg": s:aqua }) 222 | call s:h("jsSuper", { "fg": s:aqua }) 223 | call s:h("jsFuncArgRest", { "fg": s:purple }) 224 | call s:h("jsFuncArgs", { "fg": s:orange }) 225 | call s:h("jsStorageClass", { "fg": s:aqua }) 226 | call s:h("jsDocTags", { "fg": s:aqua, "format": "italic" }) 227 | 228 | " Html 229 | call s:h("htmlTag", { "fg": s:white }) 230 | call s:h("htmlEndTag", { "fg": s:white }) 231 | call s:h("htmlTagName", { "fg": s:pink }) 232 | call s:h("htmlArg", { "fg": s:green }) 233 | call s:h("htmlSpecialChar", { "fg": s:purple }) 234 | 235 | " Xml 236 | call s:h("xmlTag", { "fg": s:pink }) 237 | call s:h("xmlEndTag", { "fg": s:pink }) 238 | call s:h("xmlTagName", { "fg": s:orange }) 239 | call s:h("xmlAttrib", { "fg": s:green }) 240 | 241 | " CSS 242 | call s:h("cssProp", { "fg": s:yellow }) 243 | call s:h("cssUIAttr", { "fg": s:yellow }) 244 | call s:h("cssFunctionName", { "fg": s:aqua }) 245 | call s:h("cssColor", { "fg": s:purple }) 246 | call s:h("cssPseudoClassId", { "fg": s:purple }) 247 | call s:h("cssClassName", { "fg": s:green }) 248 | call s:h("cssValueLength", { "fg": s:purple }) 249 | call s:h("cssCommonAttr", { "fg": s:pink }) 250 | call s:h("cssBraces" , { "fg": s:white }) 251 | call s:h("cssClassNameDot", { "fg": s:pink }) 252 | call s:h("cssURL", { "fg": s:orange, "format": "underline" }) 253 | 254 | " ruby 255 | call s:h("rubyInterpolationDelimiter", {}) 256 | call s:h("rubyInstanceVariable", {}) 257 | call s:h("rubyGlobalVariable", {}) 258 | call s:h("rubyClassVariable", {}) 259 | call s:h("rubyPseudoVariable", {}) 260 | call s:h("rubyFunction", { "fg": s:green }) 261 | call s:h("rubyStringDelimiter", { "fg": s:yellow }) 262 | call s:h("rubyRegexp", { "fg": s:yellow }) 263 | call s:h("rubyRegexpDelimiter", { "fg": s:yellow }) 264 | call s:h("rubySymbol", { "fg": s:purple }) 265 | call s:h("rubyEscape", { "fg": s:purple }) 266 | call s:h("rubyInclude", { "fg": s:pink }) 267 | call s:h("rubyOperator", { "fg": s:pink }) 268 | call s:h("rubyControl", { "fg": s:pink }) 269 | call s:h("rubyClass", { "fg": s:pink }) 270 | call s:h("rubyDefine", { "fg": s:pink }) 271 | call s:h("rubyException", { "fg": s:pink }) 272 | call s:h("rubyRailsARAssociationMethod",{ "fg": s:orange }) 273 | call s:h("rubyRailsARMethod", { "fg": s:orange }) 274 | call s:h("rubyRailsRenderMethod", { "fg": s:orange }) 275 | call s:h("rubyRailsMethod", { "fg": s:orange }) 276 | call s:h("rubyConstant", { "fg": s:aqua }) 277 | call s:h("rubyBlockArgument", { "fg": s:orange }) 278 | call s:h("rubyBlockParameter", { "fg": s:orange }) 279 | 280 | " eruby 281 | call s:h("erubyDelimiter", {}) 282 | call s:h("erubyRailsMethod", { "fg": s:aqua }) 283 | 284 | " c 285 | call s:h("cLabel", { "fg": s:pink }) 286 | call s:h("cStructure", { "fg": s:pink }) 287 | call s:h("cStorageClass", { "fg": s:pink }) 288 | call s:h("cInclude", { "fg": s:red }) 289 | call s:h("cDefine", { "fg": s:red }) 290 | -------------------------------------------------------------------------------- /colors/onedark.vim: -------------------------------------------------------------------------------- 1 | " Vim Color File 2 | " Name: onedark.vim 3 | " Maintainer: https://github.com/joshdick/onedark.vim/ 4 | " License: The MIT License (MIT) 5 | " Based On: https://github.com/MaxSt/FlatColor/ 6 | 7 | " A companion [vim-airline](https://github.com/bling/vim-airline) theme is available at: https://github.com/joshdick/airline-onedark.vim 8 | 9 | " +-----------------+ 10 | " | Color Reference | 11 | " +-----------------+ 12 | 13 | " The following colors were measured inside Atom using its built-in inspector. 14 | 15 | " +---------------------------------------------+ 16 | " | Color Name | RGB | Hex | 17 | " |--------------+--------------------+---------| 18 | " | Black | rgb(40, 44, 52) | #282c34 | 19 | " |--------------+--------------------+---------| 20 | " | White | rgb(171, 178, 191) | #abb2bf | 21 | " |--------------+--------------------+---------| 22 | " | Light Red | rgb(224, 108, 117) | #e06c75 | 23 | " |--------------+--------------------+---------| 24 | " | Dark Red | rgb(190, 80, 70) | #be5046 | 25 | " |--------------+--------------------+---------| 26 | " | Green | rgb(152, 195, 121) | #98c379 | 27 | " |--------------+--------------------+---------| 28 | " | Light Yellow | rgb(229, 192, 123) | #e5c07b | 29 | " |--------------+--------------------+---------| 30 | " | Dark Yellow | rgb(209, 154, 102) | #d19a66 | 31 | " |--------------+--------------------+---------| 32 | " | Blue | rgb(97, 175, 239) | #61afef | 33 | " |--------------+--------------------+---------| 34 | " | Magenta | rgb(198, 120, 221) | #c678dd | 35 | " |--------------+--------------------+---------| 36 | " | Cyan | rgb(86, 182, 194) | #56b6c2 | 37 | " |--------------+--------------------+---------| 38 | " | Gutter Grey | rgb(99, 109, 131) | #636d83 | 39 | " |--------------+--------------------+---------| 40 | " | Comment Grey | rgb(92, 99, 112) | #5c6370 | 41 | " +---------------------------------------------+ 42 | 43 | " +----------------+ 44 | " | Initialization | 45 | " +----------------+ 46 | 47 | set background=dark 48 | 49 | highlight clear 50 | 51 | if exists("syntax_on") 52 | syntax reset 53 | endif 54 | 55 | set t_Co=256 56 | 57 | let g:colors_name="onedark" 58 | 59 | " Set to "256" for 256-color terminals, or 60 | " set to "16" to use your terminal emulator's native colors 61 | " (a 16-color palette for this color scheme is available; see 62 | " < https://github.com/joshdick/onedark.vim/blob/master/README.md > 63 | " for more information.) 64 | if !exists("g:onedark_termcolors") 65 | let g:onedark_termcolors = 256 66 | endif 67 | 68 | " Not all terminals support italics properly. If yours does, opt-in. 69 | if !exists("g:onedark_terminal_italics") 70 | let g:onedark_terminal_italics = 0 71 | endif 72 | 73 | " This function is based on one from FlatColor: https://github.com/MaxSt/FlatColor/ 74 | " Which in turn was based on one found in hemisu: https://github.com/noahfrederick/vim-hemisu/ 75 | function! s:h(group, style) 76 | if g:onedark_terminal_italics == 0 77 | if has_key(a:style, "cterm") && a:style["cterm"] == "italic" 78 | unlet a:style.cterm 79 | endif 80 | if has_key(a:style, "gui") && a:style["gui"] == "italic" 81 | unlet a:style.gui 82 | endif 83 | endif 84 | if g:onedark_termcolors == 16 85 | let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm16 : "NONE") 86 | let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm16 : "NONE") 87 | else 88 | let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE") 89 | let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE") 90 | endif 91 | execute "highlight" a:group 92 | \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE") 93 | \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE") 94 | \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE") 95 | \ "gui=" (has_key(a:style, "gui") ? a:style.gui : "NONE") 96 | \ "ctermfg=" . l:ctermfg 97 | \ "ctermbg=" . l:ctermbg 98 | \ "cterm=" (has_key(a:style, "cterm") ? a:style.cterm : "NONE") 99 | endfunction 100 | 101 | " +-----------------+ 102 | " | Color Variables | 103 | " +-----------------+ 104 | 105 | let s:red = { "gui": "#E06C75", "cterm": "204", "cterm16": "1" } " Alternate cterm: 168 106 | let s:dark_red = { "gui": "#BE5046", "cterm": "196", "cterm16": "9" } 107 | 108 | let s:green = { "gui": "#98C379", "cterm": "114", "cterm16": "2" } 109 | 110 | let s:yellow = { "gui": "#E5C07b", "cterm": "180", "cterm16": "3" } 111 | let s:dark_yellow = { "gui": "#D19A66", "cterm": "173", "cterm16": "11" } 112 | 113 | let s:blue = { "gui": "#61AFEF", "cterm": "39", "cterm16": "4" } " Alternate cterm: 75 114 | 115 | let s:purple = { "gui": "#C678DD", "cterm": "170", "cterm16": "5" } " Alternate cterm: 176 116 | 117 | let s:cyan = { "gui": "#56B6C2", "cterm": "38", "cterm16": "6" } " Alternate cterm: 73 118 | 119 | let s:white = { "gui": "#ABB2BF", "cterm": "145", "cterm16" : "7" } 120 | 121 | let s:black = { "gui": "#282C34", "cterm": "235", "cterm16": "0" } 122 | let s:visual_black = { "gui": "NONE", "cterm": "NONE", "cterm16": s:black.cterm16 } " Black out selected text in 16-color visual mode 123 | 124 | let s:comment_grey = { "gui": "#5C6370", "cterm": "59", "cterm16": "15" } 125 | let s:gutter_fg_grey = { "gui": "#636D83", "cterm": "238", "cterm16": "15" } 126 | let s:cursor_grey = { "gui": "#2C323C", "cterm": "236", "cterm16": "8" } 127 | let s:visual_grey = { "gui": "#3E4452", "cterm": "237", "cterm16": "15" } 128 | let s:menu_grey = { "gui": s:visual_grey.gui, "cterm": s:visual_grey.cterm, "cterm16": "8" } 129 | let s:special_grey = { "gui": "#3B4048", "cterm": "238", "cterm16": "15" } 130 | let s:vertsplit = { "gui": "#181A1F", "cterm": "59", "cterm16": "15" } 131 | 132 | " +---------------------------------------------------------+ 133 | " | Syntax Groups (descriptions and ordering from `:h w18`) | 134 | " +---------------------------------------------------------+ 135 | 136 | call s:h("Comment", { "fg": s:comment_grey, "gui": "italic", "cterm": "italic" }) " any comment 137 | call s:h("Constant", { "fg": s:cyan }) " any constant 138 | call s:h("String", { "fg": s:green }) " a string constant: "this is a string" 139 | call s:h("Character", { "fg": s:green }) " a character constant: 'c', '\n' 140 | call s:h("Number", { "fg": s:dark_yellow }) " a number constant: 234, 0xff 141 | call s:h("Boolean", { "fg": s:dark_yellow }) " a boolean constant: TRUE, false 142 | call s:h("Float", { "fg": s:dark_yellow }) " a floating point constant: 2.3e10 143 | call s:h("Identifier", { "fg": s:red }) " any variable name 144 | call s:h("Function", { "fg": s:blue }) " function name (also: methods for classes) 145 | call s:h("Statement", { "fg": s:purple }) " any statement 146 | call s:h("Conditional", { "fg": s:purple }) " if, then, else, endif, switch, etc. 147 | call s:h("Repeat", { "fg": s:purple }) " for, do, while, etc. 148 | call s:h("Label", { "fg": s:purple }) " case, default, etc. 149 | call s:h("Operator", { "fg": s:purple }) " sizeof", "+", "*", etc. 150 | call s:h("Keyword", { "fg": s:red }) " any other keyword 151 | call s:h("Exception", { "fg": s:purple }) " try, catch, throw 152 | call s:h("PreProc", { "fg": s:yellow }) " generic Preprocessor 153 | call s:h("Include", { "fg": s:blue }) " preprocessor #include 154 | call s:h("Define", { "fg": s:purple }) " preprocessor #define 155 | call s:h("Macro", { "fg": s:purple }) " same as Define 156 | call s:h("PreCondit", { "fg": s:yellow }) " preprocessor #if, #else, #endif, etc. 157 | call s:h("Type", { "fg": s:yellow }) " int, long, char, etc. 158 | call s:h("StorageClass", { "fg": s:yellow }) " static, register, volatile, etc. 159 | call s:h("Structure", { "fg": s:yellow }) " struct, union, enum, etc. 160 | call s:h("Typedef", { "fg": s:yellow }) " A typedef 161 | call s:h("Special", { "fg": s:blue }) " any special symbol 162 | call s:h("SpecialChar", {}) " special character in a constant 163 | call s:h("Tag", {}) " you can use CTRL-] on this 164 | call s:h("Delimiter", {}) " character that needs attention 165 | call s:h("SpecialComment", {}) " special things inside a comment 166 | call s:h("Debug", {}) " debugging statements 167 | call s:h("Underlined", {}) " text that stands out, HTML links 168 | call s:h("Ignore", {}) " left blank, hidden 169 | call s:h("Error", { "fg": s:red }) " any erroneous construct 170 | call s:h("Todo", { "fg": s:purple }) " anything that needs extra attention; mostly the keywords TODO FIXME and XXX 171 | 172 | " +----------------------------------------------------------------------+ 173 | " | Highlighting Groups (descriptions and ordering from `:h hitest.vim`) | 174 | " +----------------------------------------------------------------------+ 175 | 176 | call s:h("ColorColumn", { "bg": s:cursor_grey }) " used for the columns set with 'colorcolumn' 177 | call s:h("Conceal", {}) " placeholder characters substituted for concealed text (see 'conceallevel') 178 | call s:h("Cursor", { "fg": s:black, "bg": s:blue }) " the character under the cursor 179 | call s:h("CursorIM", {}) " like Cursor, but used when in IME mode 180 | call s:h("CursorColumn", { "bg": s:cursor_grey }) " the screen column that the cursor is in when 'cursorcolumn' is set 181 | call s:h("CursorLine", { "bg": s:cursor_grey }) " the screen line that the cursor is in when 'cursorline' is set 182 | call s:h("Directory", { "fg": s:blue }) " directory names (and other special names in listings) 183 | call s:h("DiffAdd", { "fg": s:green }) " diff mode: Added line 184 | call s:h("DiffChange", { "fg": s:dark_yellow }) " diff mode: Changed line 185 | call s:h("DiffDelete", { "fg": s:red }) " diff mode: Deleted line 186 | call s:h("DiffText", { "fg": s:blue }) " diff mode: Changed text within a changed line 187 | call s:h("ErrorMsg", {}) " error messages on the command line 188 | call s:h("VertSplit", { "fg": s:vertsplit }) " the column separating vertically split windows 189 | call s:h("Folded", { "fg": s:comment_grey }) " line used for closed folds 190 | call s:h("FoldColumn", {}) " 'foldcolumn' 191 | call s:h("SignColumn", {}) " column where signs are displayed 192 | call s:h("IncSearch", { "fg": s:black, "bg": s:yellow }) " 'incsearch' highlighting; also used for the text replaced with ":s///c" 193 | call s:h("LineNr", { "fg": s:gutter_fg_grey }) " Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. 194 | call s:h("CursorLineNr", {}) " Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. 195 | call s:h("MatchParen", { "fg": s:blue, "gui": "underline" }) " The character under the cursor or just before it, if it is a paired bracket, and its match. 196 | call s:h("ModeMsg", {}) " 'showmode' message (e.g., "-- INSERT --") 197 | call s:h("MoreMsg", {}) " more-prompt 198 | call s:h("NonText", { "fg": s:special_grey }) " '~' and '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). 199 | call s:h("Normal", { "fg": s:white, "bg": s:black }) " normal text 200 | call s:h("Pmenu", { "bg": s:menu_grey }) " Popup menu: normal item. 201 | call s:h("PmenuSel", { "bg": s:black }) " Popup menu: selected item. 202 | call s:h("PmenuSbar", { "bg": s:special_grey }) " Popup menu: scrollbar. 203 | call s:h("PmenuThumb", { "bg": s:white }) " Popup menu: Thumb of the scrollbar. 204 | call s:h("Question", { "fg": s:purple }) " hit-enter prompt and yes/no questions 205 | call s:h("Search", { "fg": s:black, "bg": s:yellow }) " Last search pattern highlighting (see 'hlsearch'). Also used for highlighting the current line in the quickfix window and similar items that need to stand out. 206 | call s:h("SpecialKey", { "fg": s:special_grey }) " Meta and special keys listed with ":map", also for text used to show unprintable characters in the text, 'listchars'. Generally: text that is displayed differently from what it really is. 207 | call s:h("SpellBad", { "fg": s:red, "gui": "underline", "cterm": "underline" }) " Word that is not recognized by the spellchecker. This will be combined with the highlighting used otherwise. 208 | call s:h("SpellCap", { "fg": s:dark_yellow }) " Word that should start with a capital. This will be combined with the highlighting used otherwise. 209 | call s:h("SpellLocal", { "fg": s:dark_yellow }) " Word that is recognized by the spellchecker as one that is used in another region. This will be combined with the highlighting used otherwise. 210 | call s:h("SpellRare", { "fg": s:dark_yellow }) " Word that is recognized by the spellchecker as one that is hardly ever used. spell This will be combined with the highlighting used otherwise. 211 | call s:h("StatusLine", { "fg": s:white, "bg": s:cursor_grey }) " status line of current window 212 | call s:h("StatusLineNC", { "fg": s:comment_grey }) " status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. 213 | call s:h("TabLine", { "fg": s:comment_grey }) " tab pages line, not active tab page label 214 | call s:h("TabLineFill", {}) " tab pages line, where there are no labels 215 | call s:h("TabLineSel", { "fg": s:white }) " tab pages line, active tab page label 216 | call s:h("Title", { "fg": s:green }) " titles for output from ":set all", ":autocmd" etc. 217 | call s:h("Visual", { "fg": s:visual_black, "bg": s:visual_grey }) " Visual mode selection 218 | call s:h("VisualNOS", { "bg": s:visual_grey }) " Visual mode selection when vim is "Not Owning the Selection". Only X11 Gui's gui-x11 and xterm-clipboard supports this. 219 | call s:h("WarningMsg", { "fg": s:red }) " warning messages 220 | call s:h("WildMenu", {}) " current match in 'wildmenu' completion 221 | 222 | " +--------------------------------+ 223 | " | Language-Specific Highlighting | 224 | " +--------------------------------+ 225 | 226 | " CSS 227 | call s:h("cssAttrComma", { "fg": s:purple }) 228 | call s:h("cssAttributeSelector", { "fg": s:green }) 229 | call s:h("cssBraces", { "fg": s:white }) 230 | call s:h("cssClassName", { "fg": s:dark_yellow }) 231 | call s:h("cssClassNameDot", { "fg": s:dark_yellow }) 232 | call s:h("cssDefinition", { "fg": s:purple }) 233 | call s:h("cssFontAttr", { "fg": s:dark_yellow }) 234 | call s:h("cssFontDescriptor", { "fg": s:purple }) 235 | call s:h("cssFunctionName", { "fg": s:blue }) 236 | call s:h("cssIdentifier", { "fg": s:blue }) 237 | call s:h("cssImportant", { "fg": s:purple }) 238 | call s:h("cssInclude", { "fg": s:white }) 239 | call s:h("cssIncludeKeyword", { "fg": s:purple }) 240 | call s:h("cssMediaType", { "fg": s:dark_yellow }) 241 | call s:h("cssProp", { "fg": s:white }) 242 | call s:h("cssPseudoClassId", { "fg": s:dark_yellow }) 243 | call s:h("cssSelectorOp", { "fg": s:purple }) 244 | call s:h("cssSelectorOp2", { "fg": s:purple }) 245 | call s:h("cssTagName", { "fg": s:red }) 246 | 247 | " HTML 248 | call s:h("htmlTitle", { "fg": s:white }) 249 | call s:h("htmlArg", { "fg": s:dark_yellow }) 250 | call s:h("htmlEndTag", { "fg": s:white }) 251 | call s:h("htmlH1", { "fg": s:white }) 252 | call s:h("htmlLink", { "fg": s:purple }) 253 | call s:h("htmlSpecialChar", { "fg": s:dark_yellow }) 254 | call s:h("htmlSpecialTagName", { "fg": s:red }) 255 | call s:h("htmlTag", { "fg": s:white }) 256 | call s:h("htmlTagName", { "fg": s:red }) 257 | 258 | " JavaScript 259 | call s:h("javaScriptBraces", { "fg": s:white }) 260 | call s:h("javaScriptFunction", { "fg": s:purple }) 261 | call s:h("javaScriptIdentifier", { "fg": s:purple }) 262 | call s:h("javaScriptNull", { "fg": s:dark_yellow }) 263 | call s:h("javaScriptNumber", { "fg": s:dark_yellow }) 264 | call s:h("javaScriptRequire", { "fg": s:cyan }) 265 | call s:h("javaScriptReserved", { "fg": s:purple }) 266 | " https://github.com/pangloss/vim-javascript 267 | call s:h("jsArrowFunction", { "fg": s:purple }) 268 | call s:h("jsClassKeywords", { "fg": s:purple }) 269 | call s:h("jsDocParam", { "fg": s:blue }) 270 | call s:h("jsDocTags", { "fg": s:purple }) 271 | call s:h("jsFuncCall", { "fg": s:blue }) 272 | call s:h("jsFunction", { "fg": s:purple }) 273 | call s:h("jsGlobalObjects", { "fg": s:yellow }) 274 | call s:h("jsModuleWords", { "fg": s:purple }) 275 | call s:h("jsModules", { "fg": s:purple }) 276 | call s:h("jsNull", { "fg": s:dark_yellow }) 277 | call s:h("jsOperator", { "fg": s:purple }) 278 | call s:h("jsStorageClass", { "fg": s:purple }) 279 | call s:h("jsTemplateBraces", { "fg": s:dark_red }) 280 | call s:h("jsTemplateVar", { "fg": s:green }) 281 | call s:h("jsThis", { "fg": s:red }) 282 | call s:h("jsUndefined", { "fg": s:dark_yellow }) 283 | " https://github.com/othree/yajs.vim 284 | call s:h("javascriptArrowFunc", { "fg": s:purple }) 285 | call s:h("javascriptClassExtends", { "fg": s:purple }) 286 | call s:h("javascriptClassKeyword", { "fg": s:purple }) 287 | call s:h("javascriptDocNotation", { "fg": s:purple }) 288 | call s:h("javascriptDocParamName", { "fg": s:blue }) 289 | call s:h("javascriptDocTags", { "fg": s:purple }) 290 | call s:h("javascriptEndColons", { "fg": s:white }) 291 | call s:h("javascriptExport", { "fg": s:purple }) 292 | call s:h("javascriptFuncArg", { "fg": s:white }) 293 | call s:h("javascriptFuncKeyword", { "fg": s:purple }) 294 | call s:h("javascriptIdentifier", { "fg": s:red }) 295 | call s:h("javascriptImport", { "fg": s:purple }) 296 | call s:h("javascriptObjectLabel", { "fg": s:white }) 297 | call s:h("javascriptOpSymbol", { "fg": s:cyan }) 298 | call s:h("javascriptOpSymbols", { "fg": s:cyan }) 299 | call s:h("javascriptPropertyName", { "fg": s:green }) 300 | call s:h("javascriptTemplateSB", { "fg": s:dark_red }) 301 | call s:h("javascriptVariable", { "fg": s:purple }) 302 | 303 | " JSON 304 | call s:h("jsonCommentError", { "fg": s:white }) 305 | call s:h("jsonKeyword", { "fg": s:red }) 306 | call s:h("jsonBoolean", { "fg": s:dark_yellow }) 307 | call s:h("jsonNumber", { "fg": s:dark_yellow }) 308 | call s:h("jsonQuote", { "fg": s:white }) 309 | call s:h("jsonMissingCommaError", { "fg": s:red, "gui": "reverse" }) 310 | call s:h("jsonNoQuotesError", { "fg": s:red, "gui": "reverse" }) 311 | call s:h("jsonNumError", { "fg": s:red, "gui": "reverse" }) 312 | call s:h("jsonString", { "fg": s:green }) 313 | call s:h("jsonStringSQError", { "fg": s:red, "gui": "reverse" }) 314 | call s:h("jsonSemicolonError", { "fg": s:red, "gui": "reverse" }) 315 | 316 | " Markdown 317 | call s:h("markdownCode", { "fg": s:green }) 318 | call s:h("markdownCodeBlock", { "fg": s:green }) 319 | call s:h("markdownCodeDelimiter", { "fg": s:green }) 320 | call s:h("markdownHeadingDelimiter", { "fg": s:red }) 321 | call s:h("markdownRule", { "fg": s:comment_grey }) 322 | call s:h("markdownHeadingRule", { "fg": s:comment_grey }) 323 | call s:h("markdownH1", { "fg": s:red }) 324 | call s:h("markdownH2", { "fg": s:red }) 325 | call s:h("markdownH3", { "fg": s:red }) 326 | call s:h("markdownH4", { "fg": s:red }) 327 | call s:h("markdownH5", { "fg": s:red }) 328 | call s:h("markdownH6", { "fg": s:red }) 329 | call s:h("markdownIdDelimiter", { "fg": s:purple }) 330 | call s:h("markdownId", { "fg": s:purple }) 331 | call s:h("markdownBlockquote", { "fg": s:comment_grey }) 332 | call s:h("markdownItalic", { "fg": s:purple, "gui": "italic", "cterm": "italic" }) 333 | call s:h("markdownBold", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" }) 334 | call s:h("markdownListMarker", { "fg": s:red }) 335 | call s:h("markdownOrderedListMarker", { "fg": s:red }) 336 | call s:h("markdownIdDeclaration", { "fg": s:blue }) 337 | call s:h("markdownLinkText", { "fg": s:blue }) 338 | call s:h("markdownLinkDelimiter", { "fg": s:white }) 339 | call s:h("markdownUrl", { "fg": s:purple }) 340 | 341 | " Ruby 342 | call s:h("rubyBlockParameter", { "fg": s:red}) 343 | call s:h("rubyBlockParameterList", { "fg": s:red }) 344 | call s:h("rubyClass", { "fg": s:purple}) 345 | call s:h("rubyConstant", { "fg": s:yellow}) 346 | call s:h("rubyControl", { "fg": s:purple }) 347 | call s:h("rubyEscape", { "fg": s:red}) 348 | call s:h("rubyFunction", { "fg": s:blue}) 349 | call s:h("rubyGlobalVariable", { "fg": s:red}) 350 | call s:h("rubyInclude", { "fg": s:blue}) 351 | call s:h("rubyIncluderubyGlobalVariable", { "fg": s:red}) 352 | call s:h("rubyInstanceVariable", { "fg": s:red}) 353 | call s:h("rubyInterpolation", { "fg": s:cyan }) 354 | call s:h("rubyInterpolationDelimiter", { "fg": s:red }) 355 | call s:h("rubyInterpolationDelimiter", { "fg": s:red}) 356 | call s:h("rubyRegexp", { "fg": s:cyan}) 357 | call s:h("rubyRegexpDelimiter", { "fg": s:cyan}) 358 | call s:h("rubyStringDelimiter", { "fg": s:green}) 359 | call s:h("rubySymbol", { "fg": s:cyan}) 360 | 361 | " Sass 362 | call s:h("sassAmpersand", { "fg": s:red }) 363 | call s:h("sassClass", { "fg": s:dark_yellow }) 364 | call s:h("sassControl", { "fg": s:purple }) 365 | call s:h("sassExtend", { "fg": s:purple }) 366 | call s:h("sassFor", { "fg": s:white }) 367 | call s:h("sassFunction", { "fg": s:cyan }) 368 | call s:h("sassId", { "fg": s:blue }) 369 | call s:h("sassInclude", { "fg": s:purple }) 370 | call s:h("sassMedia", { "fg": s:purple }) 371 | call s:h("sassMediaOperators", { "fg": s:white }) 372 | call s:h("sassMixin", { "fg": s:purple }) 373 | call s:h("sassMixinName", { "fg": s:blue }) 374 | call s:h("sassMixing", { "fg": s:purple }) 375 | 376 | " TypeScript 377 | call s:h("typescriptReserved", { "fg": s:purple }) 378 | call s:h("typescriptEndColons", { "fg": s:white }) 379 | call s:h("typescriptBraces", { "fg": s:white }) 380 | 381 | " XML 382 | call s:h("xmlAttrib", { "fg": s:dark_yellow }) 383 | call s:h("xmlEndTag", { "fg": s:red }) 384 | call s:h("xmlTag", { "fg": s:red }) 385 | call s:h("xmlTagName", { "fg": s:red }) 386 | 387 | " +---------------------+ 388 | " | Plugin Highlighting | 389 | " +---------------------+ 390 | 391 | " airblade/vim-gitgutter 392 | hi link GitGutterAdd SignifySignAdd 393 | hi link GitGutterChange SignifySignChange 394 | hi link GitGutterDelete SignifySignDelete 395 | 396 | " mhinz/vim-signify 397 | call s:h("SignifySignAdd", { "fg": s:green }) 398 | call s:h("SignifySignChange", { "fg": s:yellow }) 399 | call s:h("SignifySignDelete", { "fg": s:red }) 400 | 401 | " neomake/neomake 402 | call s:h("NeomakeWarningSign", { "fg": s:yellow }) 403 | call s:h("NeomakeErrorSign", { "fg": s:red }) 404 | call s:h("NeomakeInfoSign", { "fg": s:blue }) 405 | 406 | " tpope/vim-fugitive 407 | call s:h("diffAdded", { "fg": s:green }) 408 | call s:h("diffRemoved", { "fg": s:red }) 409 | 410 | " +------------------+ 411 | " | Git Highlighting | 412 | " +------------------+ 413 | 414 | call s:h("gitcommitComment", { "fg": s:comment_grey }) 415 | call s:h("gitcommitUnmerged", { "fg": s:green }) 416 | call s:h("gitcommitOnBranch", {}) 417 | call s:h("gitcommitBranch", { "fg": s:purple }) 418 | call s:h("gitcommitDiscardedType", { "fg": s:red }) 419 | call s:h("gitcommitSelectedType", { "fg": s:green }) 420 | call s:h("gitcommitHeader", {}) 421 | call s:h("gitcommitUntrackedFile", { "fg": s:cyan }) 422 | call s:h("gitcommitDiscardedFile", { "fg": s:red }) 423 | call s:h("gitcommitSelectedFile", { "fg": s:green }) 424 | call s:h("gitcommitUnmergedFile", { "fg": s:yellow }) 425 | call s:h("gitcommitFile", {}) 426 | hi link gitcommitNoBranch gitcommitBranch 427 | hi link gitcommitUntracked gitcommitComment 428 | hi link gitcommitDiscarded gitcommitComment 429 | hi link gitcommitSelected gitcommitComment 430 | hi link gitcommitDiscardedArrow gitcommitDiscardedFile 431 | hi link gitcommitSelectedArrow gitcommitSelectedFile 432 | hi link gitcommitUnmergedArrow gitcommitUnmergedFile 433 | 434 | " +------------------------+ 435 | " | Neovim terminal colors | 436 | " +------------------------+ 437 | 438 | if has("nvim") 439 | let g:terminal_color_0 = s:black.gui 440 | let g:terminal_color_1 = s:red.gui 441 | let g:terminal_color_2 = s:green.gui 442 | let g:terminal_color_3 = s:yellow.gui 443 | let g:terminal_color_4 = s:blue.gui 444 | let g:terminal_color_5 = s:purple.gui 445 | let g:terminal_color_6 = s:cyan.gui 446 | let g:terminal_color_7 = s:white.gui 447 | let g:terminal_color_8 = s:visual_grey.gui 448 | let g:terminal_color_9 = s:dark_red.gui 449 | let g:terminal_color_10 = s:green.gui " No dark version 450 | let g:terminal_color_11 = s:dark_yellow.gui 451 | let g:terminal_color_12 = s:blue.gui " No dark version 452 | let g:terminal_color_13 = s:purple.gui " No dark version 453 | let g:terminal_color_14 = s:cyan.gui " No dark version 454 | let g:terminal_color_15 = s:comment_grey.gui 455 | let g:terminal_color_background = g:terminal_color_0 456 | let g:terminal_color_foreground = g:terminal_color_7 457 | endif 458 | -------------------------------------------------------------------------------- /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 | " License: MIT 12 | " 13 | " Copyright (c) 2017 Junegunn Choi 14 | " 15 | " MIT License 16 | " 17 | " Permission is hereby granted, free of charge, to any person obtaining 18 | " a copy of this software and associated documentation files (the 19 | " "Software"), to deal in the Software without restriction, including 20 | " without limitation the rights to use, copy, modify, merge, publish, 21 | " distribute, sublicense, and/or sell copies of the Software, and to 22 | " permit persons to whom the Software is furnished to do so, subject to 23 | " the following conditions: 24 | " 25 | " The above copyright notice and this permission notice shall be 26 | " included in all copies or substantial portions of the Software. 27 | " 28 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 29 | " EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 30 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 31 | " NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 32 | " LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 33 | " OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 34 | " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 35 | 36 | if !exists('s:rgb_map') 37 | if get(g:, 'seoul256_srgb', 0) 38 | let s:rgb_map = 39 | \{ 16: '#000000', 17: '#00005f', 18: '#000087', 40 | \ 19: '#0000af', 20: '#0000d7', 21: '#0000ff', 41 | \ 22: '#005f00', 23: '#005f5f', 24: '#005f87', 42 | \ 25: '#005faf', 26: '#005fd7', 27: '#005fff', 43 | \ 28: '#008700', 29: '#00875f', 30: '#008787', 44 | \ 31: '#0087af', 32: '#0087d7', 33: '#0087ff', 45 | \ 34: '#00af00', 35: '#00af5f', 36: '#00af87', 46 | \ 37: '#00afaf', 38: '#00afd7', 39: '#00afff', 47 | \ 40: '#00d700', 41: '#00d75f', 42: '#00d787', 48 | \ 43: '#00d7af', 44: '#00d7d7', 45: '#00d7ff', 49 | \ 46: '#00ff00', 47: '#00ff5f', 48: '#00ff87', 50 | \ 49: '#00ffaf', 50: '#00ffd7', 51: '#00ffff', 51 | \ 52: '#5f0000', 53: '#5f005f', 54: '#5f0087', 52 | \ 55: '#5f00af', 56: '#5f00d7', 57: '#5f00ff', 53 | \ 58: '#5f5f00', 59: '#5f5f5f', 60: '#5f5f87', 54 | \ 61: '#5f5faf', 62: '#5f5fd7', 63: '#5f5fff', 55 | \ 64: '#5f8700', 65: '#5f875f', 66: '#5f8787', 56 | \ 67: '#5f87af', 68: '#5f87d7', 69: '#5f87ff', 57 | \ 70: '#5faf00', 71: '#5faf5f', 72: '#5faf87', 58 | \ 73: '#5fafaf', 74: '#5fafd7', 75: '#5fafff', 59 | \ 76: '#5fd700', 77: '#5fd75f', 78: '#5fd787', 60 | \ 79: '#5fd7af', 80: '#5fd7d7', 81: '#5fd7ff', 61 | \ 82: '#5fff00', 83: '#5fff5f', 84: '#5fff87', 62 | \ 85: '#5fffaf', 86: '#5fffd7', 87: '#5fffff', 63 | \ 88: '#870000', 89: '#87005f', 90: '#870087', 64 | \ 91: '#8700af', 92: '#8700d7', 93: '#8700ff', 65 | \ 94: '#875f00', 95: '#875f5f', 96: '#875f87', 66 | \ 97: '#875faf', 98: '#875fd7', 99: '#875fff', 67 | \ 100: '#878700', 101: '#87875f', 102: '#878787', 68 | \ 103: '#8787af', 104: '#8787d7', 105: '#8787ff', 69 | \ 106: '#87af00', 107: '#87af5f', 108: '#87af87', 70 | \ 109: '#87afaf', 110: '#87afd7', 111: '#87afff', 71 | \ 112: '#87d700', 113: '#87d75f', 114: '#87d787', 72 | \ 115: '#87d7af', 116: '#87d7d7', 117: '#87d7ff', 73 | \ 118: '#87ff00', 119: '#87ff5f', 120: '#87ff87', 74 | \ 121: '#87ffaf', 122: '#87ffd7', 123: '#87ffff', 75 | \ 124: '#af0000', 125: '#af005f', 126: '#af0087', 76 | \ 127: '#af00af', 128: '#af00d7', 129: '#af00ff', 77 | \ 130: '#af5f00', 131: '#af5f5f', 132: '#af5f87', 78 | \ 133: '#af5faf', 134: '#af5fd7', 135: '#af5fff', 79 | \ 136: '#af8700', 137: '#af875f', 138: '#af8787', 80 | \ 139: '#af87af', 140: '#af87d7', 141: '#af87ff', 81 | \ 142: '#afaf00', 143: '#afaf5f', 144: '#afaf87', 82 | \ 145: '#afafaf', 146: '#afafd7', 147: '#afafff', 83 | \ 148: '#afd700', 149: '#afd75f', 150: '#afd787', 84 | \ 151: '#afd7af', 152: '#afd7d7', 153: '#afd7ff', 85 | \ 154: '#afff00', 155: '#afff5f', 156: '#afff87', 86 | \ 157: '#afffaf', 158: '#afffd7', 159: '#afffff', 87 | \ 160: '#d70000', 161: '#d7005f', 162: '#d70087', 88 | \ 163: '#d700af', 164: '#d700d7', 165: '#d700ff', 89 | \ 166: '#d75f00', 167: '#d75f5f', 168: '#d75f87', 90 | \ 169: '#d75faf', 170: '#d75fd7', 171: '#d75fff', 91 | \ 172: '#d78700', 173: '#d7875f', 174: '#d78787', 92 | \ 175: '#d787af', 176: '#d787d7', 177: '#d787ff', 93 | \ 178: '#d7af00', 179: '#d7af5f', 180: '#d7af87', 94 | \ 181: '#d7afaf', 182: '#d7afd7', 183: '#d7afff', 95 | \ 184: '#d7d700', 185: '#d7d75f', 186: '#d7d787', 96 | \ 187: '#d7d7af', 188: '#d7d7d7', 189: '#d7d7ff', 97 | \ 190: '#d7ff00', 191: '#d7ff5f', 192: '#d7ff87', 98 | \ 193: '#d7ffaf', 194: '#d7ffd7', 195: '#d7ffff', 99 | \ 196: '#ff0000', 197: '#ff005f', 198: '#ff0087', 100 | \ 199: '#ff00af', 200: '#ff00d7', 201: '#ff00ff', 101 | \ 202: '#ff5f00', 203: '#ff5f5f', 204: '#ff5f87', 102 | \ 205: '#ff5faf', 206: '#ff5fd7', 207: '#ff5fff', 103 | \ 208: '#ff8700', 209: '#ff875f', 210: '#ff8787', 104 | \ 211: '#ff87af', 212: '#ff87d7', 213: '#ff87ff', 105 | \ 214: '#ffaf00', 215: '#ffaf5f', 216: '#ffaf87', 106 | \ 217: '#ffafaf', 218: '#ffafd7', 219: '#ffafff', 107 | \ 220: '#ffd700', 221: '#ffd75f', 222: '#ffd787', 108 | \ 223: '#ffd7af', 224: '#ffd7d7', 225: '#ffd7ff', 109 | \ 226: '#ffff00', 227: '#ffff5f', 228: '#ffff87', 110 | \ 229: '#ffffaf', 230: '#ffffd7', 231: '#ffffff', 111 | \ 232: '#080808', 233: '#121212', 234: '#1c1c1c', 112 | \ 235: '#262626', 236: '#303030', 237: '#3a3a3a', 113 | \ 238: '#444444', 239: '#4e4e4e', 240: '#585858', 114 | \ 241: '#626262', 242: '#6c6c6c', 243: '#767676', 115 | \ 244: '#808080', 245: '#8a8a8a', 246: '#949494', 116 | \ 247: '#9e9e9e', 248: '#a8a8a8', 249: '#b2b2b2', 117 | \ 250: '#bcbcbc', 251: '#c6c6c6', 252: '#d0d0d0', 118 | \ 253: '#dadada', 254: '#e4e4e4', 255: '#eeeeee' } 119 | else 120 | let s:rgb_map = 121 | \{ 22: '#006F00', 23: '#007173', 24: '#007299', 25: '#0074BE', 30: '#009799', 122 | \ 31: '#0099BD', 38: '#00BDDF', 52: '#730B00', 58: '#727100', 59: '#727272', 123 | \ 65: '#719872', 66: '#719899', 67: '#7299BC', 68: '#719CDF', 73: '#6FBCBD', 124 | \ 74: '#70BDDF', 88: '#9B1300', 89: '#9B1D72', 94: '#9A7200', 95: '#9A7372', 125 | \ 96: '#9A7599', 101: '#999872', 103: '#999ABD', 108: '#98BC99', 109: '#98BCBD', 126 | \ 110: '#98BEDE', 116: '#97DDDF', 125: '#BF2172', 131: '#BE7572', 137: '#BE9873', 127 | \ 143: '#BDBB72', 144: '#BDBC98', 145: '#BDBDBD', 151: '#BCDDBD', 152: '#BCDEDE', 128 | \ 153: '#BCE0FF', 161: '#E12672', 168: '#E17899', 173: '#E19972', 174: '#E09B99', 129 | \ 179: '#DFBC72', 181: '#E0BEBC', 184: '#DEDC00', 186: '#DEDD99', 187: '#DFDEBD', 130 | \ 189: '#DFDFFF', 216: '#FFBD98', 217: '#FFBFBD', 218: '#FFC0DE', 220: '#FFDD00', 131 | \ 222: '#FFDE99', 224: '#FFDFDF', 230: '#FFFFDF', 231: '#FFFFFF', 232: '#060606', 132 | \ 233: '#171717', 234: '#252525', 235: '#333233', 236: '#3F3F3F', 237: '#4B4B4B', 133 | \ 238: '#565656', 239: '#616161', 240: '#6B6B6B', 241: '#757575', 249: '#BFBFBF', 134 | \ 250: '#C8C8C8', 251: '#D1D0D1', 252: '#D9D9D9', 253: '#E1E1E1', 254: '#E9E9E9', 135 | \ 255: '#F1F1F1' } 136 | endif 137 | endif 138 | 139 | let s:background = &background 140 | let s:colors_name = get(g:, 'colors_name', '') 141 | 142 | silent! unlet s:style s:seoul256_background 143 | 144 | " 1. If g:seoul256_background is found 145 | if exists('g:seoul256_background') 146 | let s:seoul256_background = g:seoul256_background 147 | if s:seoul256_background >= 233 && s:seoul256_background <= 239 148 | let s:style = 'dark' 149 | elseif s:seoul256_background >= 252 && s:seoul256_background <= 256 150 | let s:style = 'light' 151 | else 152 | unlet s:seoul256_background 153 | endif 154 | endif 155 | 156 | if !exists('s:style') 157 | " 2. If g:colors_name is NOT 'seoul256' -> dark version 158 | if s:colors_name != 'seoul256' 159 | let s:style = 'dark' 160 | " 3. Follow &background setting 161 | else 162 | let s:style = &background 163 | endif 164 | endif 165 | let s:style_idx = s:style == 'light' 166 | 167 | " Background colors 168 | if s:style == 'dark' 169 | let s:dark_bg = get(s:, 'seoul256_background', 237) 170 | let s:light_bg = 253 171 | else 172 | let s:dark_bg = 237 173 | let s:light_bg = get(s:, 'seoul256_background', 253) 174 | endif 175 | let s:dark_bg_2 = s:dark_bg > 233 ? s:dark_bg - 2 : 16 176 | let s:light_bg_1 = min([s:light_bg + 1, 256]) 177 | let s:light_bg_2 = min([s:light_bg + 2, 256]) 178 | 179 | " Foreground colors 180 | let s:dark_fg = 252 181 | let s:light_fg = 239 182 | 183 | function! s:hi(item, fg, bg) 184 | let fg = a:fg[s:style_idx] > 255 ? 231 : a:fg[s:style_idx] 185 | let bg = a:bg[s:style_idx] > 255 ? 231 : a:bg[s:style_idx] 186 | 187 | if !empty(fg) 188 | execute printf("highlight %s ctermfg=%s guifg=%s", a:item, fg, get(s:rgb_map, fg, 'NONE')) 189 | endif 190 | if !empty(bg) 191 | execute printf("highlight %s ctermbg=%s guibg=%s", a:item, bg, get(s:rgb_map, bg, 'NONE')) 192 | endif 193 | endfunction 194 | 195 | let s:gui = has('gui_running') 196 | if !s:gui 197 | set t_Co=256 198 | end 199 | 200 | silent! unlet g:colors_name 201 | hi clear 202 | if exists("syntax_on") 203 | syntax reset 204 | endif 205 | 206 | call s:hi('Normal', [s:dark_fg, s:light_fg], [s:dark_bg, s:light_bg]) 207 | 208 | call s:hi('LineNr', [101, 101], [s:dark_bg + 1, s:light_bg - 2]) 209 | call s:hi('Visual', ['', ''], [23, 152]) 210 | call s:hi('VisualNOS', ['', ''], [23, 152]) 211 | 212 | call s:hi('Comment', [65, 65], ['', '']) 213 | call s:hi('Number', [222, 95], ['', '']) 214 | call s:hi('Float', [222, 95], ['', '']) 215 | call s:hi('Boolean', [103, 168], ['', '']) 216 | call s:hi('String', [109, 30], ['', '']) 217 | call s:hi('Constant', [73, 23], ['', '']) 218 | call s:hi('Character', [174, 168], ['', '']) 219 | call s:hi('Delimiter', [137, 94], ['', '']) 220 | call s:hi('StringDelimiter', [137, 94], ['', '']) 221 | call s:hi('Statement', [108, 66], ['', '']) 222 | " case, default, etc. 223 | " hi Label ctermfg= 224 | 225 | " if else end 226 | call s:hi('Conditional', [110, 31], ['', '']) 227 | 228 | " while end 229 | call s:hi('Repeat', [68, 67], ['', '']) 230 | call s:hi('Todo', [161, 125], [s:dark_bg_2, s:light_bg_2]) 231 | call s:hi('Function', [187, 58], ['', '']) 232 | 233 | " Macros 234 | call s:hi('Define', [173, 131], ['', '']) 235 | call s:hi('Macro', [173, 131], ['', '']) 236 | call s:hi('Include', [173, 131], ['', '']) 237 | call s:hi('PreCondit', [173, 131], ['', '']) 238 | 239 | 240 | " #! 241 | call s:hi('PreProc', [143, 58], ['', '']) 242 | 243 | " @abc 244 | call s:hi('Identifier', [217, 96], ['', '']) 245 | 246 | " AAA Abc 247 | call s:hi('Type', [179, 94], ['', '']) 248 | 249 | " + - * / << 250 | call s:hi('Operator', [186, 131], ['', '']) 251 | 252 | " super yield 253 | call s:hi('Keyword', [168, 168], ['', '']) 254 | 255 | " raise 256 | call s:hi('Exception', [161, 161], ['', '']) 257 | " 258 | " hi StorageClass ctermfg= 259 | call s:hi('Structure', [116, 23], ['', '']) 260 | " hi Typedef ctermfg= 261 | 262 | call s:hi('Error', [s:dark_fg, s:light_bg_1], [52, 174]) 263 | call s:hi('ErrorMsg', [s:dark_fg, s:light_bg_1], [52, 168]) 264 | call s:hi('Underlined', [181, 168], ['', '']) 265 | 266 | " set textwidth=80 267 | " set colorcolumn=+1 268 | call s:hi('ColorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 2]) 269 | 270 | " GVIM only 271 | " hi Cursor ctermfg= 272 | " hi CursorIM ctermfg= 273 | 274 | " set cursorline cursorcolumn 275 | call s:hi('CursorLine', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) 276 | call s:hi('CursorLineNr', [131, 131], [s:dark_bg - 1, s:light_bg - 1]) 277 | call s:hi('CursorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 1]) 278 | 279 | call s:hi('Directory', [187, 95], ['', '']) 280 | 281 | call s:hi('DiffAdd', ['NONE', 'NONE'], [22, 151]) 282 | call s:hi('DiffDelete', ['NONE', 'NONE'], [95, 181]) 283 | call s:hi('DiffChange', ['NONE', 'NONE'], [s:dark_bg + 3, 189]) 284 | call s:hi('DiffText', ['NONE', 'NONE'], [52, 224]) 285 | 286 | call s:hi('VertSplit', [s:dark_bg_2, s:light_bg - 3], [s:dark_bg_2, s:light_bg - 3]) 287 | call s:hi('Folded', [101, 101], [s:dark_bg + 1, s:light_bg - 2]) 288 | 289 | " set foldcolumn=1 290 | call s:hi('FoldColumn', [144, 94], [s:dark_bg + 1, s:light_bg - 2]) 291 | 292 | call s:hi('MatchParen', ['', ''], [s:dark_bg + 3, s:light_bg - 3]) 293 | 294 | " -- INSERT -- 295 | call s:hi('ModeMsg', [173, 173], ['', '']) 296 | 297 | " let &showbreak = '> ' 298 | call s:hi('NonText', [59, 145], ['', '']) 299 | 300 | call s:hi('MoreMsg', [173, 173], ['', '']) 301 | 302 | " Popup menu 303 | call s:hi('Pmenu', [s:dark_bg + 1, 238], [224, 224]) 304 | call s:hi('PmenuSel', [s:dark_fg, s:dark_fg], [89, 89]) 305 | call s:hi('PmenuSbar', ['', ''], [65, 65]) 306 | call s:hi('PmenuThumb', ['', ''], [23, 23]) 307 | 308 | call s:hi('Search', [s:dark_fg, 255], [24, 74]) 309 | call s:hi('IncSearch', [220, 220], [s:dark_bg + 1, 238]) 310 | 311 | " String delimiter, interpolation 312 | call s:hi('Special', [216, 173], ['', '']) 313 | " hi SpecialChar ctermfg= 314 | " hi SpecialComment ctermfg= 315 | " hi Tag ctermfg= 316 | " hi Debug ctermfg= 317 | 318 | " :map, listchars 319 | call s:hi('SpecialKey', [59, 145], ['', '']) 320 | 321 | if !s:gui 322 | " Red / Blue / Cyan / Magenta 323 | if s:style_idx == 0 324 | hi SpellBad ctermbg=NONE cterm=underline ctermfg=168 325 | hi SpellCap ctermbg=NONE cterm=underline ctermfg=110 326 | hi SpellLocal ctermbg=NONE cterm=underline ctermfg=153 327 | hi SpellRare ctermbg=NONE cterm=underline ctermfg=218 328 | else 329 | hi SpellBad ctermbg=NONE cterm=underline ctermfg=125 330 | hi SpellCap ctermbg=NONE cterm=underline ctermfg=25 331 | hi SpellLocal ctermbg=NONE cterm=underline ctermfg=31 332 | hi SpellRare ctermbg=NONE cterm=underline ctermfg=96 333 | endif 334 | else 335 | if s:style_idx == 0 336 | execute 'hi SpellBad gui=undercurl guisp=' . s:rgb_map[168] 337 | execute 'hi SpellCap gui=undercurl guisp=' . s:rgb_map[110] 338 | execute 'hi SpellLocal gui=undercurl guisp=' . s:rgb_map[153] 339 | execute 'hi SpellRare gui=undercurl guisp=' . s:rgb_map[218] 340 | else 341 | execute 'hi SpellBad gui=undercurl guisp=' . s:rgb_map[125] 342 | execute 'hi SpellCap gui=undercurl guisp=' . s:rgb_map[25] 343 | execute 'hi SpellLocal gui=undercurl guisp=' . s:rgb_map[31] 344 | execute 'hi SpellRare gui=undercurl guisp=' . s:rgb_map[96] 345 | endif 346 | endif 347 | 348 | " 349 | call s:hi('StatusLine', [95, 95], [187, 187]) 350 | call s:hi('StatusLineNC', [s:dark_bg + 2, s:light_bg - 2], [187, 238]) 351 | call s:hi('StatusLineTerm', [95, 95], [187, 187]) 352 | call s:hi('StatusLineTermNC', [s:dark_bg + 2, s:light_bg - 2], [187, 238]) 353 | hi StatusLineTerm cterm=bold,reverse gui=bold,reverse 354 | hi StatusLineTermNC cterm=bold,reverse gui=bold,reverse 355 | call s:hi('TabLineFill', [s:dark_bg + 2, s:light_bg - 2], ['', '']) 356 | call s:hi('TabLineSel', [187, 187], [23, 66]) 357 | call s:hi('TabLine', [s:dark_bg + 12, s:light_bg - 12], [s:dark_bg + 4, s:light_bg - 4]) 358 | call s:hi('WildMenu', [95, 95], [184, 184]) 359 | 360 | " :set all 361 | call s:hi('Title', [181, 88], ['', '']) 362 | 363 | " TODO 364 | call s:hi('Question', [179, 88], ['', '']) 365 | 366 | " Search hit bottom 367 | call s:hi('WarningMsg', [179, 88], ['', '']) 368 | 369 | " Sign column 370 | call s:hi('SignColumn', [173, 173], [s:dark_bg, s:light_bg]) 371 | 372 | " Diff 373 | call s:hi('diffAdded', [108, 65], ['', '']) 374 | call s:hi('diffRemoved', [174, 131], ['', '']) 375 | hi link diffLine Constant 376 | 377 | call s:hi('Conceal', [s:dark_fg + 2, s:light_fg - 2], [s:dark_bg - 1, s:light_bg + 2]) 378 | call s:hi('Ignore', [s:dark_bg + 3, s:light_bg - 3], [s:dark_bg, s:light_bg]) 379 | 380 | """"""""""""""""""""""""""""""""""""""""""""""""" 381 | " Plugins 382 | """"""""""""""""""""""""""""""""""""""""""""""""" 383 | 384 | " vim-indent-guides 385 | " ----------------- 386 | let g:indent_guides_auto_colors = 0 387 | call s:hi('IndentGuidesOdd', ['', ''], [s:dark_bg - 1, s:light_bg + 1]) 388 | call s:hi('IndentGuidesEven', ['', ''], [s:dark_bg + 1, s:light_bg - 1]) 389 | 390 | " vim-gitgutter 391 | " ------------- 392 | call s:hi('GitGutterAdd', [108, 65], [s:dark_bg + 1, s:light_bg - 2]) 393 | call s:hi('GitGutterChange', [68, 68], [s:dark_bg + 1, s:light_bg - 2]) 394 | call s:hi('GitGutterDelete', [161, 161], [s:dark_bg + 1, s:light_bg - 2]) 395 | call s:hi('GitGutterChangeDelete', [168, 168], [s:dark_bg + 1, s:light_bg - 2]) 396 | 397 | " ale 398 | " --- 399 | call s:hi('ALEErrorSign', [161, 161], [s:dark_bg, s:light_bg]) 400 | call s:hi('ALEWarningSign', [174, 131], [s:dark_bg, s:light_bg]) 401 | 402 | " vim-signify 403 | " ----------- 404 | call s:hi('SignifySignAdd', [108, 65], [s:dark_bg + 1, s:light_bg - 2]) 405 | call s:hi('SignifySignChange', [68, 68], [s:dark_bg + 1, s:light_bg - 2]) 406 | call s:hi('SignifySignDelete', [161, 161], [s:dark_bg + 1, s:light_bg - 2]) 407 | 408 | 409 | " http://vim.wikia.com/wiki/Highlight_unwanted_spaces 410 | " ---------------------------------------------------^^^^^ 411 | call s:hi('ExtraWhitespace', ['', ''], [s:dark_bg - 1, s:light_bg - 2]) 412 | 413 | " vim-ruby 414 | " -------- 415 | " " rubySymbol 416 | let ruby_operators = 1 417 | call s:hi('rubyClass', [31, 31], ['', '']) 418 | " call s:hi('rubyInstanceVariable', [189, 189], ['', '']) 419 | call s:hi('rubyRegexp', [186, 101], ['', '']) 420 | call s:hi('rubyRegexpDelimiter', [168, 168], ['', '']) 421 | call s:hi('rubyArrayDelimiter', [67, 38], ['', '']) 422 | call s:hi('rubyBlockParameterList', [186, 94], ['', '']) 423 | call s:hi('rubyCurlyBlockDelimiter', [144, 101], ['', '']) 424 | 425 | " ARGV $stdout 426 | call s:hi('rubyPredefinedIdentifier', [230, 52], ['', '']) 427 | " hi rubyRegexpSpecial 428 | 429 | hi CursorLine cterm=NONE 430 | hi CursorLineNr cterm=NONE 431 | 432 | let g:seoul256_current_fg = [s:dark_fg, s:light_fg][s:style_idx] 433 | let g:seoul256_current_bg = [s:dark_bg, s:light_bg][s:style_idx] 434 | let g:colors_name = 'seoul256' 435 | if s:colors_name != g:colors_name || s:background == s:style 436 | let &background = s:style 437 | else 438 | let &background = s:background 439 | endif 440 | -------------------------------------------------------------------------------- /fonts/DejaVu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chxuan/vimplus/2dc33dfeda8f63b918ec6e612fd1d3081bb9f78a/fonts/DejaVu.ttf -------------------------------------------------------------------------------- /fonts/Droid Sans Mono Nerd Font Complete.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chxuan/vimplus/2dc33dfeda8f63b918ec6e612fd1d3081bb9f78a/fonts/Droid Sans Mono Nerd Font Complete.otf -------------------------------------------------------------------------------- /ftplugin/vim/vim.vim: -------------------------------------------------------------------------------- 1 | autocmd BufEnter .vimrc execute ":call EnterVimrc()" 2 | autocmd BufLeave .vimrc execute ":call LeaveVimrc()" 3 | 4 | let s:lines = [] 5 | 6 | function! EnterVimrc() 7 | if match(getline(18), "vimplus") != -1 8 | call timer_start(0, 'HighlightLogoAsync', {'repeat': 1}) 9 | endif 10 | endfunction 11 | 12 | function! LeaveVimrc() 13 | call clearmatches() 14 | endfunction 15 | 16 | function! HighlightLogoAsync(id) 17 | call timer_stop(a:id) 18 | call highlight_logo() 19 | endfunction 20 | 21 | function! s:highlight_logo() 22 | highlight default 87a231 ctermfg=87 ctermbg=231 cterm=bold 23 | highlight default 130a83 ctermfg=130 ctermbg=83 cterm=bold 24 | highlight default 37a87 ctermfg=37 ctermbg=87 cterm=bold 25 | highlight default 248a87 ctermfg=248 ctermbg=87 cterm=bold 26 | highlight default 87a248 ctermfg=87 ctermbg=248 cterm=bold 27 | highlight default 240a37 ctermfg=240 ctermbg=37 cterm=bold 28 | highlight default 83a37 ctermfg=83 ctermbg=37 cterm=bold 29 | highlight default 248a83 ctermfg=248 ctermbg=83 cterm=bold 30 | highlight default 130a248 ctermfg=130 ctermbg=248 cterm=bold 31 | highlight default 248a240 ctermfg=248 ctermbg=240 cterm=bold 32 | highlight default 34a83 ctermfg=34 ctermbg=83 cterm=bold 33 | highlight default 37a240 ctermfg=37 ctermbg=240 cterm=bold 34 | highlight default 87a37 ctermfg=87 ctermbg=37 cterm=bold 35 | highlight default 231a248 ctermfg=231 ctermbg=248 cterm=bold 36 | highlight default 83a87 ctermfg=83 ctermbg=87 cterm=bold 37 | highlight default 37a248 ctermfg=37 ctermbg=248 cterm=bold 38 | highlight default 34a37 ctermfg=34 ctermbg=37 cterm=bold 39 | highlight default 248a37 ctermfg=248 ctermbg=37 cterm=bold 40 | highlight default 248a231 ctermfg=248 ctermbg=231 cterm=bold 41 | highlight default 130a240 ctermfg=130 ctermbg=240 cterm=bold 42 | highlight default 37a83 ctermfg=37 ctermbg=83 cterm=bold 43 | highlight default 240a248 ctermfg=240 ctermbg=248 cterm=bold 44 | highlight default 240a130 ctermfg=240 ctermbg=130 cterm=bold 45 | highlight default 87a83 ctermfg=87 ctermbg=83 cterm=bold 46 | 47 | if empty(s:lines) 48 | " let s:lines = readfile(expand($HOME . "/.vim/ftplugin/vim/vimplus_logo_light.txt")) 49 | let s:lines = readfile(expand($HOME . "/.vim/ftplugin/vim/vimplus_logo_black.txt")) 50 | endif 51 | 52 | for line in s:lines 53 | let ret = split(line, "-") 54 | call matchaddpos(ret[2], [[ret[0], ret[1] + 2]], 10, -1) 55 | endfor 56 | endfunction 57 | -------------------------------------------------------------------------------- /ftplugin/vim/vimplus_logo_black.txt: -------------------------------------------------------------------------------- 1 | 2-21-87a37 2 | 2-22-37a83 3 | 2-23-37a87 4 | 2-24-83a37 5 | 2-25-87a248 6 | 3-9-231a248 7 | 3-10-37a87 8 | 3-11-83a37 9 | 3-12-87a37 10 | 3-13-83a37 11 | 3-14-37a87 12 | 3-15-37a83 13 | 3-16-87a37 14 | 3-17-83a37 15 | 3-18-37a87 16 | 3-19-83a37 17 | 3-20-37a87 18 | 3-21-83a37 19 | 3-22-37a87 20 | 3-23-83a37 21 | 3-24-37a87 22 | 3-25-37a83 23 | 3-26-87a37 24 | 3-27-37a87 25 | 3-28-37a248 26 | 3-29-231a248 27 | 4-7-231a248 28 | 4-8-87a37 29 | 4-9-37a83 30 | 4-10-87a37 31 | 4-11-37a87 32 | 4-12-37a83 33 | 4-13-87a37 34 | 4-14-37a83 35 | 4-15-37a87 36 | 4-16-37a83 37 | 4-17-37a87 38 | 4-18-37a83 39 | 4-19-83a37 40 | 4-20-83a37 41 | 4-21-37a87 42 | 4-22-37a83 43 | 4-23-87a37 44 | 4-24-83a37 45 | 4-25-240a37 46 | 4-26-83a37 47 | 4-27-37a83 48 | 4-28-87a37 49 | 4-29-87a83 50 | 4-30-87a248 51 | 4-49-231a248 52 | 4-50-37a248 53 | 4-51-37a248 54 | 5-6-231a248 55 | 5-7-37a87 56 | 5-8-37a83 57 | 5-9-37a87 58 | 5-10-37a83 59 | 5-11-83a37 60 | 5-12-37a87 61 | 5-13-83a37 62 | 5-14-37a87 63 | 5-15-83a37 64 | 5-16-87a37 65 | 5-17-37a83 66 | 5-18-37a87 67 | 5-19-87a37 68 | 5-20-87a83 69 | 5-21-83a37 70 | 5-22-87a37 71 | 5-23-87a83 72 | 5-24-87a37 73 | 5-25-83a37 74 | 5-26-240a37 75 | 5-27-37a87 76 | 5-28-37a83 77 | 5-29-87a37 78 | 5-30-37a87 79 | 5-33-87a37 80 | 5-34-248a37 81 | 5-35-248a37 82 | 5-42-248a37 83 | 5-43-87a37 84 | 5-44-37a248 85 | 5-49-231a248 86 | 5-50-37a87 87 | 5-51-37a248 88 | 5-73-87a248 89 | 5-74-240a37 90 | 5-75-87a37 91 | 5-76-87a248 92 | 5-77-87a248 93 | 5-78-87a248 94 | 5-79-87a248 95 | 5-80-87a248 96 | 5-81-87a248 97 | 5-82-83a37 98 | 5-83-248a37 99 | 5-84-87a248 100 | 5-89-231a248 101 | 5-90-231a248 102 | 6-5-231a248 103 | 6-6-37a83 104 | 6-7-87a37 105 | 6-8-87a37 106 | 6-9-83a37 107 | 6-10-37a87 108 | 6-11-34a37 109 | 6-12-83a37 110 | 6-13-83a37 111 | 6-14-83a37 112 | 6-15-37a87 113 | 6-16-83a37 114 | 6-17-87a37 115 | 6-18-37a83 116 | 6-19-87a37 117 | 6-20-83a37 118 | 6-21-87a37 119 | 6-22-87a83 120 | 6-23-87a37 121 | 6-24-87a83 122 | 6-25-87a37 123 | 6-26-37a83 124 | 6-27-87a37 125 | 6-28-37a87 126 | 6-29-34a83 127 | 6-30-37a248 128 | 6-34-37a83 129 | 6-35-37a87 130 | 6-36-240a248 131 | 6-41-87a248 132 | 6-42-83a37 133 | 6-43-37a248 134 | 6-73-87a248 135 | 6-74-83a37 136 | 6-75-37a248 137 | 6-82-248a37 138 | 6-83-83a37 139 | 6-84-87a248 140 | 6-88-231a248 141 | 6-89-87a37 142 | 6-90-83a37 143 | 6-91-231a248 144 | 7-5-37a87 145 | 7-6-83a37 146 | 7-7-37a87 147 | 7-8-37a83 148 | 7-9-240a37 149 | 7-10-34a37 150 | 7-11-83a37 151 | 7-12-240a37 152 | 7-13-87a37 153 | 7-14-83a37 154 | 7-15-87a37 155 | 7-16-83a87 156 | 7-17-240a37 157 | 7-18-34a37 158 | 7-19-83a37 159 | 7-20-240a37 160 | 7-21-87a37 161 | 7-22-83a87 162 | 7-23-37a83 163 | 7-24-37a87 164 | 7-25-83a37 165 | 7-26-37a87 166 | 7-27-37a83 167 | 7-28-37a248 168 | 7-29-87a248 169 | 7-34-87a248 170 | 7-35-240a37 171 | 7-36-87a37 172 | 7-40-231a248 173 | 7-41-240a37 174 | 7-42-37a87 175 | 7-43-240a248 176 | 7-48-231a248 177 | 7-49-37a87 178 | 7-50-37a83 179 | 7-51-37a248 180 | 7-57-87a37 181 | 7-58-240a37 182 | 7-59-248a87 183 | 7-60-231a248 184 | 7-61-87a248 185 | 7-62-87a37 186 | 7-63-83a37 187 | 7-64-37a248 188 | 7-65-231a248 189 | 7-66-87a248 190 | 7-67-240a37 191 | 7-68-87a37 192 | 7-69-87a248 193 | 7-73-87a248 194 | 7-74-248a37 195 | 7-75-37a83 196 | 7-82-37a87 197 | 7-83-240a37 198 | 7-84-87a248 199 | 7-88-231a248 200 | 7-89-87a37 201 | 7-90-87a37 202 | 7-95-240a37 203 | 7-96-87a37 204 | 7-97-87a248 205 | 7-101-231a248 206 | 7-102-240a37 207 | 7-103-87a37 208 | 7-104-231a248 209 | 7-108-248a37 210 | 7-109-83a37 211 | 7-110-248a37 212 | 7-111-231a248 213 | 7-112-87a248 214 | 7-113-231a248 215 | 7-114-87a248 216 | 7-115-231a248 217 | 7-116-87a248 218 | 7-117-231a248 219 | 8-5-83a37 220 | 8-6-87a37 221 | 8-7-231a248 222 | 8-9-87a37 223 | 8-10-83a37 224 | 8-11-240a37 225 | 8-12-83a37 226 | 8-13-37a248 227 | 8-16-231a248 228 | 8-17-83a37 229 | 8-18-240a37 230 | 8-19-83a37 231 | 8-20-34a37 232 | 8-21-231a248 233 | 8-26-231a248 234 | 8-35-37a87 235 | 8-36-37a83 236 | 8-37-87a248 237 | 8-40-37a87 238 | 8-41-37a83 239 | 8-42-240a248 240 | 8-49-231a248 241 | 8-50-87a37 242 | 8-51-83a37 243 | 8-57-87a37 244 | 8-58-248a83 245 | 8-59-87a248 246 | 8-62-87a248 247 | 8-63-83a37 248 | 8-64-87a248 249 | 8-67-87a248 250 | 8-68-37a83 251 | 8-69-37a248 252 | 8-73-87a248 253 | 8-74-87a37 254 | 8-75-87a37 255 | 8-76-231a248 256 | 8-82-37a83 257 | 8-83-37a248 258 | 8-84-37a248 259 | 8-88-87a248 260 | 8-89-37a83 261 | 8-90-248a87 262 | 8-91-231a248 263 | 8-95-87a37 264 | 8-96-37a83 265 | 8-97-231a248 266 | 8-101-231a248 267 | 8-102-83a37 268 | 8-103-37a87 269 | 8-104-231a248 270 | 8-108-248a37 271 | 8-109-87a37 272 | 8-110-87a248 273 | 9-3-130a240 274 | 9-4-130a240 275 | 9-5-87a37 276 | 9-6-87a83 277 | 9-7-240a37 278 | 9-8-240a130 279 | 9-9-248a240 280 | 9-10-34a37 281 | 9-11-34a37 282 | 9-12-130a240 283 | 9-13-130a240 284 | 9-14-130a240 285 | 9-15-240a130 286 | 9-16-248a240 287 | 9-17-37a240 288 | 9-18-83a37 289 | 9-19-240a37 290 | 9-20-130a240 291 | 9-21-130a240 292 | 9-22-130a240 293 | 9-23-130a240 294 | 9-24-130a240 295 | 9-25-130a240 296 | 9-26-130a240 297 | 9-27-130a240 298 | 9-28-130a240 299 | 9-29-130a240 300 | 9-30-240a130 301 | 9-31-231a248 302 | 9-35-240a248 303 | 9-36-248a37 304 | 9-37-83a37 305 | 9-39-231a248 306 | 9-40-240a37 307 | 9-41-37a248 308 | 9-42-87a248 309 | 9-49-87a248 310 | 9-50-248a37 311 | 9-51-37a87 312 | 9-52-231a248 313 | 9-57-248a87 314 | 9-58-83a37 315 | 9-59-87a248 316 | 9-62-37a248 317 | 9-63-87a37 318 | 9-64-87a248 319 | 9-67-87a248 320 | 9-68-240a37 321 | 9-69-87a248 322 | 9-73-87a248 323 | 9-74-37a83 324 | 9-75-37a248 325 | 9-76-248a87 326 | 9-77-87a248 327 | 9-78-87a248 328 | 9-79-87a248 329 | 9-80-87a248 330 | 9-81-231a248 331 | 9-82-87a248 332 | 9-83-87a248 333 | 9-84-231a248 334 | 9-88-231a248 335 | 9-89-87a37 336 | 9-90-240a37 337 | 9-95-37a87 338 | 9-96-240a37 339 | 9-97-87a248 340 | 9-101-231a248 341 | 9-102-87a37 342 | 9-103-37a83 343 | 9-104-231a248 344 | 9-108-37a87 345 | 9-109-130a83 346 | 9-110-37a248 347 | 9-111-231a248 348 | 9-112-231a248 349 | 9-113-231a248 350 | 9-114-231a248 351 | 9-115-231a248 352 | 9-116-231a248 353 | 10-3-231a248 354 | 10-4-240a248 355 | 10-5-37a83 356 | 10-6-37a87 357 | 10-7-130a248 358 | 10-8-240a248 359 | 10-9-37a240 360 | 10-10-37a83 361 | 10-11-87a37 362 | 10-12-83a37 363 | 10-13-248a37 364 | 10-14-240a37 365 | 10-15-231a248 366 | 10-16-240a248 367 | 10-17-240a248 368 | 10-18-240a248 369 | 10-19-240a248 370 | 10-20-240a248 371 | 10-21-240a248 372 | 10-22-240a248 373 | 10-23-240a248 374 | 10-24-240a130 375 | 10-25-240a248 376 | 10-26-240a248 377 | 10-27-240a248 378 | 10-28-130a248 379 | 10-29-231a248 380 | 10-30-240a248 381 | 10-36-87a248 382 | 10-37-83a37 383 | 10-38-87a37 384 | 10-39-37a248 385 | 10-40-37a83 386 | 10-41-87a248 387 | 10-49-231a248 388 | 10-50-37a83 389 | 10-51-248a37 390 | 10-57-83a37 391 | 10-58-37a248 392 | 10-59-87a248 393 | 10-62-248a87 394 | 10-63-37a83 395 | 10-64-87a248 396 | 10-67-37a248 397 | 10-68-37a83 398 | 10-69-87a248 399 | 10-73-231a248 400 | 10-74-87a37 401 | 10-75-248a37 402 | 10-88-231a248 403 | 10-89-83a37 404 | 10-90-37a87 405 | 10-91-231a248 406 | 10-95-83a37 407 | 10-96-37a248 408 | 10-97-87a248 409 | 10-101-231a248 410 | 10-102-87a37 411 | 10-103-37a248 412 | 10-104-87a248 413 | 10-112-87a231 414 | 10-114-248a87 415 | 10-115-37a87 416 | 10-116-37a83 417 | 10-117-248a37 418 | 11-5-37a248 419 | 11-6-37a83 420 | 11-8-248a87 421 | 11-9-83a87 422 | 11-10-87a248 423 | 11-13-248a87 424 | 11-14-37a83 425 | 11-15-37a87 426 | 11-24-231a248 427 | 11-25-248a240 428 | 11-26-240a248 429 | 11-37-248a37 430 | 11-38-37a83 431 | 11-39-37a87 432 | 11-40-37a248 433 | 11-49-87a248 434 | 11-50-87a37 435 | 11-51-83a37 436 | 11-57-248a37 437 | 11-58-83a37 438 | 11-59-87a248 439 | 11-62-37a248 440 | 11-63-83a37 441 | 11-64-87a248 442 | 11-67-87a248 443 | 11-68-240a37 444 | 11-69-87a248 445 | 11-73-87a248 446 | 11-74-83a37 447 | 11-75-248a37 448 | 11-88-87a248 449 | 11-89-248a37 450 | 11-90-37a83 451 | 11-95-87a37 452 | 11-96-37a83 453 | 11-97-87a248 454 | 11-101-231a248 455 | 11-102-83a37 456 | 11-103-37a87 457 | 11-104-231a248 458 | 11-115-248a37 459 | 11-116-83a37 460 | 11-117-87a248 461 | 12-5-37a87 462 | 12-6-83a37 463 | 12-7-87a248 464 | 12-8-87a248 465 | 12-9-37a83 466 | 12-10-37a87 467 | 12-14-37a87 468 | 12-15-34a83 469 | 12-16-231a248 470 | 12-25-87a248 471 | 12-26-83a37 472 | 12-27-240a37 473 | 12-37-87a248 474 | 12-38-37a248 475 | 12-39-248a37 476 | 12-40-231a248 477 | 12-49-231a248 478 | 12-50-87a248 479 | 12-51-248a37 480 | 12-57-248a87 481 | 12-58-248a37 482 | 12-59-87a248 483 | 12-62-87a248 484 | 12-63-248a37 485 | 12-64-87a248 486 | 12-67-87a248 487 | 12-68-37a83 488 | 12-69-87a248 489 | 12-73-231a248 490 | 12-74-37a87 491 | 12-75-37a83 492 | 12-88-231a248 493 | 12-89-37a87 494 | 12-90-240a248 495 | 12-91-231a248 496 | 12-95-87a248 497 | 12-96-248a37 498 | 12-97-248a37 499 | 12-98-87a248 500 | 12-99-83a37 501 | 12-100-248a87 502 | 12-101-83a37 503 | 12-102-87a248 504 | 12-103-83a37 505 | 12-104-231a248 506 | 12-108-87a248 507 | 12-109-83a37 508 | 12-110-37a87 509 | 12-111-248a37 510 | 12-112-83a87 511 | 12-113-37a248 512 | 12-114-37a83 513 | 12-115-87a248 514 | 12-116-248a37 515 | 12-117-37a248 516 | 13-5-231a248 517 | 13-6-37a87 518 | 13-7-37a83 519 | 13-8-231a248 520 | 13-9-37a87 521 | 13-10-37a83 522 | 13-11-37a87 523 | 13-12-231a248 524 | 13-13-231a248 525 | 13-14-37a83 526 | 13-15-37a87 527 | 13-27-231a248 528 | 14-6-231a248 529 | 14-7-248a87 530 | 14-8-37a83 531 | 14-9-87a37 532 | 14-10-37a248 533 | 14-11-37a83 534 | 14-12-37a87 535 | 14-13-37a83 536 | 14-14-248a87 537 | 15-11-231a248 538 | -------------------------------------------------------------------------------- /help.md: -------------------------------------------------------------------------------- 1 | ## 插件相关 2 | 3 | | 快捷键 | 说明 | 4 | | ------- | ----- | 5 | | `,` | Leader Key | 6 | | `n` | 打开/关闭代码资源管理器 | 7 | | `t` | 打开/关闭函数列表 | 8 | | `a` | .h .cpp 文件切换 | 9 | | `u` | 转到函数声明 | 10 | | `U` | 转到函数实现 | 11 | | `u` | 转到变量声明 | 12 | | `o` | 打开include文件 | 13 | | `y` | 拷贝函数声明 | 14 | | `p` | 生成函数实现 | 15 | | `w` | 单词跳转 | 16 | | `f` | 搜索当前目录下的文件 | 17 | | `F` | 搜索当前目录下的文本 | 18 | | `g` | 显示git仓库提交记录 | 19 | | `G` | 显示当前文件提交记录 | 20 | | `gg` | 显示当前文件在某个commit下的完整内容 | 21 | | `ff` | 语法错误自动修复(FixIt) | 22 | | `` | 切换到上一个buffer | 23 | | `` | 切换到下一个buffer | 24 | | `d` | 删除当前buffer | 25 | | `D` | 删除当前buffer外的所有buffer | 26 | | `vim` | 运行vim编辑器时,默认启动开始页面 | 27 | | `` | 显示语法错误提示窗口 | 28 | | `` | 显示上一主题 | 29 | | `` | 显示下一主题 | 30 | | `l` | 按竖线对齐 | 31 | | `=` | 按等号对齐 | 32 | | `Ya` | 复制行文本到字母a | 33 | | `Da` | 剪切行文本到字母a | 34 | | `Ca` | 改写行文本到字母a | 35 | | `rr` | 替换文本 | 36 | | `r` | 全局替换,目前只支持单个文件 | 37 | | `rev` | 翻转当前光标下的单词或使用V模式选择的文本 | 38 | | `gcc` | 注释代码 | 39 | | `gcap` | 注释段落 | 40 | | `vif` | 选中函数内容 | 41 | | `dif` | 删除函数内容 | 42 | | `cif` | 改写函数内容 | 43 | | `vaf` | 选中函数内容(包括函数名 花括号) | 44 | | `daf` | 删除函数内容(包括函数名 花括号) | 45 | | `caf` | 改写函数内容(包括函数名 花括号) | 46 | | `fa` | 查找字母a,然后再按f键查找下一个 | 47 | | `e` | 快速编辑~/.vimrc文件 | 48 | | `s` | 重新加载~/.vimrc文件 | 49 | | `vp` | 快速编辑~/.vimrc.custom.plugins文件 | 50 | | `vc` | 快速编辑~/.vimrc.custom.config文件 | 51 | | `h` | 打开vimplus帮助文档 | 52 | | `H` | 打开当前光标所在单词的vim帮助文档 | 53 | | `t` | 生成try-catch代码块 | 54 | | `y` | 复制当前选中到系统剪切板 | 55 | | `i` | 安装插件 | 56 | | `u` | 更新插件 | 57 | | `c` | 删除插件 | 58 | 59 | 60 | ## 插入模式 61 | 62 | | 快捷键 | 说明 | 63 | | ------- | ----- | 64 | | `i` | 在光标处进入插入模式 | 65 | | `I` | 在行首进入插入模式 | 66 | | `a` | 在光标后进入插入模式 | 67 | | `A` | 在行尾进入插入模式 | 68 | | `o` | 在下一行插入新行并进入插入模式 | 69 | | `O` | 在上一行插入新行并进入插入模式 | 70 | | `gi` | 进入到上一次插入模式的位置 | 71 | | `` | 退出插入模式 | 72 | 73 | 74 | ## 缓存操作 75 | 76 | | 快捷键 | 说明 | 77 | | ------- | ----- | 78 | | `:e ` | 新建buffer打开文件 | 79 | | `:bp` | 切换到上一个buffer | 80 | | `:bn` | 切换到下一个buffer | 81 | | `:bd` | 删除当前buffer | 82 | 83 | 84 | ## 窗口操作 85 | 86 | | 快捷键 | 说明 | 87 | | ------- | ----- | 88 | | `:sp ` | 横向切分窗口并打开文件 | 89 | | `:vsp ` | 竖向切分窗口并打开文件 | 90 | | `h` | 跳到左边的窗口 | 91 | | `j` | 跳到下边的窗口 | 92 | | `k` | 跳到上边的窗口 | 93 | | `l` | 跳到右边的窗口 | 94 | | `c` | 关闭当前窗口 | 95 | | `o` | 关闭其他窗口 | 96 | | `:only` | 关闭其他窗口 | 97 | 98 | 99 | ## 光标移动 100 | 101 | | 快捷键 | 说明 | 102 | | ------- | ----- | 103 | | `h` | 上下左右移动 | 104 | | `j` | 上下左右移动 | 105 | | `k` | 上下左右移动 | 106 | | `l` | 上下左右移动 | 107 | | `0` | 光标移动到行首 | 108 | | `^` | 跳到从行首开始第一个非空白字符 | 109 | | `$` | 光标移动到行尾 | 110 | | `` | 跳到上一个位置 | 111 | | `` | 跳到下一个位置 | 112 | | `` | 上一页 | 113 | | `` | 下一页 | 114 | | `` | 上移半屏 | 115 | | `` | 下移半屏 | 116 | | `H` | 调到屏幕顶上 | 117 | | `M` | 调到屏幕中间 | 118 | | `L` | 调到屏幕下方 | 119 | | `:n` | 跳到第n行 | 120 | | `w` | 跳到下一个单词开头(标点或空格分隔的单词) | 121 | | `W` | 跳到下一个单词开头(空格分隔的单词) | 122 | | `e` | 跳到下一个单词尾部(标点或空格分隔的单词) | 123 | | `E` | 跳到下一个单词尾部(空格分隔的单词) | 124 | | `b` | 上一个单词头(标点或空格分隔的单词) | 125 | | `B` | 上一个单词头(空格分隔的单词) | 126 | | `ge` | 上一个单词尾 | 127 | | `%` | 在配对符间移动, 可用于()、{}、[] | 128 | | `gg` | 到文件首 | 129 | | `G` | 到文件尾 | 130 | | `fx` | 跳转到下一个为x的字符 | 131 | | `Fx` | 跳转到上一个为x的字符 | 132 | | `tx` | 跳转到下一个为x的字符前 | 133 | | `Tx` | 跳转到上一个为x的字符前 | 134 | | `;` | 跳到下一个搜索的结果 | 135 | | `[[` | 跳转到函数开头 | 136 | | `]]` | 跳转到函数结尾 | 137 | 138 | 139 | ## 文本编辑 140 | 141 | | 快捷键 | 说明 | 142 | | ------- | ----- | 143 | | `r` | 替换当前字符 | 144 | | `R` | 进入替换模式,直至 ESC 离开 | 145 | | `s` | 替换字符(删除光标处字符,并进入插入模式,前可接数量) | 146 | | `S` | 替换行(删除当前行,并进入插入模式,前可接数量) | 147 | | `cc` | 改写当前行(删除当前行并进入插入模式),同 S | 148 | | `cw` | 改写光标开始处的当前单词 | 149 | | `ciw` | 改写光标所处的单词 | 150 | | `caw` | 改写光标所处的单词,并且包括前后空格(如果有的话) | 151 | | `ct,` | 改写到逗号 | 152 | | `c0` | 改写到行首 | 153 | | `c^` | 改写到行首(第一个非零字符) | 154 | | `c$` | 改写到行末 | 155 | | `C` | 改写到行末(同 c$) | 156 | | `ci"` | 改写双引号中的内容 | 157 | | `ci'` | 改写单引号中的内容 | 158 | | `ci)` | 改写小括号中的内容 | 159 | | `ci]` | 改写中括号中内容 | 160 | | `ci}` | 改写大括号中内容 | 161 | | `cit` | 改写 xml tag 中的内容 | 162 | | `cis` | 改写当前句子 | 163 | | `ciB` | 改写'{}'中的内容 | 164 | | `c2w` | 改写下两个单词 | 165 | | `ct(` | 改写到小括号前 | 166 | | `x` | 删除当前字符,前面可以接数字,3x代表删除三个字符 | 167 | | `X` | 向前删除字符 | 168 | | `dd` | 删除当前行 | 169 | | `d0` | 删除到行首 | 170 | | `d^` | 删除到行首(第一个非零字符) | 171 | | `d$` | 删除到行末 | 172 | | `D` | 删除到行末(同 d$) | 173 | | `dw` | 删除当前单词 | 174 | | `dt,` | 删除到逗号 | 175 | | `diw` | 删除光标所处的单词 | 176 | | `daw` | 删除光标所处的单词,并包含前后空格(如果有的话) | 177 | | `di"` | 删除双引号中的内容 | 178 | | `di'` | 删除单引号中的内容 | 179 | | `di)` | 删除小括号中的内容 | 180 | | `di]` | 删除中括号中内容 | 181 | | `di}` | 删除大括号中内容 | 182 | | `diB` | 删除'{}'中的内容 | 183 | | `dit` | 删除 xml tag 中的内容 | 184 | | `dis` | 删除当前句子 | 185 | | `d2w` | 删除下两个单词 | 186 | | `dt(` | 删除到小括号前 | 187 | | `dgg` | 删除到文件头部 | 188 | | `dG` | 删除到文件尾部 | 189 | | `d}` | 删除下一段 | 190 | | `d{` | 删除上一段 | 191 | | `u` | 撤销 | 192 | | `U` | 撤销整行操作 | 193 | | `CTRL-R` | 撤销上一次 u 命令 | 194 | | `J` | 连接若干行 | 195 | | `gJ` | 连接若干行,删除空白字符 | 196 | | `.` | 重复上一次操作 | 197 | | `~` | 交换大小写 | 198 | | `g~iw` | 替换当前单词的大小写 | 199 | | `gUiw` | 将单词转成大写 | 200 | | `guiw` | 将当前单词转成小写 | 201 | | `guu` | 全行转为小写 | 202 | | `gUU` | 全行转为大写 | 203 | | `gg=G` | 缩进整个文件 | 204 | | `=a{` | 缩进光标所在代码块 | 205 | | `=i{` | 缩进光标所在代码块,不缩进"{" | 206 | | `<<` | 减少缩进 | 207 | | `>>` | 增加缩进 | 208 | | `==` | 自动缩进 | 209 | | `CTRL-A` | 增加数字 | 210 | | `CTRL-X` | 减少数字 | 211 | | `p` | 粘贴到光标后 | 212 | | `P` | 粘贴到光标前 | 213 | | `v` | 开始标记 | 214 | | `y` | 复制标记内容 | 215 | | `V` | 开始按行标记 | 216 | | `CTRL-V` | 开始列标记 | 217 | | `y$` | 复制当前位置到本行结束的内容 | 218 | | `yy` | 复制当前行 | 219 | | `Y` | 复制当前行,同 yy | 220 | | `yt,` | 复制到逗号 | 221 | | `yiw` | 复制当前单词 | 222 | | `"+y` | 复制当前选中到系统剪切板 | 223 | | `3yy` | 复制光标下三行内容 | 224 | | `v0` | 选中当前位置到行首 | 225 | | `v$` | 选中当前位置到行末 | 226 | | `vt,` | 选中到逗号 | 227 | | `viw` | 选中当前单词 | 228 | | `vi)` | 选中小括号内的东西 | 229 | | `vi]` | 选中中括号内的东西 | 230 | | `viB` | 选中'{}'中的内容 | 231 | | `vis` | 选中句子中的东西 | 232 | | `gv` | 重新选择上一次选中的文字 | 233 | | `:set paste` | 允许粘贴模式(避免粘贴时自动缩进影响格式) | 234 | | `:set nopaste` | 禁止粘贴模式 | 235 | | `"?yy` | 复制当前行到寄存器 ? ,问号代表 0-9 的寄存器名称 | 236 | | `"?p` | 将寄存器 ? 的内容粘贴到光标后 | 237 | | `"?P` | 将寄存器 ? 的内容粘贴到光标前 | 238 | | `:registers` | 显示所有寄存器内容 | 239 | | `:[range]y` | 复制范围,比如 :20,30y 是复制20到30行,:10y 是复制第十行 | 240 | | `:[range]d` | 删除范围,比如 :20,30d 是删除20到30行,:10d 是删除第十行 | 241 | | `ddp` | 交换两行内容:先删除当前行复制到寄存器,并粘贴 | 242 | 243 | 244 | ## 文件操作 245 | 246 | | 快捷键 | 说明 | 247 | | ------- | ----- | 248 | | `:w` | 保存文件 | 249 | | `:w ` | 按名称保存文件 | 250 | | `ZZ` | 保存文件(如果有改动的话),并关闭窗口 | 251 | | `:e ` | 打开文件并编辑 | 252 | | `:saveas ` | 另存为文件 | 253 | | `:r ` | 读取文件并将内容插入到光标后 | 254 | | `:r !dir` | 将dir命令的输出捕获并插入到光标后 | 255 | | `:close` | 关闭文件 | 256 | | `:q` | 退出 | 257 | | `:q!` | 强制退出 | 258 | | `:wa` | 保存所有文件 | 259 | | `:cd ` | 切换Vim当前路径 | 260 | | `:new` | 打开一个新的窗口编辑新文件 | 261 | | `:enew` | 在当前窗口创建新文件 | 262 | | `:vnew` | 在左右切分的新窗口中编辑新文件 | 263 | | `:tabnew` | 在新的标签页中编辑新文件 | 264 | 265 | 266 | ## 使用外部程序 267 | 268 | | 快捷键 | 说明 | 269 | | ------- | ----- | 270 | | `!` | 告诉vim正在执行一个过滤操作 | 271 | | `!5Gsort` | 使用外部sort命令对1-5行文本排序 | 272 | | `!!` | 对当前行执行过滤命令 | 273 | | `!!date` | 用"date"的输出代替当前行 | 274 | 275 | ## 宏录制 276 | 277 | | 快捷键 | 说明 | 278 | | ------- | ----- | 279 | | `qa` | 开始录制名字为a的宏 | 280 | | `q` | 结束录制宏 | 281 | | `@a` | 播放名字为a的宏 | 282 | | `100@a` | 播放名字为a的宏100次 | 283 | | `:normal@a` | 播放名字为a的宏直到自动结束 | 284 | 285 | 286 | ## 实用命令 287 | 288 | | 快捷键 | 说明 | 289 | | ------- | ----- | 290 | | `/pattern` | 从光标处向文件尾搜索 pattern | 291 | | `?pattern` | 从光标处向文件头搜索 pattern | 292 | | `n` | 向同一方向执行上一次搜索 | 293 | | `N` | 向相反方向执行上一次搜索 | 294 | | `*` | 向前搜索光标下的单词 | 295 | | `#` | 向后搜索光标下的单词 | 296 | | `:s/p1/p2/g` | 替换当前行的p1为p2 | 297 | | `:%s/p1/p2/g` | 替换当前文件中的p1为p2 | 298 | | `:%s//p2/g` | 替换当前文件中的p1单词为p2 | 299 | | `:%s/p1/p2/gc` | 替换当前文件中的p1为p2,并且每处询问你是否替换 | 300 | | `:10,20s/p1/p2/g` | 将第10到20行中所有p1替换为p2 | 301 | | `:%s/1\\2\/3/123/g` | 将“1\2/3” 替换为 “123”(特殊字符使用反斜杠标注) | 302 | | `:%s/\r//g` | 删除 DOS 换行符 ^M | 303 | | `:g/^\s*$/d` | 删除空行 | 304 | | `:g/test/d` | 删除所有包含 test 的行 | 305 | | `:v/test/d` | 删除所有不包含 test 的行 | 306 | | `:%s/^/test/` | 在行首加入特定字符(也可以用宏录制来添加) | 307 | | `:%s/$/test/` | 在行尾加入特定字符(也可以用宏录制来添加) | 308 | | `:sort` | 排序 | 309 | | `:g/^\(.\+\)$\n\1/d` | 去除重复行(先排序) | 310 | | `:%s/^.\{10\}//` | 删除每行前10个字符 | 311 | | `:%s/.\{10\}$//` | 删除每行尾10个字符 | 312 | 313 | 314 | ## 帮助 315 | 316 | | 快捷键 | 说明 | 317 | | ------- | ----- | 318 | | `h tutor` | 入门文档 | 319 | | `h quickref` | 快速帮助 | 320 | | `h index` | 查询Vim所有键盘命令定义 | 321 | | `h summary` | 帮助你更好的使用内置帮助系统 | 322 | | `h pattern.txt` | 正则表达式帮助 | 323 | | `h eval` | 脚本编写帮助 | 324 | | `h function-list` | 查看VimScript的函数列表 | 325 | | `h windows.txt` | 窗口使用帮助 | 326 | | `h tabpage.txt` | 标签页使用帮助 | 327 | | `h tips` | 查看Vim内置的常用技巧文档 | 328 | | `h quote` | 寄存器 | 329 | | `h autocommand-events` | 所有可能事件 | 330 | | `h write-plugin` | 编写插件 | 331 | 332 | 333 | ## 其他 334 | 335 | | 快捷键 | 说明 | 336 | | ------- | ----- | 337 | | `vim -u NONE -N` | 开启vim时不加载vimrc文件 | 338 | | `vimdiff file1 file2` | 显示文件差异 | 339 | | `vim -R filename` | 以只读方式打开(阅读模式) | 340 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 获取linux发行版名称 4 | function get_linux_distro() 5 | { 6 | if grep -Eq "Ubuntu" /etc/*-release; then 7 | echo "Ubuntu" 8 | elif grep -Eq "Deepin" /etc/*-release; then 9 | echo "Deepin" 10 | elif grep -Eq "Raspbian" /etc/*-release; then 11 | echo "Raspbian" 12 | elif grep -Eq "uos" /etc/*-release; then 13 | echo "UOS" 14 | elif grep -Eq "LinuxMint" /etc/*-release; then 15 | echo "LinuxMint" 16 | elif grep -Eq "elementary" /etc/*-release; then 17 | echo "elementaryOS" 18 | elif grep -Eq "Debian" /etc/*-release; then 19 | echo "Debian" 20 | elif grep -Eq "Kali" /etc/*-release; then 21 | echo "Kali" 22 | elif grep -Eq "Parrot" /etc/*-release; then 23 | echo "Parrot" 24 | elif grep -Eq "CentOS" /etc/*-release; then 25 | echo "CentOS" 26 | elif grep -Eq "fedora" /etc/*-release; then 27 | echo "fedora" 28 | elif grep -Eq "openSUSE" /etc/*-release; then 29 | echo "openSUSE" 30 | elif grep -Eq "Arch Linux" /etc/*-release; then 31 | echo "ArchLinux" 32 | elif grep -Eq "ManjaroLinux" /etc/*-release; then 33 | echo "ManjaroLinux" 34 | elif grep -Eq "Gentoo" /etc/*-release; then 35 | echo "Gentoo" 36 | elif grep -Eq "alpine" /etc/*-release; then 37 | echo "Alpine" 38 | else 39 | echo "Unknown" 40 | fi 41 | } 42 | 43 | # 获取日期 44 | function get_datetime() 45 | { 46 | time=$(date "+%Y%m%d%H%M%S") 47 | echo $time 48 | } 49 | 50 | # 判断文件是否存在 51 | function is_exist_file() 52 | { 53 | filename=$1 54 | if [ -f $filename ]; then 55 | echo 1 56 | else 57 | echo 0 58 | fi 59 | } 60 | 61 | # 判断目录是否存在 62 | function is_exist_dir() 63 | { 64 | dir=$1 65 | if [ -d $dir ]; then 66 | echo 1 67 | else 68 | echo 0 69 | fi 70 | } 71 | 72 | #备份原有的.vimrc文件 73 | function backup_vimrc_file() 74 | { 75 | old_vimrc=$HOME"/.vimrc" 76 | is_exist=$(is_exist_file $old_vimrc) 77 | if [ $is_exist == 1 ]; then 78 | time=$(get_datetime) 79 | backup_vimrc=$old_vimrc"_bak_"$time 80 | read -p "Find "$old_vimrc" already exists,backup "$old_vimrc" to "$backup_vimrc"? [Y/N] " ch 81 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 82 | cp $old_vimrc $backup_vimrc 83 | fi 84 | fi 85 | } 86 | 87 | #备份原有的.vimrc.custom.plugins文件 88 | function backup_vimrc_custom_plugins_file() 89 | { 90 | old_vimrc_plugins=$HOME"/.vimrc.custom.plugins" 91 | is_exist=$(is_exist_file $old_vimrc_plugins) 92 | if [ $is_exist == 1 ]; then 93 | time=$(get_datetime) 94 | backup_vimrc_plugins=$old_vimrc_plugins"_bak_"$time 95 | read -p "Find "$old_vimrc_plugins" already exists,backup "$old_vimrc_plugins" to "$backup_vimrc_plugins"? [Y/N] " ch 96 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 97 | cp $old_vimrc_plugins $backup_vimrc_plugins 98 | fi 99 | fi 100 | } 101 | 102 | #备份原有的.vimrc.custom.config文件 103 | function backup_vimrc_custom_config_file() 104 | { 105 | old_vimrc_config=$HOME"/.vimrc.custom.config" 106 | is_exist=$(is_exist_file $old_vimrc_config) 107 | if [ $is_exist == 1 ]; then 108 | time=$(get_datetime) 109 | backup_vimrc_config=$old_vimrc_config"_bak_"$time 110 | read -p "Find "$old_vimrc_config" already exists,backup "$old_vimrc_config" to "$backup_vimrc_config"? [Y/N] " ch 111 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 112 | cp $old_vimrc_config $backup_vimrc_config 113 | fi 114 | fi 115 | } 116 | 117 | #备份原有的.vim目录 118 | function backup_vim_dir() 119 | { 120 | old_vim=$HOME"/.vim" 121 | is_exist=$(is_exist_dir $old_vim) 122 | if [ $is_exist == 1 ]; then 123 | time=$(get_datetime) 124 | backup_vim=$old_vim"_bak_"$time 125 | read -p "Find "$old_vim" already exists,backup "$old_vim" to "$backup_vim"? [Y/N] " ch 126 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 127 | cp -R $old_vim $backup_vim 128 | fi 129 | fi 130 | } 131 | 132 | # 备份原有的.vimrc和.vim 133 | function backup_vimrc_and_vim() 134 | { 135 | backup_vimrc_file 136 | backup_vimrc_custom_plugins_file 137 | backup_vimrc_custom_config_file 138 | backup_vim_dir 139 | } 140 | 141 | # 获取ubuntu版本 142 | function get_ubuntu_version() 143 | { 144 | line=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE") 145 | arr=(${line//=/ }) 146 | version=(${arr[1]//./ }) 147 | 148 | echo ${version[0]} 149 | } 150 | 151 | # 获取alpine版本 152 | function get_alpine_version() 153 | { 154 | version=$(cat /etc/os-release | grep 'VERSION_ID' | awk -F '=' '{print $2}') 155 | 156 | echo $version 157 | } 158 | 159 | # 获取centos版本 160 | function get_centos_version() 161 | { 162 | version=`cat /etc/redhat-release | awk '{print $4}' | awk -F . '{printf "%s",$1}'` 163 | echo $version 164 | } 165 | 166 | # 判断是否是macos10.14版本 167 | function is_macos1014() 168 | { 169 | product_version=$(sw_vers | grep ProductVersion) 170 | if [[ $product_version =~ "10.14" ]]; then 171 | echo 1 172 | else 173 | echo 0 174 | fi 175 | } 176 | 177 | # 在alpine上直装vim8.2 178 | # function compile_vim_on_alpine() 179 | # { 180 | # apk --upgrade add vim 181 | # cd - 182 | # } 183 | 184 | # 在ubuntu上源代码安装vim 185 | function compile_vim_on_ubuntu() 186 | { 187 | sudo apt-get install -y libncurses5-dev libncurses5 libgnome2-dev libgnomeui-dev \ 188 | libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ 189 | libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev python3-dev ruby-dev lua5.1 lua5.1-dev 190 | 191 | rm -rf ~/vim82 192 | git clone https://gitee.com/chxuan/vim82.git ~/vim82 193 | cd ~/vim82 194 | ./configure --with-features=huge \ 195 | --enable-multibyte \ 196 | --enable-rubyinterp \ 197 | --enable-pythoninterp \ 198 | --enable-perlinterp \ 199 | --enable-luainterp \ 200 | --enable-gui=gtk2 \ 201 | --enable-cscope \ 202 | --prefix=/usr 203 | make 204 | sudo make install 205 | cd - 206 | } 207 | 208 | # 在debian上源代码安装vim 209 | function compile_vim_on_debian() 210 | { 211 | sudo apt-get install -y libncurses5-dev libncurses5 libgtk2.0-dev libatk1.0-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev python3-dev ruby-dev lua5.1 lua5.1-dev 212 | 213 | rm -rf ~/vim82 214 | git clone https://gitee.com/chxuan/vim82.git ~/vim82 215 | cd ~/vim82 216 | ./configure --with-features=huge \ 217 | --enable-multibyte \ 218 | --enable-rubyinterp \ 219 | --enable-pythoninterp \ 220 | --enable-perlinterp \ 221 | --enable-luainterp \ 222 | --enable-gui=gtk2 \ 223 | --enable-cscope \ 224 | --prefix=/usr 225 | make 226 | sudo make install 227 | cd - 228 | } 229 | 230 | # 在parrot上源代码安装vim 231 | function compile_vim_on_parrot() 232 | { 233 | sudo apt-get install -y libncurses5-dev libncurses5 libgtk2.0-dev libatk1.0-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev python3-dev ruby-dev lua5.1 vim 234 | 235 | rm -rf ~/vim82 236 | git clone https://gitee.com/chxuan/vim82.git ~/vim82 237 | cd ~/vim82 238 | ./configure --with-features=huge \ 239 | --enable-multibyte \ 240 | --enable-rubyinterp \ 241 | --enable-pythoninterp \ 242 | --enable-perlinterp \ 243 | --enable-luainterp \ 244 | --enable-gui=gtk2 \ 245 | --enable-cscope \ 246 | --prefix=/usr 247 | make 248 | sudo make install 249 | cd - 250 | } 251 | 252 | # 在centos上源代码安装vim 253 | function compile_vim_on_centos() 254 | { 255 | sudo yum install -y ruby ruby-devel lua lua-devel luajit \ 256 | luajit-devel ctags git python python-devel \ 257 | python34 python34-devel tcl-devel \ 258 | perl perl-devel perl-ExtUtils-ParseXS \ 259 | perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \ 260 | perl-ExtUtils-Embed libX11-devel ncurses-devel 261 | 262 | rm -rf ~/vim82 263 | git clone https://gitee.com/chxuan/vim82.git ~/vim82 264 | cd ~/vim82 265 | ./configure --with-features=huge \ 266 | --enable-multibyte \ 267 | --with-tlib=tinfo \ 268 | --enable-rubyinterp=yes \ 269 | --enable-pythoninterp=yes \ 270 | --enable-perlinterp=yes \ 271 | --enable-luainterp=yes \ 272 | --enable-gui=gtk2 \ 273 | --enable-cscope \ 274 | --prefix=/usr 275 | make 276 | sudo make install 277 | cd - 278 | } 279 | 280 | # 安装mac平台必备软件 281 | function install_prepare_software_on_mac() 282 | { 283 | xcode-select --install 284 | 285 | brew install vim gcc cmake ctags-exuberant ack 286 | 287 | macos1014=$(is_macos1014) 288 | if [ $macos1014 == 1 ]; then 289 | open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg 290 | fi 291 | } 292 | 293 | # 安装FreeBSD必备软件 294 | function install_prepare_software_on_freebsd() 295 | { 296 | sudo pkg install -y vim ctags automake gcc cmake p5-ack python git fontconfig 297 | } 298 | 299 | # 安装android平台必备软件 300 | function install_prepare_software_on_android() 301 | { 302 | pkg update 303 | pkg install -y git vim-python cmake python2 python ctags ack-grep ncurses-utils 304 | } 305 | 306 | # 安装alpine必备软件 需要更换源 307 | function install_prepare_software_on_alpine() 308 | { 309 | sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories 310 | 311 | version=$(get_alpine_version) 312 | 313 | apk update 314 | 315 | apk add python3 python3-dev ruby ruby-dev lua lua-dev luajit luajit-dev ctags tcl tcl-dev perl perl-dev libx11 libx11-dev ncurses ncurses-dev g++ gcc make automake cmake fontconfig fontconfig-dev nerd-fonts gcompat clang clang-dev vim 316 | } 317 | 318 | # 安装ubuntu必备软件 319 | function install_prepare_software_on_ubuntu() 320 | { 321 | sudo apt-get update 322 | 323 | version=$(get_ubuntu_version) 324 | if [ $version -eq 14 ];then 325 | sudo apt-get install -y cmake3 326 | else 327 | sudo apt-get install -y cmake 328 | fi 329 | 330 | sudo apt-get install -y build-essential python python-dev python3-dev fontconfig libfile-next-perl ack-grep git 331 | sudo apt-get install -y universal-ctags || sudo apt-get install -y exuberant-ctags 332 | 333 | if [ $version -ge 18 ];then 334 | sudo apt-get install -y vim 335 | else 336 | compile_vim_on_ubuntu 337 | fi 338 | } 339 | 340 | # 安装ubuntu系必备软件 341 | function install_prepare_software_on_ubuntu_like() 342 | { 343 | sudo apt-get update 344 | sudo apt-get install -y cmake build-essential python python-dev python3-dev fontconfig libfile-next-perl ack-grep git 345 | sudo apt-get install -y universal-ctags || sudo apt-get install -y exuberant-ctags 346 | compile_vim_on_ubuntu 347 | } 348 | 349 | # 安装debian必备软件 350 | function install_prepare_software_on_debian() 351 | { 352 | sudo apt-get update 353 | sudo apt-get install -y cmake build-essential python python-dev python3-dev fontconfig libfile-next-perl ack git 354 | sudo apt-get install -y universal-ctags || sudo apt-get install -y exuberant-ctags 355 | compile_vim_on_debian 356 | } 357 | 358 | # 安装parrot必备软件 359 | function install_prepare_software_on_parrot() 360 | { 361 | sudo apt-get update 362 | sudo apt-get install -y cmake exuberant-ctags build-essential python python-dev python3-dev fontconfig libfile-next-perl ack git 363 | compile_vim_on_parrot 364 | } 365 | 366 | # 安装centos必备软件 367 | function install_prepare_software_on_centos() 368 | { 369 | version=$(get_centos_version) 370 | if [ $version -ge 8 ];then 371 | sudo dnf install -y epel-release 372 | sudo dnf install -y vim ctags automake gcc gcc-c++ kernel-devel make cmake python2 python2-devel python3-devel fontconfig ack git 373 | else 374 | sudo yum install -y ctags automake gcc gcc-c++ kernel-devel cmake python-devel python3-devel fontconfig ack git 375 | compile_vim_on_centos 376 | fi 377 | } 378 | 379 | # 安装fedora必备软件 380 | function install_prepare_software_on_fedora() 381 | { 382 | sudo dnf install -y vim ctags automake gcc gcc-c++ kernel-devel cmake python-devel python3-devel fontconfig ack git 383 | } 384 | 385 | # 安装archlinux必备软件 386 | function install_prepare_software_on_archlinux() 387 | { 388 | sudo pacman -S --noconfirm vim ctags automake gcc cmake python3 python2 ack git fontconfig 389 | sudo ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5 390 | } 391 | 392 | # 安装gentoo必备软件 393 | function install_prepare_software_on_gentoo() 394 | { 395 | install_software_on_gentoo app-editors/vim dev-util/ctags sys-devel/automake sys-devel/gcc dev-util/cmake sys-apps/ack dev-vcs/git media-libs/fontconfig 396 | su - -c "ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5" -s /bin/bash 397 | } 398 | 399 | function install_software_on_gentoo() 400 | { 401 | pkgs=$* 402 | pkg_need_install="" 403 | for pkg in ${pkgs} 404 | do 405 | if qlist -I | grep -Eq $pkg; then 406 | echo "$pkg is already installed." 407 | else 408 | pkg_need_install="$pkg_need_install $pkg" 409 | fi 410 | done 411 | 412 | if sudo -l | grep -Eq "emerge"; then 413 | sudo emerge -v $pkg_need_install 414 | else 415 | echo "Need Root password:" 416 | su - -c "emerge -v $pkg_need_install" -s /bin/bash 417 | fi 418 | } 419 | 420 | # 安装opensuse必备软件 421 | function install_prepare_software_on_opensuse() 422 | { 423 | sudo zypper install -y vim ctags gcc gcc-c++ cmake python-devel python3-devel ack fontconfig git ncurses5-devel 424 | } 425 | 426 | # 拷贝文件 427 | function copy_files() 428 | { 429 | rm -rf ~/.vimrc 430 | ln -s ${PWD}/.vimrc ~ 431 | 432 | rm -rf ~/.vimrc.custom.plugins 433 | cp ${PWD}/.vimrc.custom.plugins ~ 434 | 435 | rm -rf ~/.vimrc.custom.config 436 | cp ${PWD}/.vimrc.custom.config ~ 437 | 438 | rm -rf ~/.ycm_extra_conf.py 439 | ln -s ${PWD}/.ycm_extra_conf.py ~ 440 | 441 | mkdir ~/.vim 442 | rm -rf ~/.vim/colors 443 | ln -s ${PWD}/colors ~/.vim 444 | 445 | rm -rf ~/.vim/ftplugin 446 | ln -s ${PWD}/ftplugin ~/.vim 447 | 448 | rm -rf ~/.vim/autoload 449 | ln -s ${PWD}/autoload ~/.vim 450 | } 451 | 452 | # 安装mac平台字体 453 | function install_fonts_on_mac() 454 | { 455 | rm -rf ~/Library/Fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf 456 | cp ./fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf ~/Library/Fonts 457 | } 458 | 459 | # 安装android平台字体 460 | function install_fonts_on_android() 461 | { 462 | rm -rf ~/.termux/font.ttf 463 | mkdir ~/.termux 464 | cp ./fonts/DejaVu.ttf ~/.termux/font.ttf 465 | 466 | # 刷新style 467 | REL="am broadcast --user 0 -a com.termux.app.reload_style com.termux" 468 | $REL > /dev/null 469 | } 470 | 471 | # 安装linux平台字体 472 | function install_fonts_on_linux() 473 | { 474 | mkdir -p ~/.local/share/fonts 475 | rm -rf ~/.local/share/fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf 476 | cp ./fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf ~/.local/share/fonts 477 | 478 | fc-cache -vf ~/.local/share/fonts 479 | } 480 | 481 | # 安装vim插件 482 | function install_vim_plugin() 483 | { 484 | vim -c "PlugInstall" -c "q" -c "q" 485 | } 486 | 487 | # 安装ycm插件 488 | function install_ycm() 489 | { 490 | git clone https://gitee.com/chxuan/YouCompleteMe-clang.git ~/.vim/plugged/YouCompleteMe 491 | 492 | cd ~/.vim/plugged/YouCompleteMe 493 | distro=`get_linux_distro` 494 | read -p "Please choose to compile ycm with python2 or python3, if there is a problem with the current selection, please choose another one. [2/3] " version 495 | if [[ $version == "2" ]]; then 496 | echo "Compile ycm with python2." 497 | # alpine 忽略 --clang-completer 并将 let g:ycm_clangd_binary_path 注入 .vimrc 498 | { 499 | if [ ${distro} == "Alpine" ]; then 500 | echo "##########################################" 501 | echo "Apline Build, need without GLIBC." 502 | echo "##########################################" 503 | sed -i "273ilet g:ycm_clangd_binary_path='/usr/bin/clang'" ~/.vimrc 504 | python2.7 ./install.py 505 | return 506 | fi 507 | } || { 508 | python2.7 ./install.py --clang-completer 509 | } || { 510 | echo "##########################################" 511 | echo "Build error, trying rebuild without Clang." 512 | echo "##########################################" 513 | python2.7 ./install.py 514 | } 515 | else 516 | echo "Compile ycm with python3." 517 | { 518 | # alpine 跳过该步骤 519 | if [ ${distro} == "Alpine" ]; then 520 | echo "##########################################" 521 | echo "Apline Build, need without GLIBC." 522 | echo "##########################################" 523 | sed -i "273ilet g:ycm_clangd_binary_path='/usr/bin/clang'" ~/.vimrc 524 | python3 ./install.py 525 | return 526 | fi 527 | } || { 528 | python3 ./install.py --clang-completer 529 | } || { 530 | echo "##########################################" 531 | echo "Build error, trying rebuild without Clang." 532 | echo "##########################################" 533 | python3 ./install.py 534 | } 535 | fi 536 | } 537 | 538 | # 在android上安装ycm插件 539 | function install_ycm_on_android() 540 | { 541 | git clone https://gitee.com/chxuan/YouCompleteMe-clang.git ~/.vim/plugged/YouCompleteMe 542 | 543 | cd ~/.vim/plugged/YouCompleteMe 544 | 545 | read -p "Please choose to compile ycm with python2 or python3, if there is a problem with the current selection, please choose another one. [2/3] " version 546 | if [[ $version == "2" ]]; then 547 | echo "Compile ycm with python2." 548 | python2.7 ./install.py --clang-completer --system-libclang 549 | else 550 | echo "Compile ycm with python3." 551 | python3 ./install.py --clang-completer --system-libclang 552 | fi 553 | } 554 | 555 | # 打印logo 556 | function print_logo() 557 | { 558 | color="$(tput setaf 6)" 559 | normal="$(tput sgr0)" 560 | printf "${color}" 561 | echo ' __ __ ' 562 | echo '__ __/_/___ ___ ____ / /_ _______ ' 563 | echo '\ \ / / / __ `__ \/ __ \/ / / / / ___/ ' 564 | echo ' \ V / / / / / / / /_/ / / /_/ (__ ) ' 565 | echo ' \_/_/_/ /_/ /_/ ,___/_/\____/____/ ' 566 | echo ' /_/ ...is now installed!' 567 | echo '' 568 | echo '' 569 | echo 'Just enjoy it!' 570 | echo 'p.s. Follow me at https://github.com/chxuan.' 571 | echo '' 572 | printf "${normal}" 573 | } 574 | 575 | # 在mac平台安装vimplus 576 | function install_vimplus_on_mac() 577 | { 578 | backup_vimrc_and_vim 579 | install_prepare_software_on_mac 580 | copy_files 581 | install_fonts_on_mac 582 | install_ycm 583 | install_vim_plugin 584 | print_logo 585 | } 586 | 587 | # 在FreeBSD上安装vimplus 588 | function install_vimplus_on_freebsd() 589 | { 590 | backup_vimrc_and_vim 591 | install_prepare_software_on_freebsd 592 | begin_install_vimplus 593 | } 594 | 595 | # 在android平台安装vimplus 596 | function install_vimplus_on_android() 597 | { 598 | backup_vimrc_and_vim 599 | install_prepare_software_on_android 600 | copy_files 601 | install_fonts_on_android 602 | install_ycm_on_android 603 | install_vim_plugin 604 | print_logo 605 | } 606 | 607 | # 开始安装vimplus 608 | function begin_install_vimplus() 609 | { 610 | copy_files 611 | install_fonts_on_linux 612 | install_ycm 613 | install_vim_plugin 614 | print_logo 615 | } 616 | 617 | # 在ubuntu上安装vimplus 618 | function install_vimplus_on_ubuntu() 619 | { 620 | backup_vimrc_and_vim 621 | install_prepare_software_on_ubuntu 622 | begin_install_vimplus 623 | } 624 | 625 | # 在ubuntu系上安装vimplus 626 | function install_vimplus_on_ubuntu_like() 627 | { 628 | backup_vimrc_and_vim 629 | install_prepare_software_on_ubuntu_like 630 | begin_install_vimplus 631 | } 632 | 633 | # 在debian上安装vimplus 634 | function install_vimplus_on_debian() 635 | { 636 | backup_vimrc_and_vim 637 | install_prepare_software_on_debian 638 | begin_install_vimplus 639 | } 640 | 641 | # 在parrot上安装vimplus 642 | function install_vimplus_on_parrot() 643 | { 644 | backup_vimrc_and_vim 645 | install_prepare_software_on_parrot 646 | begin_install_vimplus 647 | } 648 | 649 | # 在centos上安装vimplus 650 | function install_vimplus_on_centos() 651 | { 652 | backup_vimrc_and_vim 653 | install_prepare_software_on_centos 654 | begin_install_vimplus 655 | } 656 | 657 | # 在fedora上安装vimplus 658 | function install_vimplus_on_fedora() 659 | { 660 | backup_vimrc_and_vim 661 | install_prepare_software_on_fedora 662 | begin_install_vimplus 663 | } 664 | 665 | # 在archlinux上安装vimplus 666 | function install_vimplus_on_archlinux() 667 | { 668 | backup_vimrc_and_vim 669 | install_prepare_software_on_archlinux 670 | begin_install_vimplus 671 | } 672 | 673 | # 在Gentoo上安装vimplus 674 | function install_vimplus_on_gentoo() 675 | { 676 | backup_vimrc_and_vim 677 | install_prepare_software_on_gentoo 678 | begin_install_vimplus 679 | } 680 | 681 | # 在opensuse上安装vimplus 682 | function install_vimplus_on_opensuse() 683 | { 684 | backup_vimrc_and_vim 685 | install_prepare_software_on_opensuse 686 | begin_install_vimplus 687 | } 688 | 689 | # 在alpine上安装vimplus 690 | function install_vimplus_on_alpine() 691 | { 692 | backup_vimrc_and_vim 693 | install_prepare_software_on_alpine 694 | begin_install_vimplus 695 | 696 | # 单独安装 ycm 697 | 698 | } 699 | 700 | # 在linux平上台安装vimplus 701 | function install_vimplus_on_linux() 702 | { 703 | distro=`get_linux_distro` 704 | echo "Linux distro: "${distro} 705 | 706 | if [ ${distro} == "Ubuntu" ]; then 707 | install_vimplus_on_ubuntu 708 | elif [ ${distro} == "Deepin" ]; then 709 | install_vimplus_on_ubuntu_like 710 | elif [ ${distro} == "LinuxMint" ]; then 711 | install_vimplus_on_ubuntu_like 712 | elif [ ${distro} == "elementaryOS" ]; then 713 | install_vimplus_on_ubuntu_like 714 | elif [ ${distro} == "Debian" ]; then 715 | install_vimplus_on_debian 716 | elif [ ${distro} == "Raspbian" ]; then 717 | install_vimplus_on_debian 718 | elif [ ${distro} == "UOS" ]; then 719 | install_vimplus_on_debian 720 | elif [ ${distro} == "Kali" ]; then 721 | install_vimplus_on_debian 722 | elif [ ${distro} == "Parrot" ]; then 723 | install_vimplus_on_parrot 724 | elif [ ${distro} == "CentOS" ]; then 725 | install_vimplus_on_centos 726 | elif [ ${distro} == "fedora" ]; then 727 | install_vimplus_on_fedora 728 | elif [ ${distro} == "openSUSE" ]; then 729 | install_vimplus_on_opensuse 730 | elif [ ${distro} == "ArchLinux" ]; then 731 | install_vimplus_on_archlinux 732 | elif [ ${distro} == "ManjaroLinux" ]; then 733 | install_vimplus_on_archlinux 734 | elif [ ${distro} == "Gentoo" ]; then 735 | install_vimplus_on_gentoo 736 | elif [ ${distro} == "Alpine" ]; then 737 | install_vimplus_on_alpine 738 | else 739 | echo "Not support linux distro: "${distro} 740 | fi 741 | } 742 | 743 | # 获取当前时间戳 744 | function get_now_timestamp() 745 | { 746 | cur_sec_and_ns=`date '+%s-%N'` 747 | echo ${cur_sec_and_ns%-*} 748 | } 749 | 750 | # main函数 751 | function main() 752 | { 753 | begin=`get_now_timestamp` 754 | 755 | type=$(uname) 756 | echo "Platform type: "${type} 757 | 758 | if [ ${type} == "Darwin" ]; then 759 | install_vimplus_on_mac 760 | elif [ ${type} == "FreeBSD" ]; then 761 | install_vimplus_on_freebsd 762 | elif [ ${type} == "Linux" ]; then 763 | tp=$(uname -a) 764 | if [[ $tp =~ "Android" ]]; then 765 | echo "Android" 766 | install_vimplus_on_android 767 | else 768 | install_vimplus_on_linux 769 | fi 770 | else 771 | echo "Not support platform type: "${type} 772 | fi 773 | 774 | end=`get_now_timestamp` 775 | second=`expr ${end} - ${begin}` 776 | min=`expr ${second} / 60` 777 | echo "It takes "${min}" minutes." 778 | } 779 | 780 | # 调用main函数 781 | main 782 | -------------------------------------------------------------------------------- /install_to_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 获取平台类型,mac还是linux平台 4 | function get_platform_type() 5 | { 6 | echo $(uname) 7 | } 8 | 9 | # 在linux上获取当前用户 10 | function get_current_username_on_linux() 11 | { 12 | current_path=$PWD 13 | array=(${current_path//// }) 14 | 15 | if [ ${array[0]} == "root" ]; then 16 | echo ${array[0]} 17 | else 18 | echo ${array[1]} 19 | fi 20 | } 21 | 22 | # 在linux上判断用户是否存在 23 | function is_valid_user_on_linux() 24 | { 25 | desc_username=$1 26 | usernames=$(ls /home/) 27 | array=(${usernames// / }) 28 | 29 | is_found=0 30 | for username in ${array[@]} 31 | do 32 | if [ $username == $desc_username ]; then 33 | is_found=1 34 | break 35 | fi 36 | done 37 | 38 | if [ $desc_username == "root" ]; then 39 | is_found=1 40 | fi 41 | 42 | echo $is_found 43 | } 44 | 45 | # 获取日期 46 | function get_datetime() 47 | { 48 | time=$(date "+%Y%m%d%H%M%S") 49 | echo $time 50 | } 51 | 52 | # 判断文件是否存在 53 | function is_exist_file() 54 | { 55 | filename=$1 56 | if [ -f $filename ]; then 57 | echo 1 58 | else 59 | echo 0 60 | fi 61 | } 62 | 63 | # 判断目录是否存在 64 | function is_exist_dir() 65 | { 66 | dir=$1 67 | if [ -d $dir ]; then 68 | echo 1 69 | else 70 | echo 0 71 | fi 72 | } 73 | 74 | #备份原有的.vimrc文件 75 | function backup_vimrc_file() 76 | { 77 | user=$1 78 | home_path=$2 79 | old_vimrc=$home_path".vimrc" 80 | is_exist=$(is_exist_file $old_vimrc) 81 | if [ $is_exist == 1 ]; then 82 | time=$(get_datetime) 83 | backup_vimrc=$old_vimrc"_bak_"$time 84 | read -p "Find "$old_vimrc" already exists,backup "$old_vimrc" to "$backup_vimrc"? [Y/N] " ch 85 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 86 | cp $old_vimrc $backup_vimrc 87 | chown $user":"$user $backup_vimrc 88 | fi 89 | fi 90 | } 91 | 92 | #备份原有的.vimrc.custom.plugins文件 93 | function backup_vimrc_custom_plugins_file() 94 | { 95 | user=$1 96 | home_path=$2 97 | old_vimrc_plugins=$home_path".vimrc.custom.plugins" 98 | is_exist=$(is_exist_file $old_vimrc_plugins) 99 | if [ $is_exist == 1 ]; then 100 | time=$(get_datetime) 101 | backup_vimrc_plugins=$old_vimrc_plugins"_bak_"$time 102 | read -p "Find "$old_vimrc_plugins" already exists,backup "$old_vimrc_plugins" to "$backup_vimrc_plugins"? [Y/N] " ch 103 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 104 | cp $old_vimrc_plugins $backup_vimrc_plugins 105 | chown $user":"$user $backup_vimrc_plugins 106 | fi 107 | fi 108 | } 109 | 110 | #备份原有的.vimrc.custom.config文件 111 | function backup_vimrc_custom_config_file() 112 | { 113 | user=$1 114 | home_path=$2 115 | old_vimrc_config=$home_path".vimrc.custom.config" 116 | is_exist=$(is_exist_file $old_vimrc_config) 117 | if [ $is_exist == 1 ]; then 118 | time=$(get_datetime) 119 | backup_vimrc_config=$old_vimrc_config"_bak_"$time 120 | read -p "Find "$old_vimrc_config" already exists,backup "$old_vimrc_config" to "$backup_vimrc_config"? [Y/N] " ch 121 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 122 | cp $old_vimrc_config $backup_vimrc_config 123 | chown $user":"$user $backup_vimrc_config 124 | fi 125 | fi 126 | } 127 | 128 | #备份原有的.vim目录 129 | function backup_vim_dir() 130 | { 131 | user=$1 132 | home_path=$2 133 | old_vim=$home_path".vim" 134 | is_exist=$(is_exist_dir $old_vim) 135 | if [ $is_exist == 1 ]; then 136 | time=$(get_datetime) 137 | backup_vim=$old_vim"_bak_"$time 138 | read -p "Find "$old_vim" already exists,backup "$old_vim" to "$backup_vim"? [Y/N] " ch 139 | if [[ $ch == "Y" ]] || [[ $ch == "y" ]]; then 140 | cp -R $old_vim $backup_vim 141 | chown -R $user":"$user $backup_vim 142 | fi 143 | fi 144 | } 145 | 146 | # 备份原有的.vimrc和.vim 147 | function backup_vimrc_and_vim() 148 | { 149 | backup_vimrc_file $1 $2 150 | backup_vimrc_custom_plugins_file $1 $2 151 | backup_vimrc_custom_config_file $1 $2 152 | backup_vim_dir $1 $2 153 | } 154 | 155 | # 打印logo 156 | function print_logo() 157 | { 158 | color="$(tput setaf 6)" 159 | normal="$(tput sgr0)" 160 | printf "${color}" 161 | echo ' __ __ ' 162 | echo '__ __/_/___ ___ ____ / /_ _______ ' 163 | echo '\ \ / / / __ `__ \/ __ \/ / / / / ___/ ' 164 | echo ' \ V / / / / / / / /_/ / / /_/ (__ ) ' 165 | echo ' \_/_/_/ /_/ /_/ ,___/_/\____/____/ ' 166 | echo ' /_/ ...is now installed!' 167 | echo '' 168 | echo '' 169 | echo 'Just enjoy it!' 170 | echo 'p.s. Follow me at https://github.com/chxuan.' 171 | echo '' 172 | printf "${normal}" 173 | } 174 | 175 | # 获得home路径 176 | function get_home_path() 177 | { 178 | username=$1 179 | if [ $username == "root" ]; then 180 | echo "/root/" 181 | else 182 | echo "/home/"$username"/" 183 | fi 184 | } 185 | 186 | # 在linux上将vimplus安装到指定用户 187 | function install_to_user_on_linux() 188 | { 189 | src_username=`get_current_username_on_linux` 190 | desc_username=$1 191 | 192 | # 判断是否是有效用户 193 | is_found=$(is_valid_user_on_linux $desc_username) 194 | if [ $is_found != 1 ]; then 195 | echo "Invalid username "$desc_username 196 | return 197 | fi 198 | 199 | # 判断是否是当前用户 200 | if [ $src_username == $desc_username ]; then 201 | echo "Can not install vimplus to "$desc_username 202 | return 203 | fi 204 | 205 | src_home_path=$(get_home_path $src_username) 206 | desc_home_path=$(get_home_path $desc_username) 207 | 208 | echo "Current home path:"$src_home_path 209 | echo "Installing vimplus to "$desc_home_path 210 | 211 | backup_vimrc_and_vim $desc_username $desc_home_path 212 | 213 | # 拷贝.vim目录 214 | src_vim_path=$src_home_path".vim/" 215 | desc_vim_path=$desc_home_path".vim/" 216 | 217 | rm -rf $desc_vim_path 218 | mkdir $desc_vim_path 219 | 220 | cp -R $src_vim_path"autoload/" $desc_vim_path 221 | cp -R $src_vim_path"plugged/" $desc_vim_path 222 | 223 | chown -R $desc_username":"$desc_username $desc_vim_path 224 | 225 | # 拷贝.vimplus目录 226 | src_vimplus_path=$src_home_path".vimplus/" 227 | desc_vimplus_path=$desc_home_path".vimplus/" 228 | 229 | rm -rf $desc_vimplus_path 230 | cp -R $src_vimplus_path $desc_home_path 231 | chown -R $desc_username":"$desc_username $desc_vimplus_path 232 | 233 | rm -rf $desc_home_path".vimrc.custom.plugins" 234 | cp $desc_vimplus_path".vimrc.custom.plugins" $desc_home_path 235 | chown $desc_username":"$desc_username $desc_home_path".vimrc.custom.plugins" 236 | 237 | rm -rf $desc_home_path".vimrc.custom.config" 238 | cp $desc_vimplus_path".vimrc.custom.config" $desc_home_path 239 | chown $desc_username":"$desc_username $desc_home_path".vimrc.custom.config" 240 | 241 | # 创建软链接 242 | rm -rf $desc_home_path".vimrc" 243 | ln -s $desc_vimplus_path".vimrc" $desc_home_path 244 | chown -R $desc_username":"$desc_username $desc_home_path".vimrc" 245 | 246 | rm -rf $desc_home_path".ycm_extra_conf.py" 247 | ln -s $desc_vimplus_path".ycm_extra_conf.py" $desc_home_path 248 | chown -R $desc_username":"$desc_username $desc_home_path".ycm_extra_conf.py" 249 | 250 | ln -s $desc_vimplus_path"colors" $desc_vim_path 251 | chown -R $desc_username":"$desc_username $desc_vim_path"colors" 252 | 253 | ln -s $desc_vimplus_path"ftplugin" $desc_vim_path 254 | chown -R $desc_username":"$desc_username $desc_vim_path"ftplugin" 255 | 256 | ln -s $desc_vimplus_path"autoload" $desc_vim_path 257 | chown -R $desc_username":"$desc_username $desc_vim_path"autoload" 258 | 259 | # 安装字体 260 | mkdir -p $desc_home_path".local/share/fonts/" 261 | rm -rf $desc_home_path".local/share/fonts/Droid Sans Mono Nerd Font Complete.otf" 262 | cp $desc_vimplus_path"fonts/Droid Sans Mono Nerd Font Complete.otf" $desc_home_path".local/share/fonts/" 263 | chown -R $desc_username":"$desc_username $desc_home_path".local/" 264 | fc-cache -vf $desc_home_path".local/share/fonts/" 265 | } 266 | 267 | # 脚本启动点 268 | if [ $# -lt 1 ]; then 269 | echo "Please input username!" 270 | exit 1 271 | fi 272 | 273 | type=`get_platform_type` 274 | echo "Platform type: "${type} 275 | 276 | if [ ${type} == "Linux" ]; then 277 | for username in $@ 278 | do 279 | install_to_user_on_linux $username 280 | done 281 | 282 | print_logo 283 | else 284 | echo "Not support platform type: "${type} 285 | fi 286 | 287 | -------------------------------------------------------------------------------- /screenshots/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chxuan/vimplus/2dc33dfeda8f63b918ec6e612fd1d3081bb9f78a/screenshots/alipay.png -------------------------------------------------------------------------------- /screenshots/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chxuan/vimplus/2dc33dfeda8f63b918ec6e612fd1d3081bb9f78a/screenshots/main.png -------------------------------------------------------------------------------- /screenshots/vimplus-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chxuan/vimplus/2dc33dfeda8f63b918ec6e612fd1d3081bb9f78a/screenshots/vimplus-logo.png -------------------------------------------------------------------------------- /screenshots/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chxuan/vimplus/2dc33dfeda8f63b918ec6e612fd1d3081bb9f78a/screenshots/wechat.png -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf ~/.vim 4 | rm -rf ~/.vimrc 5 | rm -rf ~/.ycm_extra_conf.py 6 | 7 | echo "Done!" 8 | 9 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 判断文件是否存在 4 | function is_exist_file() 5 | { 6 | filename=$1 7 | if [ -f $filename ]; then 8 | echo 1 9 | else 10 | echo 0 11 | fi 12 | } 13 | 14 | # 更新mac平台字体 15 | function update_fonts_on_mac() 16 | { 17 | rm -rf ~/Library/Fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf 18 | cp ./fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf ~/Library/Fonts 19 | } 20 | 21 | # 更新android平台字体 22 | function update_fonts_on_android() 23 | { 24 | rm -rf ~/.termux/font.ttf 25 | mkdir ~/.termux 26 | cp ./fonts/DejaVu.ttf ~/.termux/font.ttf 27 | 28 | # 刷新style 29 | REL="am broadcast --user 0 -a com.termux.app.reload_style com.termux" 30 | $REL > /dev/null 31 | } 32 | 33 | # 更新linux平台字体 34 | function update_fonts_on_linux() 35 | { 36 | mkdir -p ~/.local/share/fonts 37 | rm -rf ~/.local/share/fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf 38 | cp ./fonts/Droid\ Sans\ Mono\ Nerd\ Font\ Complete.otf ~/.local/share/fonts 39 | 40 | fc-cache -vf ~/.local/share/fonts 41 | } 42 | 43 | # 更新vim插件 44 | function update_vim_plugin() 45 | { 46 | vim -c "PlugUpdate" -c "q" -c "q" 47 | } 48 | 49 | # 拷贝文件 50 | function copy_files() 51 | { 52 | rm -rf ~/.vimrc 53 | ln -s ${PWD}/.vimrc ~ 54 | 55 | vimrc_plugins=$HOME"/.vimrc.custom.plugins" 56 | is_exist=$(is_exist_file $vimrc_plugins) 57 | if [ $is_exist != 1 ]; then 58 | cp ${PWD}/.vimrc.custom.plugins ~ 59 | fi 60 | 61 | vimrc_config=$HOME"/.vimrc.custom.config" 62 | is_exist=$(is_exist_file $vimrc_config) 63 | if [ $is_exist != 1 ]; then 64 | cp ${PWD}/.vimrc.custom.config ~ 65 | fi 66 | 67 | rm -rf ~/.ycm_extra_conf.py 68 | ln -s ${PWD}/.ycm_extra_conf.py ~ 69 | 70 | rm -rf ~/.vim/colors 71 | ln -s ${PWD}/colors ~/.vim 72 | 73 | rm -rf ~/.vim/ftplugin 74 | ln -s ${PWD}/ftplugin ~/.vim 75 | 76 | rm -rf ~/.vim/autoload 77 | ln -s ${PWD}/autoload ~/.vim 78 | } 79 | 80 | # 打印logo 81 | function print_logo() 82 | { 83 | color="$(tput setaf 6)" 84 | normal="$(tput sgr0)" 85 | printf "${color}" 86 | echo ' __ __ ' 87 | echo '__ __/_/___ ___ ____ / /_ _______ ' 88 | echo '\ \ / / / __ `__ \/ __ \/ / / / / ___/ ' 89 | echo ' \ V / / / / / / / /_/ / / /_/ (__ ) ' 90 | echo ' \_/_/_/ /_/ /_/ ,___/_/\____/____/ ' 91 | echo ' /_/ ...is now updated!' 92 | echo '' 93 | echo '' 94 | echo 'Just enjoy it!' 95 | echo 'p.s. Follow me at https://github.com/chxuan.' 96 | echo '' 97 | printf "${normal}" 98 | } 99 | 100 | # 在mac更新vimplus 101 | function update_vimplus_on_mac() 102 | { 103 | git pull origin master 104 | copy_files 105 | update_fonts_on_mac 106 | update_vim_plugin 107 | print_logo 108 | } 109 | 110 | # 在linux更新vimplus 111 | function update_vimplus_on_linux() 112 | { 113 | git pull origin master 114 | copy_files 115 | update_fonts_on_linux 116 | update_vim_plugin 117 | print_logo 118 | } 119 | 120 | # 在android更新vimplus 121 | function update_vimplus_on_android() 122 | { 123 | git pull origin master 124 | copy_files 125 | update_fonts_on_android 126 | update_vim_plugin 127 | print_logo 128 | } 129 | 130 | # 获取当前时间戳 131 | function get_now_timestamp() 132 | { 133 | cur_sec_and_ns=`date '+%s-%N'` 134 | echo ${cur_sec_and_ns%-*} 135 | } 136 | 137 | # main函数 138 | function main() 139 | { 140 | begin=`get_now_timestamp` 141 | 142 | type=$(uname) 143 | echo "Platform type: "${type} 144 | 145 | if [ ${type} == "Darwin" ]; then 146 | update_vimplus_on_mac 147 | elif [ ${type} == "Linux" ]; then 148 | tp=$(uname -a) 149 | if [[ $tp =~ "Android" ]]; then 150 | echo "Android" 151 | update_vimplus_on_android 152 | else 153 | update_vimplus_on_linux 154 | fi 155 | else 156 | echo "Not support platform type: "${type} 157 | fi 158 | 159 | end=`get_now_timestamp` 160 | second=`expr ${end} - ${begin}` 161 | min=`expr ${second} / 60` 162 | echo "It takes "${min}" minutes." 163 | } 164 | 165 | # 调用main函数 166 | main 167 | --------------------------------------------------------------------------------