{"id":13927102,"url":"https://github.com/tao12345666333/vim","last_synced_at":"2025-04-04T14:07:56.031Z","repository":{"id":30275021,"uuid":"33826504","full_name":"tao12345666333/vim","owner":"tao12345666333","description":"My Vim configuration more Python, Javascript, Vue.js, Golang and Markdown, will add Haskell, Ruby and C/C++","archived":false,"fork":false,"pushed_at":"2023-06-02T05:01:46.000Z","size":4811,"stargazers_count":567,"open_issues_count":2,"forks_count":185,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-03-28T13:08:30.227Z","etag":null,"topics":["dockerfile","es6","golang","javascript","markdown","nerdtree","python","ruby","vim","vue","vundle"],"latest_commit_sha":null,"homepage":"http://moelove.info/vim","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tao12345666333.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-04-12T17:33:38.000Z","updated_at":"2025-02-21T22:11:27.000Z","dependencies_parsed_at":"2024-01-14T16:08:06.235Z","dependency_job_id":"320792a5-e1b8-4fa9-aadf-3fb2c3aae0b7","html_url":"https://github.com/tao12345666333/vim","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tao12345666333%2Fvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tao12345666333%2Fvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tao12345666333%2Fvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tao12345666333%2Fvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tao12345666333","download_url":"https://codeload.github.com/tao12345666333/vim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190250,"owners_count":20898702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerfile","es6","golang","javascript","markdown","nerdtree","python","ruby","vim","vue","vundle"],"created_at":"2024-08-07T16:01:25.782Z","updated_at":"2025-04-04T14:07:56.002Z","avatar_url":"https://github.com/tao12345666333.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# [我的Vim配置](http://tao12345666333.github.com/vim)\n[![Build Status](https://travis-ci.org/tao12345666333/vim.png)](https://travis-ci.org/tao12345666333/vim)\n[![pipeline status](https://gitlab.com/taobeier/vim/badges/master/pipeline.svg)](https://gitlab.com/taobeier/vim/commits/master)\n[![Docker Build Status](https://img.shields.io/docker/build/taobeier/vim.svg)](https://hub.docker.com/r/taobeier/vim/)\n\n\n## 截图\n\n![screenshot.png](https://raw.githubusercontent.com/tao12345666333/vim/master/screenshot.png)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=tao12345666333/vim\u0026type=Date)](https://star-history.com/#tao12345666333/vim\u0026Date)\n\n## 试用\n\n你可以使用 Docker 来试用它。\n\n```\nsudo docker run -it -v $PWD:/src --rm taobeier/vim\n```\n\n或者使用 GitLab 镜像源， **这里的镜像每周自动构建，会更新所有依赖的包。**\n\n```\nsudo docker run -it -v $PWD:/src --rm registry.gitlab.com/taobeier/vim\n```\n\n## 安装\n(你需要一个有Python支持的Vim版本. 请使用 `vim --version | grep +python` 来检查)\n\n* **依赖**(Debian/Ubuntu 平台)\n\n    `sudo apt-get install python vim exuberant-ctags git`\n\n    `sudo pip install pep8 flake8 pyflakes isort`\n\n* **依赖**(RedHat/CentOS 平台)\n\n    CentOS 6.7的yum源自带的Python版本较旧，推荐自行安装Python2.7.\n\n    `sudo yum install python vim ctags git`\n\n    `sudo pip install pep8 flake8 pyflakes isort`\n\n* **依赖**(Mac OS 平台)\n\n    `brew install python vim git`\n\n    `wget --no-check-certificate http://tenet.dl.sourceforge.net/project/ctags/ctags/5.8/ctags-5.8.tar.gz \u0026\u0026 tar -zxvf ctags-5.8.tar.gz \u0026\u0026 cd ctags-5.8 \u0026\u0026 ./configure \u0026\u0026 make \u0026\u0026 sudo make install`\n\n    `sudo pip install pep8 flake8 pyflakes isort`\n\n* **下载vimrc 文件到用户主目录**\n\n    `wget --no-check-certificate https://raw.githubusercontent.com/tao12345666333/vim/master/vimrc -O $HOME/.vimrc`\n\n* **打开 Vim**\n\n    打开Vim, 它将会自动安装插件. 请耐心等待它完成. 或者你可以使用下面的命令来自行安装.\n\n    `vim -E -u $HOME/.vimrc +qall`\n\n* **享受你的Vim并个性化它吧!**\n\n## 支持特性\n\n### 插件管理（Vundle）\n\n在这份配置中，使用了[**Vundle**](https://github.com/VundleVim/Vundle.vim)作为插件管理器. Vundle会自动接管 `.vim` 文件夹，所有配置好的插件将默认下载至`~/.vim/bundle/`， 在使用之前请确保`.vim`文件夹干净. Vundle的插件安装需要触发 `git clone` 操作，搜索需要 `curl` 支持.\n\n#### 配置(截取了部分)\n\n```vim\n\" let Vundle manage Vundle\nPlugin 'gmarik/vundle'\n\n\" ============================================================================\n\" Active plugins\n\" You can disable or add new ones here:\n\n\" Plugins from github repos:\n\n\" Better file browser\nPlugin 'scrooloose/nerdtree'\n\" Code commenter\nPlugin 'scrooloose/nerdcommenter'\n\" Class/module browser\nPlugin 'majutsushi/tagbar'\n\" Code and files fuzzy finder\nPlugin 'kien/ctrlp.vim'\n\" Extension to ctrlp, for fuzzy command finder\nPlugin 'fisadev/vim-ctrlp-cmdpalette'\n\" Zen coding\nPlugin 'mattn/emmet-vim'\n\" Git integration\nPlugin 'motemen/git-vim'\n\" Tab list panel\nPlugin 'kien/tabman.vim'\n\n```\n\n#### 支持操作\n\n|      命令             |         解释          |\n|-----------------------|:---------------------:|\n|  :PluginList          |   列出所有Plugin      |\n|  :PluginInstall(!)    |   安装/更新Plugin     |\n|  :PluginSearch(!) foo |  搜索foo相关的Plugin  |\n|  :PluginClean(!)      |  清理未使用的Plugin   |\n|  :PluginUpdate        |      更新插件         |\n\n\n### 工程文件浏览（NERDTree）\n\n在这份配置中, 使用了[**NERDTree**](https://github.com/scrooloose/nerdtree)查看文件列表. 你可以在NERDTree中浏览和打开你文件系统中的目录或文件. 还可以进行文件隐藏和过滤, 设置添加书签等. 在NERDTree窗口输入`?`可获得操作指南. 这份配置中默认过滤掉了`.pyc`, `.git`, `.hg`, `.svn`等文件或文件夹的显示.\n\n#### 配置\n\n```vim\n\" auto open or close NERDTree\nautocmd vimenter * if !argc() | NERDTree | endif\nautocmd bufenter * if (winnr(\"$\") == 1 \u0026\u0026 exists(\"b:NERDTreeType\") \u0026\u0026 b:NERDTreeType == \"primary\") | q | endif\n\n\" NERDTree -----------------------------\n\n\" toggle nerdtree display\nmap \u003cF3\u003e :NERDTreeToggle\u003cCR\u003e\n\" open nerdtree with the current file selected\nnmap ,t :NERDTreeFind\u003cCR\u003e\n\" don;t show these file types\nlet NERDTreeIgnore = ['\\.pyc$', '\\.pyo$']\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|      F3               |   打开/关闭NERDTree        |\n|      ,t               |打开NERDTree并选中当前文件  |\n\n\n### 语法检查\n在这份配置中， 使用[**Syntastic**](https://github.com/scrooloose/syntastic)插件进行语法静态检查. 包括但不限于`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/), 想要切换检查工具只要修改对应位置即可.\n\n#### 配置\n\n```vim\n\" Syntastic ------------------------------\n\n\" show list of errors and warnings on the current file\nnmap \u003cleader\u003ee :Errors\u003cCR\u003e\n\" turn to next or previous errors, after open errors list\nnmap \u003cleader\u003en :lnext\u003cCR\u003e\nnmap \u003cleader\u003ep :lprevious\u003cCR\u003e\n\" check also when just opened the file\nlet g:syntastic_check_on_open = 1\n\" syntastic checker for javascript.\n\" eslint is the only tool support JSX.\n\" If you don't need write JSX, you can use jshint.\n\" And eslint is slow, but not a hindrance\n\" let g:syntastic_javascript_checkers = ['jshint']\nlet g:syntastic_javascript_checkers = ['eslint']\n\" don't put icons on the sign column (it hides the vcs status icons of signify)\nlet g:syntastic_enable_signs = 0\n\" custom icons (enable them if you use a patched font, and enable the previous \n\" setting)\nlet g:syntastic_error_symbol = '✗'\nlet g:syntastic_warning_symbol = '⚠'\nlet g:syntastic_style_error_symbol = '✗'\nlet g:syntastic_style_warning_symbol = '⚠'\n```\n\n#### 特性\n\n保存时自动进行语法静态检查，方便的错误提示及灵活的可扩展性.\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|       `\\e`            |    打开错误列表            |\n|       `\\n`            |    移动到下一个错误位置    |\n|       `\\p`            |    移动到上一个错误位置    |\n\n\n### Git支持\n\n在这份配置中, 使用[**vim-fugitive**](https://github.com/tpope/vim-fugitive)和[**vim-signify**](https://github.com/mhinz/vim-signify)做Git方面的支持. 可以进行常用的git操作及优雅的状态提示等(目前支持`git`和`hg`).\n\n#### 配置\n\n```vim\n\" Signify ------------------------------\n\n\" this first setting decides in which order try to guess your current vcs\n\" UPDATE it to reflect your preferences, it will speed up opening files\nlet g:signify_vcs_list = [ 'git', 'hg' ]\n\" mappings to jump to changed blocks\nnmap \u003cleader\u003esn \u003cplug\u003e(signify-next-hunk)\nnmap \u003cleader\u003esp \u003cplug\u003e(signify-prev-hunk)\n\" nicer colors\nhighlight DiffAdd           cterm=bold ctermbg=none ctermfg=119\nhighlight DiffDelete        cterm=bold ctermbg=none ctermfg=167\nhighlight DiffChange        cterm=bold ctermbg=none ctermfg=227\nhighlight SignifySignAdd    cterm=bold ctermbg=237  ctermfg=119\nhighlight SignifySignDelete cterm=bold ctermbg=237  ctermfg=167\nhighlight SignifySignChange cterm=bold ctermbg=237  ctermfg=227\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|    :Git [args]        |      类似执行`git`命令一样 |\n|    :Gstatus           |类似`git status`.在列表中使用`-`添加/移除文件       |\n|    :Gcommit [args]    |      类似 `git commit`     |\n|    :Gmerge [args]     |      类似 `git merge`      |\n|    :Gpull [args]      |      类似 `git pull`       |\n|    :Gpush [args]      |      类似 `git push`       |\n|    :Gvdiff [revision] |类似 `git push` 但是会切分窗口|\n\n更多详细的操作可以使用 `:help fugitive`\n\n\n### Tag支持\n\n在这份配置中，使用了[**Tagbar**](http://github.com/majutsushi/tagbar)做Tag支持，可以显示当前文件中定义的类/变量等.\n\n#### 配置\n\n```vim\n\" Tagbar -----------------------------\n\n\" toggle tagbar display\nmap \u003cF4\u003e :TagbarToggle\u003cCR\u003e\n\" autofocus on tagbar open\nlet g:tagbar_autofocus = 1\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|       F4              |     打开Tag列表            |\n\n\n### 超全自动补全\n\n在这份配置中, 使用了[**Neocomplcache**](https://github.com/Shougo/neocomplcache.vim)作为主要的自动补全插件.\n\n#### 配置\n\n```vim\n\" NeoComplCache ------------------------------\n\n\" most of them not documented because I'm not sure how they work\n\" (docs aren't good, had to do a lot of trial and error to make \n\" it play nice)\n\n\" Disable AutoComplPop.\nlet g:acp_enableAtStartup = 0\n\" Use neocomplcache.\nlet g:neocomplcache_enable_at_startup = 1\nlet g:neocomplcache_enable_ignore_case = 1\n\" Use smartcase.\nlet g:neocomplcache_enable_smart_case = 1\nlet g:neocomplcache_enable_auto_select = 1\n\nlet g:neocomplcache_enable_fuzzy_completion = 1\nlet g:neocomplcache_enable_camel_case_completion = 1\nlet g:neocomplcache_enable_underbar_completion = 1\nlet g:neocomplcache_fuzzy_completion_start_length = 1\nlet g:neocomplcache_auto_completion_start_length = 1\nlet g:neocomplcache_manual_completion_start_length = 1\n\" Set minimum syntax keyword length.\nlet g:neocomplcache_min_keyword_length = 1\nlet g:neocomplcache_min_syntax_length = 1\nlet g:neocomplcache_lock_buffer_name_pattern = '\\*ku\\*'\n\" complete with workds from any opened file\nlet g:neocomplcache_same_filetype_lists = {}\nlet g:neocomplcache_same_filetype_lists._ = '_'\n\" \u003cTAB\u003e: completion.\ninoremap \u003cexpr\u003e\u003cTAB\u003e  pumvisible() ? \"\\\u003cC-n\u003e\" : \"\\\u003cTAB\u003e\"\n\" Define keyword.\nif !exists('g:neocomplcache_keyword_patterns')\n    let g:neocomplcache_keyword_patterns = {}\nendif\nlet g:neocomplcache_keyword_patterns['default'] = '\\h\\w*'\n\" Plugin key-mappings.\ninoremap \u003cexpr\u003e\u003cC-g\u003e     neocomplcache#undo_completion()\ninoremap \u003cexpr\u003e\u003cC-l\u003e     neocomplcache#complete_common_string()\n\" \u003cC-h\u003e, \u003cBS\u003e: close popup and delete backword char.\ninoremap \u003cexpr\u003e\u003cC-h\u003e neocomplcache#smart_close_popup().\"\\\u003cC-h\u003e\"\ninoremap \u003cexpr\u003e\u003cBS\u003e neocomplcache#smart_close_popup().\"\\\u003cC-h\u003e\"\ninoremap \u003cexpr\u003e\u003cC-y\u003e  neocomplcache#close_popup()\ninoremap \u003cexpr\u003e\u003cC-e\u003e  neocomplcache#cancel_popup()\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|      \\\u003cTab\u003e           | 使用Tab键进行待提示项目选择|\n|      \\\u003cC-g\u003e           |    取消补全                |\n|      \\\u003cC-l\u003e           | 完成待补全项中共同的字符串 |\n|      \\\u003cC-h\u003e           |     关闭待选项             |\n|      \\\u003cC-y\u003e           |     关闭待选项             |\n|      \\\u003cC-e\u003e           |     退出待选项             |\n|      \\\u003cBS\u003e            |     关闭待选项             |\n\n\n### 类Tmux的窗口选择\n\n在这份配置中，使用了[**vim-choosewin**](https://github.com/t9md/vim-choosewin)进行窗口管理器. 支持类Tmux的操作.\n\n#### 配置\n\n```vim\n\" Window Chooser ------------------------------\n\n\" mapping\nnmap  -  \u003cPlug\u003e(choosewin)\n\" show big letters\nlet g:choosewin_overlay_enable = 1\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|       -               |       开启窗口选择         |\n|     -  [              |   选择上一个tab的窗口      |\n|     -  ]              |   选择下一个tab的窗口      |\n\n更多操作可以使用 `:help choosewin`\n\n\n### 灵活的Tab管理\n\n在这份配置中使用了[TabMan](https://github.com/kien/tabman.vim)进行Tab管理,可以进行灵活切换与管理\n\n#### 配置\n\n```vim\n\" TabMan ------------------------------\n\n\" mappings to toggle display, and to focus on it\nlet g:tabman_toggle = 'tl'\nlet g:tabman_focus  = 'tf'\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|       tl              |     开启/关闭tab管理       |\n|       tf              |   将光标移动到tab管理窗口  |\n\n\n### 优雅的状态栏\n\n在这份配置中，使用了[**Airline**](https://github.com/vim-airline/vim-airline)提供更多状态栏支持.\n\n#### 配置\n\n```vim\n\" Airline ------------------------------\n\nlet g:airline_powerline_fonts = 1\nlet g:airline_theme = 'bubblegum'\n\"let g:airline#extensions#tabline#enabled = 1\n\"let g:airline#extensions#tabline#left_sep = ' '\n\"let g:airline#extensions#tabline#left_alt_sep = '|'\nlet g:airline#extensions#whitespace#enabled = 1\n\n\" to use fancy symbols for airline, uncomment the following lines and use a\n\" patched font (more info on the README.rst)\nif !exists('g:airline_symbols')\n   let g:airline_symbols = {}\nendif\n\nlet g:airline_left_sep = ''\nlet g:airline_left_alt_sep = ''\nlet g:airline_right_sep = ''\nlet g:airline_right_alt_sep = ''\nlet g:airline_symbols.branch = ''\nlet g:airline_symbols.readonly = ''\nlet g:airline_symbols.linenr = ''\n```\n\n#### 支持特性\n\n可以显示分支，语法静态检查结果等.\n\n\n### 自动插入头部\n\n在这份配置中写了个小函数根据新建的不同类型的文件，自动插入头部，支持`python`, `ruby`, `bash`等.\n\n\n### Markdown实时预览\n\n在这份配置中, 使用了[**vim-instant-markdown**](https://github.com/suan/vim-instant-markdown)和[vim-markdown](https://github.com/plasticboy/vim-markdown)做Markdown格式的支持，可以支持实时预览等特性.\n\n此功能需要有node环境支持，可以执行 `npm -g install instant-markdown-d` 进行安装.\n\n#### 配置\n\n```vim\n\" Vim-markdown ------------------------------\n\n\" Disabled automatically folding\nlet g:vim_markdown_folding_disabled=1\n\" LeTeX math\nlet g:vim_markdown_math=1\n\" Highlight YAML frontmatter\nlet g:vim_markdown_frontmatter=1\n\n\" Vim-instant-markdown -----------------\n\n\" If it takes your system too much, you can specify\n\" let g:instant_markdown_slow = 1\n\" if you don't want to manually control it\n\" you can open this setting\n\" and when you open this, you can manually trigger preview\n\" via the command :InstantMarkdownPreview\nlet g:instant_markdown_autostart = 0\n```\n\n#### 支持操作\n\n|      快捷键           |         解释               |\n|-----------------------|:--------------------------:|\n|:InstantMarkdownPreview| 手动触发markdown文件的预览 |\n\n\n### 多游标选择、编辑等\n\n在这份配置中, 可以在高亮某单词时, 通过使用 `Ctrl-n` 或者 `Ctrl-p` 进行多游标选择, 然后进行编辑或修改等操作.\n\n\n### 快速文件查找\n\n在这份配置中, 可以通过使用`,R`进行全文查找或者`,r`进行快速查找, 或者在当前字符串上使用`,wR`以及`,wr`来进行全文查找或者快速查找.\n\n### 快速注释\n\n使用[**NERDCommenter**](https://github.com/scrooloose/nerdcommenter)插件完成快速注释, 可以通过`\\ci`进行快速注释.\n\n#### Python 支持\n\n完备的Python支持, 可以自动识别当前是系统环境或虚拟环境, 使用`:Isort`可智能对导入包进行排序, 使用`:PymodeLintAuto`可自动格式化.\n\n**除了上述列出的功能以外, 还有很多方便的特性，可以大大提升效率，在使用中慢慢体会吧！有问题可以在[tao12345666333/vim](https://github.com/tao12345666333/vim) on github 提issue**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftao12345666333%2Fvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftao12345666333%2Fvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftao12345666333%2Fvim/lists"}