12 Readline Options

BashStyle-NG Readline Settings

Figure 12.1: Readline Settings

Basic

Setting: use_readlinecfg Configure Readline

This master switch will make BashStyle-NG adjust the Settings for Readline

Setting: completion Enable completion

Enable Readline (Tab) completion.

Setting: bellstyle Choose bellstyle

Set the style of "bell" Readline uses to inform the user when an error occurs or upon other events:

  • audible = *beep*
  • visible = screen flashes
  • nothing
Setting: editing_mode Choose editing mode

Controls whether Readline uses a set of key bindings similar to emacs or vi

Completion

Setting: skip_completed_text Skip completed text

When completion is triggered in the middle of a string, bash will never duplicate the trailing substring upon completion. Example

ls
teststring testsubstring
cp testsuring

where | represents the cursor position while pressing TAB, the following result will be generated with this setting enabled: cp testsubstring with this setting disabled: cp testsubstringring Notice how the trailing ring that was there before completion remains.

Setting: complete_horizontal Horizontal complmetion

If enabled, Readline displays completions with matches sorted horizontally in alphabetical order, rather than down the screen.

Setting: ambiguous_show Show matches if ambiguous

If enabled, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell.

Setting: colored_completion_prefix Colored Completion Prefix

Color the completion prefix, uses the $LS_COLORS value

Example when pressing TAB to complete all files starting with userdoc, ambiguous_show is enabled (in this case the prefix is yellow):

Readline colored completion prefix

Figure 12.2: Readline Settings

Setting: query_items Completion Query Items

When the number of possible completions is greater than or equal to the value of this Setting, Readline asks whether or not the user wishes to view them.

Setting: complete_hidden Match hidden files

Whether to include hidden files in file name completion or not.

Setting: ignore_case Ignore case

Whether completion is case sensitive or not.

Setting: mark_directories Mark directories

If enabled, completed directory names have a slash appended.

Setting: mark_symbolic_directories Mark symbolic directories

If enabled, completed names which are symbolic links to directories have a slash appended, subject to the value of mark_directories

Setting: visible_stats Show stats

If enabled, a character denoting a file’s type as reported by stat is appended to the filename when listing possible completions

Setting: colored_stats Colored stats

If enabled, following visible_stats the completet filenames are colored according to $LS_COLORS.

Misc.

Setting: scroll_horizontal Scroll horizontally

Makes the shell scroll horizontal, rather when wrapping to a new line, if the input exceeds the screen width.

Setting: mark_modified Mark modified history lines

When pressing Arrow Up or otherwise reusing a command from the history and modifying that command the prompt is preceeded by * to mark the history item as modified.

Setting: search_ignore_case

Whether Readline performs history list searches case sensitive or not.

Setting: enable_bracketed_paste Enable Bracketed Paste

When set to On, readline configures the terminal to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard

Edit Modes

Setting: show_editmode Show Edit Mode in Prompt

If enabled the shell shows the current active edit mode in the prompt.

Setting: emacs_mode_string Emacs Mode String

If show_editmode is enabled, this string is used for indicating emacs edit mode.

Setting: vi_cmd_mode_string Vi Command Mode String

If show_editmode is enabled, this string is used for indicating vi command mode.

Setting: vi_ins_mode_string Vi Insert Mode String

If show_editmode is enabled, this string is used for indicating vi insert mode.