.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Term::ReadLine::Zoid::ViCommand 3pm" .TH Term::ReadLine::Zoid::ViCommand 3pm "2022-06-17" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Term::ReadLine::Zoid::ViCommand \- a readline command mode .SH "SYNOPSIS" .IX Header "SYNOPSIS" This class is used as a mode under Term::ReadLine::Zoid, see there for usage details. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This mode provides a \*(L"vi command mode\*(R" as specified by the posix spec for the \fBsh\fR\|(1) utility. It intends to include at least all key-bindings mentioned by the posix spec for the vi mode in \fBsh\fR\|(1). It also contains some extensions borrowed from \fBvim\fR\|(1) and some private extensions. .PP This mode has a \*(L"kill buffer\*(R" that stores the last killed text so it can be yanked again. This buffer has only one value, it isn't a \*(L"kill ring\*(R". .SH "KEY MAPPING" .IX Header "KEY MAPPING" Since ViCommand inherits from MultiLine, which in turn inherits from Term::ReadLine::Zoid, key bindings are also inherited unless explicitly overloaded. .PP Control-d is ignored in this mode. .IP "escape" 4 .IX Item "escape" Reset the command mode. .IP "return" 4 .IX Item "return" .PD 0 .IP "^J" 4 .IX Item "^J" .PD Return the current edit line to the application for execution. .IP "^Z" 4 .IX Item "^Z" Send a \s-1SIGSTOP\s0 to the process of the application. Might not work when the application ignores those, which is something shells tend to do. .IP "i" 4 .IX Item "i" Switch back to insert mode. .IP "I" 4 .IX Item "I" Switch back to insert mode at the begin of the edit line. .IP "a" 4 .IX Item "a" Enter insert mode after the current cursor position. .IP "A" 4 .IX Item "A" Enter insert mode at the end of the edit line. .IP "m" 4 .IX Item "m" Switch to multiline insert mode, see Term::ReadLine::Zoid::MultiLine. (private extension) .IP "M" 4 .IX Item "M" Switch to multiline insert mode at the end of the edit buffer. (private extension) .IP "R" 4 .IX Item "R" Enter insert mode with replace toggled on. (vim extension) .IP "#" 4 Makes current edit line a comment that will be listed in the history, but won't be executed. .Sp Only works if the 'comment_begin' option is set. .IP "=" 4 Display possible shell word completions, does not modify the edit line. .IP "\e" 4 .IX Item "" Do pathname completion (using File::Glob) and insert the largest matching part in the edit line. .IP "*" 4 Do pathname completion but inserts \fBall\fR matches. .IP "[\fIcount\fR] @ \fIchar\fR" 4 .IX Item "[count] @ char" Regard the contents of the alias _char as a macro with editing commands. This seems a rather obfuscated feature of the posix spec to me. See also below for the alias command. .Sp Note that the \fIcount\fR argument is not posix compliant, but it seems silly not to use it. .IP "[\fIcount\fR] ~" 4 .IX Item "[count] ~" Reverse case for \fIcount\fR characters. .IP "[\fIcount\fR] ." 4 .IX Item "[count] ." Repeat the last non-motion command. If no count is specified the original count of the command is used. .IP "v" 4 .IX Item "v" Edit the buffer with the editor specified by the \f(CW\*(C`EDITOR\*(C'\fR environment variable or the editor option, defaults to 'vi'. .Sp This function requires the File::Temp module from cpan, which in turn needs File::Spec and other packages. If these are not available this functions is disabled. .IP "[\fIcount\fR] l" 4 .IX Item "[count] l" .PD 0 .IP "[\fIcount\fR] \fIspace\fR" 4 .IX Item "[count] space" .PD Move the cursor to the right. .IP "[\fIcount\fR] h" 4 .IX Item "[count] h" Move the cursor to the left. .IP "[\fIcount\fR] w" 4 .IX Item "[count] w" .PD 0 .IP "[\fIcount\fR] W" 4 .IX Item "[count] W" .PD Move the cursor to the begin of the next word or bigword. .Sp (A bigword exists of non-whitespace chars, while a word exists of alphanumeric chars only.) .IP "[\fIcount\fR] e" 4 .IX Item "[count] e" .PD 0 .IP "[\fIcount\fR] E" 4 .IX Item "[count] E" .PD Move the cursor to the end of the current word or bigword. .IP "[\fIcount\fR] b" 4 .IX Item "[count] b" .PD 0 .IP "[\fIcount\fR] B" 4 .IX Item "[count] B" .PD Move the cursor to the begin of the current word or bigword. .IP "^" 4 Move the cursor to the first non-whitespace on the edit line. .IP "$" 4 Move the cursor to the end of the edit line. .IP "0" 4 Move the cursor to the begin of the edit line. .IP "[\fIcount\fR] |" 4 .IX Item "[count] |" Set the cursor to position \fIcount\fR (1\-based). .IP "[\fIcount\fR] f \fIchar\fR" 4 .IX Item "[count] f char" Set cursor to \fIcount\fR'th occurrence of \fIchar\fR to the right. The cursor is placed on \fIchar\fR. .IP "[\fIcount\fR] F \fIchar\fR" 4 .IX Item "[count] F char" Set cursor to \fIcount\fR'th occurrence of \fIchar\fR to the left. The cursor is placed on \fIchar\fR. .IP "[\fIcount\fR] t \fIchar\fR" 4 .IX Item "[count] t char" Set cursor to \fIcount\fR'th occurrence of \fIchar\fR to the right. The cursor is placed before \fIchar\fR. .IP "[\fIcount\fR] T \fIchar\fR" 4 .IX Item "[count] T char" Set cursor to \fIcount\fR'th occurrence of \fIchar\fR to the left. The cursor is placed after \fIchar\fR. .IP "[\fIcount\fR] ;" 4 .IX Item "[count] ;" Repeat the last 'f', 'F', 't', or 'T' command. Count of last command is ignored. .IP "[\fIcount\fR] ," 4 .IX Item "[count] ," Like ';' but with direction reversed. .IP "[\fIcount\fR] c \fImotion\fR" 4 .IX Item "[count] c motion" Delete characters between the current position and the position after the \&\fImotion\fR, \fIcount\fR applies to \fImotion\fR. After the deletion enter insert mode. .Sp The \*(L"motion\*(R" 'c' deletes the current edit line. .IP "C" 4 .IX Item "C" Delete from cursor to end of line and enter insert mode. .IP "S" 4 .IX Item "S" Delete current line and enter insert mode. .IP "[\fIcount\fR] r \fIchar\fR" 4 .IX Item "[count] r char" Replace the character under the cursor (and the \fIcount\fR characters next to it) with \fIchar\fR. .IP "[\fIcount\fR] _" 4 .IX Item "[count] _" Insert a white space followed by the last (or \fIcount\fR'th) bigword from the previous history entry ans enter insert mode. .Sp Quotes are not respected by this function. .IP "[\fIcount\fR] x" 4 .IX Item "[count] x" Delete \fIcount\fR characters and place them in the save buffer. .IP "[\fIcount\fR] X" 4 .IX Item "[count] X" Delete \fIcount\fR characters before the cursor position and place them in the save buffer. .Sp ('x' is like 'delete', 'X' like backspace) .IP "[\fIcount\fR] d \fImotion\fR" 4 .IX Item "[count] d motion" Delete from the current cursor position to the position resulting from \fIcount\fR times \fImotion\fR. The deleted part will be placed in the save buffer. .Sp The \*(L"motion\*(R" 'd' deletes the current line. .IP "D" 4 .IX Item "D" Delete from the cursor position until the end of the line and put the deleted part in the save buffer. .IP "[\fIcount\fR] y \fImotion\fR" 4 .IX Item "[count] y motion" Yank (copy) characters from the current cursor position to the position resulting from \fIcount\fR times \fImotion\fR to the save buffer. .Sp the \*(L"motion\*(R" 'y' yanks the current line. .IP "Y" 4 .IX Item "Y" Like y but from cursor till end of line. .IP "[\fIcount\fR] p" 4 .IX Item "[count] p" Insert \fIcount\fR copies of the the save buffer after the cursor. .IP "[\fIcount\fR] P" 4 .IX Item "[count] P" Insert \fIcount\fR copies of the the save buffer before the cursor. .IP "u" 4 .IX Item "u" Undo the last command that changed the edit line. .IP "U" 4 .IX Item "U" Undo all changes. .Sp \&\s-1TODO\s0 all changes since when ? since entering the command mode ? .IP "[\fIcount\fR] k" 4 .IX Item "[count] k" .PD 0 .IP "[\fIcount\fR] \-" 4 .IX Item "[count] -" .PD Go \fIcount\fR lines backward in history. .IP "[\fIcount\fR] j" 4 .IX Item "[count] j" .PD 0 .IP "[\fIcount\fR] +" 4 .IX Item "[count] +" .PD Go \fIcount\fR lines forward in history. .IP "[\fInumber\fR] G" 4 .IX Item "[number] G" Go to history entry number \fInumber\fR, or to the first history entry. .IP "n" 4 .IX Item "n" Repeat the last history search by either the '/' or '?' minibuffers or the incremental search mode. .IP "N" 4 .IX Item "N" Repeat the last history search in the oposite direction. .IP ":" 4 Opens a command mini buffer. This is a very minimalistic execution environment that can for instance be used to modify options if the application doesn't provide a method to do so. Also it is used for quick hacks ;) .Sp The execution of this buffer happens entirely without returning to the application. .Sp (This is a vim extension) .IP "/" 4 Opens a mini buffer where you can type a pattern to search backward through the history. .Sp The search patterns are not globs (as posix would have them), but are evaluated as perl regexes. .Sp An empty pattern repeats the previous search. .IP "?" 4 Like '/' but searches in the forward direction. .IP "^A" 4 .IX Item "^A" If cursor is on a number, increment it. (This is a vim extension) .Sp \&\s-1FIXME\s0 bit buggy .IP "^X" 4 .IX Item "^X" If cursor is on a number, decrement it. (This is a vim extension) .Sp \&\s-1FIXME\s0 bit buggy .SH "COMMANDS" .IX Header "COMMANDS" These can be used from the \*(L":\*(R" mini buffer. Some commands are borrowed from vim, but no guarantee what so ever. .IP "\fBquit\fR" 4 .IX Item "quit" Return undef to the application (like '^D' in insert mode). .IP "\fBset\fR [\fI+o\fR|\fI\-o\fR] [\fIoption\fR=\fIvalue\fR]" 4 .IX Item "set [+o|-o] [option=value]" Set a key-value pair in the options hash When the arg '+o' is given (or the option is preceded by 'no') the option is deleted. .Sp Can be used to change the ReadLine behaviour independent from the application. .IP "\fBascii\fR" 4 .IX Item "ascii" Output ascii values for the char in the edit line on the cursor position. .IP "\fBtestchr\fR" 4 .IX Item "testchr" Wait for a character input and output ascii values for it. .IP "\fBbindchr\fR \fIchr\fR=\fIkeyname\fR" 4 .IX Item "bindchr chr=keyname" Map a char (or char sequence) to a key name. .IP "\fBbindkey\fR \fIchr\fR=sub { \fIcode\fR }" 4 .IX Item "bindkey chr=sub { code }" Map a char (or char sequence) to a key name. .IP "\fB!\fR, \fBshell\fR \fIshellcode\fR" 4 .IX Item "!, shell shellcode" Eval a system command. The '%' character in this string will be replace with the name of a tmp file containing the edit buffer. After execution this tmp file will be read back into the edit buffer. Of course you can use an backslash to escape a literal '%'. .Sp Note that this tmp file feature only works if you have File::Temp installed. .IP "\fBeval\fR \fIperlcode\fR" 4 .IX Item "eval perlcode" Eval some perlcode for the most evil instant hacks. The ReadLine object can be called as \f(CW$self\fR. .IP "\fBalias\fR \fIchar\fR=\fImacro\fR" 4 .IX Item "alias char=macro" Define a macro in an alias with a one character name. These can be executed with the '@' command. Non alphanumeric keys like \*(L"\en\*(R" and \*(L"\ee\*(R" can be inserted with the standard perl escape sequences. You need to use \*(L"\e\e\*(R" for a literal '\e'. .SH "ATTRIBS" .IX Header "ATTRIBS" These can be accessed through the \f(CW\*(C`Attribs\*(C'\fR method (defined by the parent class). .IP "aliases" 4 .IX Item "aliases" This option is refers to a hash with aliases, used for the key binding for '@'. Note that all aliases have a one character name prefixed with a \*(L"_\*(R", this is due to historic implementations where the same hash is used for system aliases. We \fBdon't\fR support aliases for the shell command, to have that you should define your own shell subroutine (see below). .IP "editor" 4 .IX Item "editor" Editor command used for the 'v' binding. The string is run by the shell command. This option defaults to the \s-1EDITOR\s0 environment variable or to \*(L"vi %\*(R". .IP "shell" 4 .IX Item "shell" The value can be set to a \s-1CODE\s0 ref to handle the shell command from the mini-buffer and the 'v' key binding. It should return the exit status of the command (like the perlfunc \f(CW\*(C`system()\*(C'\fR). .SH "AUTHOR" .IX Header "AUTHOR" Jaap Karssenberg || Pardus [Larus] .PP Copyright (c) 2004 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Term::ReadLine::Zoid