diff --git a/chapter/Debugging-Syntax-Files.md b/chapter/Debugging-Syntax-Files.md new file mode 100755 index 0000000..4b38eb1 --- /dev/null +++ b/chapter/Debugging-Syntax-Files.md @@ -0,0 +1,15 @@ +## 语法文件调试 + +语法文件由于包含错误的或者复制的正则表达式,常常会使得Vim的运行较慢。如果Vim在编译的时候包含了`+profile` [feature](#what-kind-of-vim-am-i-running)特性,就可以给用户提供一个超级好用的`:syntime`命令。 + +```vim +:syntime on +" 多次敲击来重绘窗口,这样的话就会使得相应的语法规则被重新应用一次 +:syntime off +:syntime report +``` +输出结果包含了很多的度量维度。比如,你可以通过结果知道哪些正则表达式耗时太久需要被优化;哪些正则表达式一直在别使用但重来没有一次成功匹配。 + +请查阅`:h :syntime`。 + + diff --git a/chapter/Debugging-Vim-Scripts.md b/chapter/Debugging-Vim-Scripts.md new file mode 100755 index 0000000..640901e --- /dev/null +++ b/chapter/Debugging-Vim-Scripts.md @@ -0,0 +1,40 @@ +## Vim脚本调试 + +如果你以前使用过命令行调试器的话,对于`:debug`命令你很快就会感到熟悉。 + +只需要在任何其他命令之前加上`:debug`就会让你进入调试模式。也就是,被调试的Vim脚本会在第一行停止运行,同时该行会被显示出来。 + +想了解可用的6个调试命令,可以查阅`:h >cont`和阅读下面内容。需要指出的是,类似gdb和其他相似调试器,调试命令可以使用它们的简短形式:`c`、 `q`、`n`、`s`、 `i`和 `f`。 + +除了上面的之外,你还可以自由地使用任何Vim的命令。比如,`:echo myvar`,该命令会在当前的脚本代码位置和上下文上被执行。 + +只需要简单使用`:debug 1`,你就获得了[REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)调试特性。 + +当然,调试模式下是可以定义断点的,不然的话每一行都去单步调试就会十分痛苦。(断点之所以被叫做断点,是因为运行到它们的时候,运行就会停止下来。因此,你可以利用断点跳过自己不感兴趣的代码区域)。请查阅`:h :breakadd`、 `:h :breakdel`和 `:h :breaklist`获取更多细节。 + +假设你需要知道你每次在保存一个文件的时候有哪些代码在运行: + +```vim +:au BufWritePost +" signify BufWritePost +" * call sy#start() +:breakadd func *start +:w +" Breakpoint in "sy#start" line 1 +" Entering Debug mode. Type "cont" to continue. +" function sy#start +" line 1: if g:signify_locked +>s +" function sy#start +" line 3: endif +> +" function sy#start +" line 5: let sy_path = resolve(expand('%:p')) +>q +:breakdel * +``` + +正如你所见,使用``命令会重复之前的调试命令,也就是在该例子中的`s`命令。 + +`:debug`命令可以和[verbose](#verbosity)选项一起使用。 + diff --git a/chapter/List-Of-Colorschemes.md b/chapter/List-Of-Colorschemes.md new file mode 100755 index 0000000..716d05f --- /dev/null +++ b/chapter/List-Of-Colorschemes.md @@ -0,0 +1,20 @@ +# 配色方案列表 + +这儿列举了一些常用的Vim配色方案: + +- [acme-colors](https://github.com/plan9-for-vimspace/acme-colors) +- [base16](https://github.com/chriskempson/base16-vim) +- [gotham](https://github.com/whatyouhide/vim-gotham) +- [gruvbox](https://github.com/morhetz/gruvbox) +- [janah](https://github.com/mhinz/vim-janah) +- [jellybeans](https://github.com/nanotech/jellybeans.vim) +- [lucius](https://github.com/jonathanfilip/vim-lucius) +- [molokai](https://github.com/tomasr/molokai) +- [railscasts](https://github.com/jpo/vim-railscasts-theme) +- [seoul256](https://github.com/junegunn/seoul256.vim) +- [solarized](https://github.com/altercation/vim-colors-solarized) (或者它浅色衍生方案 [flattened](https://github.com/romainl/flattened)) +- [tomorrow](https://github.com/chriskempson/vim-tomorrow-theme) +- [vividchalk](https://github.com/tpope/vim-vividchalk) +- [yowish](https://github.com/kabbamine/yowish.vim) +- [zenburn](https://github.com/jnurmine/Zenburn) + diff --git a/chapter/List-Of-Plugins.md b/chapter/List-Of-Plugins.md new file mode 100755 index 0000000..b3b56d5 --- /dev/null +++ b/chapter/List-Of-Plugins.md @@ -0,0 +1,268 @@ +## 插件列表 + +#### [以功能区分](#以功能区分-1) + +- [文本对齐](#文本对齐) +- [构建和可疑代码标记](#构建和可疑代码标记) +- [代码补全](#代码补全) +- [Cycle](#cycle) +- [注释工具](#注释工具) +- [分割符](#分割符) +- [模糊搜索](#模糊搜索) +- [Grep 工具](#grep-工具) +- [缩进](#缩进) +- [文件导航](#文件导航) +- [代码片段](#代码片段) +- [状态栏](#状态栏) +- [文字环绕符](#文字环绕符) +- [记笔记](#记笔记) +- [文本对象](#文本对象) +- [Tmux](#tmux) +- [撤销历史](#撤销历史) +- [版本控制](#版本控制) +- [写作工具](#写作工具) +- [其他](#其他) + +#### [以文件类型区分](#以文件类型区分-1) + +- [C and C++](#c-and-c) +- [Clojure](#clojure) +- [Go](#go) +- [HTML](#html) +- [Java](#java) +- [Javascript](#javascript) +- [Lua](#lua) +- [Python](#python) +- [TeX](#tex) +- [VimL](#viml) + +## 以功能区分 + +#### 文本对齐 + +- [tabular](https://github.com/godlygeek/tabular) +- [vim-easy-align](https://github.com/junegunn/vim-easy-align) + +#### 构建和可疑代码标记 + +- [ale](https://github.com/w0rp/ale) +- [neomake](https://github.com/neomake/neomake) +- [syntastic](https://github.com/vim-syntastic/syntastic) + +#### 代码补全 + +- [VimCompletesMe](https://github.com/ajh17/VimCompletesMe) +- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) +- [completor.vim](https://github.com/maralla/completor.vim) +- [deoplete.nvim](https://github.com/Shougo/deoplete.nvim) +- [neocomplete.vim](https://github.com/Shougo/neocomplete.vim) +- [supertab](https://github.com/ervandew/supertab) +- [vim-mucomplete](https://github.com/lifepillar/vim-mucomplete) + +#### Cycle + +- [switch.vim](https://github.com/AndrewRadev/switch.vim) +- [vim-speeddating](https://github.com/tpope/vim-speeddating) + +#### 注释工具 + +- [nerdcommenter](https://github.com/scrooloose/nerdcommenter) +- [tcomment_vim](https://github.com/tomtom/tcomment_vim) +- [vim-commentary](https://github.com/tpope/vim-commentary) + +#### 分割符 + +- [auto-pairs](https://github.com/jiangmiao/auto-pairs) +- [delimitMate](https://github.com/Raimondi/delimitMate) +- [vim-endwise](https://github.com/tpope/vim-endwise) + +#### 模糊搜索 + +- [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) +- [unite.vim](https://github.com/Shougo/unite.vim) + +#### Grep 工具 + +- [ctrlsf.vim](https://github.com/dyng/ctrlsf.vim) +- [ferret](https://github.com/wincent/ferret) +- [vim-grepper](https://github.com/mhinz/vim-grepper) + +#### 缩进 + +- [indentLine](https://github.com/Yggdroot/indentLine) +- [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides) + +#### 文件导航 + +- [nerdtree](https://github.com/scrooloose/nerdtree) +- [tagbar](https://github.com/majutsushi/tagbar) +- [vim-dirvish](https://github.com/justinmk/vim-dirvish) +- [vim-easymotion](https://github.com/easymotion/vim-easymotion) +- [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_) + +见[fuzzy finders](#fuzzy-finders). + +#### 代码片段 + +- [neosnippet.vim](https://github.com/Shougo/neosnippet.vim) (_depends on other plugins_) +- [ultisnips](https://github.com/SirVer/ultisnips) +- [vim-snipmate](https://github.com/garbas/vim-snipmate) (_depends on other plugins_) +- [xptemplate](https://github.com/drmingdrmer/xptemplate) + +#### 状态栏 + +- [lightline.vim](https://github.com/itchyny/lightline.vim) +- [powerline](https://github.com/powerline/powerline) +- [vim-airline](https://github.com/vim-airline/vim-airline) +- [vim-flagship](https://github.com/tpope/vim-flagship) + +#### 文字环绕符 + +- [vim-operator-surround](https://github.com/rhysd/vim-operator-surround) +- [vim-sandwich](https://github.com/machakann/vim-sandwich) +- [vim-surround](https://github.com/tpope/vim-surround) + +#### 记笔记 + +- [vim-dotoo](https://github.com/dhruvasagar/vim-dotoo) +- [vim-journal](https://github.com/junegunn/vim-journal) +- [vim-notes](https://github.com/xolox/vim-notes) +- [vim-orgmode](https://github.com/jceb/vim-orgmode) +- [vim-pad](https://github.com/fmoralesc/vim-pad) +- [vimwiki](https://github.com/vimwiki/vimwiki) + +#### 文本对象 + +- [targets.vim](https://github.com/wellle/targets.vim) +- [vim-exchange](https://github.com/tommcdo/vim-exchange) +- [vim-textobj-user](https://github.com/kana/vim-textobj-user) + +#### Tmux + +- [tmux-complete.vim](https://github.com/wellle/tmux-complete.vim) +- [vim-dispatch](https://github.com/tpope/vim-dispatch) +- [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator) +- [vitality.vim](https://github.com/sjl/vitality.vim) + +#### 撤销历史 + +- [gundo.vim](https://github.com/sjl/gundo.vim) +- [undotree](https://github.com/mbbill/undotree) + +#### 版本控制 + +- [agit.vim](https://github.com/cohama/agit.vim) +- [committia.vim](https://github.com/rhysd/committia.vim) +- [gist-vim](https://github.com/mattn/gist-vim) +- [github-issues.vim](https://github.com/jaxbot/github-issues.vim) +- [gitv](https://github.com/gregsexton/gitv) +- [gv.vim](https://github.com/junegunn/gv.vim) +- [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) +- [vim-fugitive](https://github.com/tpope/vim-fugitive) +- [vim-gitgutter](https://github.com/airblade/vim-gitgutter) +- [vim-github-dashboard](https://github.com/junegunn/vim-github-dashboard) +- [vim-lawrencium](https://bitbucket.org/ludovicchabant/vim-lawrencium) +- [vim-signify](https://github.com/mhinz/vim-signify) +- [vimagit](https://github.com/jreybert/vimagit) + +#### 写作工具 + +- [vim-grammarous](https://github.com/rhysd/vim-grammarous) +- [vim-online-thesaurus](https://github.com/beloglazov/vim-online-thesaurus) + +#### 其他 + +- [CoVim](https://github.com/FredKSchott/CoVim) +- [FastFold](https://github.com/Konfekt/FastFold) +- [NrrwRgn](https://github.com/chrisbra/NrrwRgn) +- [calendar.vim](https://github.com/itchyny/calendar.vim) +- [goyo.vim](https://github.com/junegunn/goyo.vim) +- [sideways.vim](https://github.com/AndrewRadev/sideways.vim) +- [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim) +- [targets.vim](https://github.com/wellle/targets.vim) +- [unicode.vim](https://github.com/chrisbra/unicode.vim) +- [vim-bracketed-paste](https://github.com/ConradIrwin/vim-bracketed-paste) +- [vim-devicons](https://github.com/ryanoasis/vim-devicons) +- [vim-diminactive](https://github.com/blueyed/vim-diminactive) +- [vim-fixkey](https://github.com/drmikehenry/vim-fixkey) +- [vim-gnupg](https://github.com/jamessan/vim-gnupg) +- [vim-hackernews](https://github.com/ryanss/vim-hackernews) +- [vim-move](https://github.com/matze/vim-move) +- [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) +- [vim-projectionist](https://github.com/tpope/vim-projectionist) +- [vim-rsi](https://github.com/tpope/vim-rsi) +- [vim-startify](https://github.com/mhinz/vim-startify) +- [vim-unimpaired](https://github.com/tpope/vim-unimpaired) + +## 以文件类型区分 + +#### C and C++ + +- [a.vim](https://github.com/vim-scripts/a.vim) +- [clang_complete](https://github.com/Rip-Rip/clang_complete) +- [color_coded](https://github.com/jeaye/color_coded) +- [lh-cpp](https://github.com/LucHermitte/lh-cpp) + +#### Clojure + +- [paredit](https://github.com/kovisoft/paredit) +- [rainbow_parentheses.vim](https://github.com/junegunn/rainbow_parentheses.vim) +- [vim-clojure-highlight](https://github.com/guns/vim-clojure-highlight) +- [vim-fireplace](https://github.com/tpope/vim-fireplace) +- [vim-salve](https://github.com/tpope/vim-salve) +- [vim-sexp-mappings-for-regular-people](https://github.com/tpope/vim-sexp-mappings-for-regular-people) +- [vim-sexp](https://github.com/guns/vim-sexp) + +#### HTML + +- [emmet-vim](https://github.com/mattn/emmet-vim) +- [html5.vim](https://github.com/othree/html5.vim) + +#### Go + +- [gofmt.vim](https://github.com/tweekmonster/gofmt.vim) +- [hl-goimport.vim](https://github.com/tweekmonster/hl-goimport.vim) +- [vim-go](https://github.com/fatih/vim-go) +- [vim-godebug](https://github.com/jodosha/vim-godebug) + +#### Java + +- [vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2) + +#### Javascript + +- [es.next.syntax.vim](https://github.com/othree/es.next.syntax.vim) +- [javascript-libraries-syntax.vim](https://github.com/othree/javascript-libraries-syntax.vim) +- [node-vim-debugger](https://github.com/sidorares/node-vim-debugger) +- [tern_for_vim](https://github.com/ternjs/tern_for_vim) +- [vim-esformatter](https://github.com/millermedeiros/vim-esformatter) +- [vim-javascript-syntax](https://github.com/jelera/vim-javascript-syntax) +- [vim-javascript](https://github.com/pangloss/vim-javascript) +- [vim-node](https://github.com/moll/vim-node) +- [yajs.vim](https://github.com/othree/yajs.vim) + +#### Lua + +- [vim-lua-ftplugin](https://github.com/xolox/vim-lua-ftplugin) +- [vim-lua-inspect](https://github.com/xolox/vim-lua-inspect) + +#### Python + +- [braceless.vim](https://github.com/tweekmonster/braceless.vim) +- [impsort.vim](https://github.com/tweekmonster/impsort.vim) +- [jedi-vim](https://github.com/davidhalter/jedi-vim) +- [python-mode](https://github.com/klen/python-mode) +- [vim-flake8](https://github.com/nvie/vim-flake8) + +#### TeX + +- [vimtex](https://github.com/lervag/vimtex) + +#### VimL + +- [vim-scriptease](https://github.com/tpope/vim-scriptease) diff --git a/chapter/Newline-Used-For-NUL.md b/chapter/Newline-Used-For-NUL.md new file mode 100755 index 0000000..0a04ac8 --- /dev/null +++ b/chapter/Newline-Used-For-NUL.md @@ -0,0 +1,6 @@ +## 新行用于NUL + +一个文件中的NUL字符(`\0`),是以换行符(`\n`)在内存中被存储的同时在显示的时候以`^@`呈现。 + +查阅`man 7 ascii`和`:h NL-used-for-Nul`获取更多相关信息。 +