

GitHub - tpope/vim-unimpaired: unimpaired.vim: pairs of handy bracket mappings
source link: https://github.com/tpope/vim-unimpaired
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

unimpaired.vim
Much of unimpaired.vim was extracted from my vimrc when I noticed a pattern: complementary pairs of mappings. They mostly fall into four categories.
There are mappings which are simply short normal mode aliases for
commonly used ex commands. ]q
is :cnext. [q
is :cprevious. ]a
is
:next. [b
is :bprevious. See the documentation for the full set of
20 mappings and mnemonics. All of them take a count.
There are linewise mappings. [<Space>
and ]<Space>
add newlines
before and after the cursor line. [e
and ]e
exchange the current
line with the one above or below it.
There are mappings for toggling options. [os
, ]os
, and yos
perform
:set spell
, :set nospell
, and :set invspell
, respectively. There's also
l
(list
), n
(number
), w
(wrap
), x
(cursorline cursorcolumn
),
and several others, plus mappings to help alleviate the set paste
dance.
Consult the documentation.
There are mappings for encoding and decoding. [x
and ]x
encode and
decode XML (and HTML). [u
and ]u
encode and decode URLs. [y
and
]y
do C String style escaping.
And in the miscellaneous category, there's [f
and ]f
to go to the
next/previous file in the directory, and [n
and ]n
to jump between
SCM conflict markers.
The .
command works with all operator mappings, and will work with the
linewise mappings as well if you install
repeat.vim.
Installation
Install using your favorite package manager, or use Vim's built-in package support:
mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/unimpaired.git
vim -u NONE -c "helptags unimpaired/doc" -c q
My non-US keyboard makes it hard to type
[
and]
. Can I configure different prefix characters?
The easiest solution is to map to [
and ]
directly:
nmap < [
nmap > ]
omap < [
omap > ]
xmap < [
xmap > ]
Note we're not using the noremap
family because we do want to recursively
invoke unimpaired.vim's maps.
Contributing
See the contribution guidelines for pathogen.vim.
Self-Promotion
Like unimpaired.vim? Follow the repository on GitHub and vote for it on vim.org. And if you're feeling especially charitable, follow tpope on Twitter and GitHub.
License
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
See :help license
.
</article
Recommend
-
220
Bit-Wasp/bitcoin-php: Bitcoin implementation in PHP 1.0
-
165
JSON API spec implemented in PHP 7. Immutable The goal of this library is to ensure strict validity of JSON API documents being produced. JSON: { "data": {...
-
180
A free Disqus alternative using GitHub comments, mainly for blogs with developer audiences
-
105
pocket-reader This is a client for Pocket (getpocket.com). It allows you to manage your reading list: add, remove, delete, tag, view, favorite, etc. Doing so in Emacs with the keyboard is fast and efficient. Links can be opened in Emac...
-
190
This is go-mode, the Emacs mode for editing Go code. It is a complete rewrite of the go-mode that shipped with Go 1.0.3 and before, and was part of Go 1.1 until Go 1.3. Beginning with Go 1.4, editor integration will not be part of the Go di...
-
172
NOTE: This repository is no longer maintained. The Netstack code will continue to be updated and maintained as part of gVisor, which now also maintains a branch...
-
191
doitlive doitlive is a tool for live presentations in the terminal. It reads a file of shell commands and replays the commands in a fake terminal session as you type random characters. Get it now macOS with
-
169
Kahlan is a full-featured Unit & BDD test framework a la RSpec/JSpec which uses a describe-it syntax and moves testing in PHP one step forward. Kahlan lets you stub or monkey patch your code directly...
-
189
Tably Python script for converting .csv data to LaTeX tables. Features easy to use - just provide a .csv file optionally escapes commonly used special LaTeX characters, such as $, &...
-
139
Cameradar An RTSP stream access tool that comes with its library Cameradar allows you to Detect open RTSP hosts on any accessible target host Detect which device model is streaming
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK