{"id":23635368,"url":"https://github.com/0382/vimrc","last_synced_at":"2025-07-24T13:41:01.652Z","repository":{"id":118757885,"uuid":"238665290","full_name":"0382/vimrc","owner":"0382","description":"my vim settings","archived":false,"fork":false,"pushed_at":"2023-02-25T08:58:59.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-24T08:50:00.631Z","etag":null,"topics":["vim","vimrc"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0382.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-02-06T10:43:30.000Z","updated_at":"2023-02-25T08:59:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7c49f81-075a-4ab6-8976-6094ec796b84","html_url":"https://github.com/0382/vimrc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0382/vimrc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0382%2Fvimrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0382%2Fvimrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0382%2Fvimrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0382%2Fvimrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0382","download_url":"https://codeload.github.com/0382/vimrc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0382%2Fvimrc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266852162,"owners_count":23995434,"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-07-24T02:00:09.469Z","response_time":99,"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","vimrc"],"created_at":"2024-12-28T05:34:11.303Z","updated_at":"2025-07-24T13:41:01.633Z","avatar_url":"https://github.com/0382.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 我的vim配置文件\n\n## 安装\n\n### 依赖\n\n由于使用了[coc.nvim](https://github.com/neoclide/coc.nvim)插件，需要`nodejs`支持，需要首先安装[nodejs](https://nodejs.org/)。且`coc.nvim`仅支持vim8以上的版本，故本配置也仅适用于vim8以上版本。\n\n### 安装\n\n先删除本地的`~/.vim`文件。然后直接clone本仓库\n```bash\ngit clone http://github.com/0382/settings.git ~/.vim\n```\n还需要拉取一下[vim-plug](https://github.com/junegunn/vim-plug)插件管理器\n```bash\ncd ~/.vim\ngit submodule init\ngit submodule update\n```\n\n在linux下`$~/.vimrc`或windows下的`$VIM/_vimrc`中只用写一句\n```vim\nsource ~/.vim/init.vim\n```\n\n因为使用了[vim-plug](https://github.com/junegunn/vim-plug)插件管理器，直接使用`:PlugInstall`命令安装插件即可，初次打开可能会有报错，装完插件应该就没问题了。\n\n## 使用\n\n### 基本功能\n\n没有设置`\u003cleader\u003e`键，即使用默认的`\\`键。\n\n#### 文件侧边栏\n\n使用[coc-explorer](https://github.com/weirongxu/coc-explorer)插件，需要使用命令`:CocInstall coc-explorer`来安装。\n\n快捷键\n- `\u003cleader\u003ece`打开`coc-explorer`\n\n#### 代码提示\n\n代码提示使用的是`coc.nvim`插件，使用`\u003ctab\u003e`键选择提示项，使用回车键确认。\n\n`coc.nvim`及其系列插件的配置文件使用`:CocConfig`打开，为了方便编译这个`json`文件，建议安装`coc-json`插件，`:CocInstall coc-json`。\n\n#### 快捷编译运行\n\n使用[asyncrun.vim](https://github.com/skywind3000/asyncrun.vim)和[asynctasks.vim](https://github.com/skywind3000/asynctasks.vim)来配置这个功能。\n\n- `\u003cleader\u003efb`，编译单个文件，支持`c,c++,fortran,latex`。\n- `\u003cleader\u003efr`，运行单个文件结果，支持`c,c++,fortran,rust,python,javascript,julia,lisp`。\n- `\u003cLeader\u003eff`, 格式化整个文件，姑目前仅支持`c,c++`。\n- `\u003cleader\u003epb`，编译整个项目，姑且定义了这个快捷键实际上是`make`命令，需要你自己写`Makefile`。\n- `\u003cleader\u003epr`，运行整个小目，实际上是`make run`命令。\n- `\u003cleader\u003eaq`，快速打开或关闭上述命令打开的qucikfix窗口。\n\n#### 其他\n- `\u003calt\u003ew[hjkl]`切换窗口。\n- `\u003calt\u003e=`打开或关闭`terminal`，使用的是`vim-terminal-help`的默认设置。\n- `\u003cleader\u003el`去除搜索后的高亮。\n- `\u003cC-[hjkl]\u003e`总是（包括插入模式下）能够作为方向键移动（大概）。\n\n### 具体编程语言\n\n#### c/c++开发\n\n使用[clangd](https://clangd.llvm.org/)作为[language server](https://microsoft.github.io/language-server-protocol/)来提供更加强大的代码提示功能，所以需要安装`clangd`。\n\n#### Fortran 开发\n\n使用[fortls](https://github.com/fortran-lang/fortls)作为language server，这是python写的包，所以在Windows下需要安装`python`，然后用`pip install fortls`来安装这个包，一些配置可能需要去看看该库的README。\n\n#### julia\n\n使用了[julia-vim](https://github.com/JuliaEditorSupport/julia-vim)插件作为基础支持，其中的Unicode功能待配置。使用julia包`LanguageServer, SymbolServer, StaticLint`作为language server，所以需要安装这三个包，不需要额外设置。\n\n#### rust\nrust的cargo还是很舒服的，`\u003cleader\u003epb, \u003cleader\u003epr`快捷键定义为`cargo build, cargo run`。自行安装[coc-rust-analyzer](https://github.com/fannheyward/coc-rust-analyzer)作为LSP。\n\n#### python\n\n没有特别设置，建议使用`coc.nvim`插件`coc-python`，用`:CocInstall coc-python`安装。目前我不太写`python`，待调教。\n\n## 参考\n- [vim-init](https://github.com/skywind3000/vim-init)\n- [coc.nvim](https://github.com/neoclide/coc.nvim/wiki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0382%2Fvimrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0382%2Fvimrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0382%2Fvimrc/lists"}