Compare commits
No commits in common. "master" and "plugins" have entirely different histories.
427
LICENSE
427
LICENSE
@ -1,427 +0,0 @@
|
||||
Attribution-ShareAlike 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More_considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International Public
|
||||
License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution-ShareAlike 4.0 International Public License ("Public
|
||||
License"). To the extent this Public License may be interpreted as a
|
||||
contract, You are granted the Licensed Rights in consideration of Your
|
||||
acceptance of these terms and conditions, and the Licensor grants You
|
||||
such rights in consideration of benefits the Licensor receives from
|
||||
making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. BY-SA Compatible License means a license listed at
|
||||
creativecommons.org/compatiblelicenses, approved by Creative
|
||||
Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name
|
||||
of a Creative Commons Public License. The License Elements of this
|
||||
Public License are Attribution and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
k. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
l. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
m. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material.
|
||||
Every recipient of Adapted Material from You
|
||||
automatically receives an offer from the Licensor to
|
||||
exercise the Licensed Rights in the Adapted Material
|
||||
under the conditions of the Adapter's License You apply.
|
||||
|
||||
c. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
b. ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons
|
||||
license with the same License Elements, this version or
|
||||
later, or a BY-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the
|
||||
Adapter's License You apply. You may satisfy this condition
|
||||
in any reasonable manner based on the medium, means, and
|
||||
context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms
|
||||
or conditions on, or apply any Effective Technological
|
||||
Measures to, Adapted Material that restrict exercise of the
|
||||
rights granted under the Adapter's License You apply.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material,
|
||||
|
||||
including for purposes of Section 3(b); and
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
68
PLUGINS.md
68
PLUGINS.md
@ -1,33 +1,35 @@
|
||||
## 插件列表
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
#### [Colorschemes](#colorschemes-1)
|
||||
|
||||
- [颜色主题](#颜色主题)
|
||||
- [按功能分类](#按功能分类)
|
||||
- [文本对齐](#文本对齐)
|
||||
- [语法检查](#语法检查)
|
||||
- [代码补全](#代码补全)
|
||||
#### [By topic](#by-topic-1)
|
||||
|
||||
- [Alignment](#alignment)
|
||||
- [Building and linting](#building-and-linting)
|
||||
- [Code completion](#code-completion)
|
||||
- [Commenters](#commenters)
|
||||
- [Cycle](#cycle)
|
||||
- [代码注释](#代码注释)
|
||||
- [自动补全括号](#自动补全括号)
|
||||
- [模糊搜索](#模糊搜索)
|
||||
- [文本搜索](#文本搜索)
|
||||
- [代码对齐线](#代码对齐线)
|
||||
- [Delimiter](#delimiter)
|
||||
- [Fuzzy finders](#fuzzy-finders)
|
||||
- [Grep tools](#grep-tools)
|
||||
- [Indent](#indent)
|
||||
- [Misc](#misc)
|
||||
- [Navigation](#navigation)
|
||||
- [插件管理](#插件管理)
|
||||
- [代码片段](#代码片段)
|
||||
- [状态栏](#状态栏)
|
||||
- [Plugin managers](#plugin-managers)
|
||||
- [Snippets](#snippets)
|
||||
- [Statusline](#statusline)
|
||||
- [Surround](#surround)
|
||||
- [Taking notes](#taking-notes)
|
||||
- [Testing](#testing)
|
||||
- [文本对象](#文本对象)
|
||||
- [Text objects](#text-objects)
|
||||
- [Tmux](#tmux)
|
||||
- [编辑历史管理](#编辑历史管理)
|
||||
- [版本控制](#版本控制)
|
||||
- [Undo history](#undo-history)
|
||||
- [Version control](#version-control)
|
||||
- [Writing](#writing)
|
||||
- [Misc](#misc)
|
||||
- [编程语言](#编程语言)
|
||||
- [C、C++](#cc)
|
||||
|
||||
#### [By filetype](#by-filetype-1)
|
||||
|
||||
- [C and C++](#c-and-c)
|
||||
- [Clojure](#clojure)
|
||||
- [Elixir](#elixir)
|
||||
- [Go](#go)
|
||||
@ -40,9 +42,7 @@
|
||||
- [TeX](#tex)
|
||||
- [VimL](#viml)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
### 颜色主题
|
||||
## 颜色主题
|
||||
|
||||
以下为一些比较流行的颜色主题:
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
Alternatively, generate your own colorscheme using [themer](https://github.com/mjswensen/themer)
|
||||
or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
|
||||
### 按功能分类
|
||||
## 按功能分类
|
||||
|
||||
#### 文本对齐
|
||||
|
||||
@ -85,17 +85,15 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
|
||||
#### 代码补全
|
||||
|
||||
- [VimCompletesMe](https://github.com/ajh17/VimCompletesMe)
|
||||
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
|
||||
- [asyncomplete.vim](https://github.com/prabirshrestha/asyncomplete.vim)
|
||||
- [completion-nvim](https://github.com/nvim-lua/completion-nvim)
|
||||
- [completor.vim](https://github.com/maralla/completor.vim)
|
||||
- [deoplete.nvim](https://github.com/Shougo/deoplete.nvim)
|
||||
- [neocomplete.vim](https://github.com/Shougo/neocomplete.vim)
|
||||
- [nvim-compe](https://github.com/hrsh7th/nvim-compe)
|
||||
- [nvim-completion-manager](https://github.com/roxma/nvim-completion-manager)
|
||||
- [supertab](https://github.com/ervandew/supertab)
|
||||
- [vim-mucomplete](https://github.com/lifepillar/vim-mucomplete)
|
||||
- [VimCompletesMe](https://github.com/ajh17/VimCompletesMe)
|
||||
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
|
||||
|
||||
#### Cycle
|
||||
|
||||
@ -116,11 +114,9 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
|
||||
#### 模糊搜索
|
||||
|
||||
- [leaderf](https://github.com/Yggdroot/LeaderF) (_requires +python3 or +python_)
|
||||
- [denite.nvim](https://github.com/Shougo/denite.nvim) (_requires +python3_)
|
||||
- [vim-clap](https://github.com/liuchengxu/vim-clap/)
|
||||
- [Command-T](https://github.com/wincent/Command-T) (_requires +ruby_)
|
||||
- [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim)
|
||||
- [denite.nvim](https://github.com/Shougo/denite.nvim) (_requires +python3_)
|
||||
- [fzf](https://github.com/junegunn/fzf) (and [fzf.vim](https://github.com/junegunn/fzf.vim))
|
||||
- [unite.vim](https://github.com/Shougo/unite.vim)
|
||||
- [vim-fz](https://github.com/mattn/vim-fz)
|
||||
@ -130,7 +126,6 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
- [ctrlsf.vim](https://github.com/dyng/ctrlsf.vim)
|
||||
- [ferret](https://github.com/wincent/ferret)
|
||||
- [vim-grepper](https://github.com/mhinz/vim-grepper)
|
||||
- [flygrep](https://github.com/wsdjeg/FlyGrep.vim)
|
||||
|
||||
#### 代码对齐线
|
||||
|
||||
@ -146,7 +141,6 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
- [vim-sneak](https://github.com/justinmk/vim-sneak)
|
||||
- [vim-vinegar](https://github.com/tpope/vim-vinegar)
|
||||
- [vimfiler.vim](https://github.com/Shougo/vimfiler.vim) (_depends on other plugins_)
|
||||
- [defx.nvim](https://github.com/Shougo/defx.nvim) (_requires +python3_)
|
||||
|
||||
Also see [fuzzy finders](#fuzzy-finders).
|
||||
|
||||
@ -208,13 +202,12 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator)
|
||||
- [vitality.vim](https://github.com/sjl/vitality.vim)
|
||||
|
||||
#### 编辑历史管理
|
||||
#### Undo history
|
||||
|
||||
- [vim-mundo](https://github.com/simnalamburt/vim-mundo)
|
||||
- [gundo.vim](https://github.com/sjl/gundo.vim)
|
||||
- [undotree](https://github.com/mbbill/undotree)
|
||||
|
||||
#### 版本控制
|
||||
#### Version control
|
||||
|
||||
- [agit.vim](https://github.com/cohama/agit.vim)
|
||||
- [committia.vim](https://github.com/rhysd/committia.vim)
|
||||
@ -230,7 +223,6 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [vim-lawrencium](https://bitbucket.org/ludovicchabant/vim-lawrencium)
|
||||
- [vim-signify](https://github.com/mhinz/vim-signify)
|
||||
- [vimagit](https://github.com/jreybert/vimagit)
|
||||
- [git-messenger.vim](https://github.com/rhysd/git-messenger.vim/)
|
||||
|
||||
#### Writing
|
||||
|
||||
@ -266,7 +258,7 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [vim-startify](https://github.com/mhinz/vim-startify)
|
||||
- [vim-unimpaired](https://github.com/tpope/vim-unimpaired)
|
||||
|
||||
### 编程语言
|
||||
## 编程语言
|
||||
|
||||
#### C、C++
|
||||
|
||||
|
129
README.md
129
README.md
@ -1,17 +1,13 @@
|
||||
<div align='center'>
|
||||
<h1>Vim 从入门到精通</h1>
|
||||
<div>
|
||||
<a href='https://github.com/mhinz/vim-galore'>English</a> |
|
||||
<a href='http://postd.cc/?s=vim-galore'>Japanese</a> |
|
||||
<a href='https://github.com/lsrdg/vim-galore'>Portuguese</a> |
|
||||
<a href='http://givi.olnd.ru/vim-galore/vim-galore-ru.html'>Russian</a>
|
||||
<div>
|
||||
<br />
|
||||
<sub>Licensed under <a href='https://creativecommons.org/licenses/by-sa/4.0'>CC BY-SA 4.0<a/>.</sub>
|
||||
</div>
|
||||
</div>
|
||||
<br /><br />
|
||||
</div>
|
||||
# Vim 从入门到精通
|
||||
|
||||
> 本文主要在翻译 [mhinz/vim-galore](https://github.com/mhinz/vim-galore)
|
||||
的基础添加了一些我在使用 Vim 及开发 Vim 插件的过程中积累的一些细节。
|
||||
|
||||
**Vim 中文同步聊天室**
|
||||
|
||||
- telegram: [@VimHub](https://t.me/VimHub)
|
||||
- gitter: [vim-china/Lobby](https://gitter.im/vim-china/Lobby)
|
||||
- IRC: [#vim-china](https://webchat.freenode.net/?channels=vim-china)
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
@ -20,8 +16,6 @@
|
||||
- [Vim 哲学](#vim-哲学)
|
||||
- [入门](#入门)
|
||||
- [精简的 vimrc](#精简的-vimrc)
|
||||
- [Windows 系统](#windows-系统)
|
||||
- [Linux 或者 Mac OS](#linux-或者-mac-os)
|
||||
- [我正在使用什么样的 Vim](#我正在使用什么样的-vim)
|
||||
- [备忘录](#备忘录)
|
||||
- [基础](#基础)
|
||||
@ -74,7 +68,6 @@
|
||||
- [在 Vim 7 或者更早的版本中安装](#在-vim-7-或者更早的版本中安装)
|
||||
- [简短的介绍](#简短的介绍)
|
||||
- [技巧](#技巧)
|
||||
- [跳至选择的区域另一端](#跳至选择的区域另一端)
|
||||
- [聪明地使用 n 和 N](#聪明地使用-n-和-n)
|
||||
- [聪明地使用命令行历史](#聪明地使用命令行历史)
|
||||
- [智能 Ctrl-l](#智能-ctrl-l)
|
||||
@ -89,7 +82,6 @@
|
||||
- [在 GUI 中快速改变字体大小](#在-gui-中快速改变字体大小)
|
||||
- [根据模式改变光标类型](#根据模式改变光标类型)
|
||||
- [防止水平滑动的时候失去选择](#防止水平滑动的时候失去选择)
|
||||
- [选择当前行至结尾,排除换行符](#选择当前行至结尾排除换行符)
|
||||
- [重新载入保存文件](#重新载入保存文件)
|
||||
- [更加智能的当前行高亮](#更加智能的当前行高亮)
|
||||
- [更快的关键字补全](#更快的关键字补全)
|
||||
@ -108,6 +100,10 @@
|
||||
- [杂项](#杂项)
|
||||
- [附加资源](#附加资源)
|
||||
- [Vim 配置集合](#vim-配置集合)
|
||||
- [内置插件](#内置插件)
|
||||
- [将 Control 映射到 CapsLock](#将-control-映射到-capslock)
|
||||
- [复活节彩蛋](#复活节彩蛋)
|
||||
- [为何使用 hjkl](#为何使用-hjkl)
|
||||
- [常见问题](#常见问题)
|
||||
- [编辑小文件时很慢](#编辑小文件时很慢)
|
||||
- [编辑大文件的时候很慢](#编辑大文件的时候很慢)
|
||||
@ -116,7 +112,6 @@
|
||||
- [无法重复函数中执行的搜索](#无法重复函数中执行的搜索)
|
||||
- [进阶阅读](#进阶阅读)
|
||||
- [加入我们](#加入我们)
|
||||
- [参考资料](#参考资料)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
@ -130,7 +125,7 @@
|
||||
1991 年发布初始版本。
|
||||
|
||||
Linux、Mac 用户,可以使用包管理器安装 Vim,对于 Windows 用户,可以从
|
||||
[我的网盘](https://www.jianguoyun.com/p/DVBqom8QtY2QCBj7xL0EIAA) 下载。
|
||||
[我的网盘](https://share.weiyun.com/da2be5937ac0e2bd3abc26355fad1204) 下载。
|
||||
该版本可轻易添加 `python` 、`python3` 、`lua` 等支持,只需要安装 python、lua
|
||||
即可。
|
||||
|
||||
@ -153,17 +148,13 @@ Vim 采用模式编辑的理念,即它提供了多种模式,按键在不同
|
||||
比如,要改变括号内的文本,需要执行 `ci(` (读做 `change inner parentheses`);
|
||||
删除整个段落的内容,需要执行 `dap` (读做:`delete around paragraph`)。
|
||||
|
||||
如果你能看见 Vim 老司机操作,你会发现他们使用 Vim 脚本语言就如同钢琴师弹钢琴一样。
|
||||
复杂的操作只需要几个按键就能完成。他们甚至不用刻意去想,因为这已经成为[肌肉记忆](https://en.wikipedia.org/wiki/Muscle_memory)了。
|
||||
这减少[认识负荷](https://en.wikipedia.org/wiki/Cognitive_load)并帮助人们专注于实际任务。
|
||||
如果你能看见 Vim 老司机操作,你会发现他们使用 Vim 脚本语言就如同钢琴师弹钢琴一样。复杂的操作只需要几个按键就能完成。他们甚至不用刻意去想,因为这已经成为[肌肉记忆](https://en.wikipedia.org/wiki/Muscle_memory)了。这减少[认识负荷](https://en.wikipedia.org/wiki/Cognitive_load)并帮助人们专注于实际任务。
|
||||
|
||||
## 入门
|
||||
|
||||
Vim 自带一个交互式的教程,内含你需要了解的最基础的信息,你可以通过终端运行以下命令打开教程:
|
||||
|
||||
```
|
||||
$ vimtutor
|
||||
```
|
||||
|
||||
不要因为这个看上去很无聊而跳过,按照此教程多练习。你以前用的 IDE 或者其他编辑器很少是有“模式”概念的,因此一开始你会很难适应模式切换。但是你 Vim 使用的越多,[肌肉记忆](https://en.wikipedia.org/wiki/Muscle_memory) 将越容易形成。
|
||||
|
||||
@ -183,44 +174,7 @@ Vim 基于一个 [vi](https://en.wikipedia.org/wiki/Vi) 克隆,叫做 [Stevie]
|
||||
|
||||
## 精简的 vimrc
|
||||
|
||||
Vim 启动是会按照一定的优先顺序来搜索配置文件,这个顺序,可以通过 `:version` 命令查看。下面分 Windows 系统,
|
||||
和 \*niux 系统分别来说明 Vim 是如何载入配置文件的。
|
||||
|
||||
### Windows 系统
|
||||
|
||||
```
|
||||
system vimrc file: "$VIM\vimrc"
|
||||
user vimrc file: "$HOME\_vimrc"
|
||||
2nd user vimrc file: "$HOME\vimfiles\vimrc"
|
||||
3rd user vimrc file: "$VIM\_vimrc"
|
||||
user exrc file: "$HOME\_exrc"
|
||||
2nd user exrc file: "$VIM\_exrc"
|
||||
system gvimrc file: "$VIM\gvimrc"
|
||||
user gvimrc file: "$HOME\_gvimrc"
|
||||
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
|
||||
3rd user gvimrc file: "$VIM\_gvimrc"
|
||||
defaults file: "$VIMRUNTIME\defaults.vim"
|
||||
system menu file: "$VIMRUNTIME\menu.vim"
|
||||
```
|
||||
|
||||
我们只看上面这一段,Vim 会优先读取 user vimrc file: `$HOME\_vimrc`, 当这一文件不存在是,
|
||||
Vim 再去寻找 2nd user vimrc file: `$HOME\vimfiles\vimrc`; 倘若这个文件还是不存在,那么 Vim
|
||||
会去继续寻找 3rd user vimrc file: `$VIM\_vimrc`。 了解以上顺序后,就不会再因为 Vim
|
||||
总是不读取配置文件而感到烦恼了。
|
||||
|
||||
### Linux 或者 Mac OS
|
||||
|
||||
同 Windows 系统类似,也可以使用 `:version` 命令查看 vim 载入配置的优先顺序。
|
||||
|
||||
```
|
||||
系统 vimrc 文件: "/etc/vimrc"
|
||||
用户 vimrc 文件: "$HOME/.vimrc"
|
||||
第二用户 vimrc 文件: "~/.vim/vimrc"
|
||||
用户 exrc 文件: "$HOME/.exrc"
|
||||
defaults file: "$VIMRUNTIME/defaults.vim"
|
||||
$VIM 预设值: "/etc"
|
||||
$VIMRUNTIME 预设值: "/usr/share/vim/vim81"
|
||||
```
|
||||
用户的 vimrc 配置文件可以放在 `~/.vimrc`,或者为了更好的分离放在 `~/.vim/vimrc`,后者更便于通过版本控制软件备份和同步整个配置,比方说 Github。
|
||||
|
||||
你可以在网上找到许多精简的 vimrc 配置文件,我的版本可能并不是最简单的版本,但是我的版本提供了一套我认为良好的,非常适合入门的设置。
|
||||
|
||||
@ -228,7 +182,7 @@ Vim 再去寻找 2nd user vimrc file: `$HOME\vimfiles\vimrc`; 倘若这个文件
|
||||
|
||||
精简的 vimrc 地址:[minimal-vimrc](contents/minimal-vimrc.vim)
|
||||
|
||||
如果你有兴趣,这里是我(原作者)的 [vimrc](https://github.com/mhinz/dotfiles/blob/master/.vim/vimrc)。
|
||||
如果你有兴趣,这里是我(原作者)的 [vimrc](https://github.com/mhinz/dotfiles/blob/master/vim/vimrc)。
|
||||
|
||||
**建议**:大多数插件作者都维护不止一个插件并且将他们的 vimrc 放在 Github 上展示(通常放在叫做 "vim-config" 或者 "dotfiles" 的仓库中),所以当你发现你喜欢的插件时,去插件维护者的 Github 主页看看有没有这样的仓库。
|
||||
|
||||
@ -259,12 +213,10 @@ endif
|
||||
|
||||
相关帮助:
|
||||
|
||||
```
|
||||
:h :version
|
||||
:h feature-list
|
||||
:h +feature-list
|
||||
:h has-patch
|
||||
```
|
||||
|
||||
返回主目录 [:arrow_heading_up:](#简介)
|
||||
|
||||
@ -274,6 +226,7 @@ endif
|
||||
|
||||
- <http://people.csail.mit.edu/vgod/vim/vim-cheat-sheet-en.png>
|
||||
- <https://cdn.shopify.com/s/files/1/0165/4168/files/preview.png>
|
||||
- <http://www.nathael.org/Data/vi-vim-cheat-sheet.svg>
|
||||
- <http://michael.peopleofhonoronly.com/vim/vim_cheat_sheet_for_programmers_screen.png>
|
||||
- <http://www.rosipov.com/images/posts/vim-movement-commands-cheatsheet.png>
|
||||
|
||||
@ -341,7 +294,7 @@ Vim 是一个文本编辑器。每次文本都是作为**缓冲区**的一部分
|
||||
|
||||
## 按键映射
|
||||
|
||||
使用 `:map` 命令家族你可以定义属于你自己的快捷键。该家族的每一个命令都限定在特定的模式下。从技术上来说 Vim 自带高达 12 种模式,其中 6 种可以被映射。另外一些命令作用于多种模式:
|
||||
使用 `:map` 命令家族你可以定义属于你自己的快捷键。该家族的每一个命令都限定在特定的模式下。从技术上来说 Vim 自带高达 12 中模式,其中 6 种可以被映射。另外一些命令作用于多种模式:
|
||||
|
||||
| 递归 | 非递归 | 模式 |
|
||||
| -------- | ------------ | -------------------------------- |
|
||||
@ -384,7 +337,7 @@ Vim 是一个文本编辑器。每次文本都是作为**缓冲区**的一部分
|
||||
:nnoremap a b
|
||||
```
|
||||
|
||||
经验法则:除递归映射是必须的,否则总是使用非递归映射。
|
||||
经验法则:除非递归是必须的,否则总是使用非递归映射。
|
||||
|
||||
通过不给一个右值来检查你的映射。比如`:nmap` 显示所以普通模式下的映射,`:nmap <leader>` 显示所有以 `<leader>` 键开头的普通模式下的映射。
|
||||
|
||||
@ -408,15 +361,13 @@ Vim 是一个文本编辑器。每次文本都是作为**缓冲区**的一部分
|
||||
nnoremap <leader>h :helpgrep<space>
|
||||
```
|
||||
|
||||
这样,我们只需要先按 <kbd>\\</kbd> 然后按 <kbd>h</kbd> 就可以激活这个映射 `:helpgrep<space>`。如果你想通过先按 <kbd>空格</kbd> 键来触发,只需要这样做:
|
||||
这样,我们只需要先按 <kbd>\\</kbd> 然后连续按 <kbd>\\h</kbd> 就可以激活这个映射 `:helpgrep<space>`。如果你想通过先按 <kbd>空格</kbd> 键来触发,只需要这样做:
|
||||
|
||||
```vim
|
||||
let g:mapleader = ' '
|
||||
let mapleader = ' '
|
||||
nnoremap <leader>h :helpgrep<space>
|
||||
```
|
||||
|
||||
此处建议使用 `g:mapleader`,因为在 Vim 脚本中,函数外的变量缺省的作用域是全局变量,但是在函数内缺省作用域是局部变量,而设置快捷键前缀需要修改全局变量 `g:mapleader` 的值。
|
||||
|
||||
另外,还有一个叫 `<localleader>` 的,可以把它理解为局部环境中的 `<leader>`,默认值依然为 <kbd>\\</kbd>。当我们需要只对某一个条件下(比如,特定文件类型的插件)的缓冲区设置特别的 `<leader>` 键,那么我们就可以通过修改当前环境下的 `<localleader>` 来实现。
|
||||
|
||||
**注意**:如果你打算设置 Leader 键,请确保在设置按键映射之前,先设置好 Leader 键。如果你先设置了含有 Leader 键的映射,然后又修改了 Leader 键,那么之前映射内的 Leader 键是不会因此而改变的。你可以通过执行 `:nmap <leader>` 来查看普通模式中已绑定给 Leader 键的所有映射。
|
||||
@ -1480,15 +1431,6 @@ autocmd FileType python let b:match_words = '\<if\>:\<elif\>:\<else\>'
|
||||
|
||||
# 技巧
|
||||
|
||||
## 跳至选择的区域另一端
|
||||
|
||||
在使用 `v` 或者 `V` 选择某段文字后,可以用 `o` 或者 `O` 按键跳至选择区域的开头或者结尾。
|
||||
|
||||
```
|
||||
:h v_o
|
||||
:h v_O
|
||||
```
|
||||
|
||||
## 聪明地使用 n 和 N
|
||||
|
||||
<kbd>n</kbd> 与 <kbd>N</kbd> 的实际跳转方向取决于使用 `/` 还是 `?` 来执行搜索,其中 `/` 是向后搜索,`?` 是向前搜索。一开始我(原作者)觉得这里很难理解。
|
||||
@ -1663,18 +1605,6 @@ xnoremap > >gv
|
||||
|
||||
设置好之后,在可视模式中使用 `>>>>>` 就不会再出现上面提到的问题了。
|
||||
|
||||
## 选择当前行至结尾,排除换行符
|
||||
|
||||
在 Vim 里,我们可以同过 `v$` 选择当前行至结尾,但此时会把最后一个换行符也选中,通常需要按额外的 `h` 来取消最后选中最后一个换行符号。
|
||||
Vim 提供了一个 `g_` 快捷键,可以移动光标至最后一个非空字符。因此,为达到次效果,可以使用 `vg_`。当然,如果觉得按三个键比较麻烦,
|
||||
可以添加一个映射:
|
||||
|
||||
```vim
|
||||
nnoremap L g_
|
||||
```
|
||||
|
||||
这样就可以通过 `vL` 达到一样的效果了。
|
||||
|
||||
## 重新载入保存文件
|
||||
|
||||
通过[自动命令](#自动命令),你可以在保存文件的同时触发一些其他功能。比如,如果这个文件是一个配置文件,那么就重新载入;或者你还可以对这个文件进行代码风格检查。
|
||||
@ -1926,6 +1856,14 @@ Vim 现在正在使用的另一个比较有用的方法是增加 debug 信息输
|
||||
- [amix's vimrc](https://github.com/amix/vimrc)
|
||||
- [janus](https://github.com/carlhuda/janus)
|
||||
|
||||
## 内置插件
|
||||
|
||||
## 将 Control 映射到 CapsLock
|
||||
|
||||
## 复活节彩蛋
|
||||
|
||||
## 为何使用 hjkl
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 编辑小文件时很慢
|
||||
@ -2040,12 +1978,7 @@ set ttimeoutlen=10 " unnoticeable small value
|
||||
## 进阶阅读
|
||||
|
||||
- [Vim 插件开发指南](https://github.com/wsdjeg/vim-plugin-dev-guide)
|
||||
- [常用插件列表](PLUGINS.md)
|
||||
|
||||
## 加入我们
|
||||
|
||||
可以协助我们核对翻译,或者从[章节列表](CONTRIBUTING.md)中认领章节进行翻译。
|
||||
|
||||
## 参考资料
|
||||
|
||||
- [Nifty Little Nvim Techniques to Make My Life Easier -- Series 1](https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/)
|
||||
|
7
chapter/Debugging.md
Normal file
7
chapter/Debugging.md
Normal file
@ -0,0 +1,7 @@
|
||||
## Debugging
|
||||
- 常用技巧
|
||||
- 复杂度
|
||||
- 查看启动时间
|
||||
- 运行时检测
|
||||
- 检查Vim脚本
|
||||
- 检查语法文件
|
@ -1,8 +1,3 @@
|
||||
# 技术怪癖
|
||||
|
||||
## NUL 符用新行表示
|
||||
|
||||
文件中的 NUL 符 (`\0`) 在内存中会被存储为换行符 (`\n`) 且
|
||||
在缓冲区中显示为 `^@`.
|
||||
|
||||
在 `man 7 ascii` 和 `:h NL-used-for-Nul` 中查看更多信息。
|
||||
|
44
chapter/delays-when-using-escape-key-in-terminal.md
Normal file
44
chapter/delays-when-using-escape-key-in-terminal.md
Normal file
@ -0,0 +1,44 @@
|
||||
## 使用终端中 Esc 键时的延迟
|
||||
|
||||
如果你生活在命令行里,你可能使用 xterm, gnome-terminal, iTerm2 等等所谓的 _终端虚拟器_。(区别于真正的[终端](https://en.wikipedia.org/wiki/Computer_terminal))
|
||||
|
||||
和宿主终端一样,终端虚拟器使用 [退出序列](https://en.wikipedia.org/wiki/Escape_sequence) (或者叫 _控制序列_)来控制光标移动,更换文本颜色等等。
|
||||
退出序列是一些以退出码(在 [插入符号](https://en.wikipedia.org/wiki/Caret_notation) 中展示为 `^[`)开头的 ASCII 码串。
|
||||
当接收到码串时,终端虚拟器会从 [terminfo](https://en.wikipedia.org/wiki/Terminfo) 数据库中寻找与之匹配的指令。
|
||||
|
||||
为了使问题更清晰,我想先解释一下映射超时。映射超时经常在模糊映射时发生:
|
||||
|
||||
```vim
|
||||
:nnoremap ,a :echo 'foo'<cr>
|
||||
:nnoremap ,ab :echo 'bar'<cr>
|
||||
```
|
||||
|
||||
两个映射都有可能,键入 `,a` ,就会有一秒钟的延迟,因为 Vim 会等待用户会再键入 `b` 还是不会了。
|
||||
|
||||
退出序列也会引起一样的问题:
|
||||
|
||||
- `<esc>` 在返回正常模式或退出指令时被大量使用。
|
||||
- 光标键使用了退出序列进行编码
|
||||
- Vim 运用 <kbd>Alt</kbd> (也被称为 _Meta key_)去发送固定的高位集编码的8位比特,但是很多终端虚拟器不支持(或者默认不启用),而用退出序列代替。
|
||||
|
||||
你可以用 `vim -u NONE -N` 试一试上面所说的,然后键入 `i<c-v><left>` ,你就会看见一串以 `^[`(表征退出码)开头的被输入序列。
|
||||
|
||||
简而言之,区分键入的 `<esc>` 和一个严格意义上的退出序列对 Vim 来说是一个痛苦的过程。
|
||||
|
||||
默认情况下 `:set timeout timeoutlen=1000` ,Vim 会有1秒的延迟在等 _还有吗_ 的模糊映射。
|
||||
对于映射来说,这是一个稳健的值,但是通常为了解决整个问题,你可以自定义键入的超时阈值:
|
||||
|
||||
```vim
|
||||
set timeout " 映射超时
|
||||
set timeoutlen=1000 " 默认值
|
||||
set ttimeout " 键入超时
|
||||
set ttimeoutlen=10 " 察觉不到的小值
|
||||
```
|
||||
|
||||
执行 `:h ttimeout` 你可以找到一个小表格展示这些选项的相互关系。
|
||||
|
||||
如果你在 Vim 和终端虚拟器之间使用的是 tmux ,请将以下一行放入 `~/.tmux.conf`:
|
||||
|
||||
```tmux
|
||||
set -sg escape-time 0
|
||||
```
|
13
chapter/easter-eggs.md
Normal file
13
chapter/easter-eggs.md
Normal file
@ -0,0 +1,13 @@
|
||||
## 复活节彩蛋
|
||||
|
||||
| 命令 | 消息 |
|
||||
|-----------|---------|
|
||||
| `:Ni!` | `你需要灌木丛?` |
|
||||
| `:h 'sm'` | `注意:这个缩写是限制级` |
|
||||
| `:h 42` | `生命,宇宙和一切的意义是什么?不幸的是, 道格拉斯・亚当斯(Douglas Adams),唯一知道这个问题的人现在已经死了。所以现在你可能会想知道死亡的意思是什么……` |
|
||||
| `:h UserGettingBored` | `什么时候用户会按同一个键42次?好吧,我只是开个玩笑 :-)` |
|
||||
| `:h bar` | `这不是一个烟斗。` |
|
||||
| `:h holy-grail` | `亚瑟,你终究找到了!` |
|
||||
| `:h map-modes` | `:nunmap 命令在修道院外也能用.` |
|
||||
| `:help!` | `E478:别怕!` (故障? 在使用模块帮助时 (`模块类型=帮助`) 这和 `:h help.txt` 一个效果。) |
|
||||
| `:smile` | `试一试这个表情 ;-) 添加于 7.4.1005.` |
|
@ -53,11 +53,11 @@ endif
|
||||
" Put all temporary files under the same directory.
|
||||
" https://github.com/mhinz/vim-galore#handling-backup-swap-undo-and-viminfo-files
|
||||
set backup
|
||||
set backupdir =$HOME/.vim/files/backup//
|
||||
set backupdir =$HOME/.vim/files/backup/
|
||||
set backupext =-vimbackup
|
||||
set backupskip =
|
||||
set directory =$HOME/.vim/files/swap//
|
||||
set updatecount =100
|
||||
set undofile
|
||||
set undodir =$HOME/.vim/files/undo//
|
||||
set undodir =$HOME/.vim/files/undo/
|
||||
set viminfo ='100,n$HOME/.vim/files/info/viminfo
|
||||
|
Loading…
x
Reference in New Issue
Block a user