New answers tagged

4

The Alt-. runs readline function yank-last-arg: yank-last-arg (M-., M-_) Insert the last argument to the previous command (the last word of the previ‐ ous history entry). With a numeric argument, behave exactly like yank-nth-arg. Successive calls to yank-last-arg move back through the his‐ ...


2

You can get a list of the vi-related Readline function names by running this in bash: bind -P | grep -w vi Unfortunately, the documentation for these functions is lacking. The official documentation for the Readline library focuses more on Emacs mode and provides minimal information on how to use Vi-mode. In the short section, Readline vi Mode, it states ...


5

The short answer is that you can not use regular expressions to search the shell history. According to POSIX (the standard for Unix-like operating systems), you should be able to search using regular shell pattern matching (as used for filename globbing and with case statements). This feature is referred to as non-incremental search but it currently does not ...


3

In a terminal, you generally cannot get all combinations of control- and shift-modifiers to be different values: the basis for control and shift is from US-ASCII (and similar) schemes which defines control and shift for the alphabetic characters plus a few punctuation characters. the combination control+shift usually has no effect, except for special keys. ...


1

You don't need to $include from your ~/.inputrc as you can read an inputrc file at any time with bind -f /path/to/global/inputrc so use your usual if [ -r file ] with this instead of source. The man page for says for an interactive login shell it reads /etc/profile and the first found of ~/.bash_profile, ~/.bash_login, and ~/.profile. For other ...


1

Rather than doing this in the .inputrc file (which has no facility for checking that the file actually exists AFAIK), you may set the INPUTRC environment variable in your .bashrc file: if [ -r "$GLOBAL_BASHRC" -a -f "$GLOBAL_BASHRC" ]; then # Load the bashrc source $GLOBAL_BASHRC if [ -f /path/to/global/inputrc ]; then export INPUTRC="/...


0

The applications defaults files for xterm are designed to include XTerm-color using a different route. This resource *customization: -color would tell the X Toolkit library to load a resource file ending with "-color". There are several app-defaults files installed for xterm. Looking at my /etc/X11/app-defaults, these are the main ones: -rw-r--r-- 1 ...


8

readline's vi-mode is a subset of vi (essentially features that affect a single line, with some allowances for usability). The ci command is not part of vi; it is a vim feature. Further reading: A powerful VIM command I never knew about until now. Vim 101: Efficient HTML Editing with Text Objects How to replace text between quotes in vi Change inside ...



Top 50 recent answers are included