recentpopularlog in

kme : inputrc   20

bash - How do I enable automatic history expansion for commands using 'magic space'? - Ask Ubuntu | https://askubuntu.com/
So what this does is expand, for example, "!!" into the last command entered when you press space. It's kinda nice.
bash  dotfile  inputrc  readline  magicspace  configfile 
12 weeks ago by kme
bash - How to set Readline key bindings using ALT (Meta) or some other control key as prefix instead of `C-` and `e`? - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
There are too many questions in one question, but this one's interesting:
Furthermore, how can I control the "timeout" that should occur before a key binding, that is a prefix of a longer key binding, is executed?
macos  inputrc  keybindings  terminal.app  terminal 
12 weeks ago by kme
How to Set Readline key bindings in both vi-command and vi-insert modes - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
The "bind" keyword should not be in inputrc. The following inputrc works as intended. Ctrl-B transpose words in both insert and command mode:
<code class="language-bash">
set editing-mode vi
$if mode=vi
set keymap vi-command
Control-b: transpose-words
set keymap vi-insert
Control-b: transpose-words
$endif
</code>
readline  inputrc  vikeybindings  configfile 
12 weeks ago by kme
bash vi-mode triggers (arg: 200) prompt when pasting · Issue #947 · Guake/guake | https://github.com/
This was affecting me on elementaryOS Juno with Guake *and* the elementary Terminal app.

Workaround is to 'set enable-bracketed-paste off', which isn't great?
vim  guake  vikeybindings  inputrc  readline  bracketedpaste  annoyance  sortof  solution 
12 weeks ago by kme
bash - Shell vi mode prints (arg: repetition): How to remove it? - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
I was getting (arg: 200) because I had bracketed paste mode enabled in my ~/.inputrc. Turns out that was a bug (?) in an old version of vte. But this explains what that message actually means.
readline  inputrc  vikeybindings  reference 
12 weeks ago by kme
Shell Tricks: .inputrc binding fun - BrettTerpstra.com
In Bash, there are some great but lesser-known default bindings. You may know that Option-. will insert the last argument of the previous command (e.g. running ls ~/Desktop and then typing cd and pressing Option-. will turn it into cd ~/Desktop), but did you know you can actually yank the argument at any index from the last command (without using history or ! operators)?

Just press Option-[#], where # is the position of the argument you want, then type Option-. to insert it in the current command.
inputrc  bash  dotfile  configfile 
august 2019 by kme
Linuxart » Blog Archive » Super-useful inputrc | https://web.archive.org/
Not sure if really *any* of these work. Or maybe they just *work* now, by default, for most Linux distros, since this post was from 2005.
inputrc  dotfile  configfile 
april 2019 by kme
A ~/.inputrc for Humans - Top Bug Net | https://www.topbug.net/
<code class="language-inputrc">
$include /etc/inputrc
"\C-p":history-search-backward
"\C-n":history-search-forward

set colored-stats On
set completion-ignore-case On
set completion-prefix-display-length 3
set mark-symlinked-directories On
set show-all-if-ambiguous On
set show-all-if-unmodified On
set visible-stats On
</code>

I would add these, too:
<code class="language-inputrc">
$if mode=vi
set keymap vi-command
# these are for vi-command mode
"\e[A": history-search-backward
"\e[B": history-search-forward

set keymap vi-insert
# these are for vi-insert mode
"\e[A": history-search-backward
"\e[B": history-search-forward

# source: https://brettterpstra.com/2015/07/09/shell-tricks-inputrc-binding-fun/
"\e[1;5C": forward-word
"\e[1;5D": backward-word
$endif
</code>
bash  commandline  editing  configfile  dotfile  movein  essential  newbie  inputrc  readline 
april 2019 by kme
bash - .inputrc TAB not behaving as expected - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
Readline doesn't know anything about a modifier called Shift, and quietly ignores unknown modifier names. Try wibble-TAB.
unix  bash  readline  inputrc  annoyance  workaround  solution 
november 2018 by kme
You can make readline (and bash) much more user friendly by adding a few options to ~/.inputrc : commandline | https://www.reddit.com/
set completion-prefix-display-length 2

This one is insanely useful when you have a folder with lots of similarly named files and you are not sure how far the completion has gone when you press TAB. The first part that has been completed will be replaced by "...", and it is simple to see what you need to type to finish the completion.
inputrc  input  readline  bash  cli  configfile  configsettings  example  newbie  movein  essential 
october 2018 by kme
readline - How do I reload .inputrc using a bash script? - Super User | https://superuser.com/
Use the bind command:
<code class="language-bash">
bind -f ~/.inputrc
</code>

See help bind for more information:
<code>
-f filename Read key bindings from FILENAME.
</code>
keybindings  macros  inputrc  bash  configfile  configsettings  solution 
october 2018 by kme
bash - How do I reload .inputrc? - Super User | https://superuser.com/
Interesting, but doesn't work for me.
By default, C-x C-r is bound to re-read-init-file.

See the Bash Reference Manual for explanation.


Maybe this does:
bind -f ~/.inputrc
bash  inputrc  keyboard  readline  configfile  dammitbrain 
october 2018 by kme
Linuxart » Blog Archive » Super-useful inputrc
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
set completion-ignore-case On
bash  configfile  inputrc 
april 2013 by kme
Quick Tip: some .inputrc fun - BrettTerpstra.com
You can also bind a key to glob-expand-word which will take a bash glob -- say * -- and replace the glob with all the files that match that glob.
<code>set bind-tty-special-chars on
set mark-symlinked-directories on
set prefer-visible-bell on
"\C-w": unix-filename-rubout
"": unix-filename-rubout
"\C-x*": glob-expand-word</code>

The bind-tty-special-chars is so that I can use C-s and C-r to search forward and backwards, respectively, in my command history. Normally C-s taken over by the tty but by enabling bind-tty-special-chars and also putting this,
<code># this is a bugfix for certain terminals so that all eamcs bindings
# work.
if [ -t 0 ]; then
stty stop undef
stty werase undef
fi</code>
In Bash, there are some great but lesser-known default bindings. You may know that Option-. will insert the last argument of the previous command (e.g. running ls ~/Desktop and then typing cd and pressing Option-. will turn it into cd ~/Desktop), but did you know you can actually yank the argument at any index from the last command (without using history or ! operators)?

Just press Option-[#], where # is the position of the argument you want, then type Option-. to insert it in the current command.
commandline  terminal  cli  inputrc  configfile  rubout 
april 2013 by kme
Rob on Programming: Inputrc for bash history completion using up/down arrows

# Source:
# http://robertmarkbramprogrammer.blogspot.com/2008/08/inputrc-for-bash-history-completion.html

# By default up/down are bound to previous-history
# and next-history respectively. The following does the
# same but gives the extra functionality where if you
# type any text (or more accurately, if there is any text
# between the start of the line and the cursor),
# the subset of the history starting with that text
# is searched (like 4dos for e.g.).
# Note to get rid of a line just Ctrl-C
"\e[B": history-search-forward
"\e[A": history-search-backward

$if Bash
# F10 toggles mc on and off
# Note Ctrl-o toggles panes on and off in mc
"\e[21~": "mc\C-M"

#do history expansion when space entered
Space: magic-space
$endif

# Include system wide settings which are ignored
# by default if one has their own .inputrc
$include /etc/inputrc
bash  completion  history  shell  inputrc  configfile  mc  movein 
april 2013 by kme

Copy this bookmark:





to read