Skip to content

Commit ed6850c

Browse files
committed
vim9script Port of vim-unimpaired
- Expose most of the functions used for map building through autoload so that others can more easily add maps in the same manner without copying code. - Incorporate tpope#230, tpope#228 - Use <ScriptCmd> instead of `:<C-U>`, which required some rethinking because of the use of `<C-R>=`. - Added additional maps from - phongnh/vim-toggler: conceallevel, showmatch, incsearch, expandtab, showcmd - riceissa/vim-more-toggling: syntax
1 parent 6d44a6d commit ed6850c

File tree

7 files changed

+974
-817
lines changed

7 files changed

+974
-817
lines changed

.github/FUNDING.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
github: tpope
2-
custom: ["https://www.paypal.me/vimpope"]
1+
github: halostatue
2+
buy_me_a_coffee: halostatue
3+
ko_fi: halostatue

README.markdown README.md

+31-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1+
# vim-pairs
2+
3+
This is a vim 9 fork of [tpope/vim-unimpaired][unimpaired].
4+
15
# unimpaired.vim
26

3-
Much of unimpaired.vim was extracted from my vimrc when I noticed a
4-
pattern: complementary pairs of mappings. They mostly fall into four
5-
categories.
7+
Much of unimpaired.vim was extracted from my vimrc when I noticed a pattern:
8+
complementary pairs of mappings. They mostly fall into four categories.
69

7-
There are mappings which are simply short normal mode aliases for
8-
commonly used ex commands. `]q` is :cnext. `[q` is :cprevious. `]a` is
9-
:next. `[b` is :bprevious. See the documentation for the full set of
10-
20 mappings and mnemonics. All of them take a count.
10+
There are mappings which are simply short normal mode aliases for commonly used
11+
ex commands. `]q` is :cnext. `[q` is :cprevious. `]a` is :next. `[b` is
12+
:bprevious. See the documentation for the full set of 20 mappings and mnemonics.
13+
All of them take a count.
1114

12-
There are linewise mappings. `[<Space>` and `]<Space>` add newlines
13-
before and after the cursor line. `[e` and `]e` exchange the current
14-
line with the one above or below it.
15+
There are linewise mappings. `[<Space>` and `]<Space>` add newlines before and
16+
after the cursor line. `[e` and `]e` exchange the current line with the one
17+
above or below it.
1518

1619
There are mappings for toggling options. `[os`, `]os`, and `yos` perform
17-
`:set spell`, `:set nospell`, and `:set invspell`, respectively. There's also
18-
`l` (`list`), `n` (`number`), `w` (`wrap`), `x` (`cursorline cursorcolumn`),
19-
and several others, plus mappings to help alleviate the `set paste` dance.
20-
Consult the documentation.
20+
`:set spell`, `:set nospell`, and `:set invspell`, respectively. There's also
21+
`l` (`list`), `n` (`number`), `w` (`wrap`), `x` (`cursorline cursorcolumn`), and
22+
several others, plus mappings to help alleviate the `set paste` dance. Consult
23+
the documentation.
2124

22-
There are mappings for encoding and decoding. `[x` and `]x` encode and
23-
decode XML (and HTML). `[u` and `]u` encode and decode URLs. `[y` and
24-
`]y` do C String style escaping.
25+
There are mappings for encoding and decoding. `[x` and `]x` encode and decode
26+
XML (and HTML). `[u` and `]u` encode and decode URLs. `[y` and `]y` do C String
27+
style escaping.
2528

2629
And in the miscellaneous category, there's `[f` and `]f` to go to the
27-
next/previous file in the directory, and `[n` and `]n` to jump between
28-
SCM conflict markers.
30+
next/previous file in the directory, and `[n` and `]n` to jump between SCM
31+
conflict markers.
2932

3033
The `.` command works with all operator mappings, and will work with the
3134
linewise mappings as well if you install
@@ -43,7 +46,7 @@ support:
4346

4447
## FAQ
4548

46-
> My non-US keyboard makes it hard to type `[` and `]`. Can I configure
49+
> My non-US keyboard makes it hard to type `[` and `]`. Can I configure
4750
> different prefix characters?
4851
4952
The easiest solution is to map to `[` and `]` directly:
@@ -55,7 +58,7 @@ The easiest solution is to map to `[` and `]` directly:
5558
xmap < [
5659
xmap > ]
5760

58-
Note we're not using the `noremap` family because we *do* want to recursively
61+
Note we're not using the `noremap` family because we _do_ want to recursively
5962
invoke unimpaired.vim's maps.
6063

6164
## Contributing
@@ -67,12 +70,13 @@ See the contribution guidelines for
6770

6871
Like unimpaired.vim? Follow the repository on
6972
[GitHub](https://github.com/tpope/vim-unimpaired) and vote for it on
70-
[vim.org](http://www.vim.org/scripts/script.php?script_id=1590). And if
71-
you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
72-
[Twitter](http://twitter.com/tpope) and
73-
[GitHub](https://github.com/tpope).
73+
[vim.org](http://www.vim.org/scripts/script.php?script_id=1590). And if you're
74+
feeling especially charitable, follow [tpope](http://tpo.pe/) on
75+
[Twitter](http://twitter.com/tpope) and [GitHub](https://github.com/tpope).
7476

7577
## License
7678

77-
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
78-
See `:help license`.
79+
Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See
80+
`:help license`.
81+
82+
[unimpaired]: https://github.com/tpope/vim-unimpaired

0 commit comments

Comments
 (0)