From 6b9c31ddbef9b48f589688f27341ecd0e9ee8a97 Mon Sep 17 00:00:00 2001 From: chengrui Date: Wed, 29 Mar 2017 18:14:19 +0800 Subject: [PATCH] translating common-problems and technical-quirks --- chapter/Common problems.md | 12 ++--- chapter/Technical quirks.md | 3 ++ chapter/additional-resources.md | 12 ++--- chapter/bracketed-paste.md | 18 ++++++++ ...elays-when-using-escape-key-in-terminal.md | 44 +++++++++++++++++++ chapter/editing-huge-files-is-slow.md | 20 +++++++++ chapter/editing-small-files-is-slow.md | 17 +++++++ chapter/function-search-undo.md | 8 ++++ chapter/newline-used-for-nul.md | 5 +++ 9 files changed, 127 insertions(+), 12 deletions(-) create mode 100644 chapter/Technical quirks.md create mode 100644 chapter/newline-used-for-nul.md diff --git a/chapter/Common problems.md b/chapter/Common problems.md index 8c33cb4..08260f8 100644 --- a/chapter/Common problems.md +++ b/chapter/Common problems.md @@ -1,11 +1,11 @@ -# Common problems +# 常见问题 -## Editing small files is slow +## 编辑小文件很慢 -## Editing huge files is slow +## 编辑大文件很慢 -## Bracketed paste (or why do I have to set 'paste' all the time?) +## 相同部分粘贴 (要不为什么我总要设置‘粘贴’?) -## Delays when using escape key in terminal +## 使用终端中 Esc 键时的延迟 -## Function search undo \ No newline at end of file +## 无法重复函数中执行的搜索 diff --git a/chapter/Technical quirks.md b/chapter/Technical quirks.md new file mode 100644 index 0000000..7e62e44 --- /dev/null +++ b/chapter/Technical quirks.md @@ -0,0 +1,3 @@ +# + +## NUL бʾ diff --git a/chapter/additional-resources.md b/chapter/additional-resources.md index 944ffab..60ccb3f 100644 --- a/chapter/additional-resources.md +++ b/chapter/additional-resources.md @@ -2,11 +2,11 @@ | Դ | | |----------|-------------| -| [߸Чı༭ϰ](http://www.moolenaar.net/habits.html) | ߣBram MoolenaarVimߣ | +| [߸Чı༭ϰ](http://www.moolenaar.net/habits.html) | ߣBram Moolenaar Vim ߣ | | [߸Чı༭ϰ2.0PDF棩](http://www.moolenaar.net/habits_2007.pdf) | ͬ | -| [IBM DeveloperWorks: ʹýűд Vim ༭](http://www.ibm.com/developerworks/views/linux/libraryview.jsp?sort_order=asc&sort_by=Title&search_by=scripting+the+vim+editor) | Viműд弭 | -| [Vim·](http://learnvimscriptthehardway.stevelosh.com) | ʹħץVim | -| [Vimʵ (2)](http://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275/) | ȡVim鼮 | +| [IBM DeveloperWorks: ʹýűд Vim ༭](http://www.ibm.com/developerworks/views/linux/libraryview.jsp?sort_order=asc&sort_by=Title&search_by=scripting+the+vim+editor) | Vim űд弭 | +| [ Vim ·](http://learnvimscriptthehardway.stevelosh.com) | ʹħץ Vim | +| [ Vim ʵ (2)](http://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275/) | ȡ Vim 鼮 | | [Vimcasts.org](http://vimcasts.org/episodes/archive) | Vim¼ʾ | -| [ΪʲôǸűvi](http://www.viemu.com/a-why-vi-vim.html) | | -| [㲻vi㲻Vim](http://stackoverflow.com/a/1220118) | ,Ҫ,׼ȷĸɻ | \ No newline at end of file +| [ΪʲôǸű vi](http://www.viemu.com/a-why-vi-vim.html) | | +| [㲻 vi㲻 Vim ](http://stackoverflow.com/a/1220118) | ,Ҫ,׼ȷĸɻ | \ No newline at end of file diff --git a/chapter/bracketed-paste.md b/chapter/bracketed-paste.md index e69de29..f7356d4 100644 --- a/chapter/bracketed-paste.md +++ b/chapter/bracketed-paste.md @@ -0,0 +1,18 @@ +## ճ (ҪΪʲôҪáճ) + +ճģʽʹնּıճı + +ǷԹ Vim ճ룬Ūһ㣿 + +ֻͨ `cmd+v` `shift-insert` `middle-click` ȵճʱ +ΪʱֻնﶪıVim ֪ճıΪһĴԱˣŰ棬ʧˡ + +ʹ Vim ճ `"+p` ͲΪ⣬Ϊ Vim ֪ճ + +Ϊ˽Ҫճ `:set paste` Աȡճ״ ο `:h 'paste'` `:h 'pastetoggle'`. + +Ѿܹ˲ͣл `'paste'` һIJΪʲô[ճ](https://github.com/ConradIrwin/vim-bracketed-paste) + +ߵչĶ[ӭ](http://cirw.in/blog/bracketed-paste). + +**Neovim**: Neovim Ŭ޷Щն֧ʱԶ趨ճģʽ diff --git a/chapter/delays-when-using-escape-key-in-terminal.md b/chapter/delays-when-using-escape-key-in-terminal.md index e69de29..d364eff 100644 --- a/chapter/delays-when-using-escape-key-in-terminal.md +++ b/chapter/delays-when-using-escape-key-in-terminal.md @@ -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' +:nnoremap ,ab :echo 'bar' +``` + +ӳ䶼пܣ `,a` ͻһӵӳ٣Ϊ Vim ȴûټ `b` Dzˡ + +˳Ҳһ⣺ + +- `` ڷģʽ˳ָʱʹá +- ʹ˳нб +- Vim Alt ҲΪ _Meta key_ȥ͹̶ĸλ8λأǺܶն֧֣Ĭϲã˳д档 + + `vim -u NONE -N` һ˵ģȻ `i` ͻῴһ `^[`˳룩ͷıС + +ּ֮ `` һϸϵ˳ж Vim ˵һʹĹ̡ + +Ĭ `:set timeout timeoutlen=1000` Vim 1ӳڵ __ ģӳ䡣 +ӳ˵һȽֵͨΪ˽⣬Զijʱֵ + +```vim +set timeout " ӳ䳬ʱ +set timeoutlen=1000 " Ĭֵ +set ttimeout " 볬ʱ +set ttimeoutlen=10 " Сֵ +``` + +ִ `:h ttimeout` ҵһСչʾЩѡ໥ϵ + + Vim ն֮ʹõ tmux 뽫һз `~/.tmux.conf` + +```tmux +set -sg escape-time 0 +``` diff --git a/chapter/editing-huge-files-is-slow.md b/chapter/editing-huge-files-is-slow.md index e69de29..e3c0cae 100644 --- a/chapter/editing-huge-files-is-slow.md +++ b/chapter/editing-huge-files-is-slow.md @@ -0,0 +1,20 @@ +## ༭ļ + +ļ⣬ Vim һԶȡļһ̵ȡڲṩռ䡣 +([Vim ](https://groups.google.com/forum/#!topic/vim_dev/oY3i8rqYGD4/discussion)) + +ֻȡ `tail hugefile | vim -` һܺõĽ. + +﷨趨ͲҲһʱ: + +``` +$ vim -u NONE -N +``` + +⽫ʹõ٣Ϊ۸߰﷨ʽٱʹáҲӦ Vim Ҫʹýļ Vim ϢļԱдʱijӳ١ + +``` +$ vim -n -u NONE -i NONE -N +``` + +֮д볬ļʱ Vim :\ diff --git a/chapter/editing-small-files-is-slow.md b/chapter/editing-small-files-is-slow.md index e69de29..a2ac3f3 100644 --- a/chapter/editing-small-files-is-slow.md +++ b/chapter/editing-small-files-is-slow.md @@ -0,0 +1,17 @@ +## ༭Сļ + +شӰ棺 + +1. ӵ**ʽ** Ruby ﷨ļǹȥһֱ̡[Debugging syntax files](#debugging-syntax-files)Ҳ˵ +2. **ҳˢ**һЩǿжˢ¡ + +| Ͱܱ | ԭ | | +|-----------------|------|-----------| +| `:set cursorline` | ˢ¡ | `:set nocursorline` | +| `:set cursorcolumn` | ˢ¡ | `:set nocursorcolumn` | +| `:set relativenumber` | ˢ¡ | `:set norelativenumber` | +| `:set foldmethod=syntax` | ﷨ļٵĻɲ | `:set foldmethod=manual`, `:set foldmethod=marker` or [FastFold](https://github.com/Konfekt/FastFold) | +| `:set synmaxcol=3000` | ڲʾ, Vim һ㲻ԺܳСһ趨3000ʱŻи | `:set synmaxcol=200` | +| matchparen.vim | ʹĬϼءʹʽȥƥء | Disable plugin: `:h matchparen` | + +**ע**: ֻеʵʵȱʱҪЩĽ£ᵽЩ滹պϡ diff --git a/chapter/function-search-undo.md b/chapter/function-search-undo.md index e69de29..7db6925 100644 --- a/chapter/function-search-undo.md +++ b/chapter/function-search-undo.md @@ -0,0 +1,8 @@ +## ޷ظִе + +- һؼʣ`/`, `:`, ...ıˡһõĹؼʡı䱣 `/` עʹ `:echo @/` Դӡ +- һ򵥵ı޸Ŀ `.` ٴִСִб `.` עʹ `:echo @.` Դӡ + +һϲ_not_ô¶㲻ܼ򵥵һʻͬʱı޸ġ + + `:h function-search-undo` \ No newline at end of file diff --git a/chapter/newline-used-for-nul.md b/chapter/newline-used-for-nul.md new file mode 100644 index 0000000..c1abd23 --- /dev/null +++ b/chapter/newline-used-for-nul.md @@ -0,0 +1,5 @@ +## NUL бʾ + +ļе NUL `\0`ڴбУ`\n`棬ڻռʾΪ `^@` + +Ϣο `man 7 ascii` `:h NL-used-for-Nul` \ No newline at end of file