Tom McDonald
4589b307dc
Remove :ExchangeClear deprecation notice
2015-06-18 17:16:35 +00:00
Tom McDonald
d769e46011
Fail gracefully when saving register contents
...
Fixes #37
2015-06-18 17:04:36 +00:00
Jacob Niehus
1394aa3a9b
Only reindent when both selections are linewise
2015-06-16 18:43:26 -07:00
Jacob Niehus
8bd96c3e0d
Use b:exchange_indent if present
2015-06-12 13:12:24 -07:00
Jacob Niehus
3b4b4b38ab
Indent overlapping regions correctly
2015-05-31 10:23:09 -07:00
Jacob Niehus
aff4ade39b
Add option to update indent after exchange
2015-05-28 18:12:58 -07:00
Tom McDonald
e459b57740
Enable exchange highlighting by default
2015-02-14 11:00:42 -05:00
Tom McDonald
36673b255b
Allow toggling of exchange region highlighting
...
Closes #33
2015-02-14 10:58:20 -05:00
Tom McDonald
e6bf71a53a
Add :XchangeClear, deprecate :ExchangeClear
...
References #28 , #29
2015-02-14 10:38:48 -05:00
Jacob Niehus
3ff60a7b6e
Add tpope/vim-repeat compatibility
2015-01-11 11:49:13 -07:00
Tom McDonald
4da8b67383
Suppress errors when restoring invalid registers
...
Particularly for * and + registers when clipboard support is not
present.
Fixes #31
2014-12-22 14:13:52 +00:00
Tom McDonald
fc78e3aa68
Refactor register save/restore
2014-12-22 14:12:55 +00:00
Jacob Niehus
483a294cce
Restore star and plus registers in addition to unnamed register
2014-12-06 12:48:30 -07:00
cohama
3eea6c08fd
Add :ExchangeClear command
2014-11-24 16:03:57 +00:00
Tom McDonald
9c025e5914
Merge pull request #27 from inkarkat/fix-selection-exclusive
...
Support :set selection=exclusive
2014-06-24 11:26:05 -04:00
Ingo Karkat
55421a1852
Support :set selection=exclusive
...
With this, the '> mark points to after the end of the selection.
- Do not change the 'selection' value when the plugin is triggered from visual mode, so that we can grab the original selection.
- Simplification: gv can be used instead of "`<" . a:type . "`>" to restore the original selection. This also deals with blockwise-to-end in all cases.
- For the highlighting, the end position must be corrected. Since these are byte indices, we cannot just decrement by 1, but have to subtract the length of the last selected character!
2014-06-24 16:33:37 +02:00
Ingo Karkat
d578e14e89
Do not create a select mode default mapping.
...
In select mode (the variant of visual mode), any printable characters should override the selection (see below :help v_CTRL-G), so no such mappings should exist. Limit the default visual mode mapping to visual mode (:xmap). (The <Plug>(Exchange) can and should be defined for both.)
2014-06-24 16:28:41 +02:00
Tom McDonald
72d9f0a3cf
Add "expand" functionality
...
When one exchange region is completely contained within another,
replace the larger one with the smaller one.
The term "expand" may seem counter-intuitive, as the result is less
text, but think of it this way: the smaller region is "expanding"
to occupy the space previously defined by the larger region.
2014-04-27 10:28:16 -04:00
Tom McDonald
a55ebe1c8d
Use srings to describe exchange region comparison
...
... in preparation for things to come.
2014-04-27 10:14:13 -04:00
Tom McDonald
06f62c9f51
Ensure 'selection' is set to inclusive
...
References #23 .
2014-04-26 08:25:46 -04:00
Tom McDonald
105cf06d43
Use '[ and '] marks instead of a-z marks
...
Closes #22 .
2014-04-08 17:09:22 -04:00
Tom McDonald
c307765978
Use less popular marks during exchange
...
At least until I can figure out why they're being overwritten.
References #22 .
2014-04-08 15:21:36 -04:00
Tom McDonald
694d00abe9
Use clearer variable names for mark backups
2014-04-08 15:20:29 -04:00
Christian Wellenbrock
ff52604e80
Use X as visual mapping for Exchange
2014-02-25 00:19:48 +01:00
Brian Smyth
57fe37a89c
Use a named register for visual mode put.
...
Save and restore both the unnamed and z registers. Using the z register
works around the bug addressed by Vim patch 7.3.411.
2014-02-04 12:39:30 -05:00
Micha Moskovic
ac8ae24d73
Link 'IncSearch' for default highlight group
...
The previous green one is completely arbitrary and looks ugly with some colorschemes.
2014-01-07 18:12:25 +01:00
Tom McDonald
d67bace226
Improve highlighting coverage
...
* Support gui
* Use colors available for terminals with 8 colors
2014-01-05 11:06:07 -05:00
Tom McDonald
53b2b497b0
Maintain cursor position when exchanging
...
Closes #16 .
2014-01-01 11:32:54 -05:00
Tom McDonald
39895312ec
Highlight the first defined exchange region
...
Closes #13 .
2014-01-01 11:03:33 -05:00
Tom McDonald
80f24f2398
Change <Plug> mappings to avoid prefix strings
...
Any custom mappings to <Plug>Exchange, <Plug>ExchangeLine, or
<Plug>ExchangeClear will have to be changed to map to <Plug>(Exchange),
<Plug>(ExchangeLine), and <Plug>(ExchangeClear).
References #12
2013-12-22 10:05:38 -05:00
Tom McDonald
88bb271e2d
Fix incorrect visual mapping to cxx
...
Fixes #12 .
2013-12-22 09:28:36 -05:00
Tom McDonald
855b57077e
Allow default mappings to be overridden
...
Partial solution to #11
2013-12-21 22:51:50 -05:00
Tom McDonald
fba5bcea8c
Detect overlap for two blockwise regions
2013-12-12 15:12:14 -05:00
Tom McDonald
ec7f183583
Fix quoting for escaped <C-V> sequence
...
This bug would probably have never affected anyone, since it only
comes up when a normal-mode motion results in a blockwise selection.
2013-12-12 15:06:40 -05:00
Tom McDonald
2d7ef58550
Use getreg() instead of macro syntax
2013-12-11 10:19:25 -05:00
Tom McDonald
62ae17d31a
Use " register instead of @
2013-12-11 10:17:26 -05:00
Tom McDonald
a0e2169959
Use setreg() to preserve yanked text's -wise mode
2013-12-11 10:03:15 -05:00
Israel Chauca Fuentes
07d9946872
Use getregtype() to restore register's mode.
2013-12-11 09:23:52 -05:00
Micha Moskovic
00b3dd0274
Make the default mappings optional
2013-12-10 17:43:08 +01:00
Tom McDonald
ae6495dafc
Protect against mapped underscore
...
Refs pull request #3
2013-12-10 09:16:01 -05:00
James Baumgarten
a1745846e6
make sure to paste from unnamed register
2013-12-10 01:18:03 -08:00
Tom McDonald
9aa477fa96
Match case when comparing visual mode
...
Closes #4 .
2013-12-09 20:40:00 -05:00
Christian Wellenbrock
275bc1e2b7
Add mapping to make 'cxx' work linewise
2013-12-09 23:03:55 +01:00
Tom McDonald
e31a5f57d2
Detect overlapping and swap-needing exchange text
...
Closes #1 .
2013-12-09 13:19:19 -05:00
Tom McDonald
6ff338e953
Code organization
2013-12-06 13:45:08 -05:00
Tom McDonald
366ead65a2
Rewrite to support swapping exchange operands
2013-12-06 00:26:36 -05:00
Tom McDonald
9833bfaf9f
Preserve cursor position after exchange
2013-12-05 23:19:37 -05:00
Tom McDonald
ea205fd0fc
Fix typo
...
(Actually, it was the result of me testing the plugin)
2013-12-05 13:00:38 -05:00
Tom McDonald
a17828563e
Initial prototype
2013-12-05 12:50:07 -05:00