Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
NAME	urxvi

SITE	http://chipstips.com/?tag=plurxvi
	http://bitbucket.org/sterlingcamden/urxvi

AUTHOR	Chip Camden

DATE	January, 2011

DESCRIPTION

Perl extension for rxvt-unicode (aka urxvt) to enable the user to
navigate the terminal window using the keyboard.  The supplied urxvirc
file implements key bindings similar to the default bindings for vi
for cursor movement and text selection.

INSTALLATION

See the man page for urxvtperl(3) for a full discussion of Perl
extensions.  Enable this extension using one of the methods documented
there.  For example, you could place the script urxvi in
/usr/local/lib/urxvt/perl, then add the following to .Xdefaults:

URxvt.perl-ext: default,urxvi
URxvt.keysym.0xff14:	  perl:urxvi

This binds the Scroll Lock key to enable urxvi's functionality.


OPERATION

On initialization, this extension first tries to load any "urxvirc" file found
in the same directory as the "urxvi" script itself.  No error occurs if this
file cannot be found.  Next, any script specified by the resource
URxvt.urxvi.rxfile will be loaded -- again, silently failing if not found.

Once the extension is invoked vie the "urxvi" user command, the extension
captures all keyboard input to the terminal window until either a 'quit'
command is executed or the 'urxvi' user command is repeated.  

The supplied version of urxvirc provides the following key bindings:

^		move to the first non-space character on the current row.
$		move to the last non-space character on the current row.
+, <Return>	move to the beginning of the (current + (repeat-count or 1)) row.
-		move to the beginning of the (current - (repeat-count or 1)) row.
/		prompt the user for a pattern to find forward
?		prompt the user for a pattern to find backward
:		prompt the user for a command to execute
'		go to mark, based on next key
|		prompt the user for a command to which to pipe selected text
		(or all text, if there is no selection).
0		move to beginning of line, unless a repeat-count has been started
		(in which case it adds the 0 to the repeat-count).
1-9		add the digit to the repeat-count.
b		move backward to the beginning of a word (delimited by non-word chaarcters).
B		move backward to the beginning of a WORD (delimited by spaces).
e		move forward to the end of a word.
E		move forward to the end of a WORD.
G		move to the beginning of the (repeat-count or last) absolute row.
		(For most commands, rows start at 0 for the final screen-full as
		in urxvt's API, with negative numbers for scrollback rows.  In this
		command, however, they begin at 1 for the first known row.)
h, <Left>	move (repeat-count or 1) columns left.
H		move to the beginning of the first visible row.
j, <Down>	move (repeat-count or 1) rows down.
k, <Up>		move (repeat-count or 1) rows up.
l, <Right>	move (repeat-count or 1) columns right.
L		move to the beginning of the last visible row.
m		mark, based on next key
n		find the next occurrence of the previous interactive "find", in the
		same direction.
q		quit urxvi
v		toggle character-wise selection mode.
V		toggle line-wise selection mode.
w		move forward to the beginning of a word.
W		move forward to the beginning of a WORD.
y		if in selection mode, exit selection mode (leaving text selected)
		otherwise, wait for the next key.  If another y, select (repeat-count or 1)
		lines, starting with the current line.  For any other character, execute
		that movement in select mode, then turn off select mode.
<Home>		move to the first row.
<End>		move to the last row.
<C-b>, <PageUp> move (repeat-count or 1) pages up.
<C-d>		move (repeat-count or 1) half pages down.
<C-f>, <PageDown> move (repeat-count or 1) pages down.
<C-u>		move (repeat-count or 1) half pages up.
<Esc>		if in selection mode, exit selection mode (leaving text selected)
		otherwise, if any text is selected, clear the selection
		otherwise, quit urxvi.

When in selection mode, every cursor movement selects the text between the selection anchor
(where selection was initiated) and the current cursor position.  There are two selection
modes, "line" and "char".  The former selects whole lines, while the latter selects from/to
row/column pairs.  Selected text is immediately copied to the clipboard, as it would be if
you performed the same selection with the mouse.

When in command mode, the following default key bindings are provided by urxvirc:

<Left>		Move command cursor one character left.
<Right>		Move command cursor one character right.
<Enter>		Apply the command.
<BS>		Erase character to the left of the command cursor.
		If no characters in cmd_text, exit command mode.
<Home>, <C-b>	Move command cursor to leftmost character.
<End>, <C-e>	Move command cursor to the right of the command text.
<Insert>	Toggle insert mode.
<Del>		Delete the character under the command cursor.
<C-u>		Erase all text to the left of the command cursor.
<Esc>, <C-c>	Exit command mode without executing anything.


SYNTAX

The urxvirc file and any user-supplied rc files contain commands in a simple S-expression
syntax that I like to call Slips (for "Sloppy Lisp").  See the file SLIPS-REFERENCE for full syntax.
The provided urxvirc file can serve as a good set of examples.


RESOURCES

This extension uses the following resources:

URxvt.urxvi.debug

	If set to "on", then debugging message will be sent to urxvt's stdout.
	These messages can be useful for debugging the syntax of your rc file.

URxvt.urxvi.rcfile

	If set, this resource specifies the path to an rcfile to evaluate.

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.