{"id":13415362,"url":"https://github.com/ruchee/vimrc","last_synced_at":"2025-12-18T12:03:47.610Z","repository":{"id":15302307,"uuid":"18032080","full_name":"ruchee/vimrc","owner":"ruchee","description":"Ruchee's Vim Config Files","archived":true,"fork":false,"pushed_at":"2023-10-17T02:27:55.000Z","size":38304,"stargazers_count":415,"open_issues_count":0,"forks_count":176,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-07-31T21:53:43.305Z","etag":null,"topics":["vim"],"latest_commit_sha":null,"homepage":"","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/ruchee.png","metadata":{"files":{"readme":"README.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-23T11:42:48.000Z","updated_at":"2024-07-09T09:48:36.000Z","dependencies_parsed_at":"2024-10-26T18:58:29.495Z","dependency_job_id":null,"html_url":"https://github.com/ruchee/vimrc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ruchee/vimrc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruchee%2Fvimrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruchee%2Fvimrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruchee%2Fvimrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruchee%2Fvimrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruchee","download_url":"https://codeload.github.com/ruchee/vimrc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruchee%2Fvimrc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27796292,"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","status":"online","status_checked_at":"2025-12-18T02:00:09.725Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["vim"],"created_at":"2024-07-30T21:00:47.619Z","updated_at":"2025-12-18T12:03:47.604Z","avatar_url":"https://github.com/ruchee.png","language":"Vim Script","funding_links":[],"categories":["Vim Script","Mac OSX"],"sub_categories":[],"readme":"![Vim Ruchee](https://raw.github.com/ruchee/vimrc/master/macvim.jpg \"Vim Ruchee\")\n\n----\n## For Vim 8+: [Modern Vim configuration files for Vim 8+](https://github.com/ruchee/modern_vimrc)\n----\n#### macOS\n\n1. `brew install --cask macvim`\n2. `brew install ctags git`\n3. 删除个人主目录下的 `.vim` 文件夹和 `.vimrc` 文件（如果存在的话） [ 命令为 `rm -rf ~/.vim ~/.vimrc` ]\n4. 使用 `Git` 下载本项目，然后将项目的子目录拷贝到个人主目录下，并将 `vimfiles`、`_vimrc` 分别重命名为 `.vim`、`.vimrc` [ 命令为 `git clone https://github.com/ruchee/vimrc.git ~/vimrc`、`mv ~/vimrc/vimfiles ~/.vim`、`mv ~/vimrc/_vimrc ~/.vimrc` ]\n5. 指定在终端使用 `MacVim` [ 命令为 `ln -s /Applications/MacVim.app/Contents/bin/* /usr/local/bin` ]\n\n----\n\n#### Linux\n\n1. `sudo apt-get install vim-gtk exuberant-ctags git` [ 非 `Debian/Ubuntu` 系统安装命令略有不同  ]\n2. 删除个人主目录下的 `.vim` 文件夹和 `.vimrc` 文件（如果存在的话） [ 命令为 `rm -rf ~/.vim ~/.vimrc` ]\n3. 使用 `Git` 下载本项目，然后将项目的子目录拷贝到个人主目录下，并将 `vimfiles`、`_vimrc` 分别重命名为 `.vim`、`.vimrc` [ 命令为 `git clone https://github.com/ruchee/vimrc.git ~/vimrc`、`mv ~/vimrc/vimfiles ~/.vim`、`mv ~/vimrc/_vimrc ~/.vimrc`]\n4. 下载 `Monaco` 字体，下载后使用命令 `mv monaco.ttf ~/.fonts` 完成安装 [ Monaco 字体下载地址 [https://github.com/todylu/monaco.ttf/blob/master/monaco.ttf?raw=true](https://github.com/todylu/monaco.ttf/blob/master/monaco.ttf?raw=true) ]\n\n----\n\n#### Windows\n\n1. 访问 [http://www.vim.org/download.php#pc](http://www.vim.org/download.php#pc) 下载最新的 `gVim`（有可能需要翻墙才能访问）\n2. 安装 `gVim` 到任意目录，这儿为方便讲解，我假定你安装到了 `D:\\Apps\\Vim`\n3. 将 `D:\\Apps\\Vim\\vim82` 加入 `path` 环境变量 [ 不知何为环境变量者，请求助于搜索引擎 ]\n4. 删除 `Vim` 安装目录下的 `vimfiles` 目录以及 `_vimrc` 文件 [ 如果你自己修改过配置，请注意备份 ]\n5. 使用 `Git` 下载本项目，然后将项目的子目录拷贝到 `Vim` 安装目录下，取代已删文件的位置 [ 命令为 `git clone https://github.com/ruchee/vimrc.git` ]（也可以点击本页面的 `Code -\u003e Download ZIP` 按钮下载）\n6. 访问 [http://ctags.sourceforge.net](http://ctags.sourceforge.net) 下载最新的 `ctags`，将 `ctags.exe` 复制到 `D:\\Apps\\Vim\\vim82` 目录\n7. 安装 `Monaco` 字体，本配置默认使用该字体，可上 [https://github.com/todylu/monaco.ttf/blob/master/monaco.ttf?raw=true](https://github.com/todylu/monaco.ttf/blob/master/monaco.ttf?raw=true) 下载，下载后丢到 `C:\\WINDOWS\\Fonts` 目录即可\n\n----\n\n#### Cygwin\n\n1. 启动 `Cygwin` 安装器，选中 `vim`、`git` 为 `Install` 状态，然后开始安装，直至安装完成\n2. 打开 `Cygwin` 终端，用 `Git` 下载本项目\n3. 余下各步骤与上述 `Linux` 下的步骤完全一样，这儿不再赘述\n4. 字体安装这一步，因为 `Cygwin` 沿用的是 `Windows` 的字体，所以将字体文件放到 `C:\\WINDOWS\\Fonts` 下即可\n\n----\n\n### 注意事项\n\n1. 使用说明全部集中在 `_vimrc` 文件的头部，配置的后半部分是各插件的具体配置项，初学无需理会\n2. 如出现快捷键不响应的情况，请检查你是否开启了其他软件（比如 金山词霸 等），某些软件的快捷键有可能和 `Vim` 相冲突，只需修改或禁用这些软件的快捷键即可\n3. 本配置默认显示的是相对行号，如不习惯，可注释掉配置中的 `set relativenumber` 一项，以使用绝对行号\n4. 如果条件允许，最好用 `universal-ctags` 替代老旧的 `ctags`\n5. 部分插件需要脚本语言的支持，如果条件允许，请安装 `Python3`、`Ruby` 等语言的运行环境\n6. 本配置集成了 `vim-sync` 插件，可以和远程服务器相互传输文件，使用此功能需要先配置项目的 `.sync`，详情请参考 [https://github.com/eshion/vim-sync/issues/10](https://github.com/eshion/vim-sync/issues/10)\n7. `php-cs-fixer` 的配置，请参考：[https://www.ruchee.com/notes/2021/use_php-cs-fixer_format_php_code.html](https://www.ruchee.com/notes/2021/use_php-cs-fixer_format_php_code.html)\n8. 请尽量使用最新的 `Vim 8.x` 版本，低版本部分功能可能无法正常工作\n\n----\n\n### ctags 简易的使用说明，这儿以 Windows 下的 MinGW 为例\n\n1. 首先确保系统能够找到 `ctags`，也就是 `ctags` 添加到了系统的 `path` 环境变量\n2. 以 `MinGW` 为例，到编译器安装目录的 `include` 目录上（譬如 `D:\\MinGW\\include` ）执行命令 `ctags -R --languages=c,c++`\n3. 在 `_vimrc` 文件中添加两行 `set tags+=D:/MinGW/include/tags`、`set path+=D:/MinGW/include`\n4. 以后编辑 `C/C++` 源文件时，键入一小部分字符，然后按 `Ctrl+P` 即可拥有简单的 `C/C++` 代码补全\n5. 将光标移到某个函数名上，按 `Ctrl+]`，`Vim` 将自动跳转到该函数的定义，按 `Ctrl+T` 可返回跳转之前的位置\n\n社区还有更强大的补全工具 `YouCompleteMe` 和 `LSP`，本配置未集成，请自行探索安装\n\n----\n\n### LSP 补全配置参考\n\n需要安装四个插件（本配置未集成，请自行下载安装）\n\n1. `lsp`\n2. `lsp-settings`\n3. `asyncomplete`\n4. `asyncomplete-lsp`\n\n我的配置信息如下：\n\n```vim\nlet g:lsp_diagnostics_enabled = 0  \" 不使用 LSP 自带的错误检测\nlet g:asyncomplete_auto_popup = 0  \" 禁止补全窗口自动弹出\n\n\" 使用 Ctrl + U 快捷键手动弹出补全窗口\nimap \u003cc-u\u003e \u003cPlug\u003e(asyncomplete_force_refresh)\n\n\" 指定各编程语言使用的 LSP Server\nlet g:lsp_settings_filetype_elixir     = 'elixir-ls'\nlet g:lsp_settings_filetype_php        = 'intelephense'\nlet g:lsp_settings_filetype_python     = 'pylsp-all'\nlet g:lsp_settings_filetype_ruby       = 'solargraph'\nlet g:lsp_settings_filetype_javascript = 'deno'\nlet g:lsp_settings_filetype_typescript = 'deno'\n```\n\n详细使用方法请参考：[https://github.com/mattn/vim-lsp-settings](https://github.com/mattn/vim-lsp-settings)\n\n----\n\n### 自定义配置\n\n可在指定目录放置一个配置文件来覆盖本配置的默认设置项\n\n1. `macOS` 和 `Linux` 放在 `HOME` 目录下，命名为 `.self.vim`\n2. `Windows` 放在 `Vim` 安装目录下，命名为 `_self.vim`\n\n下面是一个配置文件的示例：\n\n```vim\n\"----------------------------------------------------------------------\n\nlet g:snips_author = 'Ruchee'\n\n\"----------------------------------------------------------------------\n\n\" 进行 LISP 开发时，将此设置值改为0，以关闭默认的 NERD Commenter 按键映射\n\" NERD Commenter 和 Vlime 的按键有冲突\nlet g:NERDCreateDefaultMappings = 1\n\n\"----------------------------------------------------------------------\n\" For Elixir\n\nlet g:tagbar_type_elixir = {\n    \\ 'ctagstype' : 'elixir',\n    \\ 'kinds' : [\n        \\ 'm:modules',\n        \\ 'f:functions',\n        \\ 'p:protocols',\n        \\ 'c:callbacks',\n        \\ 'd:delegates',\n        \\ 'e:exceptions',\n        \\ 'g:guards',\n        \\ 'i:implementations',\n        \\ 'a:macros',\n        \\ 'o:operators',\n        \\ 'r:records',\n        \\ 't:tests',\n        \\ 'y:types',\n    \\ ]\n\\ }\n\nau FileType erlang set tags+=~/code/data/sources/languages/erlang/tags\nau FileType elixir set tags+=~/code/data/sources/languages/elixir/tags\n\n\"----------------------------------------------------------------------\n\" For TypeScript\n\nlet g:tagbar_type_typescript = {\n    \\ 'ctagstype': 'typescript',\n    \\ 'kinds': [\n        \\ 'n:namespaces',\n        \\ 'i:interfaces',\n        \\ 'c:classes',\n        \\ 'g:enums',\n        \\ 'e:enumerators',\n        \\ 'm:methods',\n        \\ 'f:functions',\n        \\ 'z:function parameters',\n        \\ 'p:properties',\n        \\ 'v:variables',\n        \\ 'l:local variables',\n        \\ 'C:constants',\n        \\ 'G:generators',\n        \\ 'a:aliases',\n    \\ ]\n\\ }\n\n\"----------------------------------------------------------------------\n```\n\n----\n\n本配置文件的更新以我本机的实际使用情况为准\n\n祝使用愉快\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruchee%2Fvimrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruchee%2Fvimrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruchee%2Fvimrc/lists"}