├── .dockerignore ├── .gitignore ├── .gitlab-ci.yml ├── Dockerfile ├── LICENSE ├── README-zh.md ├── README.md ├── eslintrc ├── install.sh ├── screenshot.png └── vimrc /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | ** 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # Using GitLab CI for GitHub repo. 2 | # Author: Jintao Zhang 3 | image: docker:latest 4 | 5 | services: 6 | - docker:dind 7 | 8 | variables: 9 | DOCKER_DRIVER: overlay2 10 | IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH 11 | 12 | stages: 13 | - build-latest 14 | - build-normal 15 | 16 | before_script: 17 | - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY 18 | 19 | .build_template: &build_definition 20 | script: 21 | - IMAGE_TAG=$CI_COMMIT_REF_SLUG 22 | - '[[ $CI_COMMIT_REF_SLUG = master ]] && IMAGE_TAG=latest || IMAGE_TAG=$CI_COMMIT_REF_SLUG' 23 | - docker build -t "$IMAGE_NAME:$IMAGE_TAG" . 24 | - docker images 25 | - docker push "$IMAGE_NAME:$IMAGE_TAG" 26 | 27 | 28 | build-latest: 29 | stage: build-latest 30 | <<: *build_definition 31 | only: 32 | - master 33 | 34 | build-normal: 35 | stage: build-normal 36 | <<: *build_definition 37 | except: 38 | - master 39 | 40 | after_script: 41 | - docker logout $CI_REGISTRY 42 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim as builder 2 | 3 | LABEL maintainer="Jintao Zhang " 4 | 5 | RUN apt update && apt install -y --no-install-recommends \ 6 | ca-certificates \ 7 | exuberant-ctags \ 8 | gcc \ 9 | git \ 10 | libncurses5-dev \ 11 | make \ 12 | python \ 13 | python-dev \ 14 | wget \ 15 | && rm -rf /var/lib/apt/lists/* 16 | 17 | # Build Vim from source code 18 | RUN git clone https://github.com/vim/vim.git \ 19 | && cd vim \ 20 | && ./configure \ 21 | --disable-gui \ 22 | --disable-netbeans \ 23 | --enable-pythoninterp=yes \ 24 | --enable-multibyte \ 25 | --with-features=huge \ 26 | --with-compiledby="Jintao Zhang " \ 27 | --with-python-command=python \ 28 | && make \ 29 | && make install \ 30 | && wget --no-check-certificate https://raw.githubusercontent.com/tao12345666333/vim/master/vimrc -O $HOME/.vimrc \ 31 | && vim -E -u $HOME/.vimrc +qall 32 | # && find $HOME/.vim/bundle/ -type d -name '.git' -exec rm -rf {} \; 33 | 34 | 35 | FROM debian:stretch-slim 36 | 37 | COPY --from=builder /usr/local/bin/ /usr/local/bin 38 | COPY --from=builder /usr/local/share/vim/ /usr/local/share/vim/ 39 | COPY --from=builder /root/.vimrc /root/.vimrc 40 | COPY --from=builder /root/.vim /root/.vim 41 | # we don't need man page 42 | 43 | RUN apt update && apt install -y --no-install-recommends \ 44 | python \ 45 | python-dev \ 46 | python-pip \ 47 | python-setuptools \ 48 | && rm -rf /var/lib/apt/lists/* \ 49 | && pip install pep8 flake8 pyflakes isort 50 | 51 | WORKDIR /src 52 | 53 | ENTRYPOINT [ "vim" ] 54 | CMD [ "--help" ] 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 TaoBeier 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-zh.md: -------------------------------------------------------------------------------- 1 | # [我的Vim配置](http://tao12345666333.github.com/vim) 2 | [![Build Status](https://travis-ci.org/tao12345666333/vim.png)](https://travis-ci.org/tao12345666333/vim) 3 | [![pipeline status](https://gitlab.com/taobeier/vim/badges/master/pipeline.svg)](https://gitlab.com/taobeier/vim/commits/master) 4 | [![Docker Build Status](https://img.shields.io/docker/build/taobeier/vim.svg)](https://hub.docker.com/r/taobeier/vim/) 5 | 6 | 7 | ## 截图 8 | 9 | ![screenshot.png](https://raw.githubusercontent.com/tao12345666333/vim/master/screenshot.png) 10 | 11 | ## Star History 12 | 13 | [![Star History Chart](https://api.star-history.com/svg?repos=tao12345666333/vim&type=Date)](https://star-history.com/#tao12345666333/vim&Date) 14 | 15 | ## 试用 16 | 17 | 你可以使用 Docker 来试用它。 18 | 19 | ``` 20 | sudo docker run -it -v $PWD:/src --rm taobeier/vim 21 | ``` 22 | 23 | 或者使用 GitLab 镜像源, **这里的镜像每周自动构建,会更新所有依赖的包。** 24 | 25 | ``` 26 | sudo docker run -it -v $PWD:/src --rm registry.gitlab.com/taobeier/vim 27 | ``` 28 | 29 | ## 安装 30 | (你需要一个有Python支持的Vim版本. 请使用 `vim --version | grep +python` 来检查) 31 | 32 | * **依赖**(Debian/Ubuntu 平台) 33 | 34 | `sudo apt-get install python vim exuberant-ctags git` 35 | 36 | `sudo pip install pep8 flake8 pyflakes isort` 37 | 38 | * **依赖**(RedHat/CentOS 平台) 39 | 40 | CentOS 6.7的yum源自带的Python版本较旧,推荐自行安装Python2.7. 41 | 42 | `sudo yum install python vim ctags git` 43 | 44 | `sudo pip install pep8 flake8 pyflakes isort` 45 | 46 | * **依赖**(Mac OS 平台) 47 | 48 | `brew install python vim git` 49 | 50 | `wget --no-check-certificate http://tenet.dl.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz && tar -zxvf ctags-5.8.tar.gz && cd ctags-5.8 && ./configure && make && sudo make install` 51 | 52 | `sudo pip install pep8 flake8 pyflakes isort` 53 | 54 | * **下载vimrc 文件到用户主目录** 55 | 56 | `wget --no-check-certificate https://raw.githubusercontent.com/tao12345666333/vim/master/vimrc -O $HOME/.vimrc` 57 | 58 | * **打开 Vim** 59 | 60 | 打开Vim, 它将会自动安装插件. 请耐心等待它完成. 或者你可以使用下面的命令来自行安装. 61 | 62 | `vim -E -u $HOME/.vimrc +qall` 63 | 64 | * **享受你的Vim并个性化它吧!** 65 | 66 | ## 支持特性 67 | 68 | ### 插件管理(Vundle) 69 | 70 | 在这份配置中,使用了[**Vundle**](https://github.com/VundleVim/Vundle.vim)作为插件管理器. Vundle会自动接管 `.vim` 文件夹,所有配置好的插件将默认下载至`~/.vim/bundle/`, 在使用之前请确保`.vim`文件夹干净. Vundle的插件安装需要触发 `git clone` 操作,搜索需要 `curl` 支持. 71 | 72 | #### 配置(截取了部分) 73 | 74 | ```vim 75 | " let Vundle manage Vundle 76 | Plugin 'gmarik/vundle' 77 | 78 | " ============================================================================ 79 | " Active plugins 80 | " You can disable or add new ones here: 81 | 82 | " Plugins from github repos: 83 | 84 | " Better file browser 85 | Plugin 'scrooloose/nerdtree' 86 | " Code commenter 87 | Plugin 'scrooloose/nerdcommenter' 88 | " Class/module browser 89 | Plugin 'majutsushi/tagbar' 90 | " Code and files fuzzy finder 91 | Plugin 'kien/ctrlp.vim' 92 | " Extension to ctrlp, for fuzzy command finder 93 | Plugin 'fisadev/vim-ctrlp-cmdpalette' 94 | " Zen coding 95 | Plugin 'mattn/emmet-vim' 96 | " Git integration 97 | Plugin 'motemen/git-vim' 98 | " Tab list panel 99 | Plugin 'kien/tabman.vim' 100 | 101 | ``` 102 | 103 | #### 支持操作 104 | 105 | | 命令 | 解释 | 106 | |-----------------------|:---------------------:| 107 | | :PluginList | 列出所有Plugin | 108 | | :PluginInstall(!) | 安装/更新Plugin | 109 | | :PluginSearch(!) foo | 搜索foo相关的Plugin | 110 | | :PluginClean(!) | 清理未使用的Plugin | 111 | | :PluginUpdate | 更新插件 | 112 | 113 | 114 | ### 工程文件浏览(NERDTree) 115 | 116 | 在这份配置中, 使用了[**NERDTree**](https://github.com/scrooloose/nerdtree)查看文件列表. 你可以在NERDTree中浏览和打开你文件系统中的目录或文件. 还可以进行文件隐藏和过滤, 设置添加书签等. 在NERDTree窗口输入`?`可获得操作指南. 这份配置中默认过滤掉了`.pyc`, `.git`, `.hg`, `.svn`等文件或文件夹的显示. 117 | 118 | #### 配置 119 | 120 | ```vim 121 | " auto open or close NERDTree 122 | autocmd vimenter * if !argc() | NERDTree | endif 123 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 124 | 125 | " NERDTree ----------------------------- 126 | 127 | " toggle nerdtree display 128 | map :NERDTreeToggle 129 | " open nerdtree with the current file selected 130 | nmap ,t :NERDTreeFind 131 | " don;t show these file types 132 | let NERDTreeIgnore = ['\.pyc$', '\.pyo$'] 133 | ``` 134 | 135 | #### 支持操作 136 | 137 | | 快捷键 | 解释 | 138 | |-----------------------|:--------------------------:| 139 | | F3 | 打开/关闭NERDTree | 140 | | ,t |打开NERDTree并选中当前文件 | 141 | 142 | 143 | ### 语法检查 144 | 145 | 在这份配置中, 使用[**Ale**](https://github.com/dense-analysis/ale)插件进行语法静态检查. 包括但不限于`C/C++/Go/Python/Haskell/Ruby/JavaScript`等. 在本配置中对JavaScript的静态检查使用`eslint`,可以支持ES6及JSX等, 细节可以参考[JSLint, JSHint和ESLint的对比及Vim配置](http://moelove.info/2015/11/28/JSLint-JSHint-ESLint%E5%AF%B9%E6%AF%94%E5%92%8CVim%E9%85%8D%E7%BD%AE/), 想要切换检查工具只要修改对应位置即可. 146 | 147 | #### 特性 148 | 149 | 保存时自动进行语法静态检查,方便的错误提示及灵活的可扩展性. 150 | 151 | 152 | ### Git支持 153 | 154 | 在这份配置中, 使用[**vim-fugitive**](https://github.com/tpope/vim-fugitive)和[**vim-signify**](https://github.com/mhinz/vim-signify)做Git方面的支持. 可以进行常用的git操作及优雅的状态提示等(目前支持`git`和`hg`). 155 | 156 | #### 配置 157 | 158 | ```vim 159 | " Signify ------------------------------ 160 | 161 | " this first setting decides in which order try to guess your current vcs 162 | " UPDATE it to reflect your preferences, it will speed up opening files 163 | let g:signify_vcs_list = [ 'git', 'hg' ] 164 | " mappings to jump to changed blocks 165 | nmap sn (signify-next-hunk) 166 | nmap sp (signify-prev-hunk) 167 | " nicer colors 168 | highlight DiffAdd cterm=bold ctermbg=none ctermfg=119 169 | highlight DiffDelete cterm=bold ctermbg=none ctermfg=167 170 | highlight DiffChange cterm=bold ctermbg=none ctermfg=227 171 | highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119 172 | highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167 173 | highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227 174 | ``` 175 | 176 | #### 支持操作 177 | 178 | | 快捷键 | 解释 | 179 | |-----------------------|:--------------------------:| 180 | | :Git [args] | 类似执行`git`命令一样 | 181 | | :Gstatus |类似`git status`.在列表中使用`-`添加/移除文件 | 182 | | :Gcommit [args] | 类似 `git commit` | 183 | | :Gmerge [args] | 类似 `git merge` | 184 | | :Gpull [args] | 类似 `git pull` | 185 | | :Gpush [args] | 类似 `git push` | 186 | | :Gvdiff [revision] |类似 `git push` 但是会切分窗口| 187 | 188 | 更多详细的操作可以使用 `:help fugitive` 189 | 190 | 191 | ### Tag支持 192 | 193 | 在这份配置中,使用了[**Tagbar**](http://github.com/majutsushi/tagbar)做Tag支持,可以显示当前文件中定义的类/变量等. 194 | 195 | #### 配置 196 | 197 | ```vim 198 | " Tagbar ----------------------------- 199 | 200 | " toggle tagbar display 201 | map :TagbarToggle 202 | " autofocus on tagbar open 203 | let g:tagbar_autofocus = 1 204 | ``` 205 | 206 | #### 支持操作 207 | 208 | | 快捷键 | 解释 | 209 | |-----------------------|:--------------------------:| 210 | | F4 | 打开Tag列表 | 211 | 212 | 213 | ### 超全自动补全 214 | 215 | 在这份配置中, 使用了[**Neocomplcache**](https://github.com/Shougo/neocomplcache.vim)作为主要的自动补全插件. 216 | 217 | #### 配置 218 | 219 | ```vim 220 | " NeoComplCache ------------------------------ 221 | 222 | " most of them not documented because I'm not sure how they work 223 | " (docs aren't good, had to do a lot of trial and error to make 224 | " it play nice) 225 | 226 | " Disable AutoComplPop. 227 | let g:acp_enableAtStartup = 0 228 | " Use neocomplcache. 229 | let g:neocomplcache_enable_at_startup = 1 230 | let g:neocomplcache_enable_ignore_case = 1 231 | " Use smartcase. 232 | let g:neocomplcache_enable_smart_case = 1 233 | let g:neocomplcache_enable_auto_select = 1 234 | 235 | let g:neocomplcache_enable_fuzzy_completion = 1 236 | let g:neocomplcache_enable_camel_case_completion = 1 237 | let g:neocomplcache_enable_underbar_completion = 1 238 | let g:neocomplcache_fuzzy_completion_start_length = 1 239 | let g:neocomplcache_auto_completion_start_length = 1 240 | let g:neocomplcache_manual_completion_start_length = 1 241 | " Set minimum syntax keyword length. 242 | let g:neocomplcache_min_keyword_length = 1 243 | let g:neocomplcache_min_syntax_length = 1 244 | let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' 245 | " complete with workds from any opened file 246 | let g:neocomplcache_same_filetype_lists = {} 247 | let g:neocomplcache_same_filetype_lists._ = '_' 248 | " : completion. 249 | inoremap pumvisible() ? "\" : "\" 250 | " Define keyword. 251 | if !exists('g:neocomplcache_keyword_patterns') 252 | let g:neocomplcache_keyword_patterns = {} 253 | endif 254 | let g:neocomplcache_keyword_patterns['default'] = '\h\w*' 255 | " Plugin key-mappings. 256 | inoremap neocomplcache#undo_completion() 257 | inoremap neocomplcache#complete_common_string() 258 | " , : close popup and delete backword char. 259 | inoremap neocomplcache#smart_close_popup()."\" 260 | inoremap neocomplcache#smart_close_popup()."\" 261 | inoremap neocomplcache#close_popup() 262 | inoremap neocomplcache#cancel_popup() 263 | ``` 264 | 265 | #### 支持操作 266 | 267 | | 快捷键 | 解释 | 268 | |-----------------------|:--------------------------:| 269 | | \ | 使用Tab键进行待提示项目选择| 270 | | \ | 取消补全 | 271 | | \ | 完成待补全项中共同的字符串 | 272 | | \ | 关闭待选项 | 273 | | \ | 关闭待选项 | 274 | | \ | 退出待选项 | 275 | | \ | 关闭待选项 | 276 | 277 | 278 | ### 类Tmux的窗口选择 279 | 280 | 在这份配置中,使用了[**vim-choosewin**](https://github.com/t9md/vim-choosewin)进行窗口管理器. 支持类Tmux的操作. 281 | 282 | #### 配置 283 | 284 | ```vim 285 | " Window Chooser ------------------------------ 286 | 287 | " mapping 288 | nmap - (choosewin) 289 | " show big letters 290 | let g:choosewin_overlay_enable = 1 291 | ``` 292 | 293 | #### 支持操作 294 | 295 | | 快捷键 | 解释 | 296 | |-----------------------|:--------------------------:| 297 | | - | 开启窗口选择 | 298 | | - [ | 选择上一个tab的窗口 | 299 | | - ] | 选择下一个tab的窗口 | 300 | 301 | 更多操作可以使用 `:help choosewin` 302 | 303 | 304 | ### 灵活的Tab管理 305 | 306 | 在这份配置中使用了[TabMan](https://github.com/kien/tabman.vim)进行Tab管理,可以进行灵活切换与管理 307 | 308 | #### 配置 309 | 310 | ```vim 311 | " TabMan ------------------------------ 312 | 313 | " mappings to toggle display, and to focus on it 314 | let g:tabman_toggle = 'tl' 315 | let g:tabman_focus = 'tf' 316 | ``` 317 | 318 | #### 支持操作 319 | 320 | | 快捷键 | 解释 | 321 | |-----------------------|:--------------------------:| 322 | | tl | 开启/关闭tab管理 | 323 | | tf | 将光标移动到tab管理窗口 | 324 | 325 | 326 | ### 优雅的状态栏 327 | 328 | 在这份配置中,使用了[**Airline**](https://github.com/vim-airline/vim-airline)提供更多状态栏支持. 329 | 330 | #### 配置 331 | 332 | ```vim 333 | " Airline ------------------------------ 334 | 335 | let g:airline_powerline_fonts = 1 336 | let g:airline_theme = 'bubblegum' 337 | "let g:airline#extensions#tabline#enabled = 1 338 | "let g:airline#extensions#tabline#left_sep = ' ' 339 | "let g:airline#extensions#tabline#left_alt_sep = '|' 340 | let g:airline#extensions#whitespace#enabled = 1 341 | 342 | " to use fancy symbols for airline, uncomment the following lines and use a 343 | " patched font (more info on the README.rst) 344 | if !exists('g:airline_symbols') 345 | let g:airline_symbols = {} 346 | endif 347 | 348 | let g:airline_left_sep = '' 349 | let g:airline_left_alt_sep = '' 350 | let g:airline_right_sep = '' 351 | let g:airline_right_alt_sep = '' 352 | let g:airline_symbols.branch = '' 353 | let g:airline_symbols.readonly = '' 354 | let g:airline_symbols.linenr = '' 355 | ``` 356 | 357 | #### 支持特性 358 | 359 | 可以显示分支,语法静态检查结果等. 360 | 361 | 362 | ### 自动插入头部 363 | 364 | 在这份配置中写了个小函数根据新建的不同类型的文件,自动插入头部,支持`python`, `ruby`, `bash`等. 365 | 366 | 367 | ### Markdown实时预览 368 | 369 | 在这份配置中, 使用了[**vim-instant-markdown**](https://github.com/suan/vim-instant-markdown)和[vim-markdown](https://github.com/plasticboy/vim-markdown)做Markdown格式的支持,可以支持实时预览等特性. 370 | 371 | 此功能需要有node环境支持,可以执行 `npm -g install instant-markdown-d` 进行安装. 372 | 373 | #### 配置 374 | 375 | ```vim 376 | " Vim-markdown ------------------------------ 377 | 378 | " Disabled automatically folding 379 | let g:vim_markdown_folding_disabled=1 380 | " LeTeX math 381 | let g:vim_markdown_math=1 382 | " Highlight YAML frontmatter 383 | let g:vim_markdown_frontmatter=1 384 | 385 | " Vim-instant-markdown ----------------- 386 | 387 | " If it takes your system too much, you can specify 388 | " let g:instant_markdown_slow = 1 389 | " if you don't want to manually control it 390 | " you can open this setting 391 | " and when you open this, you can manually trigger preview 392 | " via the command :InstantMarkdownPreview 393 | let g:instant_markdown_autostart = 0 394 | ``` 395 | 396 | #### 支持操作 397 | 398 | | 快捷键 | 解释 | 399 | |-----------------------|:--------------------------:| 400 | |:InstantMarkdownPreview| 手动触发markdown文件的预览 | 401 | 402 | 403 | ### 多游标选择、编辑等 404 | 405 | 在这份配置中, 可以在高亮某单词时, 通过使用 `Ctrl-n` 或者 `Ctrl-p` 进行多游标选择, 然后进行编辑或修改等操作. 406 | 407 | 408 | ### 快速文件查找 409 | 410 | 在这份配置中, 可以通过使用`,R`进行全文查找或者`,r`进行快速查找, 或者在当前字符串上使用`,wR`以及`,wr`来进行全文查找或者快速查找. 411 | 412 | ### 快速注释 413 | 414 | 使用[**NERDCommenter**](https://github.com/scrooloose/nerdcommenter)插件完成快速注释, 可以通过`\ci`进行快速注释. 415 | 416 | #### Python 支持 417 | 418 | 完备的Python支持, 可以自动识别当前是系统环境或虚拟环境, 使用`:Isort`可智能对导入包进行排序, 使用`:PymodeLintAuto`可自动格式化. 419 | 420 | **除了上述列出的功能以外, 还有很多方便的特性,可以大大提升效率,在使用中慢慢体会吧!有问题可以在[tao12345666333/vim](https://github.com/tao12345666333/vim) on github 提issue** 421 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [My Vim setting](http://tao12345666333.github.com/vim) 2 | [![Build Status](https://travis-ci.org/tao12345666333/vim.png)](https://travis-ci.org/tao12345666333/vim) 3 | [![pipeline status](https://gitlab.com/taobeier/vim/badges/master/pipeline.svg)](https://gitlab.com/taobeier/vim/commits/master) 4 | [![Docker Build Status](https://img.shields.io/docker/build/taobeier/vim.svg)](https://hub.docker.com/r/taobeier/vim/) 5 | 6 | 7 | ## [中文说明](README-zh.md) 8 | 9 | ## screenshot 10 | 11 | ![screenshot.png](https://raw.githubusercontent.com/tao12345666333/vim/master/screenshot.png) 12 | 13 | ## Star History 14 | 15 | [![Star History Chart](https://api.star-history.com/svg?repos=tao12345666333/vim&type=Date)](https://star-history.com/#tao12345666333/vim&Date) 16 | 17 | ## Try it 18 | 19 | You can use Docker to try it. 20 | 21 | ``` 22 | sudo docker run -it -v $PWD:/src --rm taobeier/vim 23 | ``` 24 | 25 | Or use the GitLab registry, **where the image is automatically built weekly and all dependent packages are updated**. 26 | 27 | ``` 28 | sudo docker run -it -v $PWD:/src --rm registry.gitlab.com/taobeier/vim 29 | ``` 30 | 31 | ## Install 32 | (You need a vim compiled with python support. Check it with `vim --version | grep +python`) 33 | 34 | * **Dependencies**(Debian/Ubuntu platform) 35 | 36 | `sudo apt-get install python vim exuberant-ctags git` 37 | 38 | `sudo pip install pep8 flake8 pyflakes isort` 39 | 40 | * **Dependencies**(RedHat/CentOS platform) 41 | 42 | The CentOS 6.7's default Python is 2.6, it's recommend to install Python2.7. 43 | 44 | `sudo yum install python vim ctags git` 45 | 46 | `sudo pip install pep8 flake8 pyflakes isort` 47 | 48 | * **Dependencies**(Mac OS platform) 49 | 50 | `brew install python vim git` 51 | 52 | `wget --no-check-certificate http://tenet.dl.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz && tar -zxvf ctags-5.8.tar.gz && cd ctags-5.8 && ./configure && make && sudo make install` 53 | 54 | `sudo pip install pep8 flake8 pyflakes isort` 55 | 56 | * **Download vimrc file to user home directory** 57 | 58 | `wget --no-check-certificate https://raw.githubusercontent.com/tao12345666333/vim/master/vimrc -O $HOME/.vimrc` 59 | 60 | * **Open Vim** 61 | 62 | Open vim, it will install plugins automatically. Wait for the installation to be finished. 63 | Or you can run 64 | 65 | `vim -E -u $HOME/.vimrc +qall` 66 | 67 | * **Enjoy your Vim and costomize it** 68 | 69 | ## Features 70 | 71 | ### Plugin Manage(Vundle) 72 | 73 | In this configuration,I use [**Vundle**](https://github.com/VundleVim/Vundle.vim) as plugins manager. Vundle will auto manage the `.vim` directory,all plugins which has been configured will be downloaded to `~/.vim/bundle/` by default, please keep the `.vim` directory clean before use it. When Vundle installing plugins `git clone` operation will be triggered,the search operation need `curl` . 74 | 75 | #### Configuration(one part) 76 | 77 | ```vim 78 | " let Vundle manage Vundle 79 | Plugin 'gmarik/vundle' 80 | 81 | " ============================================================================ 82 | " Active plugins 83 | " You can disable or add new ones here: 84 | 85 | " Plugins from github repos: 86 | 87 | " Better file browser 88 | Plugin 'scrooloose/nerdtree' 89 | " Code commenter 90 | Plugin 'scrooloose/nerdcommenter' 91 | " Class/module browser 92 | Plugin 'majutsushi/tagbar' 93 | " Code and files fuzzy finder 94 | Plugin 'kien/ctrlp.vim' 95 | " Extension to ctrlp, for fuzzy command finder 96 | Plugin 'fisadev/vim-ctrlp-cmdpalette' 97 | " Zen coding 98 | Plugin 'mattn/emmet-vim' 99 | " Git integration 100 | Plugin 'motemen/git-vim' 101 | " Tab list panel 102 | Plugin 'kien/tabman.vim' 103 | 104 | ``` 105 | 106 | #### Supported operations 107 | 108 | | command | description | 109 | |-----------------------|:---------------------:| 110 | | :PluginList | list all Plugins | 111 | | :PluginInstall(!) | install/update Plugin | 112 | | :PluginSearch(!) foo |search Plugin about foo| 113 | | :PluginClean(!) | clean unused Plugins | 114 | | :PluginUpdate | update Plugins | 115 | 116 | 117 | ### Project file browser(NERDTree) 118 | 119 | In this configuration,I use [**NERDTree**](https://github.com/scrooloose/nerdtree) as file browser. The NERDTree allows you to explore your filesystem and to open files and directory. It also allows you to hide files or set bookmarks etc. In NERDTree window input `?` can get the operation guide. This configuration filters out `.pyc`, `.git`, `.hg`, `.svn` etc. 120 | 121 | #### Configuration 122 | 123 | ```vim 124 | " auto open or close NERDTree 125 | autocmd vimenter * if !argc() | NERDTree | endif 126 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 127 | 128 | " NERDTree ----------------------------- 129 | 130 | " toggle nerdtree display 131 | map :NERDTreeToggle 132 | " open nerdtree with the current file selected 133 | nmap ,t :NERDTreeFind 134 | " don;t show these file types 135 | let NERDTreeIgnore = ['\.pyc$', '\.pyo$'] 136 | ``` 137 | 138 | #### Supported operation 139 | 140 | | shortcut key | description | 141 | |-----------------------|:--------------------------:| 142 | | F3 | open/close NERDTree | 143 | | ,t |open NERDTree and select current file| 144 | 145 | 146 | ### Syntax checking 147 | 148 | In this configuration,I use [**Ale**](https://github.com/dense-analysis/ale) plugin for syntax checking. Support `C/C++/Go/Python/Haskell/Ruby/JavaScript` etc. For JavaScript, I use `eslint` as checker, so it can check ES6 and JSX etc. You can see [JSLint, JSHint和ESLint的对比及Vim配置](http://moelove.info/2015/11/28/JSLint-JSHint-ESLint%E5%AF%B9%E6%AF%94%E5%92%8CVim%E9%85%8D%E7%BD%AE/) for more details, when you want to change checker tools, just modify a little setting. 149 | 150 | #### Features 151 | 152 | When you save files, it will check syntax automatically, and display syntax errors. 153 | -------------------------------------------------------------------------------- /eslintrc: -------------------------------------------------------------------------------- 1 | // http://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | extends: 'airbnb-base', 13 | // required to lint *.vue files 14 | plugins: [ 15 | 'html' 16 | ], 17 | // check if imports actually resolve 18 | 'settings': { 19 | 'import/resolver': { 20 | 'webpack': { 21 | 'config': 'build/webpack.base.conf.js' 22 | } 23 | } 24 | }, 25 | // add your custom rules here 26 | 'rules': { 27 | // don't require .vue extension when importing 28 | 'import/extensions': ['error', 'always', { 29 | 'js': 'never', 30 | 'vue': 'never' 31 | }], 32 | // allow optionalDependencies 33 | 'import/no-extraneous-dependencies': ['error', { 34 | 'optionalDependencies': ['test/unit/index.js'] 35 | }], 36 | 'no-console': ['error', { allow: ['warn', 'error', 'log'] }], 37 | 'quote-props': [2, "as-needed"], 38 | 'no-shadow': ['error', { 'builtinGlobals': false, hoist: 'never', allow: ['resolve', 'reject', 'done', 'cb'] }], 39 | 'no-param-reassign': ["error", { "props": false }], 40 | 'arrow-body-style': ["error", "always"], 41 | 'no-restricted-syntax': ['error', 'WithStatement'], 42 | 'no-underscore-dangle': ['error', { 'allow': ["_id"], 'allowAfterThis': true }], 43 | 'consistent-return': 'off', 44 | // allow debugger during development 45 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | wget --no-check-certificate https://raw.githubusercontent.com/tao12345666333/vim/master/vimrc -O $HOME/.vimrc 4 | 5 | vim -E -u $HOME/.vimrc +qall 6 | 7 | echo 'Install Complete! ' 8 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tao12345666333/vim/286524f6fdef15b6fb4369bcfb0dfb3df623e612/screenshot.png -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | " ============================================================================ 3 | " Author: Jintao Zhang 4 | " Blog: https://moelove.info 5 | " Version: v25.04.0 6 | " Update Time: 2025-04-18 7 | 8 | " ============================================================================ 9 | " Vundle initialization 10 | " Avoid modify this section, unless you are very sure of what you are doing 11 | 12 | " no vi-compatible 13 | set nocompatible 14 | 15 | " Setting up Vundle - the best vim plugin manager 16 | let iCanHazVundle=1 17 | let vundle_readme=expand('~/.vim/bundle/vundle/README.md') 18 | if !filereadable(vundle_readme) 19 | echo "Installing Vundle..." 20 | echo "" 21 | silent !mkdir -p ~/.vim/bundle 22 | silent !git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle 23 | let iCanHazVundle=0 24 | endif 25 | 26 | filetype off 27 | 28 | set rtp+=~/.vim/bundle/vundle/ 29 | call vundle#rc() 30 | 31 | " let Vundle manage Plugins 32 | Plugin 'VundleVim/Vundle.vim' 33 | 34 | " ============================================================================ 35 | " Active plugins 36 | " You can disable or add new ones here: 37 | 38 | " Plugins from github repos: 39 | 40 | " Better file browser 41 | Plugin 'scrooloose/nerdtree' 42 | " Code commenter 43 | Plugin 'scrooloose/nerdcommenter' 44 | " Class/module browser 45 | Plugin 'majutsushi/tagbar' 46 | " Code and files fuzzy finder 47 | Plugin 'ctrlpvim/ctrlp.vim' 48 | " Extension to ctrlp, for fuzzy command finder 49 | Plugin 'fisadev/vim-ctrlp-cmdpalette' 50 | " Zen coding 51 | Plugin 'mattn/emmet-vim' 52 | " A Git wrapper so awesome 53 | Plugin 'tpope/vim-fugitive' 54 | " Tab management for Vim 55 | Plugin 'kien/tabman.vim' 56 | " Airline 57 | Plugin 'vim-airline/vim-airline' 58 | Plugin 'vim-airline/vim-airline-themes' 59 | " Consoles as buffers 60 | Plugin 'rosenfeld/conque-term' 61 | " Pending tasks list 62 | Plugin 'fisadev/FixedTaskList.vim' 63 | " Surround 64 | Plugin 'tpope/vim-surround' 65 | " Autoclose 66 | Plugin 'Townk/vim-autoclose' 67 | " Indent text object 68 | Plugin 'michaeljsmith/vim-indent-object' 69 | " Python mode (indentation, doc, refactor, lints, code checking, motion and 70 | " operators, highlighting, run and ipdb breakpoints) 71 | Plugin 'python-mode/python-mode' 72 | " Better autocompletion 73 | Plugin 'Shougo/neocomplcache.vim' 74 | " Snippets manager (SnipMate), dependencies, and snippets repo 75 | Plugin 'MarcWeber/vim-addon-mw-utils' 76 | Plugin 'tomtom/tlib_vim' 77 | Plugin 'honza/vim-snippets' 78 | Plugin 'garbas/vim-snipmate' 79 | " awesome colorscheme 80 | Plugin 'tomasr/molokai' 81 | " Git/mercurial/others diff icons on the side of the file lines 82 | Plugin 'mhinz/vim-signify' 83 | " Automatically sort python imports 84 | Plugin 'fisadev/vim-isort' 85 | " Drag visual blocks arround 86 | Plugin 'fisadev/dragvisuals.vim' 87 | " Window chooser 88 | Plugin 't9md/vim-choosewin' 89 | " ALE (Asynchronous Lint Engine) 90 | Plugin 'dense-analysis/ale' 91 | " Paint css colors with the real color 92 | Plugin 'lilydjwg/colorizer' 93 | " Relative numbering of lines (0 is the current line) 94 | " Require Vim 7.3+ 95 | " Plugin 'myusuf3/numbers.vim' 96 | 97 | " javascript complete after install the plugin, you must cd the install 98 | " directory and run `npm install`, then add a .tern-project config file 99 | " the doc at http://ternjs.net/doc/manual.html#vim 100 | Plugin 'ternjs/tern_for_vim' 101 | " Golang Plugins 102 | Plugin 'fatih/vim-go' 103 | " JSX syntax highlight. 104 | Plugin 'mxw/vim-jsx' 105 | " Markdown syntastic highlight 106 | Plugin 'godlygeek/tabular' 107 | Plugin 'plasticboy/vim-markdown' 108 | " Markdown realtime preview 109 | " Before you want to use it, please run 110 | " `sudo npm -g install instant-markdown-d` 111 | Plugin 'suan/vim-instant-markdown' 112 | " Handlebars syntax highlighting 113 | Plugin 'mustache/vim-mustache-handlebars' 114 | " Vue.js syntax and highlighting 115 | Plugin 'tao12345666333/vim-vue' 116 | " True Sublime Text style multiple selections for Vim 117 | Plugin 'terryma/vim-multiple-cursors' 118 | " Modern database interface for Vim 119 | Plugin 'tpope/vim-dadbod' 120 | " Dockerfile support 121 | Plugin 'ekalinin/Dockerfile.vim' 122 | 123 | " Plugins from vim-scripts repos: 124 | 125 | " Search results counter 126 | Plugin 'IndexedSearch' 127 | " XML/HTML tags navigation 128 | Plugin 'matchit.zip' 129 | " Gvim colorscheme 130 | Plugin 'Wombat' 131 | " Yank history navigation 132 | Plugin 'YankRing.vim' 133 | 134 | " ============================================================================ 135 | " Install plugins the first time vim runs 136 | 137 | if iCanHazVundle == 0 138 | echo "Installing Plugins, please ignore key map error messages" 139 | echo "" 140 | :PluginInstall 141 | endif 142 | 143 | " ============================================================================ 144 | " Vim settings and mappings 145 | " You can edit them as you wish 146 | 147 | " allow plugins by file type (required for plugins!) 148 | filetype plugin on 149 | filetype indent on 150 | 151 | " tabs and spaces handling 152 | set expandtab 153 | set tabstop=4 154 | set softtabstop=4 155 | set shiftwidth=4 156 | " highlight cursor line and column 157 | set cursorline 158 | set cursorcolumn 159 | " hidden startup messages 160 | set shortmess=atI 161 | " auto read and write 162 | set autowrite 163 | set autoread 164 | " when deal with unsaved files ask what to do 165 | set confirm 166 | " no backup files 167 | set nobackup 168 | " other settings 169 | set langmenu=zh_CN.UTF-8 170 | set mouse=a 171 | set whichwrap+=<,>,h,l,[,] 172 | set background=dark 173 | set encoding=utf-8 174 | 175 | set backspace=2 " make backspace work like most other apps 176 | set backspace=indent,eol,start 177 | 178 | " tab length exceptions on some file types 179 | autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2 180 | autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2 softtabstop=2 181 | autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2 182 | 183 | " auto open or close NERDTree 184 | autocmd vimenter * if !argc() | NERDTree | endif 185 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 186 | 187 | " always show status bar 188 | set laststatus=2 189 | 190 | " incremental search 191 | set incsearch 192 | " highlighted search results 193 | set hlsearch 194 | " search ignore case 195 | set ignorecase 196 | " muting search highlighting 197 | nnoremap :nohlsearch 198 | 199 | " syntax highlight on 200 | syntax on 201 | 202 | " show line numbers 203 | set nu 204 | 205 | " tab navigation mappings 206 | map tn :tabn 207 | map tp :tabp 208 | map tm :tabm 209 | map tt :tabnew 210 | map ts :tab split 211 | map :tabn 212 | imap :tabn 213 | map :tabp 214 | imap :tabp 215 | 216 | " navigate windows with meta+arrows 217 | map l 218 | map h 219 | map k 220 | map j 221 | imap l 222 | imap h 223 | imap k 224 | imap j 225 | 226 | " old autocomplete keyboard shortcut 227 | imap 228 | 229 | " Comment this line to enable autocompletion preview window 230 | " (displays documentation related to the selected completion option) 231 | " Disabled by default because preview makes the window flicker 232 | set completeopt-=preview 233 | 234 | " save as sudo 235 | ca w!! w !sudo tee "%" 236 | 237 | " simple recursive grep 238 | " both recursive grep commands with internal or external (fast) grep 239 | command! -nargs=1 RecurGrep lvimgrep //gj ./**/*.* | lopen | set nowrap 240 | command! -nargs=1 RecurGrepFast silent exec 'lgrep! ./**/*.*' | lopen 241 | " mappings to call them 242 | nmap ,R :RecurGrep 243 | nmap ,r :RecurGrepFast 244 | " mappings to call them with the default word as search text 245 | nmap ,wR :RecurGrep 246 | nmap ,wr :RecurGrepFast 247 | 248 | " use 256 colors when possible 249 | if &term =~? 'mlterm\|xterm\|xterm-256\|screen-256' 250 | let &t_Co = 256 251 | colorscheme molokai 252 | else 253 | colorscheme delek 254 | endif 255 | 256 | " colors for gvim 257 | if has('gui_running') 258 | colorscheme wombat 259 | endif 260 | 261 | " when scrolling, keep cursor 3 lines away from screen border 262 | set scrolloff=3 263 | 264 | " autocompletion of files and commands behaves like zsh 265 | " (autocomplete menu) 266 | set wildmenu 267 | set wildmode=full 268 | 269 | " better backup, swap and undos storage 270 | set directory=~/.vim/dirs/tmp " directory to place swap files in 271 | set backup " make backup files 272 | set backupdir=~/.vim/dirs/backups " where to put backup files 273 | set undofile " persistent undos - undo after you re-open the file 274 | set undodir=~/.vim/dirs/undos 275 | set viminfo+=n~/.vim/dirs/viminfo 276 | " store yankring history file there too 277 | let g:yankring_history_dir = '~/.vim/dirs/' 278 | 279 | " create needed directories if they don't exist 280 | if !isdirectory(&backupdir) 281 | call mkdir(&backupdir, "p") 282 | endif 283 | if !isdirectory(&directory) 284 | call mkdir(&directory, "p") 285 | endif 286 | if !isdirectory(&undodir) 287 | call mkdir(&undodir, "p") 288 | endif 289 | 290 | " ============================================================================ 291 | " Plugins settings and mappings 292 | " Edit them as you wish. 293 | 294 | " Tagbar ----------------------------- 295 | 296 | " toggle tagbar display 297 | map :TagbarToggle 298 | " autofocus on tagbar open 299 | let g:tagbar_autofocus = 1 300 | 301 | " NERDTree ----------------------------- 302 | 303 | " toggle nerdtree display 304 | map :NERDTreeToggle 305 | " open nerdtree with the current file selected 306 | nmap ,t :NERDTreeFind 307 | " don;t show these file types 308 | let NERDTreeIgnore = ['\.pyc$', '\.pyo$'] 309 | 310 | 311 | " Tasklist ------------------------------ 312 | 313 | " show pending tasks list 314 | map :TaskList 315 | 316 | " CtrlP ------------------------------ 317 | 318 | " file finder mapping 319 | let g:ctrlp_map = ',e' 320 | " hidden some types files 321 | let g:ctrlp_show_hidden = 1 322 | set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.png,*.jpg,*.gif "Linux 323 | " tags (symbols) in current file finder mapping 324 | nmap ,g :CtrlPBufTag 325 | " tags (symbols) in all files finder mapping 326 | nmap ,G :CtrlPBufTagAll 327 | " general code finder in all files mapping 328 | nmap ,f :CtrlPLine 329 | " recent files finder mapping 330 | nmap ,m :CtrlPMRUFiles 331 | " commands finder mapping 332 | nmap ,c :CtrlPCmdPalette 333 | " to be able to call CtrlP with default search text 334 | function! CtrlPWithSearchText(search_text, ctrlp_command_end) 335 | execute ':CtrlP' . a:ctrlp_command_end 336 | call feedkeys(a:search_text) 337 | endfunction 338 | " same as previous mappings, but calling with current word as default text 339 | nmap ,wg :call CtrlPWithSearchText(expand(''), 'BufTag') 340 | nmap ,wG :call CtrlPWithSearchText(expand(''), 'BufTagAll') 341 | nmap ,wf :call CtrlPWithSearchText(expand(''), 'Line') 342 | nmap ,we :call CtrlPWithSearchText(expand(''), '') 343 | nmap ,pe :call CtrlPWithSearchText(expand(''), '') 344 | nmap ,wm :call CtrlPWithSearchText(expand(''), 'MRUFiles') 345 | nmap ,wc :call CtrlPWithSearchText(expand(''), 'CmdPalette') 346 | " don't change working directory 347 | let g:ctrlp_working_path_mode = 0 348 | " ignore these files and folders on file finder 349 | let g:ctrlp_custom_ignore = { 350 | \ 'dir': '\v[\/](\.git|\.hg|\.svn)$', 351 | \ 'file': '\.pyc$\|\.pyo$', 352 | \ } 353 | 354 | " ALE (Asynchronous Lint Engine) ------------------------------ 355 | 356 | 357 | " Python-mode ------------------------------ 358 | 359 | " don't use linter, we use syntastic for that 360 | let g:pymode_lint_on_write = 0 361 | let g:pymode_lint_signs = 0 362 | " don't fold python code on open 363 | let g:pymode_folding = 0 364 | " don't load rope by default. Change to 1 to use rope 365 | let g:pymode_rope = 0 366 | " open definitions on same window, and custom mappings for definitions and 367 | " occurrences 368 | let g:pymode_rope_goto_definition_bind = ',d' 369 | let g:pymode_rope_goto_definition_cmd = 'e' 370 | nmap ,D :tab split:PymodePython rope.goto() 371 | nmap ,o :RopeFindOccurrences 372 | 373 | " NeoComplCache ------------------------------ 374 | 375 | " most of them not documented because I'm not sure how they work 376 | " (docs aren't good, had to do a lot of trial and error to make 377 | " it play nice) 378 | 379 | " Disable AutoComplPop. 380 | let g:acp_enableAtStartup = 0 381 | " Use neocomplcache. 382 | let g:neocomplcache_enable_at_startup = 1 383 | let g:neocomplcache_enable_ignore_case = 1 384 | " Use smartcase. 385 | let g:neocomplcache_enable_smart_case = 1 386 | let g:neocomplcache_enable_auto_select = 1 387 | 388 | let g:neocomplcache_enable_fuzzy_completion = 1 389 | let g:neocomplcache_enable_camel_case_completion = 1 390 | let g:neocomplcache_enable_underbar_completion = 1 391 | let g:neocomplcache_fuzzy_completion_start_length = 1 392 | let g:neocomplcache_auto_completion_start_length = 1 393 | let g:neocomplcache_manual_completion_start_length = 1 394 | " Set minimum syntax keyword length. 395 | let g:neocomplcache_min_keyword_length = 1 396 | let g:neocomplcache_min_syntax_length = 1 397 | let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' 398 | " complete with workds from any opened file 399 | let g:neocomplcache_same_filetype_lists = {} 400 | let g:neocomplcache_same_filetype_lists._ = '_' 401 | " : completion. 402 | inoremap pumvisible() ? "\" : "\" 403 | " Define keyword. 404 | if !exists('g:neocomplcache_keyword_patterns') 405 | let g:neocomplcache_keyword_patterns = {} 406 | endif 407 | let g:neocomplcache_keyword_patterns['default'] = '\h\w*' 408 | " Plugin key-mappings. 409 | inoremap neocomplcache#undo_completion() 410 | inoremap neocomplcache#complete_common_string() 411 | " , : close popup and delete backword char. 412 | inoremap neocomplcache#smart_close_popup()."\" 413 | inoremap neocomplcache#smart_close_popup()."\" 414 | inoremap neocomplcache#close_popup() 415 | inoremap neocomplcache#cancel_popup() 416 | 417 | " TabMan ------------------------------ 418 | 419 | " mappings to toggle display, and to focus on it 420 | let g:tabman_toggle = 'tl' 421 | let g:tabman_focus = 'tf' 422 | 423 | " Autoclose ------------------------------ 424 | 425 | " Fix to let ESC work as espected with Autoclose plugin 426 | let g:AutoClosePumvisible = {"ENTER": "\", "ESC": "\"} 427 | 428 | " DragVisuals ------------------------------ 429 | 430 | " mappings to move blocks in 4 directions 431 | vmap DVB_Drag('left') 432 | vmap DVB_Drag('right') 433 | vmap DVB_Drag('down') 434 | vmap DVB_Drag('up') 435 | " mapping to duplicate block 436 | vmap D DVB_Duplicate() 437 | 438 | " Signify ------------------------------ 439 | 440 | " this first setting decides in which order try to guess your current vcs 441 | " UPDATE it to reflect your preferences, it will speed up opening files 442 | let g:signify_vcs_list = [ 'git', 'hg' ] 443 | " mappings to jump to changed blocks 444 | nmap sn (signify-next-hunk) 445 | nmap sp (signify-prev-hunk) 446 | " nicer colors 447 | highlight DiffAdd cterm=bold ctermbg=none ctermfg=119 448 | highlight DiffDelete cterm=bold ctermbg=none ctermfg=167 449 | highlight DiffChange cterm=bold ctermbg=none ctermfg=227 450 | highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119 451 | highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167 452 | highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227 453 | 454 | " Window Chooser ------------------------------ 455 | 456 | " mapping 457 | nmap - (choosewin) 458 | " show big letters 459 | let g:choosewin_overlay_enable = 1 460 | 461 | " Airline ------------------------------ 462 | 463 | let g:airline_powerline_fonts = 1 464 | let g:airline_theme = 'bubblegum' 465 | "let g:airline#extensions#tabline#enabled = 1 466 | "let g:airline#extensions#tabline#left_sep = ' ' 467 | "let g:airline#extensions#tabline#left_alt_sep = '|' 468 | let g:airline#extensions#whitespace#enabled = 1 469 | 470 | " to use fancy symbols for airline, uncomment the following lines and use a 471 | " patched font (more info on the README.rst) 472 | if !exists('g:airline_symbols') 473 | let g:airline_symbols = {} 474 | endif 475 | " let g:airline_left_sep = '⮀' 476 | " let g:airline_left_alt_sep = '⮁' 477 | " let g:airline_right_sep = '⮂' 478 | " let g:airline_right_alt_sep = '⮃' 479 | " let g:airline_symbols.branch = '⭠' 480 | " let g:airline_symbols.readonly = '⭤' 481 | " let g:airline_symbols.linenr = '⭡' 482 | 483 | let g:airline_left_sep = '' 484 | let g:airline_left_alt_sep = '' 485 | let g:airline_right_sep = '' 486 | let g:airline_right_alt_sep = '' 487 | let g:airline_symbols.branch = '' 488 | let g:airline_symbols.readonly = '' 489 | let g:airline_symbols.linenr = '' 490 | 491 | " new file set title and turn to endline 492 | autocmd BufNewFile *.sh,*.py,*.rb exec ":call SetTitle()" 493 | function SetTitle() 494 | if &filetype == 'sh' 495 | call setline(1,"\#!/bin/bash") 496 | call append(line("."), "") 497 | 498 | elseif &filetype == 'python' 499 | call setline(1,"#!/usr/bin/env python") 500 | call append(line("."),"# coding=utf-8") 501 | call append(line(".")+1, "") 502 | 503 | elseif &filetype == 'ruby' 504 | call setline(1,"#!/usr/bin/env ruby") 505 | call append(line("."),"# encoding: utf-8") 506 | call append(line(".")+1, "") 507 | endif 508 | endfunction 509 | autocmd BufNewFile * normal G 510 | 511 | " Vim-jsx ------------------------------ 512 | 513 | " if you use JSX syntax in .js file, please enable it. 514 | let g:jsx_ext_required = 0 515 | 516 | " Vim-markdown ------------------------------ 517 | 518 | " Disabled automatically folding 519 | let g:vim_markdown_folding_disabled=1 520 | " LeTeX math 521 | let g:vim_markdown_math=1 522 | " Highlight YAML frontmatter 523 | let g:vim_markdown_frontmatter=1 524 | 525 | " Vim-instant-markdown ----------------- 526 | 527 | " If it takes your system too much, you can specify 528 | " let g:instant_markdown_slow = 1 529 | " if you don't want to manually control it 530 | " you can open this setting 531 | " and when you open this, you can manually trigger preview 532 | " via the command :InstantMarkdownPreview 533 | let g:instant_markdown_autostart = 0 534 | --------------------------------------------------------------------------------