├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── PLUGINS.md ├── README.md ├── chapter ├── Common problems.md ├── List-Of-Colorschemes.md ├── List-Of-Plugins.md ├── Miscellaneous.md ├── Technical quirks.md ├── bracketed-paste.md ├── editing-huge-files-is-slow.md ├── editing-small-files-is-slow.md ├── function-search-undo.md ├── map-capslock-to-control.md ├── standard-plugins.md ├── vim-distributions.md └── why-hjkl-for-navigation.md ├── contents └── minimal-vimrc.vim └── tools └── chinese_linter.vim /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 有兴趣加入本项目的话,请关注下面的认领列表,选择相应的章节翻译,或者协助校验正在翻译的项目。如果有兴趣加入,可以fork本项目,开始翻译后提交PR,便于我们协助校验,不必翻译结束后才提交PR. 2 | 3 | ## 认领方式 4 | 5 | **开issue** 6 | 7 | ```md 8 | 章节名称:***** 9 | 译者:****** 10 | PR: PR的链接 11 | ``` 12 | 13 | ## 提交方式 14 | 15 | 每个章节独立翻译,并提交至 [chapter/](chapter/) 文件夹,文件名为英文标题小写,以`-`链接单词。例如翻译`What is Vim?`章节, 文件名即为`chapter/what-is-vim.md`. 合并到主仓库后,将定期将这些章节文件合并到`README.dm`。 16 | 17 | ## 章节列表 18 | 19 | 基于[mhinz/vim-galore@d50d48b](https://github.com/mhinz/vim-galore/tree/d50d48bce40bbbd99a0528a2893b00cf54a6f4b9), 后期如果有改动,定期在更新。 20 | 21 | |章节名称|认领状态|PR链接| 22 | |:------|:------|:------| 23 | | [Intro](https://github.com/mhinz/vim-galore#intro) | [wsdjeg] | [#4] | 24 | | [What is Vim?](https://github.com/mhinz/vim-galore#what-is-vim) | [wsdjeg] | [#4] | 25 | | [The Vim Philosophy](https://github.com/mhinz/vim-galore#the-vim-philosophy) | [wsdjeg] | [#4] | 26 | | [First steps](https://github.com/mhinz/vim-galore#first-steps) | [wsdjeg] | [#4] | 27 | | [Minimal vimrc](https://github.com/mhinz/vim-galore#minimal-vimrc) | [wsdjeg] | [#4] | 28 | | [What kind of Vim am I running?](https://github.com/mhinz/vim-galore#what-kind-of-vim-am-i-running) | [wsdjeg] | [#4] | 29 | | [Cheatsheets](https://github.com/mhinz/vim-galore#cheatsheets) | [wsdjeg] | [#4] | 30 | | [Basics](https://github.com/mhinz/vim-galore#basics-1) | [wsdjeg] | [#4] | 31 | | [Buffers, windows, tabs](https://github.com/mhinz/vim-galore#buffers-windows-tabs) | [wsdjeg] | [#4] | 32 | | [Active, loaded, listed, named buffers](https://github.com/mhinz/vim-galore#active-loaded-listed-named-buffers) | [wsdjeg] | [#4] | 33 | | [Argument list](https://github.com/mhinz/vim-galore#argument-list) | [wsdjeg] | [#4] | 34 | | [Mappings](https://github.com/mhinz/vim-galore#mappings) | [wsdjeg] | [#4] | 35 | | [Mapleader](https://github.com/mhinz/vim-galore#mapleader) | [星星丶S1nG] | [#7] | 36 | | [Registers](https://github.com/mhinz/vim-galore#registers) | [星星丶S1nG] | [#7] | 37 | | [Ranges](https://github.com/mhinz/vim-galore#ranges) | [星星丶S1nG] | [#7] | 38 | | [Marks](https://github.com/mhinz/vim-galore#marks) | [星星丶S1nG] | [#7] | 39 | | [Completion](https://github.com/mhinz/vim-galore#completion) | [星星丶S1nG] | [#7] | 40 | | [Motions, operators, text objects](https://github.com/mhinz/vim-galore#motions-operators-text-objects) | [星星丶S1nG] | [#7] | 41 | | [Autocmds](https://github.com/mhinz/vim-galore#autocmds) | [星星丶S1nG] | [#7] | 42 | | [Changelist, jumplist](https://github.com/mhinz/vim-galore#changelist-jumplist) | [星星丶S1nG] | [#7] | 43 | | [Undo tree](https://github.com/mhinz/vim-galore#undo-tree) | [星星丶S1nG] | [#7] | 44 | | [Quickfix and location lists](https://github.com/mhinz/vim-galore#quickfix-and-location-lists) | [星星丶S1nG] | [#7] | 45 | | [Macros](https://github.com/mhinz/vim-galore#macros) | [星星丶S1nG] | [#7] | 46 | | [Colorschemes](https://github.com/mhinz/vim-galore#colorschemes) | [星星丶S1nG] | [#7] | 47 | | [Folding](https://github.com/mhinz/vim-galore#folding) | [星星丶S1nG] | [#7] | 48 | | [Sessions](https://github.com/mhinz/vim-galore#sessions) | [星星丶S1nG] | [#7] | 49 | | [Locality](https://github.com/mhinz/vim-galore#locality) | [星星丶S1nG] | [#7] | 50 | | [Usage](https://github.com/mhinz/vim-galore#usage-1) | [hotleave] | [#13] | 51 | | [Getting help offline](https://github.com/mhinz/vim-galore#getting-help-offline) | [hotleave] | [#13] | 52 | | [Getting help offline (alternative)](https://github.com/mhinz/vim-galore#getting-help-offline-alternative) | [hotleave] | [#13] | 53 | | [Getting help online](https://github.com/mhinz/vim-galore#getting-help-online) | [hotleave] | [#13] | 54 | | [Autocmds in practice](https://github.com/mhinz/vim-galore#autocmds-in-practice) | [hotleave] | [#13] | 55 | | [User events](https://github.com/mhinz/vim-galore#user-events) | [hotleave] | [#13] | 56 | | [Nested autocmds](https://github.com/mhinz/vim-galore#nested-autocmds) | [hotleave] | [#13] | 57 | | [Clipboard](https://github.com/mhinz/vim-galore#clipboard) | [hotleave] | [#13] | 58 | | [Clipboard usage (Windows, OSX)](https://github.com/mhinz/vim-galore#clipboard-usage-windows-osx) | [hotleave] | [#13] | 59 | | [Clipboard usage (Linux, BSD, ...)](https://github.com/mhinz/vim-galore#clipboard-usage-linux-bsd-) | [hotleave] | [#13] | 60 | | [Restore cursor position when opening file](https://github.com/mhinz/vim-galore#restore-cursor-position-when-opening-file) | [hotleave] | [#13] | 61 | | [Handling backup, swap, undo, and viminfo files](https://github.com/mhinz/vim-galore#handling-backup-swap-undo-and-viminfo-files) | [hotleave] | [#13] | 62 | | [Editing remote files](https://github.com/mhinz/vim-galore#editing-remote-files) | [hotleave] | [#13] | 63 | | [Managing plugins](https://github.com/mhinz/vim-galore#managing-plugins) | [hotleave] | [#13] | 64 | | [Block insert](https://github.com/mhinz/vim-galore#block-insert) | [hotleave] | [#13] | 65 | | [Running external programs and using filters](https://github.com/mhinz/vim-galore#running-external-programs-and-using-filters) | [hotleave] | [#13] | 66 | | [Cscope](https://github.com/mhinz/vim-galore#cscope) | [hotleave] | [#13] | 67 | | [MatchIt](https://github.com/mhinz/vim-galore#matchit) | [hotleave] | [#13] | 68 | | [Tips](https://github.com/mhinz/vim-galore#tips-1) | [星星丶S1nG] | [#15] | 69 | | [Saner behavior of n and N](https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n) | [星星丶S1nG] | [#15] | 70 | | [Saner command-line history](https://github.com/mhinz/vim-galore#saner-command-line-history) | [星星丶S1nG] | [#15] | 71 | | [Saner CTRL-L](https://github.com/mhinz/vim-galore#saner-ctrl-l) | [星星丶S1nG] | [#15] | 72 | | [Disable audible and visual bells](https://github.com/mhinz/vim-galore#disable-audible-and-visual-bells) | [星星丶S1nG] | [#15] | 73 | | [Quickly move current line](https://github.com/mhinz/vim-galore#quickly-move-current-line) | [星星丶S1nG] | [#15] | 74 | | [Quickly add empty lines](https://github.com/mhinz/vim-galore#quickly-add-empty-lines) | [星星丶S1nG] | [#15] | 75 | | [Quickly edit your macros](https://github.com/mhinz/vim-galore#quickly-edit-your-macros) | [星星丶S1nG] | [#15] | 76 | | [Quickly jump to header or source file](https://github.com/mhinz/vim-galore#quickly-jump-to-header-or-source-file) | [星星丶S1nG] | [#15] | 77 | | [Quickly change font size in GUI](https://github.com/mhinz/vim-galore#quickly-change-font-size-in-gui) | [星星丶S1nG] | [#15] | 78 | | [Change cursor style dependent on mode](https://github.com/mhinz/vim-galore#change-cursor-style-dependent-on-mode) | [星星丶S1nG] | [#15] | 79 | | [Don't lose selection when shifting sidewards](https://github.com/mhinz/vim-galore#dont-lose-selection-when-shifting-sidewards) | [星星丶S1nG] | [#15] | 80 | | [Reload a file on saving](https://github.com/mhinz/vim-galore#reload-a-file-on-saving) | [星星丶S1nG] | [#15] | 81 | | [Smarter cursorline](https://github.com/mhinz/vim-galore#smarter-cursorline) | [星星丶S1nG] | [#15] | 82 | | [Faster keyword completion](https://github.com/mhinz/vim-galore#faster-keyword-completion) | [星星丶S1nG] | [#15] | 83 | | [Cosmetic changes to colorschemes](https://github.com/mhinz/vim-galore#cosmetic-changes-to-colorschemes) | [星星丶S1nG] | [#15] | 84 | | [Commands](https://github.com/mhinz/vim-galore#commands-1) | [hotleave] | [#18] | 85 | | [:global and :vglobal](https://github.com/mhinz/vim-galore#global-and-vglobal) - Execute a command on all matching lines. | [hotleave] | [#18] | 86 | | [:normal and :execute](https://github.com/mhinz/vim-galore#normal-and-execute) - The scripting dream team. | [hotleave] | [#18] | 87 | | [:redir](https://github.com/mhinz/vim-galore#redir) - Redirect messages. | [hotleave] | [#18] | 88 | | [Debugging](https://github.com/mhinz/vim-galore#debugging-1) | YDWX | | 89 | | [General tips](https://github.com/mhinz/vim-galore#general-tips) | YDWX | | 90 | | [Verbosity](https://github.com/mhinz/vim-galore#verbosity) | YDWX | | 91 | | [Profiling startup time](https://github.com/mhinz/vim-galore#profiling-startup-time) | YDWX | | 92 | | [Profiling at runtime](https://github.com/mhinz/vim-galore#profiling-at-runtime) | YDWX | | 93 | | [Debugging Vim scripts](https://github.com/mhinz/vim-galore#debugging-vim-scripts) | | | 94 | | [Debugging syntax files](https://github.com/mhinz/vim-galore#debugging-syntax-files) | | | 95 | | [Miscellaneous](https://github.com/mhinz/vim-galore#miscellaneous-1) | #11 | | 96 | | [Additional resources](https://github.com/mhinz/vim-galore#additional-resources) | #11 | | 97 | | [Vim distributions](https://github.com/mhinz/vim-galore#vim-distributions) | #11 | | 98 | | [Standard plugins](https://github.com/mhinz/vim-galore#standard-plugins) | #11 | | 99 | | [Map CapsLock to Control](https://github.com/mhinz/vim-galore#map-capslock-to-control) | #11 | | 100 | | [Easter eggs](https://github.com/mhinz/vim-galore#easter-eggs) | #11 | | 101 | | [Why hjkl for navigation?](https://github.com/mhinz/vim-galore#why-hjkl-for-navigation) | #11 | | 102 | | [Common problems](https://github.com/mhinz/vim-galore#common-problems-1) | [hotleave] | [#18] | 103 | | [Editing small files is slow](https://github.com/mhinz/vim-galore#editing-small-files-is-slow) | [hotleave] | [#18] | 104 | | [Editing huge files is slow](https://github.com/mhinz/vim-galore#editing-huge-files-is-slow) | [hotleave] | [#18] | 105 | | [Bracketed paste (or why do I have to set 'paste' all the time?)](https://github.com/mhinz/vim-galore#bracketed-paste-or-why-do-i-have-to-set-paste-all-the-time) | [hotleave] | [#18] | 106 | | [Delays when using escape key in terminal](https://github.com/mhinz/vim-galore#delays-when-using-escape-key-in-terminal) | [hotleave] | [#18] | 107 | | [Function search undo](https://github.com/mhinz/vim-galore#function-search-undo) | [hotleave] | [#18] | 108 | | [Technical quirks](https://github.com/mhinz/vim-galore#technical-quirks-1) | | [#18] | 109 | | [Newline used for NUL](https://github.com/mhinz/vim-galore#newline-used-for-nul) | | | 110 | | [List of colorschemes](https://github.com/mhinz/vim-galore#list-of-colorschemes-1) | | | 111 | | [List of plugins](https://github.com/mhinz/vim-galorecontents/plugins.md) | | | 112 | 113 | 114 | 115 | [#4]: https://github.com/wsdjeg/vim-galore-zh_cn/pull/4 116 | [#7]: https://github.com/wsdjeg/vim-galore-zh_cn/pull/7 117 | [#13]: https://github.com/wsdjeg/vim-galore-zh_cn/pull/13 118 | [#15]: https://github.com/wsdjeg/vim-galore-zh_cn/pull/15 119 | [#18]: https://github.com/wsdjeg/vim-galore-zh_cn/pull/18 120 | 121 | 122 | [wsdjeg]: https://github.com/wsdjeg 123 | [星星丶S1nG]: https://github.com/S1ngS1ng 124 | [Hotleave]: https://github.com/hotleave 125 | 126 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-ShareAlike 4.0 International Public 58 | License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-ShareAlike 4.0 International Public License ("Public 63 | License"). To the extent this Public License may be interpreted as a 64 | contract, You are granted the Licensed Rights in consideration of Your 65 | acceptance of these terms and conditions, and the Licensor grants You 66 | such rights in consideration of benefits the Licensor receives from 67 | making the Licensed Material available under these terms and 68 | conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. Share means to provide material to the public by any means or 126 | process that requires permission under the Licensed Rights, such 127 | as reproduction, public display, public performance, distribution, 128 | dissemination, communication, or importation, and to make material 129 | available to the public including in ways that members of the 130 | public may access the material from a place and at a time 131 | individually chosen by them. 132 | 133 | l. Sui Generis Database Rights means rights other than copyright 134 | resulting from Directive 96/9/EC of the European Parliament and of 135 | the Council of 11 March 1996 on the legal protection of databases, 136 | as amended and/or succeeded, as well as other essentially 137 | equivalent rights anywhere in the world. 138 | 139 | m. You means the individual or entity exercising the Licensed Rights 140 | under this Public License. Your has a corresponding meaning. 141 | 142 | 143 | Section 2 -- Scope. 144 | 145 | a. License grant. 146 | 147 | 1. Subject to the terms and conditions of this Public License, 148 | the Licensor hereby grants You a worldwide, royalty-free, 149 | non-sublicensable, non-exclusive, irrevocable license to 150 | exercise the Licensed Rights in the Licensed Material to: 151 | 152 | a. reproduce and Share the Licensed Material, in whole or 153 | in part; and 154 | 155 | b. produce, reproduce, and Share Adapted Material. 156 | 157 | 2. Exceptions and Limitations. For the avoidance of doubt, where 158 | Exceptions and Limitations apply to Your use, this Public 159 | License does not apply, and You do not need to comply with 160 | its terms and conditions. 161 | 162 | 3. Term. The term of this Public License is specified in Section 163 | 6(a). 164 | 165 | 4. Media and formats; technical modifications allowed. The 166 | Licensor authorizes You to exercise the Licensed Rights in 167 | all media and formats whether now known or hereafter created, 168 | and to make technical modifications necessary to do so. The 169 | Licensor waives and/or agrees not to assert any right or 170 | authority to forbid You from making technical modifications 171 | necessary to exercise the Licensed Rights, including 172 | technical modifications necessary to circumvent Effective 173 | Technological Measures. For purposes of this Public License, 174 | simply making modifications authorized by this Section 2(a) 175 | (4) never produces Adapted Material. 176 | 177 | 5. Downstream recipients. 178 | 179 | a. Offer from the Licensor -- Licensed Material. Every 180 | recipient of the Licensed Material automatically 181 | receives an offer from the Licensor to exercise the 182 | Licensed Rights under the terms and conditions of this 183 | Public License. 184 | 185 | b. Additional offer from the Licensor -- Adapted Material. 186 | Every recipient of Adapted Material from You 187 | automatically receives an offer from the Licensor to 188 | exercise the Licensed Rights in the Adapted Material 189 | under the conditions of the Adapter's License You apply. 190 | 191 | c. No downstream restrictions. You may not offer or impose 192 | any additional or different terms or conditions on, or 193 | apply any Effective Technological Measures to, the 194 | Licensed Material if doing so restricts exercise of the 195 | Licensed Rights by any recipient of the Licensed 196 | Material. 197 | 198 | 6. No endorsement. Nothing in this Public License constitutes or 199 | may be construed as permission to assert or imply that You 200 | are, or that Your use of the Licensed Material is, connected 201 | with, or sponsored, endorsed, or granted official status by, 202 | the Licensor or others designated to receive attribution as 203 | provided in Section 3(a)(1)(A)(i). 204 | 205 | b. Other rights. 206 | 207 | 1. Moral rights, such as the right of integrity, are not 208 | licensed under this Public License, nor are publicity, 209 | privacy, and/or other similar personality rights; however, to 210 | the extent possible, the Licensor waives and/or agrees not to 211 | assert any such rights held by the Licensor to the limited 212 | extent necessary to allow You to exercise the Licensed 213 | Rights, but not otherwise. 214 | 215 | 2. Patent and trademark rights are not licensed under this 216 | Public License. 217 | 218 | 3. To the extent possible, the Licensor waives any right to 219 | collect royalties from You for the exercise of the Licensed 220 | Rights, whether directly or through a collecting society 221 | under any voluntary or waivable statutory or compulsory 222 | licensing scheme. In all other cases the Licensor expressly 223 | reserves any right to collect such royalties. 224 | 225 | 226 | Section 3 -- License Conditions. 227 | 228 | Your exercise of the Licensed Rights is expressly made subject to the 229 | following conditions. 230 | 231 | a. Attribution. 232 | 233 | 1. If You Share the Licensed Material (including in modified 234 | form), You must: 235 | 236 | a. retain the following if it is supplied by the Licensor 237 | with the Licensed Material: 238 | 239 | i. identification of the creator(s) of the Licensed 240 | Material and any others designated to receive 241 | attribution, in any reasonable manner requested by 242 | the Licensor (including by pseudonym if 243 | designated); 244 | 245 | ii. a copyright notice; 246 | 247 | iii. a notice that refers to this Public License; 248 | 249 | iv. a notice that refers to the disclaimer of 250 | warranties; 251 | 252 | v. a URI or hyperlink to the Licensed Material to the 253 | extent reasonably practicable; 254 | 255 | b. indicate if You modified the Licensed Material and 256 | retain an indication of any previous modifications; and 257 | 258 | c. indicate the Licensed Material is licensed under this 259 | Public License, and include the text of, or the URI or 260 | hyperlink to, this Public License. 261 | 262 | 2. You may satisfy the conditions in Section 3(a)(1) in any 263 | reasonable manner based on the medium, means, and context in 264 | which You Share the Licensed Material. For example, it may be 265 | reasonable to satisfy the conditions by providing a URI or 266 | hyperlink to a resource that includes the required 267 | information. 268 | 269 | 3. If requested by the Licensor, You must remove any of the 270 | information required by Section 3(a)(1)(A) to the extent 271 | reasonably practicable. 272 | 273 | b. ShareAlike. 274 | 275 | In addition to the conditions in Section 3(a), if You Share 276 | Adapted Material You produce, the following conditions also apply. 277 | 278 | 1. The Adapter's License You apply must be a Creative Commons 279 | license with the same License Elements, this version or 280 | later, or a BY-SA Compatible License. 281 | 282 | 2. You must include the text of, or the URI or hyperlink to, the 283 | Adapter's License You apply. You may satisfy this condition 284 | in any reasonable manner based on the medium, means, and 285 | context in which You Share Adapted Material. 286 | 287 | 3. You may not offer or impose any additional or different terms 288 | or conditions on, or apply any Effective Technological 289 | Measures to, Adapted Material that restrict exercise of the 290 | rights granted under the Adapter's License You apply. 291 | 292 | 293 | Section 4 -- Sui Generis Database Rights. 294 | 295 | Where the Licensed Rights include Sui Generis Database Rights that 296 | apply to Your use of the Licensed Material: 297 | 298 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 299 | to extract, reuse, reproduce, and Share all or a substantial 300 | portion of the contents of the database; 301 | 302 | b. if You include all or a substantial portion of the database 303 | contents in a database in which You have Sui Generis Database 304 | Rights, then the database in which You have Sui Generis Database 305 | Rights (but not its individual contents) is Adapted Material, 306 | 307 | including for purposes of Section 3(b); and 308 | c. You must comply with the conditions in Section 3(a) if You Share 309 | all or a substantial portion of the contents of the database. 310 | 311 | For the avoidance of doubt, this Section 4 supplements and does not 312 | replace Your obligations under this Public License where the Licensed 313 | Rights include other Copyright and Similar Rights. 314 | 315 | 316 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 317 | 318 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 319 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 320 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 321 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 322 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 323 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 324 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 325 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 326 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 327 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 328 | 329 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 330 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 331 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 332 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 333 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 334 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 335 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 336 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 337 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 338 | 339 | c. The disclaimer of warranties and limitation of liability provided 340 | above shall be interpreted in a manner that, to the extent 341 | possible, most closely approximates an absolute disclaimer and 342 | waiver of all liability. 343 | 344 | 345 | Section 6 -- Term and Termination. 346 | 347 | a. This Public License applies for the term of the Copyright and 348 | Similar Rights licensed here. However, if You fail to comply with 349 | this Public License, then Your rights under this Public License 350 | terminate automatically. 351 | 352 | b. Where Your right to use the Licensed Material has terminated under 353 | Section 6(a), it reinstates: 354 | 355 | 1. automatically as of the date the violation is cured, provided 356 | it is cured within 30 days of Your discovery of the 357 | violation; or 358 | 359 | 2. upon express reinstatement by the Licensor. 360 | 361 | For the avoidance of doubt, this Section 6(b) does not affect any 362 | right the Licensor may have to seek remedies for Your violations 363 | of this Public License. 364 | 365 | c. For the avoidance of doubt, the Licensor may also offer the 366 | Licensed Material under separate terms or conditions or stop 367 | distributing the Licensed Material at any time; however, doing so 368 | will not terminate this Public License. 369 | 370 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 371 | License. 372 | 373 | 374 | Section 7 -- Other Terms and Conditions. 375 | 376 | a. The Licensor shall not be bound by any additional or different 377 | terms or conditions communicated by You unless expressly agreed. 378 | 379 | b. Any arrangements, understandings, or agreements regarding the 380 | Licensed Material not stated herein are separate from and 381 | independent of the terms and conditions of this Public License. 382 | 383 | 384 | Section 8 -- Interpretation. 385 | 386 | a. For the avoidance of doubt, this Public License does not, and 387 | shall not be interpreted to, reduce, limit, restrict, or impose 388 | conditions on any use of the Licensed Material that could lawfully 389 | be made without permission under this Public License. 390 | 391 | b. To the extent possible, if any provision of this Public License is 392 | deemed unenforceable, it shall be automatically reformed to the 393 | minimum extent necessary to make it enforceable. If the provision 394 | cannot be reformed, it shall be severed from this Public License 395 | without affecting the enforceability of the remaining terms and 396 | conditions. 397 | 398 | c. No term or condition of this Public License will be waived and no 399 | failure to comply consented to unless expressly agreed to by the 400 | Licensor. 401 | 402 | d. Nothing in this Public License constitutes or may be interpreted 403 | as a limitation upon, or waiver of, any privileges and immunities 404 | that apply to the Licensor or You, including from the legal 405 | processes of any jurisdiction or authority. 406 | 407 | 408 | ======================================================================= 409 | 410 | Creative Commons is not a party to its public 411 | licenses. Notwithstanding, Creative Commons may elect to apply one of 412 | its public licenses to material it publishes and in those instances 413 | will be considered the “Licensor.” The text of the Creative Commons 414 | public licenses is dedicated to the public domain under the CC0 Public 415 | Domain Dedication. Except for the limited purpose of indicating that 416 | material is shared under a Creative Commons public license or as 417 | otherwise permitted by the Creative Commons policies published at 418 | creativecommons.org/policies, Creative Commons does not authorize the 419 | use of the trademark "Creative Commons" or any other trademark or logo 420 | of Creative Commons without its prior written consent including, 421 | without limitation, in connection with any unauthorized modifications 422 | to any of its public licenses or any other arrangements, 423 | understandings, or agreements concerning use of licensed material. For 424 | the avoidance of doubt, this paragraph does not form part of the 425 | public licenses. 426 | 427 | Creative Commons may be contacted at creativecommons.org. 428 | -------------------------------------------------------------------------------- /PLUGINS.md: -------------------------------------------------------------------------------- 1 | ## 插件列表 2 | 3 | 4 | 5 | - [颜色主题](#颜色主题) 6 | - [按功能分类](#按功能分类) 7 | - [文本对齐](#文本对齐) 8 | - [语法检查](#语法检查) 9 | - [代码补全](#代码补全) 10 | - [Cycle](#cycle) 11 | - [代码注释](#代码注释) 12 | - [自动补全括号](#自动补全括号) 13 | - [模糊搜索](#模糊搜索) 14 | - [文本搜索](#文本搜索) 15 | - [代码对齐线](#代码对齐线) 16 | - [Navigation](#navigation) 17 | - [插件管理](#插件管理) 18 | - [代码片段](#代码片段) 19 | - [状态栏](#状态栏) 20 | - [Surround](#surround) 21 | - [Taking notes](#taking-notes) 22 | - [Testing](#testing) 23 | - [文本对象](#文本对象) 24 | - [Tmux](#tmux) 25 | - [编辑历史管理](#编辑历史管理) 26 | - [版本控制](#版本控制) 27 | - [Writing](#writing) 28 | - [Misc](#misc) 29 | - [编程语言](#编程语言) 30 | - [C、C++](#cc) 31 | - [Clojure](#clojure) 32 | - [Elixir](#elixir) 33 | - [Go](#go) 34 | - [HTML](#html) 35 | - [Java](#java) 36 | - [Javascript](#javascript) 37 | - [Lua](#lua) 38 | - [PHP](#php) 39 | - [Python](#python) 40 | - [TeX](#tex) 41 | - [VimL](#viml) 42 | 43 | 44 | 45 | ### 颜色主题 46 | 47 | 以下为一些比较流行的颜色主题: 48 | 49 | - [acme-colors](https://github.com/plan9-for-vimspace/acme-colors) 50 | - [apprentice](https://github.com/romainl/Apprentice) 51 | - [base16](https://github.com/chriskempson/base16-vim) 52 | - [gotham](https://github.com/whatyouhide/vim-gotham) 53 | - [gruvbox](https://github.com/morhetz/gruvbox) 54 | - [janah](https://github.com/mhinz/vim-janah) 55 | - [jellybeans](https://github.com/nanotech/jellybeans.vim) 56 | - [lucius](https://github.com/jonathanfilip/vim-lucius) 57 | - [molokai](https://github.com/tomasr/molokai) 58 | - [nofrils](https://github.com/robertmeta/nofrils) 59 | - [oceanic-next](https://github.com/mhartington/oceanic-next) 60 | - [paramount](https://github.com/owickstrom/vim-colors-paramount) 61 | - [railscasts](https://github.com/jpo/vim-railscasts-theme) 62 | - [seoul256](https://github.com/junegunn/seoul256.vim) 63 | - [solarized](https://github.com/altercation/vim-colors-solarized) (or [solarized8](https://github.com/lifepillar/vim-solarized8) or [flattened](https://github.com/romainl/flattened)) 64 | - [tomorrow](https://github.com/chriskempson/vim-tomorrow-theme) 65 | - [vividchalk](https://github.com/tpope/vim-vividchalk) 66 | - [yowish](https://github.com/kabbamine/yowish.vim) 67 | - [zenburn](https://github.com/jnurmine/Zenburn) 68 | 69 | Alternatively, generate your own colorscheme using [themer](https://github.com/mjswensen/themer) 70 | or [Colortemplate](https://github.com/lifepillar/vim-colortemplate). 71 | 72 | ### 按功能分类 73 | 74 | #### 文本对齐 75 | 76 | - [tabular](https://github.com/godlygeek/tabular) 77 | - [vim-easy-align](https://github.com/junegunn/vim-easy-align) 78 | - [vim-lion](https://github.com/tommcdo/vim-lion) 79 | 80 | #### 语法检查 81 | 82 | - [ale](https://github.com/w0rp/ale) 83 | - [neomake](https://github.com/neomake/neomake) 84 | - [syntastic](https://github.com/vim-syntastic/syntastic) 85 | 86 | #### 代码补全 87 | 88 | - [VimCompletesMe](https://github.com/ajh17/VimCompletesMe) 89 | - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) 90 | - [asyncomplete.vim](https://github.com/prabirshrestha/asyncomplete.vim) 91 | - [completion-nvim](https://github.com/nvim-lua/completion-nvim) 92 | - [completor.vim](https://github.com/maralla/completor.vim) 93 | - [deoplete.nvim](https://github.com/Shougo/deoplete.nvim) 94 | - [neocomplete.vim](https://github.com/Shougo/neocomplete.vim) 95 | - [nvim-compe](https://github.com/hrsh7th/nvim-compe) 96 | - [nvim-completion-manager](https://github.com/roxma/nvim-completion-manager) 97 | - [supertab](https://github.com/ervandew/supertab) 98 | - [vim-mucomplete](https://github.com/lifepillar/vim-mucomplete) 99 | 100 | #### Cycle 101 | 102 | - [switch.vim](https://github.com/AndrewRadev/switch.vim) 103 | - [vim-speeddating](https://github.com/tpope/vim-speeddating) 104 | 105 | #### 代码注释 106 | 107 | - [nerdcommenter](https://github.com/scrooloose/nerdcommenter) 108 | - [tcomment_vim](https://github.com/tomtom/tcomment_vim) 109 | - [vim-commentary](https://github.com/tpope/vim-commentary) 110 | 111 | #### 自动补全括号 112 | 113 | - [auto-pairs](https://github.com/jiangmiao/auto-pairs) 114 | - [delimitMate](https://github.com/Raimondi/delimitMate) 115 | - [vim-endwise](https://github.com/tpope/vim-endwise) 116 | 117 | #### 模糊搜索 118 | 119 | - [leaderf](https://github.com/Yggdroot/LeaderF) (_requires +python3 or +python_) 120 | - [denite.nvim](https://github.com/Shougo/denite.nvim) (_requires +python3_) 121 | - [vim-clap](https://github.com/liuchengxu/vim-clap/) 122 | - [Command-T](https://github.com/wincent/Command-T) (_requires +ruby_) 123 | - [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) 124 | - [fzf](https://github.com/junegunn/fzf) (and [fzf.vim](https://github.com/junegunn/fzf.vim)) 125 | - [unite.vim](https://github.com/Shougo/unite.vim) 126 | - [vim-fz](https://github.com/mattn/vim-fz) 127 | 128 | #### 文本搜索 129 | 130 | - [ctrlsf.vim](https://github.com/dyng/ctrlsf.vim) 131 | - [ferret](https://github.com/wincent/ferret) 132 | - [vim-grepper](https://github.com/mhinz/vim-grepper) 133 | - [flygrep](https://github.com/wsdjeg/FlyGrep.vim) 134 | 135 | #### 代码对齐线 136 | 137 | - [indentLine](https://github.com/Yggdroot/indentLine) 138 | - [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides) 139 | 140 | #### Navigation 141 | 142 | - [nerdtree](https://github.com/scrooloose/nerdtree) 143 | - [tagbar](https://github.com/majutsushi/tagbar) 144 | - [vim-dirvish](https://github.com/justinmk/vim-dirvish) 145 | - [vim-easymotion](https://github.com/easymotion/vim-easymotion) 146 | - [vim-sneak](https://github.com/justinmk/vim-sneak) 147 | - [vim-vinegar](https://github.com/tpope/vim-vinegar) 148 | - [vimfiler.vim](https://github.com/Shougo/vimfiler.vim) (_depends on other plugins_) 149 | - [defx.nvim](https://github.com/Shougo/defx.nvim) (_requires +python3_) 150 | 151 | Also see [fuzzy finders](#fuzzy-finders). 152 | 153 | #### 插件管理 154 | 155 | - [apt-vim](https://github.com/egalpin/apt-vim) 156 | - [dein.vim](https://github.com/Shougo/dein.vim) 157 | - [minpac](https://github.com/k-takata/minpac) 158 | - [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) 159 | - [vim-pathogen](https://github.com/tpope/vim-pathogen) 160 | - [vim-plug](https://github.com/junegunn/vim-plug) 161 | - [vundle.vim](https://github.com/VundleVim/Vundle.vim) 162 | 163 | #### 代码片段 164 | 165 | - [neosnippet.vim](https://github.com/Shougo/neosnippet.vim) (_depends on other plugins_) 166 | - [ultisnips](https://github.com/SirVer/ultisnips) 167 | - [vim-snipmate](https://github.com/garbas/vim-snipmate) (_depends on other plugins_) 168 | - [xptemplate](https://github.com/drmingdrmer/xptemplate) 169 | 170 | #### 状态栏 171 | 172 | - [lightline.vim](https://github.com/itchyny/lightline.vim) 173 | - [powerline](https://github.com/powerline/powerline) 174 | - [vim-airline](https://github.com/vim-airline/vim-airline) 175 | - [vim-flagship](https://github.com/tpope/vim-flagship) 176 | 177 | #### Surround 178 | 179 | - [vim-operator-surround](https://github.com/rhysd/vim-operator-surround) 180 | - [vim-sandwich](https://github.com/machakann/vim-sandwich) 181 | - [vim-surround](https://github.com/tpope/vim-surround) 182 | 183 | #### Taking notes 184 | 185 | - [vim-dotoo](https://github.com/dhruvasagar/vim-dotoo) 186 | - [vim-journal](https://github.com/junegunn/vim-journal) 187 | - [vim-notes](https://github.com/xolox/vim-notes) 188 | - [vim-orgmode](https://github.com/jceb/vim-orgmode) 189 | - [vim-pad](https://github.com/fmoralesc/vim-pad) 190 | - [vimwiki](https://github.com/vimwiki/vimwiki) 191 | 192 | #### Testing 193 | 194 | - [vim-test](https://github.com/janko-m/vim-test) 195 | 196 | #### 文本对象 197 | 198 | - [targets.vim](https://github.com/wellle/targets.vim) 199 | - [vim-exchange](https://github.com/tommcdo/vim-exchange) 200 | - [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object) 201 | - [vim-matchup](https://github.com/andymass/vim-matchup) 202 | - [vim-textobj-user](https://github.com/kana/vim-textobj-user) 203 | 204 | #### Tmux 205 | 206 | - [tmux-complete.vim](https://github.com/wellle/tmux-complete.vim) 207 | - [vim-dispatch](https://github.com/tpope/vim-dispatch) 208 | - [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator) 209 | - [vitality.vim](https://github.com/sjl/vitality.vim) 210 | 211 | #### 编辑历史管理 212 | 213 | - [vim-mundo](https://github.com/simnalamburt/vim-mundo) 214 | - [gundo.vim](https://github.com/sjl/gundo.vim) 215 | - [undotree](https://github.com/mbbill/undotree) 216 | 217 | #### 版本控制 218 | 219 | - [agit.vim](https://github.com/cohama/agit.vim) 220 | - [committia.vim](https://github.com/rhysd/committia.vim) 221 | - [gist-vim](https://github.com/mattn/gist-vim) 222 | - [github-issues.vim](https://github.com/jaxbot/github-issues.vim) 223 | - [gitv](https://github.com/gregsexton/gitv) 224 | - [gv.vim](https://github.com/junegunn/gv.vim) 225 | - [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) 226 | - [vim-auto-programming](https://github.com/haya14busa/vim-auto-programming) 227 | - [vim-fugitive](https://github.com/tpope/vim-fugitive) 228 | - [vim-gitgutter](https://github.com/airblade/vim-gitgutter) 229 | - [vim-github-dashboard](https://github.com/junegunn/vim-github-dashboard) 230 | - [vim-lawrencium](https://bitbucket.org/ludovicchabant/vim-lawrencium) 231 | - [vim-signify](https://github.com/mhinz/vim-signify) 232 | - [vimagit](https://github.com/jreybert/vimagit) 233 | - [git-messenger.vim](https://github.com/rhysd/git-messenger.vim/) 234 | 235 | #### Writing 236 | 237 | - [vim-grammarous](https://github.com/rhysd/vim-grammarous) 238 | - [vim-online-thesaurus](https://github.com/beloglazov/vim-online-thesaurus) 239 | 240 | #### Misc 241 | 242 | - [calendar.vim](https://github.com/itchyny/calendar.vim) 243 | - [CoVim](https://github.com/FredKSchott/CoVim) 244 | - [FastFold](https://github.com/Konfekt/FastFold) 245 | - [goyo.vim](https://github.com/junegunn/goyo.vim) 246 | - [is.vim](https://github.com/haya14busa/is.vim) 247 | - [NrrwRgn](https://github.com/chrisbra/NrrwRgn) 248 | - [sideways.vim](https://github.com/AndrewRadev/sideways.vim) 249 | - [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim) 250 | - [unicode.vim](https://github.com/chrisbra/unicode.vim) 251 | - [vim-abolish](https://github.com/tpope/vim-abolish) 252 | - [vim-bracketed-paste](https://github.com/ConradIrwin/vim-bracketed-paste) 253 | - [vim-devicons](https://github.com/ryanoasis/vim-devicons) 254 | - [vim-diff-enhanced](https://github.com/chrisbra/vim-diff-enhanced) 255 | - [vim-diminactive](https://github.com/blueyed/vim-diminactive) 256 | - [vim-fixkey](https://github.com/drmikehenry/vim-fixkey) 257 | - [vim-gnupg](https://github.com/jamessan/vim-gnupg) 258 | - [vim-gutentags](https://github.com/ludovicchabant/vim-gutentags) 259 | - [vim-hackernews](https://github.com/ryanss/vim-hackernews) 260 | - [vim-move](https://github.com/matze/vim-move) 261 | - [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) 262 | - [vim-projectionist](https://github.com/tpope/vim-projectionist) 263 | - [vim-qf](https://github.com/romainl/vim-qf) 264 | - [vim-rsi](https://github.com/tpope/vim-rsi) 265 | - [vim-sleuth](https://github.com/tpope/vim-sleuth) 266 | - [vim-startify](https://github.com/mhinz/vim-startify) 267 | - [vim-unimpaired](https://github.com/tpope/vim-unimpaired) 268 | 269 | ### 编程语言 270 | 271 | #### C、C++ 272 | 273 | - [a.vim](https://github.com/vim-scripts/a.vim) 274 | - [clang_complete](https://github.com/Rip-Rip/clang_complete) 275 | - [color_coded](https://github.com/jeaye/color_coded) 276 | - [lh-cpp](https://github.com/LucHermitte/lh-cpp) 277 | - [vim-cpp-enhanced-highlight](https://github.com/octol/vim-cpp-enhanced-highlight) 278 | 279 | #### Clojure 280 | 281 | - [paredit](https://github.com/kovisoft/paredit) 282 | - [rainbow_parentheses.vim](https://github.com/junegunn/rainbow_parentheses.vim) 283 | - [vim-clojure-highlight](https://github.com/guns/vim-clojure-highlight) 284 | - [vim-fireplace](https://github.com/tpope/vim-fireplace) 285 | - [vim-salve](https://github.com/tpope/vim-salve) 286 | - [vim-sexp-mappings-for-regular-people](https://github.com/tpope/vim-sexp-mappings-for-regular-people) 287 | - [vim-sexp](https://github.com/guns/vim-sexp) 288 | 289 | #### Elixir 290 | 291 | - [alchemist.vim](https://github.com/slashmili/alchemist.vim) 292 | - [vim-elixir](https://github.com/elixir-editors/vim-elixir) 293 | - [vim-mix-format](https://github.com/mhinz/vim-mix-format) 294 | 295 | #### Go 296 | 297 | - [gofmt.vim](https://github.com/tweekmonster/gofmt.vim) 298 | - [hl-goimport.vim](https://github.com/tweekmonster/hl-goimport.vim) 299 | - [vim-go](https://github.com/fatih/vim-go) 300 | - [vim-godebug](https://github.com/jodosha/vim-godebug) 301 | 302 | #### HTML 303 | 304 | - [emmet-vim](https://github.com/mattn/emmet-vim) 305 | - [html5.vim](https://github.com/othree/html5.vim) 306 | 307 | #### Java 308 | 309 | - [vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2) 310 | 311 | #### Javascript 312 | 313 | - [es.next.syntax.vim](https://github.com/othree/es.next.syntax.vim) 314 | - [javascript-libraries-syntax.vim](https://github.com/othree/javascript-libraries-syntax.vim) 315 | - [node-vim-debugger](https://github.com/sidorares/node-vim-debugger) 316 | - [tern_for_vim](https://github.com/ternjs/tern_for_vim) 317 | - [vim-esformatter](https://github.com/millermedeiros/vim-esformatter) 318 | - [vim-flow](https://github.com/flowtype/vim-flow) 319 | - [vim-javascript-syntax](https://github.com/jelera/vim-javascript-syntax) 320 | - [vim-javascript](https://github.com/pangloss/vim-javascript) 321 | - [vim-node](https://github.com/moll/vim-node) 322 | - [vim-prettier](https://github.com/prettier/vim-prettier) 323 | - [yajs.vim](https://github.com/othree/yajs.vim) 324 | - [yats.vim](https://github.com/HerringtonDarkholme/yats.vim) 325 | 326 | #### Lua 327 | 328 | - [vim-lua-ftplugin](https://github.com/xolox/vim-lua-ftplugin) 329 | - [vim-lua-inspect](https://github.com/xolox/vim-lua-inspect) 330 | 331 | #### PHP 332 | 333 | - [php.vim](https://github.com/StanAngeloff/php.vim) 334 | - [vim-php-cs-fixer](https://github.com/stephpy/vim-php-cs-fixer) 335 | - [vim-php-namespace](https://github.com/arnaud-lb/vim-php-namespace) 336 | - [vim-php-refactoring-toolbox](https://github.com/adoy/vim-php-refactoring-toolbox) 337 | 338 | #### Python 339 | 340 | - [braceless.vim](https://github.com/tweekmonster/braceless.vim) 341 | - [impsort.vim](https://github.com/tweekmonster/impsort.vim) 342 | - [jedi-vim](https://github.com/davidhalter/jedi-vim) 343 | - [python-mode](https://github.com/klen/python-mode) 344 | - [SimpylFold](https://github.com/tmhedberg/SimpylFold) 345 | - [vim-flake8](https://github.com/nvie/vim-flake8) 346 | 347 | #### TeX 348 | 349 | - [vimtex](https://github.com/lervag/vimtex) 350 | 351 | #### VimL 352 | 353 | - [exception.vim](https://github.com/tweekmonster/exception.vim) 354 | - [helpful.vim](https://github.com/tweekmonster/helpful.vim) 355 | - [vader.vim](https://github.com/junegunn/vader.vim) 356 | - [vim-lookup](https://github.com/mhinz/vim-lookup) 357 | - [vim-scriptease](https://github.com/tpope/vim-scriptease) 358 | - [vim-themis](https://github.com/thinca/vim-themis) 359 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Vim 从入门到精通

3 |

4 |
5 | 6 | 7 | 8 | 9 | 10 | 文章移至: [https://wsdjeg.net/vim-galore-zh-cn/](https://wsdjeg.net/vim-galore-zh-cn/) 11 | -------------------------------------------------------------------------------- /chapter/Common problems.md: -------------------------------------------------------------------------------- 1 | # 常见问题 2 | 3 | ## 编辑小文件很慢 4 | 5 | ## 编辑大文件很慢 6 | 7 | ## 相同部分粘贴 (要不为什么我总要设置‘粘贴’?) 8 | 9 | ## 使用终端中 Esc 键时的延迟 10 | 11 | ## 无法重复函数中执行的搜索 12 | -------------------------------------------------------------------------------- /chapter/List-Of-Colorschemes.md: -------------------------------------------------------------------------------- 1 | # 配色方案列表 2 | 3 | 这儿列举了一些常用的Vim配色方案: 4 | 5 | - [acme-colors](https://github.com/plan9-for-vimspace/acme-colors) 6 | - [base16](https://github.com/chriskempson/base16-vim) 7 | - [gotham](https://github.com/whatyouhide/vim-gotham) 8 | - [gruvbox](https://github.com/morhetz/gruvbox) 9 | - [janah](https://github.com/mhinz/vim-janah) 10 | - [jellybeans](https://github.com/nanotech/jellybeans.vim) 11 | - [lucius](https://github.com/jonathanfilip/vim-lucius) 12 | - [molokai](https://github.com/tomasr/molokai) 13 | - [railscasts](https://github.com/jpo/vim-railscasts-theme) 14 | - [seoul256](https://github.com/junegunn/seoul256.vim) 15 | - [solarized](https://github.com/altercation/vim-colors-solarized) (或者它浅色衍生方案 [flattened](https://github.com/romainl/flattened)) 16 | - [tomorrow](https://github.com/chriskempson/vim-tomorrow-theme) 17 | - [vividchalk](https://github.com/tpope/vim-vividchalk) 18 | - [yowish](https://github.com/kabbamine/yowish.vim) 19 | - [zenburn](https://github.com/jnurmine/Zenburn) 20 | 21 | -------------------------------------------------------------------------------- /chapter/List-Of-Plugins.md: -------------------------------------------------------------------------------- 1 | ## 插件列表 2 | 3 | #### [以功能区分](#以功能区分-1) 4 | 5 | - [文本对齐](#文本对齐) 6 | - [构建和可疑代码标记](#构建和可疑代码标记) 7 | - [代码补全](#代码补全) 8 | - [Cycle](#cycle) 9 | - [注释工具](#注释工具) 10 | - [分割符](#分割符) 11 | - [模糊搜索](#模糊搜索) 12 | - [Grep 工具](#grep-工具) 13 | - [缩进](#缩进) 14 | - [文件导航](#文件导航) 15 | - [代码片段](#代码片段) 16 | - [状态栏](#状态栏) 17 | - [文字环绕符](#文字环绕符) 18 | - [记笔记](#记笔记) 19 | - [文本对象](#文本对象) 20 | - [Tmux](#tmux) 21 | - [撤销历史](#撤销历史) 22 | - [版本控制](#版本控制) 23 | - [写作工具](#写作工具) 24 | - [其他](#其他) 25 | 26 | #### [以文件类型区分](#以文件类型区分-1) 27 | 28 | - [C and C++](#c-and-c) 29 | - [Clojure](#clojure) 30 | - [Go](#go) 31 | - [HTML](#html) 32 | - [Java](#java) 33 | - [Javascript](#javascript) 34 | - [Lua](#lua) 35 | - [Python](#python) 36 | - [TeX](#tex) 37 | - [VimL](#viml) 38 | 39 | ## 以功能区分 40 | 41 | #### 文本对齐 42 | 43 | - [tabular](https://github.com/godlygeek/tabular) 44 | - [vim-easy-align](https://github.com/junegunn/vim-easy-align) 45 | 46 | #### 构建和可疑代码标记 47 | 48 | - [ale](https://github.com/w0rp/ale) 49 | - [neomake](https://github.com/neomake/neomake) 50 | - [syntastic](https://github.com/vim-syntastic/syntastic) 51 | 52 | #### 代码补全 53 | 54 | - [VimCompletesMe](https://github.com/ajh17/VimCompletesMe) 55 | - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) 56 | - [completor.vim](https://github.com/maralla/completor.vim) 57 | - [deoplete.nvim](https://github.com/Shougo/deoplete.nvim) 58 | - [neocomplete.vim](https://github.com/Shougo/neocomplete.vim) 59 | - [supertab](https://github.com/ervandew/supertab) 60 | - [vim-mucomplete](https://github.com/lifepillar/vim-mucomplete) 61 | 62 | #### Cycle 63 | 64 | - [switch.vim](https://github.com/AndrewRadev/switch.vim) 65 | - [vim-speeddating](https://github.com/tpope/vim-speeddating) 66 | 67 | #### 注释工具 68 | 69 | - [nerdcommenter](https://github.com/scrooloose/nerdcommenter) 70 | - [tcomment_vim](https://github.com/tomtom/tcomment_vim) 71 | - [vim-commentary](https://github.com/tpope/vim-commentary) 72 | 73 | #### 分割符 74 | 75 | - [auto-pairs](https://github.com/jiangmiao/auto-pairs) 76 | - [delimitMate](https://github.com/Raimondi/delimitMate) 77 | - [vim-endwise](https://github.com/tpope/vim-endwise) 78 | 79 | #### 模糊搜索 80 | 81 | - [Command-T](https://github.com/wincent/Command-T) (_requires +ruby_) 82 | - [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) 83 | - [denite.nvim](https://github.com/Shougo/denite.nvim) (_requires +python3_) 84 | - [fzf](https://github.com/junegunn/fzf) 85 | - [unite.vim](https://github.com/Shougo/unite.vim) 86 | 87 | #### Grep 工具 88 | 89 | - [ctrlsf.vim](https://github.com/dyng/ctrlsf.vim) 90 | - [ferret](https://github.com/wincent/ferret) 91 | - [vim-grepper](https://github.com/mhinz/vim-grepper) 92 | 93 | #### 缩进 94 | 95 | - [indentLine](https://github.com/Yggdroot/indentLine) 96 | - [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides) 97 | 98 | #### 文件导航 99 | 100 | - [nerdtree](https://github.com/scrooloose/nerdtree) 101 | - [tagbar](https://github.com/majutsushi/tagbar) 102 | - [vim-dirvish](https://github.com/justinmk/vim-dirvish) 103 | - [vim-easymotion](https://github.com/easymotion/vim-easymotion) 104 | - [vim-sneak](https://github.com/justinmk/vim-sneak) 105 | - [vim-vinegar](https://github.com/tpope/vim-vinegar) 106 | - [vimfiler.vim](https://github.com/Shougo/vimfiler.vim) (_depends on other plugins_) 107 | 108 | 见[fuzzy finders](#fuzzy-finders). 109 | 110 | #### 代码片段 111 | 112 | - [neosnippet.vim](https://github.com/Shougo/neosnippet.vim) (_depends on other plugins_) 113 | - [ultisnips](https://github.com/SirVer/ultisnips) 114 | - [vim-snipmate](https://github.com/garbas/vim-snipmate) (_depends on other plugins_) 115 | - [xptemplate](https://github.com/drmingdrmer/xptemplate) 116 | 117 | #### 状态栏 118 | 119 | - [lightline.vim](https://github.com/itchyny/lightline.vim) 120 | - [powerline](https://github.com/powerline/powerline) 121 | - [vim-airline](https://github.com/vim-airline/vim-airline) 122 | - [vim-flagship](https://github.com/tpope/vim-flagship) 123 | 124 | #### 文字环绕符 125 | 126 | - [vim-operator-surround](https://github.com/rhysd/vim-operator-surround) 127 | - [vim-sandwich](https://github.com/machakann/vim-sandwich) 128 | - [vim-surround](https://github.com/tpope/vim-surround) 129 | 130 | #### 记笔记 131 | 132 | - [vim-dotoo](https://github.com/dhruvasagar/vim-dotoo) 133 | - [vim-journal](https://github.com/junegunn/vim-journal) 134 | - [vim-notes](https://github.com/xolox/vim-notes) 135 | - [vim-orgmode](https://github.com/jceb/vim-orgmode) 136 | - [vim-pad](https://github.com/fmoralesc/vim-pad) 137 | - [vimwiki](https://github.com/vimwiki/vimwiki) 138 | 139 | #### 文本对象 140 | 141 | - [targets.vim](https://github.com/wellle/targets.vim) 142 | - [vim-exchange](https://github.com/tommcdo/vim-exchange) 143 | - [vim-textobj-user](https://github.com/kana/vim-textobj-user) 144 | 145 | #### Tmux 146 | 147 | - [tmux-complete.vim](https://github.com/wellle/tmux-complete.vim) 148 | - [vim-dispatch](https://github.com/tpope/vim-dispatch) 149 | - [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator) 150 | - [vitality.vim](https://github.com/sjl/vitality.vim) 151 | 152 | #### 撤销历史 153 | 154 | - [gundo.vim](https://github.com/sjl/gundo.vim) 155 | - [undotree](https://github.com/mbbill/undotree) 156 | 157 | #### 版本控制 158 | 159 | - [agit.vim](https://github.com/cohama/agit.vim) 160 | - [committia.vim](https://github.com/rhysd/committia.vim) 161 | - [gist-vim](https://github.com/mattn/gist-vim) 162 | - [github-issues.vim](https://github.com/jaxbot/github-issues.vim) 163 | - [gitv](https://github.com/gregsexton/gitv) 164 | - [gv.vim](https://github.com/junegunn/gv.vim) 165 | - [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) 166 | - [vim-fugitive](https://github.com/tpope/vim-fugitive) 167 | - [vim-gitgutter](https://github.com/airblade/vim-gitgutter) 168 | - [vim-github-dashboard](https://github.com/junegunn/vim-github-dashboard) 169 | - [vim-lawrencium](https://bitbucket.org/ludovicchabant/vim-lawrencium) 170 | - [vim-signify](https://github.com/mhinz/vim-signify) 171 | - [vimagit](https://github.com/jreybert/vimagit) 172 | 173 | #### 写作工具 174 | 175 | - [vim-grammarous](https://github.com/rhysd/vim-grammarous) 176 | - [vim-online-thesaurus](https://github.com/beloglazov/vim-online-thesaurus) 177 | 178 | #### 其他 179 | 180 | - [CoVim](https://github.com/FredKSchott/CoVim) 181 | - [FastFold](https://github.com/Konfekt/FastFold) 182 | - [NrrwRgn](https://github.com/chrisbra/NrrwRgn) 183 | - [calendar.vim](https://github.com/itchyny/calendar.vim) 184 | - [goyo.vim](https://github.com/junegunn/goyo.vim) 185 | - [sideways.vim](https://github.com/AndrewRadev/sideways.vim) 186 | - [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim) 187 | - [targets.vim](https://github.com/wellle/targets.vim) 188 | - [unicode.vim](https://github.com/chrisbra/unicode.vim) 189 | - [vim-bracketed-paste](https://github.com/ConradIrwin/vim-bracketed-paste) 190 | - [vim-devicons](https://github.com/ryanoasis/vim-devicons) 191 | - [vim-diminactive](https://github.com/blueyed/vim-diminactive) 192 | - [vim-fixkey](https://github.com/drmikehenry/vim-fixkey) 193 | - [vim-gnupg](https://github.com/jamessan/vim-gnupg) 194 | - [vim-hackernews](https://github.com/ryanss/vim-hackernews) 195 | - [vim-move](https://github.com/matze/vim-move) 196 | - [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) 197 | - [vim-projectionist](https://github.com/tpope/vim-projectionist) 198 | - [vim-rsi](https://github.com/tpope/vim-rsi) 199 | - [vim-startify](https://github.com/mhinz/vim-startify) 200 | - [vim-unimpaired](https://github.com/tpope/vim-unimpaired) 201 | 202 | ## 以文件类型区分 203 | 204 | #### C and C++ 205 | 206 | - [a.vim](https://github.com/vim-scripts/a.vim) 207 | - [clang_complete](https://github.com/Rip-Rip/clang_complete) 208 | - [color_coded](https://github.com/jeaye/color_coded) 209 | - [lh-cpp](https://github.com/LucHermitte/lh-cpp) 210 | 211 | #### Clojure 212 | 213 | - [paredit](https://github.com/kovisoft/paredit) 214 | - [rainbow_parentheses.vim](https://github.com/junegunn/rainbow_parentheses.vim) 215 | - [vim-clojure-highlight](https://github.com/guns/vim-clojure-highlight) 216 | - [vim-fireplace](https://github.com/tpope/vim-fireplace) 217 | - [vim-salve](https://github.com/tpope/vim-salve) 218 | - [vim-sexp-mappings-for-regular-people](https://github.com/tpope/vim-sexp-mappings-for-regular-people) 219 | - [vim-sexp](https://github.com/guns/vim-sexp) 220 | 221 | #### HTML 222 | 223 | - [emmet-vim](https://github.com/mattn/emmet-vim) 224 | - [html5.vim](https://github.com/othree/html5.vim) 225 | 226 | #### Go 227 | 228 | - [gofmt.vim](https://github.com/tweekmonster/gofmt.vim) 229 | - [hl-goimport.vim](https://github.com/tweekmonster/hl-goimport.vim) 230 | - [vim-go](https://github.com/fatih/vim-go) 231 | - [vim-godebug](https://github.com/jodosha/vim-godebug) 232 | 233 | #### Java 234 | 235 | - [vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2) 236 | 237 | #### Javascript 238 | 239 | - [es.next.syntax.vim](https://github.com/othree/es.next.syntax.vim) 240 | - [javascript-libraries-syntax.vim](https://github.com/othree/javascript-libraries-syntax.vim) 241 | - [node-vim-debugger](https://github.com/sidorares/node-vim-debugger) 242 | - [tern_for_vim](https://github.com/ternjs/tern_for_vim) 243 | - [vim-esformatter](https://github.com/millermedeiros/vim-esformatter) 244 | - [vim-javascript-syntax](https://github.com/jelera/vim-javascript-syntax) 245 | - [vim-javascript](https://github.com/pangloss/vim-javascript) 246 | - [vim-node](https://github.com/moll/vim-node) 247 | - [yajs.vim](https://github.com/othree/yajs.vim) 248 | 249 | #### Lua 250 | 251 | - [vim-lua-ftplugin](https://github.com/xolox/vim-lua-ftplugin) 252 | - [vim-lua-inspect](https://github.com/xolox/vim-lua-inspect) 253 | 254 | #### Python 255 | 256 | - [braceless.vim](https://github.com/tweekmonster/braceless.vim) 257 | - [impsort.vim](https://github.com/tweekmonster/impsort.vim) 258 | - [jedi-vim](https://github.com/davidhalter/jedi-vim) 259 | - [python-mode](https://github.com/klen/python-mode) 260 | - [vim-flake8](https://github.com/nvie/vim-flake8) 261 | 262 | #### TeX 263 | 264 | - [vimtex](https://github.com/lervag/vimtex) 265 | 266 | #### VimL 267 | 268 | - [vim-scriptease](https://github.com/tpope/vim-scriptease) 269 | -------------------------------------------------------------------------------- /chapter/Miscellaneous.md: -------------------------------------------------------------------------------- 1 | # 杂项 2 | 3 | ## 附加资源 4 | 5 | ## Vim 配置集合 6 | 7 | ## 内置插件 8 | 9 | ## 映射大写锁定键(CapsLock)到控制键(Ctrl) 10 | 11 | ## 复活节彩蛋 12 | 13 | ## 为什么用 hjkl 移动光标? 14 | 15 | -------------------------------------------------------------------------------- /chapter/Technical quirks.md: -------------------------------------------------------------------------------- 1 | # 技术怪癖 2 | 3 | ## NUL 符用新行表示 4 | 5 | 文件中的 NUL 符 (`\0`) 在内存中会被存储为换行符 (`\n`) 且 6 | 在缓冲区中显示为 `^@`. 7 | 8 | 在 `man 7 ascii` 和 `:h NL-used-for-Nul` 中查看更多信息。 9 | -------------------------------------------------------------------------------- /chapter/bracketed-paste.md: -------------------------------------------------------------------------------- 1 | ## 粘贴归类 (要不为什么我总要设置‘粘贴’?) 2 | 3 | 粘贴归类模式使得终端虚拟器可以区分键入文本和粘贴文本。 4 | 5 | 你是否曾经尝试过向 Vim 粘贴过代码,结果弄得一团糟? 6 | 7 | 这只会在你通过 `cmd+v`, `shift-insert`, `middle-click` 等等命令进行粘贴时发生。 8 | 因为那时你只是在向终端虚拟器里丢文本。Vim 并不知道你在粘贴文本,它天真地认为你是一个熟练的打字员。因此,它尝试排版,但是失败了。 9 | 10 | 如果你使用 Vim 命令集里的粘贴,比如 `"+p` ,那这就不会成为问题,因为 Vim 知道你做的是粘贴操作。 11 | 12 | 为了解决这个,你需要设置粘贴 `:set paste` ,以便获取粘贴现状。 参考 `:h 'paste'` 和 `:h 'pastetoggle'`. 13 | 14 | 如果你已经受够了不停地切换 `'paste'` ,看一看这个不错的插件能为你做什么:[粘贴归类](https://github.com/ConradIrwin/vim-bracketed-paste)。 15 | 16 | 插件作者的拓展阅读:[欢迎点击](http://cirw.in/blog/bracketed-paste). 17 | 18 | **Neovim**: Neovim 努力无缝地完成这些工作,并在终端虚拟器支持时自动设定粘贴归类模式。 19 | -------------------------------------------------------------------------------- /chapter/editing-huge-files-is-slow.md: -------------------------------------------------------------------------------- 1 | ## 编辑大文件很慢 2 | 3 | 大文件最大的问题,就是 Vim 会一次性读取整个文件。这一过程的完成取决于内部如何提供缓存空间。 4 | ([Vim 开发的讨论](https://groups.google.com/forum/#!topic/vim_dev/oY3i8rqYGD4/discussion)) 5 | 6 | 如果你只是想读取, `tail hugefile | vim -` 会是一个很好的解决方法. 7 | 8 | 如果不用语法,设定和插件,你也能生活自理一段时间: 9 | 10 | ``` 11 | $ vim -u NONE -N 12 | ``` 13 | 14 | 这将使得导航明显提速,因为代价高昂的语法高亮正则表达式不再被使用。你也应该让 Vim 不要使用交换文件和 Vim 信息文件,以避免写入时的长延迟。 15 | 16 | ``` 17 | $ vim -n -u NONE -i NONE -N 18 | ``` 19 | 20 | 简而言之,真的写入超大文件的时候尽量别用 Vim。 :\ 21 | -------------------------------------------------------------------------------- /chapter/editing-small-files-is-slow.md: -------------------------------------------------------------------------------- 1 | ## 编辑小文件很慢 2 | 3 | 对性能有重大影响的有两个方面: 4 | 5 | 1. 复杂的**正则表达式**。尤其是 Ruby 语法文件导致人们过去一直慢慢吞吞。([Debugging syntax files](#debugging-syntax-files)里也有说明。) 6 | 2. **页面刷新**。一些特性强制所有行都刷新。 7 | 8 | | 典型败笔 | 原因? | 解决方法? | 9 | |-----------------|------|-----------| 10 | | `:set cursorline` | 导致所有行刷新。 | `:set nocursorline` | 11 | | `:set cursorcolumn` | 导致所有行刷新。 | `:set nocursorcolumn` | 12 | | `:set relativenumber` | 导致所有行刷新。 | `:set norelativenumber` | 13 | | `:set foldmethod=syntax` | 语法文件算减速的话,这无异于刹车。 | `:set foldmethod=manual`, `:set foldmethod=marker` or [快速折叠](https://github.com/Konfekt/FastFold) | 14 | | `:set synmaxcol=3000` | 根据内部表示规则, Vim 一般不待见对很长的行。这一设定导致3000列时才会把所在行高亮。 | `:set synmaxcol=200` | 15 | | matchparen.vim           | 使用默认加载。使用正则表达式去匹配括回。 | 禁用插件: `:h matchparen` | 16 | 17 | **注意**: 只有当真的遭遇实质的性能缺陷时,你才需要做这些改进。多数情况下,上面提到的这些方面还都凑合。 18 | -------------------------------------------------------------------------------- /chapter/function-search-undo.md: -------------------------------------------------------------------------------- 1 | ## 无法重复函数中执行的搜索 2 | 3 | - 一个命令的搜索关键词(`/`, `:代替`, ...)改变了“上一次搜索所用的关键词”。(这个改变保存在 `/` 的注册表里;使用 `:echo @/` 可以打印出来) 4 | - 一个简单的文本修改可以用 `.` 再次执行。(这个执行保存在 `.` 的注册表里;使用 `:echo @.` 可以打印出来) 5 | 6 | 如果你在一个函数里做以上操作,两件都_not_会是那么回事儿。所以你不能简单地在一个函数里高亮词汇同时再用这个函数做文本修改。 7 | 8 | 帮助: `:h function-search-undo` -------------------------------------------------------------------------------- /chapter/map-capslock-to-control.md: -------------------------------------------------------------------------------- 1 | ## 映射大写锁定键(CapsLock)到控制键(Ctrl) 2 | 3 | 大写锁定键属于键盘上最少用到的按键,但是它要比控制键更加容易按到, 4 | 因为它位于你手放在键盘时的[起始行](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-homerow.png)。 5 | 如果你敲很多代码的话,映射大写锁定键(CapsLock)到控制键(Ctrl)可以有效降低 6 | [重复使力伤害](https://de.wikipedia.org/wiki/Repetitive-Strain-Injury-Syndrom) (ps:为什么将 jk 映射为 esc,而不是 jj,重复点击同一个按键对手指伤害很大)。 7 | 8 | 友情提示:当你习惯这个设定后,你就离不开它了。 9 | 10 | **OSX**: 11 | 12 | `System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys`. 变更 13 | "CapsLock" 为 "Control"。 14 | 15 | **Linux**: 16 | 17 | 为了使按键生效,请把以下几行放入 `~/.xmodmap` 文件: 18 | 19 | remove Lock = Caps_Lock 20 | keysym Caps_Lock = Control_L 21 | add Control = Control_L 22 | 23 | 用以下命令使之生效
`$ xmodmap ~/.xmodmap`。 24 | 25 | 替代方法有[caps2esc](https://github.com/oblitum/caps2esc) 或者 26 | [xcape](https://github.com/alols/xcape)。 27 | 28 | **Windows**: 29 | 30 | 请参看 [superuser.com: 在Windows8.1映射大写锁定键到控制键](http://superuser.com/questions/764782/map-caps-lock-to-control-in-windows-8-1)。 31 | -------------------------------------------------------------------------------- /chapter/standard-plugins.md: -------------------------------------------------------------------------------- 1 | ## 内置插件 2 | 3 | 出乎很多人的意料,Vim自己默认加载了大把大把的插件。启动 Vim 后,用`:scriptnames`查看所有加载的源文件 4 | 5 | 这些文件多数永远不会被用到,所以请禁止如你所见的以下插件。 6 | 这些插件仍旧会在源文件列出,但是当Vim启动时,只有第一行会被读取,而之后的配置,命令和日志都不会执行。 7 | 8 | | 插件 | 禁用 | 帮助 | 9 | |------------|-------------------------------------|------| 10 | | 2html | `let g:loaded_2html_plugin = 1` | `:h 2html` | 11 | | getscript | `let g:loaded_getscriptPlugin = 1` | `:h pi_getscript` | 12 | | gzip | `let g:loaded_gzip = 1` | `:h pi_gzip` | 13 | | logipat | `let g:loaded_logipat = 1` | `:h pi_logipat` | 14 | | matchparen | `let g:loaded_matchparen = 1` | `:h pi_paren` | 15 | | netrw | `let g:loaded_netrwPlugin = 1` | `:h pi_netrw` | 16 | | rrhelper | `let g:loaded_rrhelper = 1` | `:e $VIMRUNTIME/plugin/rrhelper.vim` | 17 | | spellfile | `let g:loaded_spellfile_plugin = 1` | `:h spellfile.vim` | 18 | | tar | `let g:loaded_tarPlugin = 1` | `:h pi_tar` | 19 | | vimball | `let g:loaded_vimballPlugin = 1` | `:h pi_vimball` | 20 | | zip | `let g:loaded_zipPlugin = 1` | `:h pi_zip` | 21 | -------------------------------------------------------------------------------- /chapter/vim-distributions.md: -------------------------------------------------------------------------------- 1 | ## Vim 配置集合 2 | 3 | Vim 配置集合是集成多多种插件以及相关配置的组合。 4 | 5 | 高阶用户总是知道如何构建自己的编辑器,所以配置集合一般是针对初学者。 6 | 如果你想要尝试,那么将面临一个辩证的想法:加入很多额外的东西来学习 Vim 是否会让这变得更加简单。 7 | 8 | 我知道很多人不想在配置编辑器上花过多时间(但实际上,当你卡住时,你就会不停地花时间定制自己的 vimrc) 9 | 因此,想要节约时间,那么就因该真正的去了解和学习 Vim 原生功能,只有这样你才能中获益。 10 | 11 | 再次强调一下:“一个程序员应当懂得他的工具”。 12 | 13 | 总之,如果你知道自己在做什么,你也许能从以下几个 Vim 配置集合中获得一些灵感。 14 | 15 | - [cream](http://cream.sourceforge.net) 16 | - [janus](https://github.com/carlhuda/janus.git) 17 | - [spacevim](https://github.com/SpaceVim/SpaceVim) 18 | - [spf13](https://github.com/spf13/spf13-vim) 19 | -------------------------------------------------------------------------------- /chapter/why-hjkl-for-navigation.md: -------------------------------------------------------------------------------- 1 | ## 为什么用hjkl移动光标? 2 | 3 | 当 [Bill Joy](https://en.wikipedia.org/wiki/Bill_Joy) 创建[vi](https://en.wikipedia.org/wiki/Vi),Vim 的前身时, 他的工作是在一台[ADM-3A](https://en.wikipedia.org/wiki/ADM-3A)完成的,而这个机器没有用别的键控制光标,而正是如你猜到的 hjkl 作为光标控制键。 4 | 5 | 键盘布局: [请点击](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-adm-3a-layout.jpg) 6 | 7 | 这也告诉了我们为什么 Unix 系统会以`~`代表主目录。 8 | 9 | -------------------------------------------------------------------------------- /contents/minimal-vimrc.vim: -------------------------------------------------------------------------------- 1 | " 2 | " A (not so) minimal vimrc. 3 | " 4 | 5 | " You want Vim, not vi. When Vim finds a vimrc, 'nocompatible' is set anyway. 6 | " We set it explicitely to make our position clear! 7 | set nocompatible 8 | 9 | filetype plugin indent on " Load plugins according to detected filetype. 10 | syntax on " Enable syntax highlighting. 11 | 12 | set autoindent " Indent according to previous line. 13 | set expandtab " Use spaces instead of tabs. 14 | set softtabstop =4 " Tab key indents by 4 spaces. 15 | set shiftwidth =4 " >> indents by 4 spaces. 16 | set shiftround " >> indents to next multiple of 'shiftwidth'. 17 | 18 | set backspace =indent,eol,start " Make backspace work as you would expect. 19 | set hidden " Switch between buffers without having to save first. 20 | set laststatus =2 " Always show statusline. 21 | set display =lastline " Show as much as possible of the last line. 22 | 23 | set showmode " Show current mode in command-line. 24 | set showcmd " Show already typed keys when more are expected. 25 | 26 | set incsearch " Highlight while searching with / or ?. 27 | set hlsearch " Keep matches highlighted. 28 | 29 | set ttyfast " Faster redrawing. 30 | set lazyredraw " Only redraw when necessary. 31 | 32 | set splitbelow " Open new windows below the current window. 33 | set splitright " Open new windows right of the current window. 34 | 35 | set cursorline " Find the current line quickly. 36 | set wrapscan " Searches wrap around end-of-file. 37 | set report =0 " Always report changed lines. 38 | set synmaxcol =200 " Only highlight the first 200 columns. 39 | 40 | set list " Show non-printable characters. 41 | if has('multi_byte') && &encoding ==# 'utf-8' 42 | let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' 43 | else 44 | let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' 45 | endif 46 | 47 | " The fish shell is not very compatible to other shells and unexpectedly 48 | " breaks things that use 'shell'. 49 | if &shell =~# 'fish$' 50 | set shell=/bin/bash 51 | endif 52 | 53 | " Put all temporary files under the same directory. 54 | " https://github.com/mhinz/vim-galore#handling-backup-swap-undo-and-viminfo-files 55 | set backup 56 | set backupdir =$HOME/.vim/files/backup// 57 | set backupext =-vimbackup 58 | set backupskip = 59 | set directory =$HOME/.vim/files/swap// 60 | set updatecount =100 61 | set undofile 62 | set undodir =$HOME/.vim/files/undo// 63 | set viminfo ='100,n$HOME/.vim/files/info/viminfo 64 | -------------------------------------------------------------------------------- /tools/chinese_linter.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | " 忽略的错误 3 | let g:chinese_linter_disabled_nr = get(g:,'chinese_linter_disabled_nr', []) 4 | " 中文标点符号(更全) 5 | let s:CHINEXE_PUNCTUATION = "\u3002\uff1f\uff01\uff0c\u3001\uff1b\uff1a\u201c\u201d\u2018\u2019\uff08\uff09\u300a\u300b\u3008\u3009\u3010\u3011\u300e\u300f\u300c\u300d\ufe43\ufe44\u3014\u3015\u2026\u2014\uff5e\ufe4f\uffe5" 6 | " 英文标点 7 | let s:punctuation = ',' 8 | " 中文标点符号 9 | let s:punctuation_cn = '[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b]' 10 | " 中文汉字 11 | let s:chars_cn = '[\u4e00-\u9fa5]' 12 | " 数字 13 | let s:numbers = '[0-9]' 14 | " 英文字母 15 | let s:chars = '[a-zA-Z]' 16 | let s:ERRORS = { 17 | \ 'E001' : ['中文字符后存在英文标点', s:chars_cn . s:punctuation], 18 | \ 'E002' : ['中英文之间没有空格', '\(' . s:chars_cn . s:chars . '\)\|\(' . s:chars . s:chars_cn . '\)'], 19 | \ 'E003' : ['中文与数字之间没有空格', '\(' . s:chars_cn . s:numbers . '\)\|\(' . s:numbers . s:chars_cn . '\)'], 20 | \ 'E004' : ['中文标点之后存在空格', s:punctuation_cn . '\s\+'], 21 | \ 'E005' : ['行尾含有空格', '\s\+$'], 22 | \ } 23 | 24 | command! -nargs=? CheckChinese call s:check() 25 | 26 | function! s:check(...) abort 27 | let s:file = getline(1,'$') 28 | let s:bufnr = bufnr('%') 29 | let s:linenr = 0 30 | let s:colnr = 0 31 | let s:qf = [] 32 | for l:line in s:file 33 | let s:linenr += 1 34 | call s:parser(l:line) 35 | endfor 36 | let s:linenr = 0 37 | let s:colnr = 0 38 | if !empty(s:qf) 39 | let g:wsd = s:qf 40 | call s:update_qf(s:qf) 41 | copen 42 | else 43 | call setqflist([]) 44 | cclose 45 | endif 46 | endfunction 47 | 48 | function! s:parser(line) abort 49 | for l:error_nr in keys(s:ERRORS) 50 | if index(g:chinese_linter_disabled_nr, l:error_nr) == -1 51 | call s:find_error(l:error_nr, a:line) 52 | endif 53 | endfor 54 | endfunction 55 | 56 | function! s:find_error(nr, line) abort 57 | let l:error = s:ERRORS[a:nr] 58 | let s:colnr = matchend(a:line, l:error[1]) 59 | if s:colnr != -1 60 | call s:add_to_qf(a:nr) 61 | endif 62 | endfunction 63 | 64 | function! s:add_to_qf(nr) abort 65 | let l:error_item = { 66 | \ 'bufnr' : s:bufnr, 67 | \ 'lnum' : s:linenr, 68 | \ 'col' : s:colnr, 69 | \ 'vcol' : 0, 70 | \ 'text' : a:nr . ' ' . s:ERRORS[a:nr][0], 71 | \ 'nr' : a:nr, 72 | \ 'type' : 'E' 73 | \ } 74 | call add(s:qf, l:error_item) 75 | endfunction 76 | 77 | " TODO 加入语法分析 78 | 79 | 80 | function! s:update_qf(dict) abort 81 | call setqflist(a:dict) 82 | endfunction 83 | --------------------------------------------------------------------------------