about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authormidchildan <git@midchildan.org>2024-02-03 01:28:00 +0900
committerOliver Kiddle <opk@zsh.org>2024-02-15 15:40:37 +0100
commitfb9a7cc5dd07910afa7ebea174b379350cae4c91 (patch)
tree25584d9a0a71ec0a7bce61e8c14dda6b8ee32aa9 /Doc
parent2d2086557ef80117e939253a68580abe07c89fe2 (diff)
downloadzsh-fb9a7cc5dd07910afa7ebea174b379350cae4c91.tar.gz
zsh-fb9a7cc5dd07910afa7ebea174b379350cae4c91.tar.xz
zsh-fb9a7cc5dd07910afa7ebea174b379350cae4c91.zip
52520: add new features and improvements to the "incarg" ZLE widget
- Decrement integers without defining a new widget
- Preserve the number of leading zeros
- Increment binaries, octals, and hexadecimals
- Move the cursor to the end of the incremented integer
- Create a sequence of integers across terminal panes
- Add a Vim variant
- Also add tests
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/contrib.yo30
1 files changed, 24 insertions, 6 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index e1781a5e1..718686587 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -2620,12 +2620,30 @@ zle -N history-pattern-search-forward history-pattern-search)
 tindex(incarg)
 vindex(incarg, use of)
 item(tt(incarg))(
-Typing the keystrokes for this widget with the cursor placed on or to the
-left of an integer causes that integer to be incremented by one.  With a
-numeric argument, the number is incremented by the amount of the
-argument (decremented if the numeric argument is negative).  The shell
-parameter tt(incarg) may be set to change the default increment to
-something other than one.
+This widget allows you to increment integers on the current line. In addition
+to decimals, it can handle hexadecimals prefixed with tt(0x), binaries with
+tt(0b), and octals with tt(0o).
+
+By default, the target integer will be incremented by one. With a numeric
+argument, the integer is incremented by the amount of the argument. The shell
+parameter tt(incarg) may be set to change the default increment to something
+other than one.
+
+The behavior of this widget changes depending on the widget name.
+
+When the widget is named tt(incarg), the widget will increment an integer
+placed under the cursor placed or just to the left of it. tt(decarg), on the
+other hand, decrements the integer. When the name is prefixed with tt(vim-),
+the cursor will jump to the nearest integer after the cursor before incrementing
+it.
+
+There's also a tt(sync-) prefix that can be added to the widget name. This
+variant is used for creating a sequence of numbers on split terminals with
+synchronized key input. The first pane won't increment the integer at all, but
+each pane after that will have the integer incremented once more than the
+previous pane. It currently supports tmux and iTerm2.
+
+The prefixes tt(vim-) and tt(sync-) can be combined into tt(vim-sync-).
 
 example(bindkey '^X+' incarg)
 )