mirror of
https://gitlab.com/wsdjeg/vim-galore-zh_cn.git
synced 2025-01-31 16:39:28 +08:00
format modification
This commit is contained in:
parent
768bf7acef
commit
b185c42c3e
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## 附加资源
|
## 附加资源
|
||||||
|
|
||||||
## Vim发行版
|
## Vim 发行版
|
||||||
|
|
||||||
## 内置插件
|
## 内置插件
|
||||||
|
|
||||||
@ -10,5 +10,5 @@
|
|||||||
|
|
||||||
## 复活节彩蛋
|
## 复活节彩蛋
|
||||||
|
|
||||||
## 为什么用hjkl移动光标?
|
## 为什么用 hjkl 移动光标?
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
| 命令 | 消息 |
|
| 命令 | 消息 |
|
||||||
|-----------|---------|
|
|-----------|---------|
|
||||||
| `:Ni!` | `你需要灌木丛?` |
|
| `:Ni!` | `你需要灌木丛?` |
|
||||||
| `:h 'sm'` | `注意:这个缩写是限制级` |
|
| `:h 'sm'` | `注意:这个缩写是限制级` |
|
||||||
| `:h 42` | `生命,宇宙和一切的意义是什么?不幸的是, 道格拉斯·亚当斯(Douglas Adams),唯一知道这个问题的人现在已经死了。所以现在你可能会想知道死亡的意思是什么……` |
|
| `:h 42` | `生命,宇宙和一切的意义是什么?不幸的是, 道格拉斯·亚当斯(Douglas Adams),唯一知道这个问题的人现在已经死了。所以现在你可能会想知道死亡的意思是什么……` |
|
||||||
| `:h UserGettingBored` | `什么时候用户会按同一个键42次?好吧,我只是开个玩笑 :-)` |
|
| `:h UserGettingBored` | `什么时候用户会按同一个键42次?好吧,我只是开个玩笑 :-)` |
|
||||||
| `:h bar` | `这不是一个烟斗。(原文:Ceci n'est pas une pipe.)` |
|
| `:h bar` | `这不是一个烟斗。` |
|
||||||
| `:h holy-grail` | `亚瑟,你终究找到了!` |
|
| `:h holy-grail` | `亚瑟,你终究找到了!` |
|
||||||
| `:h map-modes` | `:nunmap命令在修道院外也能用.` |
|
| `:h map-modes` | `:nunmap 命令在修道院外也能用.` |
|
||||||
| `:help!` | `E478:别怕!` (故障? 在使用模块帮助时 (`模块类型=帮助`) 这和 `:h help.txt` 一个效果。) |
|
| `:help!` | `E478:别怕!` (故障? 在使用模块帮助时 (`模块类型=帮助`) 这和 `:h help.txt` 一个效果。) |
|
||||||
| `:smile` | `试一试这个表情 ;-) 添加于 7.4.1005.` |
|
| `:smile` | `试一试这个表情 ;-) 添加于 7.4.1005.` |
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
## 映射大写锁定键(CapsLock)到控制键(Ctrl)
|
## 映射大写锁定键(CapsLock)到控制键(Ctrl)
|
||||||
|
|
||||||
大写锁定键属于键盘上最少用到的按键,但是它要比控制键更加容易按到,<br>
|
大写锁定键属于键盘上最少用到的按键,但是它要比控制键更加容易按到,
|
||||||
因为它位于你手放在键盘时的[起始行](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-homerow.png)。
|
因为它位于你手放在键盘时的[起始行](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-homerow.png)。
|
||||||
如果你敲很多代码的话,映射大写锁定键(CapsLock)到控制键(Ctrl)可以有效降低
|
如果你敲很多代码的话,映射大写锁定键(CapsLock)到控制键(Ctrl)可以有效降低
|
||||||
[重复使力伤害](https://de.wikipedia.org/wiki/Repetitive-Strain-Injury-Syndrom) 。
|
[重复使力伤害](https://de.wikipedia.org/wiki/Repetitive-Strain-Injury-Syndrom) (ps:为什么将 jk 映射为 esc,而不是 jj,重复点击同一个按键对手指伤害很大)。
|
||||||
|
|
||||||
友情提示:当你习惯这个设定后,你就离不开它了。
|
友情提示:当你习惯这个设定后,你就离不开它了。
|
||||||
|
|
||||||
**OSX**:
|
**OSX**:
|
||||||
|
|
||||||
`System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys`. 变更
|
`System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys`. 变更
|
||||||
"CapsLock" 为 "Control".
|
"CapsLock" 为 "Control"。
|
||||||
|
|
||||||
**Linux**:
|
**Linux**:
|
||||||
|
|
||||||
@ -20,11 +20,11 @@
|
|||||||
keysym Caps_Lock = Control_L
|
keysym Caps_Lock = Control_L
|
||||||
add Control = Control_L
|
add Control = Control_L
|
||||||
|
|
||||||
用以下命令使之生效<br> `$ xmodmap ~/.xmodmap`.
|
用以下命令使之生效<br> `$ xmodmap ~/.xmodmap`。
|
||||||
|
|
||||||
替代方法有[caps2esc](https://github.com/oblitum/caps2esc) 或者
|
替代方法有[caps2esc](https://github.com/oblitum/caps2esc) 或者
|
||||||
[xcape](https://github.com/alols/xcape).
|
[xcape](https://github.com/alols/xcape)。
|
||||||
|
|
||||||
**Windows**:
|
**Windows**:
|
||||||
|
|
||||||
请参看 [superuser.com: 在Windows8.1映射大写锁定键到控制键](http://superuser.com/questions/764782/map-caps-lock-to-control-in-windows-8-1).
|
请参看 [superuser.com: 在Windows8.1映射大写锁定键到控制键](http://superuser.com/questions/764782/map-caps-lock-to-control-in-windows-8-1)。
|
||||||
|
@ -1,281 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
|
|
||||||
## Additional resources
|
|
||||||
|
|
||||||
| Resource | Description |
|
|
||||||
|----------|-------------|
|
|
||||||
| [Seven habits of effective text editing](http://www.moolenaar.net/habits.html) | By Bram Moolenaar, the author of Vim. |
|
|
||||||
| [Seven habits of effective text editing 2.0 (PDF)](http://www.moolenaar.net/habits_2007.pdf) | See above. |
|
|
||||||
| [IBM DeveloperWorks: Scripting the Vim editor](http://www.ibm.com/developerworks/views/linux/libraryview.jsp?sort_order=asc&sort_by=Title&search_by=scripting+the+vim+editor) | Five-part series on Vim scripting. |
|
|
||||||
| [Learn Vimscript the Hard Way](http://learnvimscriptthehardway.stevelosh.com) | Develop a Vim plugin from scratch. |
|
|
||||||
| [Practical Vim (2nd Edition)](http://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275/) | Hands down the best book about Vim. |
|
|
||||||
| [Vimcasts.org](http://vimcasts.org/episodes/archive) | Vim screencasts. |
|
|
||||||
| [Why, oh WHY, do those #?@! nutheads use vi?](http://www.viemu.com/a-why-vi-vim.html) | Common misconceptions explained. |
|
|
||||||
| [Your problem with Vim is that you don't grok vi](http://stackoverflow.com/a/1220118) | Concise, informative and correct. A real gem. |
|
|
||||||
|
|
||||||
## Vim distributions
|
|
||||||
|
|
||||||
Vim distributions are bundles of custom settings and plugins for Vim.
|
|
||||||
|
|
||||||
More advanced users know how to configure their editor anyway, so distributions
|
|
||||||
are mostly targeted at beginners. If you think about that, it's quite
|
|
||||||
paradoxical though: Making it easier by adding even more things to learn about?
|
|
||||||
|
|
||||||
I know that many people don't want to spend hours and hours on customizing an
|
|
||||||
editor (and actually you never stop customizing your vimrc when you finally got
|
|
||||||
hooked), but eventually you only get efficient in Vim when you take the time to
|
|
||||||
learn it properly.
|
|
||||||
|
|
||||||
Repeat after me: "A programmer should know their tools."
|
|
||||||
|
|
||||||
Anyway, if you know what you're doing, you might draw some inspiration from
|
|
||||||
looking at a few distributions:
|
|
||||||
|
|
||||||
- [cream](http://cream.sourceforge.net)
|
|
||||||
- [janus](https://github.com/carlhuda/janus.git)
|
|
||||||
- [spacevim](https://github.com/SpaceVim/SpaceVim)
|
|
||||||
- [spf13](https://github.com/spf13/spf13-vim)
|
|
||||||
|
|
||||||
## Standard plugins
|
|
||||||
|
|
||||||
Surprising to many people, Vim comes with a handful of plugins on its own that
|
|
||||||
all get loaded by default. Check `:scriptnames` after starting Vim to see all
|
|
||||||
sourced files.
|
|
||||||
|
|
||||||
Most of them will never get used, so disable them as you see fit. They will
|
|
||||||
still be shown as sourced, but only the first lines actually get read before Vim
|
|
||||||
bails out. No further code (mappings, commands, logic) will be processed.
|
|
||||||
|
|
||||||
| Plugin | Disable it using.. | Help |
|
|
||||||
|------------|-------------------------------------|------|
|
|
||||||
| 2html | `let g:loaded_2html_plugin = 1` | `:h 2html` |
|
|
||||||
| getscript | `let g:loaded_getscriptPlugin = 1` | `:h pi_getscript` |
|
|
||||||
| gzip | `let g:loaded_gzip = 1` | `:h pi_gzip` |
|
|
||||||
| logipat | `let g:loaded_logipat = 1` | `:h pi_logipat` |
|
|
||||||
| matchparen | `let g:loaded_matchparen = 1` | `:h pi_paren` |
|
|
||||||
| netrw | `let g:loaded_netrwPlugin = 1` | `:h pi_netrw` |
|
|
||||||
| rrhelper | `let g:loaded_rrhelper = 1` | `:e $VIMRUNTIME/plugin/rrhelper.vim` |
|
|
||||||
| spellfile | `let g:loaded_spellfile_plugin = 1` | `:h spellfile.vim` |
|
|
||||||
| tar | `let g:loaded_tarPlugin = 1` | `:h pi_tar` |
|
|
||||||
| vimball | `let g:loaded_vimballPlugin = 1` | `:h pi_vimball` |
|
|
||||||
| zip | `let g:loaded_zipPlugin = 1` | `:h pi_zip` |
|
|
||||||
|
|
||||||
## Map CapsLock to Control
|
|
||||||
|
|
||||||
CapsLock belongs to the most useless keys on your keyboard, but it's much easier
|
|
||||||
to reach than the Control key, since it lies on your [home
|
|
||||||
row](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-homerow.png).
|
|
||||||
Mapping CapsLock to Control is a great way to prevent or at least reduce
|
|
||||||
[RSI](https://de.wikipedia.org/wiki/Repetitive-Strain-Injury-Syndrom) if you
|
|
||||||
program a lot.
|
|
||||||
|
|
||||||
Attention: When you get used to it, you can't live without it anymore.
|
|
||||||
|
|
||||||
**OSX**:
|
|
||||||
|
|
||||||
`System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys`. Change
|
|
||||||
"CapsLock" to "Control".
|
|
||||||
|
|
||||||
**Linux**:
|
|
||||||
|
|
||||||
To change the keys in X, put this in your `~/.xmodmap`:
|
|
||||||
|
|
||||||
remove Lock = Caps_Lock
|
|
||||||
keysym Caps_Lock = Control_L
|
|
||||||
add Control = Control_L
|
|
||||||
|
|
||||||
Afterwards source it via `$ xmodmap ~/.xmodmap`.
|
|
||||||
|
|
||||||
An alternative would be using [caps2esc](https://github.com/oblitum/caps2esc) or
|
|
||||||
[xcape](https://github.com/alols/xcape).
|
|
||||||
|
|
||||||
**Windows**:
|
|
||||||
|
|
||||||
See [superuser.com: Map Caps-Lock to Control in Windows
|
|
||||||
8.1](http://superuser.com/questions/764782/map-caps-lock-to-control-in-windows-8-1).
|
|
||||||
|
|
||||||
## Easter eggs
|
|
||||||
|
|
||||||
| Command | Message |
|
|
||||||
|-----------|---------|
|
|
||||||
| `:Ni!` | `Do you demand a shrubbery?` |
|
|
||||||
| `:h 'sm'` | `NOTE: Use of the short form is rated PG.` |
|
|
||||||
| `:h 42` | `What is the meaning of life, the universe and everything? Douglas Adams, the only person who knew what this question really was about is now dead, unfortunately. So now you might wonder what the meaning of death is...` |
|
|
||||||
| `:h UserGettingBored` | `When the user presses the same key 42 times. Just kidding! :-)` |
|
|
||||||
| `:h bar` | `Ceci n'est pas une pipe.` |
|
|
||||||
| `:h holy-grail` | `You found it, Arthur!` |
|
|
||||||
| `:h map-modes` | `:nunmap can also be used outside of a monastery.` |
|
|
||||||
| `:help!` | `E478: Don't panic!` (Glitch? When used in a help buffer (`buftype=help`) this works like `:h help.txt` instead.) |
|
|
||||||
| `:smile` | Try it out yourself. ;-) Added in 7.4.1005. |
|
|
||||||
|
|
||||||
## Why hjkl for navigation?
|
|
||||||
|
|
||||||
When [Bill Joy](https://en.wikipedia.org/wiki/Bill_Joy) created
|
|
||||||
[vi](https://en.wikipedia.org/wiki/Vi), a predecessor of Vim, he did it on a
|
|
||||||
[ADM-3A](https://en.wikipedia.org/wiki/ADM-3A) which had no extra cursor buttons
|
|
||||||
but used, you might already guessed it, hjkl instead.
|
|
||||||
|
|
||||||
Keyboard layout: [click](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-adm-3a-layout.jpg)
|
|
||||||
|
|
||||||
This also shows why `~` is used to denote the home directory on Unix systems.
|
|
||||||
|
|
||||||
# Common problems
|
|
||||||
|
|
||||||
## Editing small files is slow
|
|
||||||
|
|
||||||
There are two things which can have a huge impact on performance:
|
|
||||||
|
|
||||||
1. Complex **regular expressions**. Particular the Ruby syntax file caused
|
|
||||||
people to have slowdowns in the past. (Also see [Debugging syntax files](#debugging-syntax-files).)
|
|
||||||
2. **Screen redraws**. Some features force all lines to redraw.
|
|
||||||
|
|
||||||
| Typical culprit | Why? | Solution? |
|
|
||||||
|-----------------|------|-----------|
|
|
||||||
| `:set cursorline` | Causes all lines to redraw. | `:set nocursorline` |
|
|
||||||
| `:set cursorcolumn` | Causes all lines to redraw. | `:set nocursorcolumn` |
|
|
||||||
| `:set relativenumber` | Causes all lines to redraw. | `:set norelativenumber` |
|
|
||||||
| `:set foldmethod=syntax` | If the syntax file is slow already, this makes it even worse. | `:set foldmethod=manual`, `:set foldmethod=marker` or [FastFold](https://github.com/Konfekt/FastFold) |
|
|
||||||
| `:set synmaxcol=3000` | Due to internal representation, Vim has problems with long lines in general. Highlights columns till column 3000. | `:set synmaxcol=200` |
|
|
||||||
| matchparen.vim | Loaded by default. Uses regular expressions to find the accompanying parenthesis. | Disable plugin: `:h matchparen` |
|
|
||||||
|
|
||||||
**NOTE**: You only need to do this if you experience actual performance
|
|
||||||
drawbacks. In most cases using the things mentioned above is absolutely fine.
|
|
||||||
|
|
||||||
## Editing huge files is slow
|
|
||||||
|
|
||||||
The biggest issue with big files is, that Vim reads the whole file at once. This
|
|
||||||
is done due to how buffers are represented internally.
|
|
||||||
([Discussion on vim_dev@](https://groups.google.com/forum/#!topic/vim_dev/oY3i8rqYGD4/discussion))
|
|
||||||
|
|
||||||
If you only want to read, `tail hugefile | vim -` is a good workaround.
|
|
||||||
|
|
||||||
If you can live without syntax, settings and plugins for the moment:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ vim -u NONE -N
|
|
||||||
```
|
|
||||||
|
|
||||||
This should make navigation quite a lot faster, especially since no expensive
|
|
||||||
regular expressions for syntax highlighting are used. You should also tell Vim
|
|
||||||
not to use swapfiles and viminfo files to avoid long delays on writing:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ vim -n -u NONE -i NONE -N
|
|
||||||
```
|
|
||||||
|
|
||||||
Putting it in a nutshell, try to avoid using Vim when intending to write really
|
|
||||||
huge files. :\
|
|
||||||
|
|
||||||
## Bracketed paste (or why do I have to set 'paste' all the time?)
|
|
||||||
|
|
||||||
Bracketed paste mode allows terminal emulators to distinguish between typed text
|
|
||||||
and pasted text.
|
|
||||||
|
|
||||||
Did you ever tried pasting code into Vim and afterwards everything seemed messed
|
|
||||||
up?
|
|
||||||
|
|
||||||
This only happens if you paste via `cmd+v`, `shift-insert`, `middle-click` etc.
|
|
||||||
because then you're just throwing text at the terminal emulator. Vim doesn't
|
|
||||||
know that you just pasted the text, it thinks you're an extremely fast typist.
|
|
||||||
Accordingly, it tries to indent the lines and fails.
|
|
||||||
|
|
||||||
Obviously this is not an issue, if you paste using Vim's registers, e.g. `"+p`,
|
|
||||||
because then Vim knows that you're actually pasting.
|
|
||||||
|
|
||||||
To workaround this, you have to `:set paste`, so it gets pasted as-is. See `:h
|
|
||||||
'paste'` and `:h 'pastetoggle'`.
|
|
||||||
|
|
||||||
If you're fed up with toggling `'paste'` all the time, have a look at this fine
|
|
||||||
plugin that does it for you:
|
|
||||||
[bracketed-paste](https://github.com/ConradIrwin/vim-bracketed-paste).
|
|
||||||
|
|
||||||
Additional read from the same author as the plugin:
|
|
||||||
[here](http://cirw.in/blog/bracketed-paste).
|
|
||||||
|
|
||||||
**Neovim**: Neovim tries to make all of this much more seamless and sets
|
|
||||||
bracketed paste mode automatically if the terminal emulator supports it.
|
|
||||||
|
|
||||||
## Delays when using escape key in terminal
|
|
||||||
|
|
||||||
If you live in the command-line, you probably use a so-called _terminal
|
|
||||||
emulator_ like xterm, gnome-terminal, iTerm2, etc. (opposed to a real
|
|
||||||
[terminal](https://en.wikipedia.org/wiki/Computer_terminal)).
|
|
||||||
|
|
||||||
Like their ancestors, terminal emulators use [escape
|
|
||||||
sequences](https://en.wikipedia.org/wiki/Escape_sequence) (or _control
|
|
||||||
sequences_) to control things like moving the cursor, changing text colors, etc.
|
|
||||||
They're simply strings of ASCII characters starting with an escape character
|
|
||||||
(displayed in [caret notation](https://en.wikipedia.org/wiki/Caret_notation) as
|
|
||||||
`^[`). When such a string arrives, the terminal emulator looks up the
|
|
||||||
accompanying action in the [terminfo](https://en.wikipedia.org/wiki/Terminfo)
|
|
||||||
database.
|
|
||||||
|
|
||||||
To make the problem clearer, I'll explain mapping timeouts first. They always
|
|
||||||
happen when there's ambiguity between mappings:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
:nnoremap ,a :echo 'foo'<cr>
|
|
||||||
:nnoremap ,ab :echo 'bar'<cr>
|
|
||||||
```
|
|
||||||
|
|
||||||
Both mappings work as expected, but when typing `,a`, there will be a delay of 1
|
|
||||||
second, because Vim waits whether the user keys in another `b` or not.
|
|
||||||
|
|
||||||
Escape sequences pose the same problem:
|
|
||||||
|
|
||||||
- `<esc>` is used a lot for returning to normal mode or quitting an action.
|
|
||||||
- Cursor keys are encoded using escape sequences.
|
|
||||||
- Vim expects <kbd>Alt</kbd> (also called _Meta key_) to send a proper 8-bit
|
|
||||||
encoding with the high bit set, but many terminal emulators don't support it
|
|
||||||
(or don't enable it by default) and send an escape sequence instead.
|
|
||||||
|
|
||||||
You can test the above like this: `vim -u NONE -N` and type `i<c-v><left>` and
|
|
||||||
you'll see a sequence inserted that starts with `^[` which denotes the escape
|
|
||||||
character.
|
|
||||||
|
|
||||||
Putting it in a nutshell, Vim has a hard time distinguishing between a typed
|
|
||||||
`<esc>` character and a proper escape sequence.
|
|
||||||
|
|
||||||
By default, Vim uses `:set timeout timeoutlen=1000`, so it delays on ambiguity
|
|
||||||
of mappings _and_ key codes by 1 second. This is a sane value for mappings, but
|
|
||||||
you can define the key code timeout on its own which is the most common
|
|
||||||
workaround for this entire issue:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
set timeout " for mappings
|
|
||||||
set timeoutlen=1000 " default value
|
|
||||||
set ttimeout " for key codes
|
|
||||||
set ttimeoutlen=10 " unnoticeable small value
|
|
||||||
```
|
|
||||||
|
|
||||||
Under `:h ttimeout` you find a small table showing the relationship between
|
|
||||||
these options.
|
|
||||||
|
|
||||||
If you're using tmux between Vim and your terminal emulator, also put this in
|
|
||||||
your `~/.tmux.conf`:
|
|
||||||
|
|
||||||
```tmux
|
|
||||||
set -sg escape-time 0
|
|
||||||
```
|
|
||||||
|
|
||||||
## Function search undo
|
|
||||||
|
|
||||||
- A search pattern in a command (`/`, `:substitute`, ...) changes the "last used
|
|
||||||
search pattern". (It's saved in the `/` register; print it with `:echo @/`).
|
|
||||||
- A simple text change can be redone with `.`. (It's saved in the `.` register;
|
|
||||||
print it with `:echo @.`).
|
|
||||||
|
|
||||||
Both things are _not_ the case, if you do them from a function, though! Thus you
|
|
||||||
can't easily highlight words from a function or redo the text changes made by
|
|
||||||
it.
|
|
||||||
|
|
||||||
Help: `:h function-search-undo`
|
|
||||||
|
|
||||||
# Technical quirks
|
|
||||||
|
|
||||||
## Newline used for NUL
|
|
||||||
|
|
||||||
NUL characters (`\0`) in a file, are stored as newline (`\n`) in memory and
|
|
||||||
displayed in a buffer as `^@`.
|
|
||||||
|
|
||||||
See `man 7 ascii` and `:h NL-used-for-Nul` for more information.
|
|
@ -1,12 +1,11 @@
|
|||||||
## 内置插件
|
## 内置插件
|
||||||
|
|
||||||
出乎很多人的意料,Vim自己默认加载了大把大把的插件。<br>
|
出乎很多人的意料,Vim自己默认加载了大把大把的插件。启动 Vim 后,用`:scriptnames`查看所有加载的源文件
|
||||||
启动Vim后,用`:scriptnames`查看所有加载的源文件
|
|
||||||
|
|
||||||
这些文件多数永远不会被用到,所以请禁止如你所见的以下插件。<br>
|
这些文件多数永远不会被用到,所以请禁止如你所见的以下插件。
|
||||||
这些插件仍旧会在源文件列出,但是当Vim启动时,只有第一行会被读取,而之后的配置,命令和日志都不会执行。
|
这些插件仍旧会在源文件列出,但是当Vim启动时,只有第一行会被读取,而之后的配置,命令和日志都不会执行。
|
||||||
|
|
||||||
| Plugin | Disable it using.. | Help |
|
| 插件 | 禁用 | 帮助 |
|
||||||
|------------|-------------------------------------|------|
|
|------------|-------------------------------------|------|
|
||||||
| 2html | `let g:loaded_2html_plugin = 1` | `:h 2html` |
|
| 2html | `let g:loaded_2html_plugin = 1` | `:h 2html` |
|
||||||
| getscript | `let g:loaded_getscriptPlugin = 1` | `:h pi_getscript` |
|
| getscript | `let g:loaded_getscriptPlugin = 1` | `:h pi_getscript` |
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
## Vim发行版
|
## Vim 配置集合
|
||||||
|
|
||||||
Vim发行版是集成客制化设定和Vim插件的包
|
Vim 配置集合是集成多多种插件以及相关配置的组合。
|
||||||
|
|
||||||
高阶用户总是知道如何构建自己的编辑器,所以发行版一般是针对初学者。<br>
|
高阶用户总是知道如何构建自己的编辑器,所以发行版一般是针对初学者。
|
||||||
如果你考虑这方面,那么这就是一个非常辩证的想法:<br>
|
如果你想要尝试,那么将面临一个辩证的想法:加入很多额外的东西来学习 Vim 是否会让这变得更加简单。
|
||||||
加入更多需要学的东西,使得学习本身变得简单。
|
|
||||||
|
|
||||||
我知道很多人不想在编辑器上花很多时间(当你卡住时,你实际上在不停地花时间定制自己的vimrc),<br>
|
我知道很多人不想在配置编辑器上花过多时间(但实际上,当你卡住时,你就会不停地花时间定制自己的 vimrc)
|
||||||
但是只有正确地去了解Vim,你才能最终从它身上获得高效。
|
因此,想要节约时间,那么就因该真正的去了解和学习 Vim 原生功能,只有这样你才能中获益。
|
||||||
|
|
||||||
跟我说一遍: "一个程序员需要懂得他的工具。"
|
再次强调一下:“一个程序员应当懂得他的工具”。
|
||||||
|
|
||||||
无论如何,如果你知道自己在做什么,那你也许能从以下几个发行版Vim中获得一些灵感
|
总之,如果你知道自己在做什么,你也许能从以下几个 Vim 配置集合中获得一些灵感。
|
||||||
|
|
||||||
- [cream](http://cream.sourceforge.net)
|
- [cream](http://cream.sourceforge.net)
|
||||||
- [janus](https://github.com/carlhuda/janus.git)
|
- [janus](https://github.com/carlhuda/janus.git)
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
## 为什么用hjkl移动光标?
|
## 为什么用hjkl移动光标?
|
||||||
|
|
||||||
当 [Bill Joy](https://en.wikipedia.org/wiki/Bill_Joy) 创建
|
当 [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 作为光标控制键。
|
||||||
[vi](https://en.wikipedia.org/wiki/Vi), Vim的前身时, 他的工作是在一台
|
|
||||||
[ADM-3A](https://en.wikipedia.org/wiki/ADM-3A)完成的,<br>
|
|
||||||
而这个机器没有用别的键控制光标,而正是如你猜到的hjkl作为光标控制键。
|
|
||||||
|
|
||||||
键盘布局: [请点击](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-adm-3a-layout.jpg)
|
键盘布局: [请点击](https://raw.githubusercontent.com/mhinz/vim-galore/master/contents/images/content-adm-3a-layout.jpg)
|
||||||
|
|
||||||
这也告诉了我们为什么Unix系统会以`~`代表主目录。
|
这也告诉了我们为什么 Unix 系统会以`~`代表主目录。
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user