'\" t .\" Title: incdec .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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 .\}