aboutsummaryrefslogtreecommitdiffstats
path: root/doc/incdec.7
blob: de0dca0ef8ca0cc1a903856f775f0d9f2187e067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'\" t
.\"     Title: incdec
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 08/29/2021
.\"    Manual: \ \&
.\"    Source: \ \&
.\"  Language: English
.\"
.TH "INCDEC" "7" "08/29/2021" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
incdec \- Readline bindings to increment and decrement numbers
.SH "SYNOPSIS"
.sp
Incdec bindings
.SH "DESCRIPTION"
.sp
A pair of Readline bindings and Bash functions to quickly increment and decrement a number on the current command line\&.
.SH "BINDINGS"
.PP
\fB__readline_incdec_decrement (C\-x x)\fR
.RS 4
Decrement the first number to the left of point by one\&. If no number is on the left of point, the first number to the right of point is decremented\&.
.RE
.PP
\fB__readline_incdec_increment (C\-x a)\fR
.RS 4
Increment the first number to the left of point by one\&. If no number is on the left of point, the first number to the right of point is incremented\&.
.RE
.SH "CUSTOM BINDINGS"
.sp
Custom bindings can be defined by mapping to the increment and decrement functions\&. For example, this defines bindings for \fIC\-x \-\fR and \fIC\-x +\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
bind \-x \*(Aq"\eC\-x\-": __readline_incdec_decrement\*(Aq
bind \-x \*(Aq"\eC\-x+": __readline_incdec_increment\*(Aq
.fi
.if n \{\
.RE
.\}