{"id":13399303,"url":"https://github.com/wklken/k-vim","last_synced_at":"2025-05-14T15:09:03.872Z","repository":{"id":8893585,"uuid":"10614163","full_name":"wklken/k-vim","owner":"wklken","description":"vim配置","archived":false,"fork":false,"pushed_at":"2023-11-16T10:48:34.000Z","size":451,"stargazers_count":4896,"open_issues_count":33,"forks_count":1799,"subscribers_count":296,"default_branch":"master","last_synced_at":"2025-04-01T14:00:43.765Z","etag":null,"topics":["k-vim","solarized","vim-configuration","vimrc","ycm"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tdomhan/pyquizlet","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wklken.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}},"created_at":"2013-06-11T03:28:47.000Z","updated_at":"2025-04-01T07:48:23.000Z","dependencies_parsed_at":"2024-02-18T00:31:45.319Z","dependency_job_id":"3bf69d02-a054-4a9d-8355-e86c57902c51","html_url":"https://github.com/wklken/k-vim","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklken%2Fk-vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklken%2Fk-vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklken%2Fk-vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wklken%2Fk-vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wklken","download_url":"https://codeload.github.com/wklken/k-vim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247866071,"owners_count":21009239,"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":["k-vim","solarized","vim-configuration","vimrc","ycm"],"created_at":"2024-07-30T19:00:36.122Z","updated_at":"2025-04-08T15:02:09.314Z","avatar_url":"https://github.com/wklken.png","language":"Vim script","readme":"k-vim\n=======================\n\n\n\u003e VERSION: 9.2\n\n\u003e LAST_UPDATE_TIME: 2017-07-29\n\n\u003e 本次更新: 小版本更新, 支持vim8异步语法检查\n\n详细 [更新日志](https://github.com/wklken/k-vim/wiki/UPDATE_LOG)\n\n# 目标\n\n\u003e Just a Better Vim Config. Keep it Simple.\n\n\n**PS**: 服务器端无插件`k-vim`简化版本(curl直接设置vimrc即可)[vim-for-server](https://github.com/wklken/vim-for-server) / vscode-vim配置(尽量一致的键位) [k-vim-vscode](https://github.com/wklken/k-vim-vscode)\n\n**PPS**: 一份tmux配置 [k-tmux](https://github.com/wklken/k-tmux)\n\n---------------------------------\n\n---------------------------------\n\n# 截图\n\nsolarized主题\n\n![solarized](https://github.com/wklken/gallery/blob/master/vim/solarized.png?raw=true)\n\nmolokai主题\n\n![molokai](https://github.com/wklken/gallery/blob/master/vim/molokai.png?raw=true)\n\n---------------------------------\n---------------------------------\n\n# 安装步骤\n\n### 1. clone 到本地\n\n```\ngit clone https://github.com/wklken/k-vim.git\n```\n\n\n### 2. 安装依赖包\n\n\n##### 2.1 系统依赖 # ctags, ag(the_silver_searcher)\n\n```\n# ubuntu\nsudo apt-get install ctags\nsudo apt-get install build-essential cmake python-dev  #编译YCM自动补全插件依赖\nsudo apt-get install silversearcher-ag\n\n# centos\nsudo yum install python-devel.x86_64\nsudo yum groupinstall 'Development Tools'\nsudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm\nsudo yum install the_silver_searcher\nsudo yum install cmake\n\n# mac\nbrew install ctags\nbrew install the_silver_searcher\n```\n\n##### 2.2 使用Python\n\n```\nsudo pip install flake8 yapf\n```\n\n##### 2.3 如果使用Javascript(不需要的跳过)\n\n```\n# 安装jshint和jslint,用于javascript语法检查\n# 需要nodejs支持,各个系统安装见文档 https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager\n\n# ubuntu\nsudo apt-get install nodejs npm\nsudo npm install -g jslint\nsudo npm install jshint -g\nsudo npm install -g eslint eslint-plugin-standard eslint-plugin-promise eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-html babel-eslint\n\n# mac\nbrew install node\nnpm install jshint -g\nnpm install jslint -g\nnpm install -g eslint eslint-plugin-standard eslint-plugin-promise eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-html babel-eslint\n```\n\n\n### 3. 安装\n\n```\n进入目录, 执行安装\n# 注意原先装过的童鞋, 重装时，不要到~/.vim下执行(这是软连接指向k-vim真是目录)，必须到k-vim原生目录执行\n# 会进入安装插件的列表，一安装是从github clone的，完全取决于网速, 之后会自动编译 YCM, 编译失败的话需要手动编译, 有问题见YCM文档\n# 如果发现有插件安装失败 可以进入vim, 执行`:PlugInstall'\n\ncd k-vim/\nsh -x install.sh\n```\n\n------------------------\n------------------------\n\n# 移除安装\n\n```\ncd ~ \u0026\u0026 rm -rf .vim .vimrc .vimrc.bundles \u0026\u0026 cd -\n```\n\n---------------------------------\n---------------------------------\n\n# 常见问题\n\n详见 [wiki](https://github.com/wklken/k-vim/wiki) 以及  [issues](https://github.com/wklken/k-vim/issues)\n\n\n------------------------\n------------------------\n\n# 插件\n\n### 选择安装插件集合\n\n编辑vimrc.bundles中\n\n```\n\" more options: ['json', 'nginx', 'golang', 'ruby', 'less', 'json', ]\nlet g:bundle_groups=['python', 'javascript', 'markdown', 'html', 'css', 'tmux', 'beta']\n```\n\n选定集合后, 使用插件管理工具进行安装/更新\n\n### 插件管理\n\n使用 [vim-plug](https://github.com/junegunn/vim-plug) 管理插件\n\n`vim-plug` 常见问题: [vim-plug faq](https://github.com/junegunn/vim-plug/wiki/faq) / [YCM timeout](https://github.com/junegunn/vim-plug/wiki/faq#youcompleteme-timeout)\n／[YCM 国人在国内做的镜像](https://github.com/LooEv/A-bridge-to-YouCompleteMe)\n\n管理插件的命令\n\n```\n:PlugInstall     install                      安装插件\n:PlugUpdate      install or update            更新插件\n:PlugClean       remove plugin not in list    删除本地无用插件\n:PlugUpgrade     Upgrade vim-plug itself      升级本身\n:PlugStatus      Check the status of plugins  查看插件状态\n```\n\n\n\n### 插件列表\n\n说明/演示/自定义快捷键等, 待处理\n\n------------------------\n------------------------\n\n\n# 自定义快捷键\n\n```\n注意, 以下 ',' 代表\u003cleader\u003e\n1. 可以自己修改vimrc中配置，决定是否开启鼠标\n\nset mouse-=a           \" 鼠标暂不启用, 键盘党....\nset mouse=a            \" 开启鼠标\n\n2. 退出vim后，内容显示在终端屏幕, 可以用于查看和复制, 如果不需要可以关掉\n    好处：误删什么的，如果以前屏幕打开，可以找回....惨痛的经历\n\nset t_ti= t_te=\n\n3. 可以自己修改vimrc决定是否使用方向键进行上下左右移动，默认关闭，强迫自己用 hjkl，可以注解\nhjkl  上下左右\n\nmap \u003cLeft\u003e \u003cNop\u003e\nmap \u003cRight\u003e \u003cNop\u003e\nmap \u003cUp\u003e \u003cNop\u003e\nmap \u003cDown\u003e \u003cNop\u003e\n\n4. 上排F功能键\n\nF1 废弃这个键,防止调出系统帮助\nF2 set nu/nonu,行号开关，用于鼠标复制代码用\nF3 set list/nolist,显示可打印字符开关\nF4 set wrap/nowrap,换行开关\nF5 set paste/nopaste,粘贴模式paste_mode开关,用于有格式的代码粘贴\nF6 syntax on/off,语法开关，关闭语法可以加快大文件的展示\n\nF9 tagbar\nF10 运行当前文件(quickrun)\n\n5. 分屏移动\n\nctrl + j/k/h/l   进行上下左右窗口跳转,不需要ctrl+w+jkhl\n\n6. 搜索\n\u003cspace\u003e 空格，进入搜索状态\n/       同上\n,/      去除匹配高亮\n\n(交换了#/* 号键功能, 更符合直觉, 其实是离左手更近)\n#       正向查找光标下的词\n*       反向查找光标下的词\n\n优化搜索保证结果在屏幕中间\n\n7. tab操作\nctrl+t 新建一个tab\n\n(hjkl)\n,th    切第1个tab\n,tl    切最后一个tab\n,tj    下一个tab\n,tk    前一个tab\n\n,tn    下一个tab(next)\n,tp    前一个tab(previous)\n\n,td    关闭tab\n,te    tabedit\n,tm    tabm\n\n,1     切第1个tab\n,2     切第2个tab\n...\n,9     切第9个tab\n,0     切最后一个tab\n\n,tt 最近使用两个tab之间切换\n(可修改配置位 ctrl+o,  但是ctrl+o/i为系统光标相关快捷键, 故不采用)\n\n8. buffer操作(不建议, 建议使用ctrlspace插件来操作)\n[b    前一个buffer\n]b    后一个buffer\n\u003c-    前一个buffer\n-\u003e    后一个buffer\n\n\n9. 按键修改\nY         =y$   复制到行尾\nU         =Ctrl-r\n,sa       select all,全选\ngv        选中并高亮最后一次插入的内容\n,v        选中段落\nkj        代替\u003cEsc\u003e，不用到角落去按esc了\n\n,q     :q，退出vim\n,w     :w, 保存当前文件\n\nctrl+n    相对/绝对行号切换\n\u003center\u003e   normal模式下回车选中当前项\n\n更多细节优化:\n    1. j/k 对于换行展示移动更友好\n    2. HL 修改成 ^$, 更方便在同行移动\n    3. ; 修改成 : ，一键进入命令行模式，不需要按shift\n    4. 命令行模式 ctrl+a/e 到开始结尾\n    5. \u003c和\u003e 代码缩进后自动再次选中, 方便连续多次缩进, esc退出\n    6. 对py文件，保存自动去行尾空白，打开自动加行首代码\n    7. 'w!!'强制保存, 即使readonly\n    8. 去掉错误输入提示\n    9. 交换\\`和', '能跳转到准确行列位置\n    10. python/ruby 等, 保存时自动去行尾空白\n    11. 统一所有分屏打开的操作位v/s[nerdtree/ctrlspace] (特殊ctrlp ctrl+v/x)\n    12. ',zz' 代码折叠toggle\n    13. python使用\"\"\"添加docstring会自动补全三引号\n    14. Python使用#进行注释时, 自动缩进\n```\n\n------------------------\n------------------------\n\n### UPDATE_LOG\n\nversion 9.2\n\n```\n插件部分:\n1. 增加 w0rp/ale 异步语法检查插件, 用户vim版本为8.0时自动启用. 非8时, 启用默认scrooloose/syntastic, 两套插件快捷键一致\n2. 切换使用flake8作为python风格检查(pip install pep8)\n3. 启用yapf作为python代码格式化(pip install yapf)\n4. 启用eslint作为javascript代码检查\n5. YCM 设置回车选中不再弹补全框\n\n细节:\n1. 新增快捷键 gv 选中并高亮最后一次插入的内容\n```\n\n### Contributors\n\nthx a lot. 可以给我提pull request:)\n\n查看详情 [git-contributors](https://github.com/wklken/k-vim/graphs/contributors)\n\n### Inspire\n\n1. vimrc文件布局`vimrc+vimrc.bundles`配置方式参考 [maximum-awesome](https://github.com/square/maximum-awesome)\n\n2. install.sh 参考`spf13-vim` 的`bootstrap.sh` [spf13-vim](https://github.com/spf13/spf13-vim)\n\n2. 插件管理使用[Vim-plug](https://github.com/junegunn/vim-plug)\n\n3. 自动补全 [YCM](https://github.com/Valloric/YouCompleteMe)\n\n4. 插件挑选 [VimAwesome](http://vimawesome.com/)\n\n### Resources\n\n[链接](http://www.wklken.me/posts/2014/10/03/vim-resources.html)\n\n### Donation\n\n如果你认为对你有所帮助, You can Buy me a coffee:)\n\n\n![donation](https://raw.githubusercontent.com/wklken/gallery/master/donation/donation_w.jpg)\n\n### Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/wklken/k-vim.svg)](https://starchart.cc/wklken/k-vim)\n\n\n------------------------\n------------------------\n\nThe End!\n\nwklken (凌岳/pythoner/vim党预备党员)\n\nGithub: https://github.com/wklken\n\nBlog: [http://www.wklken.me](http://www.wklken.me)\n\n2013-06-11 于深圳\n\n\n","funding_links":[],"categories":["Vim Script","VimL","Vim script","Vim script (13)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwklken%2Fk-vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwklken%2Fk-vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwklken%2Fk-vim/lists"}