.vim
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:✌️ A modular (Neo)Vim configuration
# A [modular][] (Neo)Vim configuration!

Nearly every (Neo)Vim configuration you find online is composed of a single,
giant `vimrc` file.  But _this one is different_: it's [modular], relying on
(Neo)Vim's behavior of loading all `plugin/**/*.vim` files on startup to
cleanly partition your settings, mappings, bundles, and other configuration
into separate files that each focus on a single topic and _do one thing well_.

## Features

* Modularity of bundles, filetypes, colorschemes, and Vim settings.

* Lazy loading of filetype-specific bundles to start Vim up quickly.

* Parallel installation and updating of bundles from Git repositories.

* Easy upgrades with intelligent and automated Git conflict resolution.

* Shell scripts for bundle management: insert, delete, rename, and more.

## Organization



	* [Branches](#branches)
	* [Scripts](#scripts)
	* [Bundles](#bundles)
	* [Configs](#configs)
* [Dependencies](#dependencies)
* [Installation](#installation)
* [Usage](#usage)
	* [Bundling](#bundling)
	* [Updating](#updating)
	* [Tracking](#tracking)
	* [Locking](#locking)
* [Shortcuts](#shortcuts)
	* [Mnemonics](#mnemonics)
	* [Cheatsheet](#cheatsheet)
	* [Control](#control)
	* [Command](#command)
	* [Motion](#motion)
	* [Selection](#selection)
	* [Clipboard](#clipboard)
	* [Completion](#completion)
	* [Folding](#folding)
	* [URxvt integration](#urxvt-integration)
* [Manuals](#manuals)
	* [bin/clean](#binclean)
	* [bin/delete](#bindelete)
	* [bin/insert](#bininsert)
	* [bin/locate](#binlocate)
	* [bin/orphans](#binorphans)
	* [bin/rebase](#binrebase)
	* [bin/rebase-autocon](#binrebase-autocon)
	* [bin/rebase-stacked](#binrebase-stacked)
	* [bin/rename](#binrename)
	* [bin/rename-editor](#binrename-editor)
	* [bin/rename-fromto](#binrename-fromto)
	* [bin/setup](#binsetup)
	* [bin/update](#binupdate)
	* [bin/usage](#binusage)
	* [bin/usage-readme](#binusage-readme)
* [References](#references)
* [License](#license)



### Branches

* The **[origin]** branch is a "bare bones" template for anyone to start with.

* The **[basics]** branch is a rudimentary configuration of the Standard Vim.

* The **[qwerty]** branch is an enhanced configuration meant for QWERTY typists.

* The **[dvorak]** branch is an optimized configuration meant for Dvorak typists
  --- those who [type in Dvorak]( http://www.dvzine.org/zine/01-toc.html ).

* The **[engram]** branch is an optimized configuration meant for Engram typists
  --- those who type in [Arno's Engram keyboard layout]( https://engram.dev ).

* The **[master]** branch is the frontier, where I experiment with new plugins.

[origin]: https://github.com/sunaku/.vim/tree/origin#readme
[basics]: https://github.com/sunaku/.vim/tree/basics#readme
[qwerty]: https://github.com/sunaku/.vim/tree/qwerty#readme
[dvorak]: https://github.com/sunaku/.vim/tree/dvorak#readme
[engram]: https://github.com/sunaku/.vim/tree/engram#readme
[master]: https://github.com/sunaku/.vim/tree/master#readme

### Scripts

* `bin/*` scripts automate common tasks.  See below for their usage manuals.

### Bundles

* `**/*.get` files specify URLs of Git repositories to clone for your bundles.

* `**/*.set` files specify branch names or commit SHAs to check out from Git.

* `**/*.run` files specify shell commands to run after updating your bundles.

* `bundle/*/*/` directories are eagerly loaded Vim scripts; see [Unbundle].

* `ftbundle/*/*/` directories are lazily loaded, filetype-specific bundles.

### Configs

* `plugin/**/*.vim` configure Vim _before_ it finishes starting up.

* `bundle/*/*.vim` configure your bundles _before_ they are loaded.

* `ftbundle/*/*.vim` configure your ftbundles _before_ they are loaded.

* `ftplugin/{*,/*}.vim` configure your filetypes _when_ they are loaded.

* `after/colors/*.vim` configure your colorschemes _after_ they are applied.

* `after/plugin/**/*.vim` configure Vim _after_ all of the above is finished.

## Dependencies

* [Vim](http://www.vim.org/) 7+ or [NeoVim](https://neovim.io/) 0.1+

* [Git](http://git-scm.com/) 1.5+

* [POSIX](http://pubs.opengroup.org/onlinepubs/9699919799/) environment
  (Linux, BSD, MacOSX, etc.)

    Special note to Microsoft Windows users: simply

    * replace `~/.vim` with `%USERPROFILE%\vimfiles`
    * replace `~/.vimrc` with `%USERPROFILE%\_vimrc`

    in all commands listed throughout this document.

* [xargs](http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/xargs.1)
  with support for the `-r` command-line option:

    > Do not run the command if there are no arguments.  Normally the
    > command is executed at least once even if there are no arguments.

[Unbundle]: https://github.com/sunaku/vim-unbundle

## Installation

Backup your configuration:

    mv ~/.vim ~/.vim.bak
    mv ~/.config/nvim ~/.config/nvim.bak # for NeoVim

Install this configuration:

    git clone https://github.com/sunaku/.vim.git ~/.vim
    ln -s ~/.vim ~/.config/nvim  # for NeoVim
    cd ~/.vim
    bin/setup

Select a Git branch to use:

    bin/setup origin  # template
    bin/setup basics  # template + basics
    bin/setup qwerty  # template + basics + my flair
    bin/setup dvorak  # template + basics + my flair + dvorak
    bin/setup engram  # template + basics + my flair + engram
    bin/setup master  # template + basics + my flair + engram + new stuff

## Usage

See usage information:

    bin/usage

See usage information for provided *SCRIPT*:

    bin/usage SCRIPT

### Bundling

Add bundle from *URL* under *CATEGORY*:

    bin/insert URL bundle/CATEGORY

Add bundle from *URL* under *CATEGORY* with *BUNDLE_NAME*:

    bin/insert URL bundle/CATEGORY/BUNDLE_NAME

Add ftbundle from *URL* for *FILETYPE*:

    bin/insert URL ftbundle/FILETYPE

Add ftbundle from *URL* for *FILETYPE* with *BUNDLE_NAME*:

    bin/insert URL ftbundle/FILETYPE/BUNDLE_NAME

Add bundle from Github *USER*/*REPO* under *CATEGORY*:

    bin/insert USER/REPO bundle/CATEGORY

Add bundle from Github *USER*/*REPO* under *CATEGORY* with *BUNDLE_NAME*:

    bin/insert USER/REPO bundle/CATEGORY/BUNDLE_NAME

Add ftbundle from Github *USER*/*REPO* for *FILETYPE*:

    bin/insert USER/REPO ftbundle/FILETYPE

Add ftbundle from Github *USER*/*REPO* for *FILETYPE* with *BUNDLE_NAME*:

    bin/insert USER/REPO ftbundle/FILETYPE/BUNDLE_NAME

Rename bundles with names matching *BUNDLE_NAME* (regexp):

    bin/rename BUNDLE_NAME

Rename all bundles from the comfort of Vim:

    bin/rename-editor BUNDLE_NAME

Rename a `*.get` file from its current name to a new one:

    bin/rename-fromto CURRENT_GET_FILE NEW_GET_FILE

Delete bundles with names matching *BUNDLE_NAME* (regexp):

    bin/delete BUNDLE_NAME

Lists untracked `*.get` files and bundles lacking `*.get` files:

    bin/orphans

Deletes untracked `*.get` files and bundles lacking `*.get` files:

    bin/clean        # asks you for confirmation
    bin/clean -f     # no confirmation; force it

### Updating

Update installed bundles and ftbundles:

    bin/update

Update this Vim configuration framework:

    bin/rebase      # asks to confirm bin/clean
    bin/rebase -f   # no confirmation; force it

Do all that periodically via crontab(1):

    @daily cd ~/.vim && bin/rebase -f && bin/update

### Tracking

Track a certain Git *BRANCH* by creating a `*.set` file for your *BUNDLE*:

    echo BRANCH > BUNDLE.set

Remove *BRANCH* tracking for your *BUNDLE* by deleting its `*.set` file:

    rm BUNDLE.set

### Locking

Lock a *BUNDLE* to a certain Git *COMMITISH* to prevent it from being updated:

    cd BUNDLE
    git checkout COMMITISH

Unlock a locked *BUNDLE*, so it can be updated, by checking out its `master`:

    cd BUNDLE
    git checkout master

## Shortcuts

This branch of the Vim configuration defines the following shortcuts, which
assume that you type in [Arno's Engram keyboard layout]( https://engram.dev ).
If this assumption doesn't apply to you, then try the [qwerty] branch instead.

* `,` is the ``, used in _some_ shortcuts in this configuration.

* `` (space bar) precedes _most_ shortcuts in this configuration.
  Press it and wait a moment to view a searchable menu of all shortcuts.
  To use it in a `:normal` command, type `` twice and then ``:

  ```vim
  :normal ^V ic
  ```

* `` immediately opens a searchable menu of all shortcuts.

### Mnemonics

Inspired by the "verb then subject" design of Vim's own normal mode shortcuts,
I have attempted to mirror its mnemonic devices in my own `` shortcuts:

| Shortcuts  | Key      | Mnemonic        | Same as Vim? |
| ---------- | -------- | --------------- | ------------ |
| `a` | a        | **a**ppend      | Yes          |
| `o` | o        | **o**pen        | Yes          |
| `e` | e        | **e**xpose      | No           |
| `u` | u        | **u**ndo        | Yes          |
| `i` | i        | **i**nsert      | Yes          |
| `d` | d        | **d**elete      | Yes          |
| `h` | h        | diff (**h**unk) | No           |
| `t` | t        | **t**oggle      | No           |
| `n` | n        | **n**ext        | Yes          |
| `w` | w        | **w**rite       | No           |
| `v` | v        | **v**isual      | Yes          |
| `z` | z        | fold            | Yes          |
| `,` | ,        | execute         | No           |
| `.` | .        | repeat          | Yes          |
| `p` | p        | **p**aste       | Yes          |
| `y` | y        | **y**ank        | Yes          |
| `f` | f        | **f**ormat      | No           |
| `c` | c        | **c**hange      | Yes          |
| `r` | r        | **r**ead        | No           |

### Cheatsheet

This table is *always* available (and searchable) in Vim: press **space bar** twice!

Shortcut              | Description
--------              | -----------
``-``                 | (EasyMotion) Repeat last motion forward.
``0gt``               | expose last tab
``1gt``               | expose first tab
``2gt``               | expose tab 2
``3gt``               | expose tab 3
``4gt``               | expose tab 4
``5gt``               | expose tab 5
``6gt``               | expose tab 6
``7gt``               | expose tab 7
``8gt``               | expose tab 8
``9gt``               | expose tab 9
````             | (Coc) Jump to next placeholder in snippet expansion.
````             | (Coc) Jump to previous placeholder in snippet expansion.
````             | exit/quit vim
````             | strip trailing whitespace in buffer and write buffer to file
````     | exit/quit vim forcefully
``k`` | (dasht) search ALL the docsets at command prompt
``K`` | (dasht) search ALL the docsets for cursor word or selected text
````  | minimum window height
````  | minimum window width
```` | maximum window width
````    | maximum window height
``[[``        | (blockinsert) blockwise surround at start and end of line
``[]``        | (blockinsert) blockwise insert at start then end of line
``]]``        | (blockinsert) blockwise surround at start and end of line
``a``         | (blockinsert) blockwise append at end of line
``b``         | (CamelCaseMotion) go to start of current word in camel/snake case
``e``         | (CamelCaseMotion) go to end of current word in camel/snake case
``gd``        | (Coc) Open the definition of the symbol under the cursor.
``ge``        | (CamelCaseMotion) go to end of previous word in camel/snake case
``gi``        | (Coc) Open the implementation of the symbol under the cursor.
``gR``        | (Coc) Open the references of the symbol under the cursor.
``gy``        | (Coc) Open the type definition of the symbol under the cursor.
``i``         | (blockinsert) blockwise insert at start of line
``k``         | (dasht) search related docsets at command prompt
``K``         | (dasht) search related docsets for cursor word or selected text
``o``         | switch to most recently focused tab
``p``         | paste after cursor, adding a space
``P``         | paste before cursor, adding a space
``q[[``       | (blockinsert) blockwise execute at start and end of line
``q[]``       | (blockinsert) blockwise execute at start then end of line
``q]]``       | (blockinsert) blockwise execute at start and end of line
``qa``        | (blockinsert) blockwise execute at end of line
``qi``        | (blockinsert) blockwise execute at start of line
``tb``        | (test) run all tests in buffer
``tn``        | (test) run test under cursor
``ts``        | (test) run all tests in suite
``tt``        | (test) repeat recent test run
``tv``        | (test) expose recently ran test
``w``         | (CamelCaseMotion) go to start of next word in camel/snake case
````          | decrease window height
````          | decrease window width
````         | increase window width
````            | increase window height
``!T``         | (table-mode) evaluate "tmf:" formula line
``$t``         | move tab to last place
``*g``         | (fugitive) git grep: search repository for word under cursor
``+w``         | increase window size
``-w``         | decrease window size
``//``         | (fuzzysearch) fuzzy-regex search in buffer
``/d``         | (clap) find line under working directory
``/g``         | (fugitive) git grep: search repository
``0T``         | (table-mode) sort current column at cursor
``0w``         | minimum window size
``1T``         | (table-mode) add fomula for current table cell
``1w``         | maximum window size
````    | show shortcut menu and run chosen shortcut
``=c``         | (NERDCommenter) comment, aligning both delimiters
``=T``         | (table-mode) realign table columns
``=w``         | (visual-split) resize window to selection
``>t``         | move tab right
``?g``         | (fugitive) git grep: search repository for Vim search pattern
``^t``         | move tab to first place
````           | fallback to shortcut menu on partial entry
``ac``         | (NERDCommenter) append comment at end of line
``Ac``         | (NERDCommenter) comment from cursor to end of line
``aC``         | (NERDCommenter) comment, nesting
``ag``         | (fugitive) git commit --amend
``Ag``         | (fugitive) git commit --amend --reuse-message=HEAD
``at``         | append new tab
``At``         | append new tab in last place
``aw``         | split window right
``c*``         | (traces) interactive search and replace for word at cursor
``c/``         | (traces) interactive search and replace in selection or buffer
``c?``         | (abolish) interactive search and replace in selection or buffer
``cf``         | (eunuch) rename file
``Cg``         | (fugitive) git mv -f: rename file forcefully
``cg``         | (fugitive) git mv: rename file
``cq``         | (qfreplace) interactively change lines in quickfix window
``d$``         | (better-whitespace) strip trailing whitespace in buffer
``db``         | (sayonara) close buffer while retaining window
``DB``         | (wipeout) destroy all buffers not open in any tabs or windows
``Db``         | close all buffers
``dc``         | (NERDCommenter) uncomment, deleting comment delimiters
``dE``         | (errormarker) remove all error markers from signcolumn
``df``         | (eunuch) prompt to delete file
``Dg``         | (fugitive) git rm -f: delete file from repository forcefully
``dg``         | (fugitive) git rm: delete file from repository
``DT``         | (table-mode) delete current column or [count] right columns
``dT``         | (table-mode) delete current row or [count] rows
``Dt``         | close other tabs
``dt``         | close tab
``Dw``         | close other windows
``dw``         | close window
``Dz``         | close all other folds in buffer
``e/``         | (fzf) repeat search from history
``e:``         | (fzf) run command from menu
``e;``         | (fzf) repeat command from history
``e``   | (fzf) trigger mapping / keybinding / shortcut
``ea``         | (projectionist) expose alternate file
``eA``         | (projectionist) expose available projections
``ec``         | (clap) apply colorscheme
``eD``         | (NERDTree) find current buffer in tree
``ed``         | (NERDTree) open tree and focus it
``ee``         | (clap) expose clap providers
``eE``         | (errormarker) expose error message for cursor position
``eF``         | (fzf) apply filetype
``Ef``         | edit file as...
``Eg``         | (fugitive) return to editing git buffer
``eg``         | (fzf) browse git log
``eG``         | (fzf) browse git log for buffer
``ej``         | (clap) expose jumplist
``eL``         | (fzf) expose line in any buffer
``el``         | (fzf) expose line in buffer
``em``         | (clap) expose mark in buffer
``eQ``         | (clap) expose location list
``eq``         | (clap) expose quickfix list
``er``         | (clap) expose registers
``et``         | (fzf) expose tag in any buffer
``eT``         | (fzf) expose tag in buffer
``Et``         | (taglist) show tag name at cursor
``ew``         | (fzf) expose window in any tab
``ex``         | (scratch) expose scratch buffer
``ey``         | (clap) expose yanks
``f"``         | convert single to double quotes at cursor
``f'``         | convert double to single quotes at cursor
``f(``         | format function call, removing parentheses
``f)``         | format function call, adding parentheses
``f-``         | format as separator, appending minus signs to end of line
``f1``         | format as markdown title heading ``

`` ``f2`` | format as markdown section heading ``

`` ``f:`` | format ruby quotes to symbol at cursor ``f;`` | format ruby symbol to quotes at cursor ``f`` | indent with spaces in buffer ``f`` | indent with tabs in buffer ``f=`` | format as separator, appending equal signs to end of line ``f_`` | format as separator, repeating last character to end of line ``fa`` | (argwrap) toggle multi-line syntax at cursor ``fA`` | (FIGlet) decorate {motion} or visual selection as ASCII art ``fC`` | (FIGlet) comment {motion} or visual selection as ASCII art ``fc`` | format as markdown fenced code block ``fh`` | format line as comment section, surrounding with blank comment lines ``fH`` | format line as comment section, surrounding with minus sign separators ``fJ`` | format elixir pipeline at cursor: join into a single line ``fK`` | format elixir pipeline at cursor: split into multiple lines ``fP`` | format elixir function call to pipeline at cursor ``fp`` | format elixir pipeline to function call at cursor ``fs`` | (switch) cycle through alternate syntax at cursor ``fT`` | (table-mode) tabelize selection, using \| as delimiter ``FT`` | (table-mode) tableize selection, asking for delimiter ``ft`` | format as markdown table heading ```` ``GG`` | (fugitive) git blame: who changed which line ``gg`` | (fugitive) open git status window ``gh`` | (GitGutter) preview git hunk at cursor ``gT`` | (table-mode) inspect table, for defining formulas ``h,`` | diff obtain hunk from left window ``h.`` | diff obtain hunk from right window ``h<`` | diff put hunk into left window ``h>`` | diff put hunk into right window ``ha`` | (conflict-marker) resolve merge conflict by keeping both versions ``hb`` | diff buffer against original version ``hg`` | (fugitive) git diff: show changes against repository ``hn`` | (conflict-marker) resolve merge conflict by deleting both versions ``ho`` | (conflict-marker) resolve merge conflict by keeping our version ``ht`` | (conflict-marker) resolve merge conflict by keeping their version ``Ic`` | (NERDCommenter) comment, aligning left delimiter ``ic`` | (NERDCommenter) comment, inserting comment delimiters ``iC`` | (NERDCommenter) comment, minimally ``IC`` | (NERDCommenter) comment, sexily ``iD`` | (projectionist) change buffer's working directory to innermost root ``id`` | (projectionist) change working directory to innermost root ``if`` | (projectionist) create file relative to innermost root ``ig`` | (fugitive) git commit: record new commit ``it`` | insert new tab ``It`` | insert new tab in first place ``iw`` | split window left ``Ix`` | (scratch) clear scratch buffer and enter insert mode in it ``ix`` | (scratch) enter insert mode in scratch buffer ``nt`` | expose next tab ``Nt`` | expose previous tab ``o.`` | (fzf) reopen file from history ``ob`` | (fzf) open buffer ``Od`` | (unite) expose filer in buffer's directory ``od`` | (unite) expose filer in working directory ``Of`` | (fzf) open file under buffer's directory ``of`` | (fzf) open file under working directory ``og`` | (fzf) open git file (tracked by git) ``oG`` | (fzf) open git file that has changes ``oh`` | (fzf) open help topic ``oH`` | (helpful) search for helptags and display Vim version information ``Ow`` | (visual-split) split window above ``ow`` | (visual-split) split window below ``ox`` | (slimux) select target pane interactively ``Pc`` | (NERDCommenter) duplicate above cursor and comment ``pc`` | (NERDCommenter) duplicate below cursor and comment ``pp`` | paste after cursor, adding an extra newline ``pP`` | paste after cursor, surrounding with newlines ``PP`` | paste before cursor, adding an extra newline ``Pp`` | paste before cursor, surrounding with newlines ``pw`` | (windowswap) paste window ``q.`` | (coc-fzf) Continue listing ``q`` | (coc-fzf) expose Coc functionality ``qa`` | (Coc) Perform codeAction of selected region. ``qa`` | (coc-clap) Show actions ``qc`` | (coc-clap) Show commands ``qd`` | (coc-fzf) Show all diagnostics ``qD`` | (coc-fzf) Show diagnostics for current buffer ``qe`` | (coc-clap) Manage extensions ``qf`` | (Coc) Perform autofix of issue at cursor line. ``qi`` | (coc-marketplace) Show available plugins for installation ``qj`` | (Coc) Do default action for next item. ``qk`` | (Coc) Do default action for previous item. ``ql`` | (coc-fzf) expose Coc location ``qn`` | (Coc) Rename the symbol under the cursor. ``qo`` | (coc-fzf) Find symbol of current document ``qp`` | (Coc) Resume latest coc list ``qq`` | (coc-clap) expose Coc services ``qs`` | (coc-fzf) Search workspace symbols ``qv`` | (Coc) Format the selected region of code. ``qy`` | (coc-fzf) Show yank history ``rB`` | (projectionist) replace buffer with "new file" template ``rb`` | reload buffer from file ``Rb`` | reload buffer from file forcefully ``rd`` | (NERDTree) refresh tree from root node ``Rg`` | (fugitive) git checkout -f: revert buffer to repository forcefully ``rg`` | (fugitive) git checkout: revert buffer to repository ``rh`` | (GitGutter) revert git hunk at cursor ``t#`` | (colorizer) toggle hex color code highlighting ``t>`` | (indentLine) toggle indentation lines ``tc`` | (NERDCommenter) invert comment markers ``tC`` | (NERDCommenter) toggle comment markers ``td`` | (NERDTree) toggle tree visibility ``tg`` | (Twiggy) toggle git control panel ``tH`` | (GitGutter) toggle git hunk highlighting ``th`` | (GitGutter) toggle git hunk signs ``tl`` | (ListToggle) toggle location list ``tq`` | (ListToggle) toggle quickfix list ``tT`` | (table-mode) toggle table mode for current buffer ``tt`` | (taglist) toggle tags sidebar ``tu`` | (undotree) toggle undo history tree sidebar ``tv`` | (goyo) toggle distraction-free writing mode ``tV`` | (limelight) toggle enhancement for distraction-free writing mode ``tx`` | (scratch) toggle scratch buffer preview ``Uw`` | (undoclosewin) show history of recently closed windows ``uw`` | (undoclosewin) undo/restore most recently closed window ``vb`` | visually select entire buffer ``wb`` | write buffer to file ``Wb`` | write buffer to file forcefully ``Wg`` | (fugitive) git add -f: stage all changes in buffer forcefully ``wg`` | (fugitive) git add: stage all changes in buffer ``wh`` | (GitGutter) stage git hunk at cursor ``Wx`` | (slimux) send entire buffer to target pane ``wx`` | (slimux) send line or selection to target pane ``xf`` | (Xtract) extract selection into relative file ``xv`` | (ExtractToVariable) extract selection into variable assignment ``yb`` | yank buffer contents ``yc`` | (NERDCommenter) yank then comment ``Yf`` | save copy of file as... ``yf`` | save file as... ``yw`` | (windowswap) yank window ``Yx`` | (scratch) clear scratch buffer and yank selection to it ``yx`` | (scratch) yank selection to scratch buffer ``zR`` | (narrow) widen view / disable narrowing ``zv`` | (narrow) narrow view to selection ``~c`` | (NERDCommenter) toggle alternate comment delimiters ``=p`` | (unimpaired) Paste after cursor, linewise, reindenting. ``=P`` | (unimpaired) Paste before cursor, linewise, reindenting. ``>p`` | (unimpaired) Paste after cursor, linewise, increasing indent. ``>P`` | (unimpaired) Paste before cursor, linewise, increasing indent. ``[%`` | (indentwise) go to starting line of same indent, ascending [count] indents ``[+`` | (indentwise) go to previous line of deeper indent ``[-`` | (indentwise) go to previous line of lesser indent ``[`` | (unimpaired) go to previous file with locations ``[`` | (unimpaired) go to previous file with quickfixes ``[`` | (unimpaired) Add [count] blank lines above the cursor. ``[=`` | (indentwise) go to previous line of same indent, crossing different indents ``[\|`` | (table-mode) move cursor to previous table cell ``[_`` | (indentwise) go to previous line of [count] indent ``[A`` | (unimpaired) go to first argument ``[a`` | (unimpaired) go to previous argument ``[B`` | (unimpaired) go to first buffer ``[b`` | (unimpaired) go to previous buffer ``[D`` | (quickfix) list definitions of word at cursor from top of file ``[e`` | (unimpaired) Exchange current line with [count] lines above it. ``[f`` | (unimpaired) go to previous file in current file's directory ``[h`` | (GitGutter) jump to previous git hunk ``[I`` | (quickfix) list occurences of word at cursor from top of file ``[L`` | (unimpaired) go to first location ``[l`` | (unimpaired) go to previous location ``[n`` | (unimpaired) go to previous conflict marker or diff/patch hunk ``[ob`` | (unimpaired) enable assuming light background ``[oC`` | (HiCterm) enable cterm color code highlighting ``[oc`` | (unimpaired) enable highlighting cursor's line ``[od`` | (unimpaired) enable diffing with current buffer ``[oh`` | (unimpaired) enable highlighting search results ``[oi`` | (unimpaired) enable ignoring case sensitivity ``[ol`` | (unimpaired) enable listing nonprintable characters ``[on`` | (unimpaired) enable absolute line numbering ``[op`` | (unimpaired) Paste before cursor, linewise, using paste mode. ``[or`` | (unimpaired) enable relative line numbering ``[os`` | (unimpaired) enable checking for misspelled words ``[ou`` | (unimpaired) enable highlighting cursor's column ``[ov`` | (unimpaired) enable constraining cursor to line ``[ow`` | (unimpaired) enable wrapping very long lines ``[ox`` | (unimpaired) enable highlighting cursor's position ``[P`` | (unimpaired) Paste after cursor, linewise. ``[p`` | (unimpaired) Paste after cursor, linewise. ``[Q`` | (unimpaired) go to first quickfix ``[q`` | (unimpaired) go to previous quickfix ``[T`` | (unimpaired) go to first ctag ``[t`` | (unimpaired) go to previous ctag ``[u`` | (unimpaired) URL escape. ``[uu`` | (unimpaired) URL escape current line. ``[v`` | move cursor up as far as possible inside vertical column ``[w`` | (Coc) Go to previous diagnostic callout. ``[x`` | (unimpaired) XML escape. ``[xx`` | (unimpaired) XML escape current line. ``[y`` | (unimpaired) String escape. ``[yy`` | (unimpaired) String escape current line. ``\|\|`` | (table-mode) expand borders of table header ``\|`` | (table-mode) trigger table creation in table mode ``]%`` | (indentwise) go to ending line of same indent, descending [count] indents ``]+`` | (indentwise) go to next line of deeper indent ``]-`` | (indentwise) go to next line of lesser indent ``]`` | (unimpaired) go to next file with locations ``]`` | (unimpaired) go to next file with quickfixes ``]`` | (unimpaired) Add [count] blank lines below the cursor. ``]=`` | (indentwise) go to next line of same indent, crossing different indents ``]\|`` | (table-mode) move cursor to next table cell ``]_`` | (indentwise) go to next line of [count] indent ``]A`` | (unimpaired) go to last argument ``]a`` | (unimpaired) go to next argument ``]B`` | (unimpaired) go to last buffer ``]b`` | (unimpaired) go to next buffer ``]D`` | (quickfix) list definitions of word at cursor from here onward ``]e`` | (unimpaired) Exchange current line with [count] lines below it. ``]f`` | (unimpaired) go to next file in current file's directory ``]h`` | (GitGutter) jump to next git hunk ``]I`` | (quickfix) list occurences of word at cursor from here onward ``]L`` | (unimpaired) go to last location ``]l`` | (unimpaired) go to next location ``]n`` | (unimpaired) go to next conflict marker or diff/patch hunk ``]ob`` | (unimpaired) disable assuming light background ``]oC`` | (HiCterm) disable cterm color code highlighting ``]oc`` | (unimpaired) disable highlighting cursor's line ``]od`` | (unimpaired) disable diffing with current buffer ``]oh`` | (unimpaired) disable highlighting search results ``]oi`` | (unimpaired) disable ignoring case sensitivity ``]ol`` | (unimpaired) disable listing nonprintable characters ``]on`` | (unimpaired) disable absolute line numbering ``]op`` | (unimpaired) Paste after cursor, linewise, using paste mode. ``]or`` | (unimpaired) disable relative line numbering ``]os`` | (unimpaired) disable checking for misspelled words ``]ou`` | (unimpaired) disable highlighting cursor's column ``]ov`` | (unimpaired) disable constraining cursor to line ``]ow`` | (unimpaired) disable wrapping very long lines ``]ox`` | (unimpaired) disable highlighting cursor's position ``]P`` | (unimpaired) Paste before cursor, linewise. ``]p`` | (unimpaired) Paste before cursor, linewise. ``]Q`` | (unimpaired) go to last quickfix ``]q`` | (unimpaired) go to next quickfix ``]T`` | (unimpaired) go to last ctag ``]t`` | (unimpaired) go to next ctag ``]u`` | (unimpaired) URL unescape. ``]uu`` | (unimpaired) URL unescape current line. ``]v`` | move cursor down as far as possible inside vertical column ``]w`` | (Coc) Go to next diagnostic callout. ``]x`` | (unimpaired) XML unescape. ``]xx`` | (unimpaired) XML unescape current line. ``]y`` | (unimpaired) String unescape. ``]yy`` | (unimpaired) String unescape current line. ``_`` | (EasyMotion) Repeat last motion backward. ``c`` | change text starting at cursor ``cop`` | toggle verbatim paste mode ``coQ`` | toggle automatic formatting in buffer ``coz`` | toggle code folding in buffer ``cS`` | (sandwich) change automatic delimiters surrounding specified motion ``cs`` | (sandwich) change specified delimiters surrounding specified motion ``dmx`` | (signature) Remove mark 'x' where x is a-zA-Z ``dS`` | (sandwich) delete automatic delimiters surrounding specified motion ``ds`` | (sandwich) delete specified delimiters surrounding specified motion ``F`` | (EasyMotion) Jump backward, landing on top of {char}. ``f`` | (EasyMotion) Jump forward, landing on top of {char}. ``g!`` | (scriptease) evaluate motion or selection as VimL and replace ``g<`` | (swap) swap delimited item to the left ``g=`` | (swap) enter interactive swapping mode ``g>`` | (swap) swap delimited item to the right ``gA`` | (SyntaxAttr) inspect syntax highlighting group at cursor ``ga`` | inspect Unicode for character at cursor ``gF`` | open file location (path:line,column) at cursor or in selection ``gG`` | inspect function, method, or class name at cursor ``gJ`` | (splitjoin) join lines at cursor into a single lines ``gK`` | (splitjoin) split line at cursor into multiple lines ``gl`` | (lion) left-align {motion} to [count] occurrences of {character} ``gL`` | (lion) right-align {motion} to [count] occurrences of {character} ``gr`` | Replace {motion} text with the contents of specified register. ``grr`` | Replace [count] lines with the contents of specified register. ``gS`` | (sandwich) surround inside automatic delimiters with specified delimiters ``gs`` | (sandwich) surround selection or specified motion with specified delimiters ``K`` | (Coc) Open the documentation of the symbol under the cursor. ``m'[`` | (signature) Jump by alphabetical order to start of prev line having a mark ``m']`` | (signature) Jump by alphabetical order to start of next line having a mark ``m,`` | (signature) Place the next available mark ``m-`` | (signature) Delete all marks from the current line ``m.`` | (signature) If no mark on line, place the next available mark. Otherwise, remove (first) existing mark. ``m/`` | (signature) Open location list and display marks from current buffer ``m`` | (signature) Remove all markers ``m`` | (signature) Remove all markers of the same type ``m`` | (signature) Delete all marks from the current buffer ``m?`` | (signature) Open location list and display markers from current buffer ``m['`` | (signature) Jump to start of prev line containing a mark ``m[-`` | (signature) Jump to prev line having a marker of the same type ``m[0-9]`` | (signature) Toggle the corresponding marker !@#$%^&*() ``m[=`` | (signature) Jump to prev line having a marker of any type ``m[`​`` | (signature) Jump to prev mark ``m]'`` | (signature) Jump to start of next line containing a mark ``m]-`` | (signature) Jump to next line having a marker of the same type ``m]=`` | (signature) Jump to next line having a marker of any type ``m]`​`` | (signature) Jump to next mark ``m`​[`` | (signature) Jump by alphabetical order to prev mark ``m`​]`` | (signature) Jump by alphabetical order to next mark ``mx`` | (signature) Toggle mark 'x' and display it in the leftmost column ``s.`` | (EasyMotion) Repeat last motion, including last search target. ``s1`` | (EasyMotion) Find {char} forward and backward. ``s2`` | (EasyMotion) Search for 2 characters in current window. ``s3`` | (EasyMotion) Search for N characters in current window. ``S`` | (EasyMotion) Jump anywhere in current line. ``sa`` | (EasyMotion) Find {char} in all open windows. ``sB`` | (EasyMotion) Beginning of WORD backward. ``sb`` | (EasyMotion) Beginning of word backward. ``sE`` | (EasyMotion) End of WORD forward. ``se`` | (EasyMotion) End of word forward. ``sF`` | (EasyMotion) Find {char} to the left. ``sf`` | (EasyMotion) Find {char} to the right. ``sge`` | (EasyMotion) End of word backward. ``sgE`` | (EasyMotion) End of WORD backward. ``sj`` | (EasyMotion) Line downward. ``sk`` | (EasyMotion) Line upward. ``sl`` | (EasyMotion) Beginning of line in all windows. ``sN`` | (EasyMotion) Jump to latest "/" or "?" backward. ``sn`` | (EasyMotion) Jump to latest "/" or "?" forward. ``so`` | (EasyMotion) Beginning of word in all windows. ``ss`` | (EasyMotion) Jump anywhere in current window. ``sT`` | (EasyMotion) Till after the {char} to the left. ``st`` | (EasyMotion) Till before the {char} to the right. ``sW`` | (EasyMotion) Beginning of WORD forward. ``sw`` | (EasyMotion) Beginning of word forward. ``T`` | (EasyMotion) Jump backward, landing just after {char}. ``t`` | (EasyMotion) Jump forward, landing just before {char}. ``va"`` | (textobj) select around double quotes ``va'`` | (textobj) select around single quotes ``va(`` | (textobj) select around () block ``va:`` | (textobj) select around Ruby symbol ``va<`` | (textobj) select around ``<>`` block ``va`` | (textobj) select around whitespace ``va>`` | (textobj) select around ``<>`` block ``va[`` | (textobj) select around [] block ``va\|`` | (textobj) select around table cell (table-mode) ``va]`` | (textobj) select around [] block ``va`​`` | (textobj) select around back quotes ``vab`` | (textobj) select around () block ``vaB`` | (textobj) select around {} block ``vaC`` | (textobj) select around comment and leading/trailing whitespace ``vac`` | (textobj) select around comment, including comment delimiters ``vad`` | (textobj) select around delimited text ``vaD`` | (textobj) select around delimited text, per alternate grouping ``vaf`` | (textobj) select outer function call ``vah`` | (textobj) select around git hunk ``vai`` | (textobj) select around indentation level and line above ``vaI`` | (textobj) select around indentation level and lines above/below ``vaK`` | (textobj) select around vertical WORD column ``vak`` | (textobj) select around vertical word column ``val`` | (textobj) select around line ``vam`` | (textobj) select around merge conflict ``van`` | (textobj) select around nearest block of specified delimiter ``vap`` | (textobj) select around paragraph ``vaP`` | (textobj) select around sentence ``var`` | (textobj) select around Ruby/VimL block ``vaS`` | (textobj) select around text surrounded by automatic delimiters ``vas`` | (textobj) select around text surrounded by specified delimiters ``vat`` | (textobj) select around XML tag ``vau`` | (textobj) select around URL ``vav`` | (textobj) select around variable name ``vaW`` | (textobj) select around WORD ``vaw`` | (textobj) select around word ``vax`` | (textobj) select around XML attribute ``vay`` | (textobj) select around syntax element ``va{`` | (textobj) select around {} block ``va}`` | (textobj) select around {} block ``vi"`` | (textobj) select inside double quotes ``vi'`` | (textobj) select inside single quotes ``vi(`` | (textobj) select inside () block ``vi:`` | (textobj) select inside Ruby symbol ``vi<`` | (textobj) select inside ``<>`` block ``vi`` | (textobj) select inside whitespace ``vi>`` | (textobj) select inside ``<>`` block ``vi[`` | (textobj) select inside [] block ``vi\|`` | (textobj) select inside table cell (table-mode) ``vi]`` | (textobj) select inside [] block ``vi`​`` | (textobj) select inside back quotes ``vib`` | (textobj) select inside () block ``viB`` | (textobj) select inside {} block ``vic`` | (textobj) select inside comment ``vid`` | (textobj) select inside delimited text ``viD`` | (textobj) select inside delimited text per alternate grouping ``vif`` | (textobj) select inner function call ``vih`` | (textobj) select inside git hunk ``vii`` | (textobj) select inside indentation level; no line above ``viI`` | (textobj) select inside indentation level; no lines above/below ``viK`` | (textobj) select inside vertical WORD column ``vik`` | (textobj) select inside vertical word column ``vil`` | (textobj) select inside line ``vim`` | (textobj) select inside merge conflict ``vin`` | (textobj) select inside nearest block of specified delimiter ``vip`` | (textobj) select inside paragraph ``viP`` | (textobj) select inside sentence ``vir`` | (textobj) select inside Ruby/VimL block ``viS`` | (textobj) select inside text surrounded by automatic delimiters ``vis`` | (textobj) select inside text surrounded by specified delimiters ``vit`` | (textobj) select inside XML tag ``viu`` | (textobj) select inside URL ``viv`` | (textobj) select inside variable name ``viW`` | (textobj) select inside WORD ``viw`` | (textobj) select inside word ``vix`` | (textobj) select inside XML attribute ``viy`` | (textobj) select inside syntax element ``vi{`` | (textobj) select inside {} block ``vi}`` | (textobj) select inside {} block ``yob`` | (unimpaired) toggle assuming light background ``yoc`` | (unimpaired) toggle highlighting cursor's line ``yod`` | (unimpaired) toggle diffing with current buffer ``yoh`` | (unimpaired) toggle highlighting search results ``yoi`` | (unimpaired) toggle ignoring case sensitivity ``yol`` | (unimpaired) toggle listing nonprintable characters ``yon`` | (unimpaired) toggle absolute line numbering ``yop`` | (unimpaired) Change entire line, using paste mode temporarily. ``yor`` | (unimpaired) toggle relative line numbering ``yos`` | (unimpaired) toggle checking for misspelled words ``you`` | (unimpaired) toggle highlighting cursor's column ``yov`` | (unimpaired) toggle constraining cursor to line ``yow`` | (unimpaired) toggle wrapping very long lines ``yox`` | (unimpaired) toggle highlighting cursor's position ``z0`` | fold up to level 0 ``z1`` | fold up to level 1 ``z2`` | fold up to level 2 ``z3`` | fold up to level 3 ``z4`` | fold up to level 4 ``z5`` | fold up to level 5 ``z6`` | fold up to level 6 ``z7`` | fold up to level 7 ``z8`` | fold up to level 8 ``z9`` | fold up to level 9 ``zS`` | (scriptease) show active syntax highlighting groups at cursor ``{\|`` | (table-mode) move cursor to table cell above ``}\|`` | (table-mode) move cursor to table cell below You can refresh the table above by running the following command in Vim: ```vim call ShortcutsCheatsheetRefresh() " defined in plugin/000/shortcut.vim ``` You can also automate the above action from the command line by running: ```sh vim README.md -c 'call ShortcutsCheatsheetUpdate()' ``` ### Control * Run `stty -ixon` before starting Vim to use `` and `` keys. * `` saves the current buffer after stripping trailing whitespace. * `` exits Vim (after confirmation if there are unsaved buffers). * `` clears search highlighting; recalculates hunks when diffing. ### Command * `;` puts Vim into command mode. It is a shift-less alternative to `:`. * `!` puts Vim into shell command mode, for shift-less entrance to `:!`. * `@;` repeats the most recently executed command line, just like `@:`. * `Q` formats the current paragraph or text selection, just like `gq`. ### Motion [Sneak]( https://github.com/justinmk/vim-sneak ): * `-` repeats last sneak forward * `_` repeats last sneak backward * `f` sneaks forward onto {char} * `F` sneaks backward onto {char} * `t` sneaks forward until {char} * `T` sneaks backward until {char} * `s` sneaks forward onto {char}{char} * `S` sneaks backward onto {char}{char} * `` accepts sneak choice at cursor [CamelCaseMotion]( https://github.com/bkad/CamelCaseMotion ): * `w` is like `w` but knows about camel/snake case. * `b` is like `b` but knows about camel/snake case. * `e` is like `e` but knows about camel/snake case. ### Selection * `gV` visually selects the most recently pasted text. * `gn` selects the nearest search result after the cursor. * `gN` selects the nearest search result before the cursor. ### Clipboard * `Y` yanks from cursor to end of line, like Vim's native `C` and `D` keys. * `y` copies the current visual selection to the system clipboard. ### Completion In insert mode, when the completion menu doesn't appear: * `` forcefully triggers completion menu to appear. In insert mode, when the completion menu automatically appears: * `` accepts the currently selected completion menu item. * `` expands snippet or cycles forward through placeholders. * `` forcefully refreshes the entire completion menu. * `` cycles forward through completion menu items, just like ``. * `` cycles forward through chain of completion menu sources. See [MUcomplete.vim](https://github.com/lifepillar/vim-mucomplete) and [NeoSnippet.vim](https://github.com/Shougo/neosnippet.vim). ### Folding Jump: * `` jumps to nearest fold above current line. * `` jumps to nearest fold below current line. * `` jumps to nearest section above current line. * `` jumps to nearest section below current line. Fold: * `` closes current fold. * `` opens current fold. * `` decreases fold level. * `` increases fold level. ### URxvt integration If you use Vim in the URxvt terminal emulator, then load the following snippet into xrdb(1) so you can use all the shortcuts defined in this Vim configuration: xrdb -merge ~/.vim/urxvt.xrdb ## Manuals The usage manual for each script is reproduced here, for your convenience. ### bin/clean Deletes untracked `*.get` files and bundles lacking `*.get` files. If REGEX is provided, it will filter the candidates for deletion. Usage: bin/clean [-f] [OPTIONS_FOR_GREP...] [REGEX] Usage: bin/clean # asks you for confirmation Usage: bin/clean -f # no confirmation; force it ### bin/delete Deletes existing bundles whose names match the given regular expression. Usage: bin/delete [OPTIONS_FOR_GREP...] BUNDLE_NAME_REGEXP ### bin/insert Inserts a new bundle, optionally named BUNDLE_NAME, into the given CATEGORY. You can specify USER/REPO in place of URL to insert from GitHub repositories. Usage: bin/insert [URL|USER/REPO] [ft]bundle/CATEGORY[/BUNDLE_NAME] Usage: bin/insert URL bundle/CATEGORY Usage: bin/insert URL bundle/CATEGORY/BUNDLE_NAME Usage: bin/insert URL ftbundle/FILETYPE Usage: bin/insert URL ftbundle/FILETYPE/BUNDLE_NAME Usage: bin/insert USER/REPO bundle/CATEGORY Usage: bin/insert USER/REPO bundle/CATEGORY/BUNDLE_NAME Usage: bin/insert USER/REPO ftbundle/FILETYPE Usage: bin/insert USER/REPO ftbundle/FILETYPE/BUNDLE_NAME ### bin/locate Finds all known and untracked '*.get' files. Usage: bin/manifest [OPTIONAL_FILTER_REGEXP] ### bin/orphans Lists untracked `*.get` files and bundles lacking `*.get` files. Usage: bin/orphans ### bin/rebase Replays local commits atop the newest changes from upstream. Usage: bin/rebase # asks to confirm bin/clean Usage: bin/rebase -f # no confirmation; force it ### bin/rebase-autocon Usage: git-rebase-autocon [TARGET] [ARGUMENTS_FOR_GIT_REBASE...] Rebases the given TARGET while automatically resolving conflicts by substituting empty-tree commits labeled "fixup!" that log all conflicting hunks in their commit messages in git-diff(1) format. If TARGET is not specified, the upstream tracking branch is used. Optional ARGUMENTS_FOR_GIT_REBASE... are passed to git-rebase(1). Documented at ### bin/rebase-stacked Rebases the main branches, going from conventional to divergent. ### bin/rename Renames existing bundles whose names match the given regular expression. Usage: bin/rename [OPTIONS_FOR_GREP...] BUNDLE_NAME_REGEXP At the prompt, edit the bundle location and press ENTER to rename it so. If you no longer wish to rename the bundle, just press ENTER to skip it. If you made a mistake and want to abort the rename, press Control and C. ### bin/rename-editor Lets you rename all *.get files in one fell swoop, from the comfort of Vim. Usage: bin/rename-editor The editor will present you with 3 split windows (left, middle, and right): 1. The left window lists the current names for your reference (read-only) 2. The middle window lists the current names for you to rename (writable) 3. The right window lists the default names for your reference (read-only) Edit the names in the middle window and then save the file before exiting. To cancel or avoid performing any renames, exit the editor without saving. Note: DO NOT change the order or amount of lines presented in the editor! ### bin/rename-fromto Renames the given *.get file and all associated files to the new name. Usage: bin/rename-fromto CURRENT_GET_FILE NEW_GET_FILE ### bin/setup Activates the given BRANCH and installs any bundles it defines. Usage: bin/setup [BRANCH] Usage: bin/setup origin # template Usage: bin/setup basics # template + basics Usage: bin/setup qwerty # template + basics + my flair Usage: bin/setup dvorak # template + basics + my flair + dvorak Usage: bin/setup engram # template + basics + my flair + engram Usage: bin/setup master # template + basics + my flair + engram + new stuff ### bin/update Usage: bin/update [BUNDLE_NAME|DIRECTORY|GET_FILE]... Usage: env UPDATE_BUNDLES_SEQUENTIALLY=1 bin/update Clones or updates the Git repositories specified in `./**/*.get` files: optionally matching the given BUNDLE_NAME, DIRECTORY, or GET_FILE path, starting from the most recently modified file down to the earliest one, checking out the branch or commit named in related `./**/*.set` files. After that, it runs corresponding `./**/*.run` scripts for those repos. This is done in parallel, at up to half of the maximum process limit, unless the `UPDATE_BUNDLES_SEQUENTIALLY` environment variable is set. ### bin/usage Displays help and usage information for this and fellow scripts. Usage: bin/usage [SCRIPT] ### bin/usage-readme Formats usage information from all scripts for injection into README. ## References * [Plugin Layout in the Dark Ages][modular] by Steve Losh. [modular]: http://learnvimscriptthehardway.stevelosh.com/chapters/42.html * [Configuring Vim right](http://items.sjbach.com/319/configuring-vim-right) by Stephen Bach. * [Replacing All The Things with Unite.vim]( http://www.codeography.com/2013/06/17/replacing-all-the-things-with-unite-vim.html ) by Christopher Sexton. ## License [Spare A Life]: https://sunaku.github.io/vegan-for-life.html > Like my work?


本源码包内暂不包含可直接显示的源代码文件,请下载源码包。