Customizing keybindings

The keys used to activate commands in aptitude can be customized in the configuration file. Every command has an associated configuration variable under Aptitude::UI::Keybindings; to change the keystroke bound to a command, just set the corresponding variable to the keystroke. For instance, to make the key s perform a search, set Aptitude::UI::Keybindings::Search to “s”. You can require the Control key to be pressed by placing “C-” in front of the key: for instance, using “C-s” instead of “s” would bind Search to Control+s instead of s. Finally, you can bind a command to several keys at once using a comma-separated list: for instance, using “s,C-s” would cause both s and Control+s to perform a search.

The following commands can be bound to keys by setting the variable Aptitude::UI::Keybindings::command, where command is the name of the command to be bound:

CommandDefaultDescription
ApplySolution! If packages are broken and aptitude has suggested a solution to the problem, immediately apply the solution.
Beginhome,C-a Move to the beginning of the current display: to the top of a list, or to the left of a text entry field.
BugReportB Reports a bug in the currently selected package, using reportbug.
CancelC-g,escape,C-[ Cancels the current interaction: for instance, discards a dialog box or deactivates the menu.
ChangelogC Displays the changelog.Debian of the currently selected package or package version.
ChangePkgTreeGroupingG Changes the grouping policy of the currently active package list.
ChangePkgTreeLimitl Changes the limit of the currently active package list.
ChangePkgTreeSortingS Changes the sorting policy of the currently active package list.
ClearAutom Marks the currently selected package as having been manually installed.
CollapseAll] Collapses the selected tree and all its children in a hierarchical list.
CollapseTreeNo binding Collapses the selected tree in a hierarchical list.
CommitN In the hierarchy editor, stores the hierarchy location of the current package and proceeds to the next package.
Confirmenter In dialog boxes, this is equivalent to pressing “Ok”; when interacting with a status-line multiple choice question, it chooses the default option.
Cycletab Switches the keyboard focus to the next “widget”.
CycleNextf6 Switches to the next active view.
CycleOrdero Cycles through predefined arrangements of the display.
CyclePrevf7 Switches to the previous active view.
DelBOLC-u Deletes all text between the cursor and the beginning of the line.
DelBackbackspace,C-h Deletes the previous character when entering text.
DelEOLC-k Deletes all text from the cursor to the end of the line.
DelForwarddelete,C-d Deletes the character under the cursor when entering text.
Dependenciesd Displays the dependencies of the currently selected package.
DescriptionCyclei When browsing the package list, cycles through the available views in the information area.
DescriptionDownz When browsing the package list, scrolls the information area down one line.
DescriptionUpa When browsing the package list, scrolls the information area up one line.
DoInstallRung If not in a preview screen, display the preview screen [a]; if in a preview screen, perform an install run.
Downdown,j Moves down: for instance, scrolls a text display down or selects the next item in a list.
DpkgReconfigureR Runs “dpkg-reconfigure” on the currently selected package.
DumpResolver* If packages are broken, writes the current state of the problem-resolver to a file (for debugging purposes).
EditHierE Opens the hierarchy editor.
Endend,C-e Move to the end of the current display: to the bottom of a list, or to the right of a text entry field.
ExamineSolutione If some packages are broken and aptitude has suggested a solution, display a dialog box with a detailed description of the proposed solution.
ExpandAll[ Expands the selected tree and all its children in a hierarchical list.
ExpandTreeNo binding Expands the selected tree in a hierarchical list.
FirstSolution< Select the first solution produced by the problem resolver.
ForbidUpgradeF Forbids a package from being upgraded to the currently available version (or a particular version).
ForgetNewPackagesf Discards all information about which packages are “new” (causes the list of “new” packages to become empty).
Help? Displays the on-line help screen.
HistoryNextdown,C-n In a line editor with history, moves forwards in the history.
HistoryPrevup,C-p In a line editor with history, moves backwards in the history.
Hold= Places a package on hold.
Install+ Flags a package for installation.
InstallSingleI Marks a single package for installation; all other packages are kept at their current version.
Keep: Cancels all installation or removal requests and all holds for a package.
LastSolution< Select the last solution produced by the problem resolver.
Leftleft,h Moves left: for instance, moves one menu to the left in the menu bar, or moves the cursor to the left when editing text.
LevelDownJ In a hierarchical list, selects the next sibling of the currently selected item (the next item at the same level with the same parent).
LevelUpK In a hierarchical list, selects the previous sibling of the currently selected item (the previous item at the same level with the same parent).
MarkUpgradableU Attempts to upgrade all packages which are not held back or forbidden from upgrading.
MineFlagSquaref In Minesweeper, places or removes a flag on a square.
MineLoadGameL Loads a Minesweeper game.
MineSaveGameS Saves a Minesweeper game.
MineSweepSquareNo binding Sweeps around the current square in Minesweeper.
MineUncoverSquareNo binding Uncovers the current square in Minesweeper
MineUncoverSweepSquareenter Uncovers the current square in Minesweeper if it is covered; otherwise, sweeps around it.
NextPagepagedown,C-f Moves the current display one page forward.
NextSolution. Advance the dependency resolver to the next solution.
Non[b] This key will select the “no” button in yes/no dialog boxes.
Parent^ Selects the parent of the selected item in a hierarchical list.
PrevPagepageup,C-b Moves the current display one page backward.
PrevSolution, Return the dependency resolver to the previous solution.
Purge_ Flags the currently selected package to be purged.
PushButtonspace,enter Activates the currently selected button, or toggles a checkbox.
Quitq Close the current view.
QuitProgramQ Quit the entire program.
RejectBreakHolds  Reject all resolver actions that would break a hold; equivalent to ResolverReject Breaking Holds.
RefreshC-l Redraws the screen from scratch.
Remove- Flags a package for removal.
ReInstallL Flags the currently selected package to be reinstalled.
RepeatSearchBackN Repeats the last search, but searches in the opposite direction.
ReSearchn Repeats the last search.
ReverseDependenciesr Displays packages which depend upon the currently selected package.
Rightright,l Moves right: for instance, moves one menu to the right in the menu bar, or moves the cursor to the right when editing text.
SaveHierS In the hierarchy editor, saves the current hierarchy.
Search/ Activate the “search” function of the currently active interface element.
SearchBack\ Activate the “search backwards” function of the currently active interface element.
SearchBrokenb In a package tree, search for the next broken package.
SetAutoM Marks the current package as having been automatically installed.
ShowHideDescriptionD In a package list, toggles whether the information area is visible.
SolutionActionApprovea When viewing a solution, marks the currently selected action as "approved" (it will be included in future solutions whenever possible).
SolutionActionRejectr When viewing a solution, marks the currently selected action as "rejected" (future solutions will not contain it).
ToggleExpandedenter Expands or collapses the currently selected tree in a hierarchical list.
ToggleMenuActiveC-m,f10,C-space Activates or deactivates the main menu.
UndoC-_,C-u Cancels the last action, up to when aptitude was started OR the last time you update the package lists or installed packages.
Upup,k Moves up: for instance, scrolls a text display up or selects the previous item in a list.
UpdatePackageListu Updates the list of packages by fetching new lists from the Internet if necessary.
Versionsv Displays the available versions of the currently selected package.
Yes y [b] This key will select the “Yes” button in yes/no dialog boxes.

[b] This default may be different in different locales.

In addition to letter keys, number keys, and punctuation, the following “special” keys can be bound:

Key nameDescription
a1The A1 key.
a3The A3 key.
b2The B2 key.
backspaceThe Backspace key.
backtabThe back-tab key
beginThe Begin key (not Home)
break The “break” key.
c1The C1 key.
c3The C3 key.
cancelThe Cancel key.
createThe Create key.
comma Comma (,) -- note that because commas are used to list keys, this is the only way to bind to a comma.
commandThe Command key.
copyThe Copy key.
deleteThe Delete key.
delete_lineThe “delete line” key.
downThe “down” arrow key.
endThe End key.
entryThe Enter key.
exitThe Exit key.
f1, f2, ..., f10The F1 through F10 keys.
findThe Find key.
homeThe Home key.
insertThe Insert key.
insert_exitThe “insert exit” key.
clearThe “clear” key.
clear_eolThe “clear to end of line” key.
clear_eosThe “clear to end of screen” key.
insert_lineThe “insert line” key.
leftThe “left” arrow key.
markThe Mark key.
messageThe Message key.
moveThe Move key.
nextThe Next key.
openThe Open key.
previousThe Previous key.
printThe Print key.
redoThe Redo key.
referenceThe Reference key.
refreshThe Refresh key.
replaceThe Replace key.
restartThe Restart key.
resumeThe Resume key.
returnThe Return key.
rightThe “right” arrow key.
saveThe Save key.
scrollfThe “scroll forward” key.
scrollrThe “scroll backwards” key.
selectThe Select key.
suspendThe Suspend key.
pagedownThe “Page Down” key.
pageupThe “Page Up” key.
spaceThe Space key
tabThe Tab key
undoThe Undo key.
upThe “up” arrow key.

In addition to binding keys globally, it is possible to change key bindings for one particular part (or domain) of aptitude: for instance, to make Tab the equivalent of the right arrow key in menu bars, set Aptitude::UI::Keybindings::Menubar::Right to “tab,right”. The following domains are available:

DomainDescription
EditLine Used by line-editing widgets, such as the entry field in a “search” dialog.
Menu Used by drop-down menus.
Menubar Used by the menu bar at the top of the screen.
Minesweeper Used by the Minesweeper mode.
MinibufChoice Used by the multiple-choice prompts that appear if you have chosen to have some prompts appear in the status line.
Pager Used when displaying a file on disk (for instance, the help text).
PkgNode Used by packages, trees of packages, package versions, and package dependencies when they appear in package lists.
PkgTree Used by package lists.
Table Used by tables of widgets (for instance, dialog boxes).
TextLayout Used by formatted text displays, such as package descriptions.
Tree Used by all tree displays (including package lists, for which it can be overridden by PkgTree).