.inputrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 29 Mar 2023 23:42:06 +0300
changeset 1018 831e2c1bf980
parent 1015 64055295c18c
child 1021 011e1d002d17
permissions -rw-r--r--
Completed migration from ~/devel to ~/work.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50
9a89ae1918c4 How re-read ~/.inputrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 37
diff changeset
     1
# Settings for readline.
9a89ae1918c4 How re-read ~/.inputrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 37
diff changeset
     2
#
9a89ae1918c4 How re-read ~/.inputrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 37
diff changeset
     3
# Tips:
1014
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
     4
# * Re-read ~/.inputrc: C-x C-r
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
     5
# * Dump PTY codes on a key release: showkey -a
33
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
# I like this!
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
set editing-mode emacs
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
# Don't strip characters to 7 bits when reading.
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
set input-meta on
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
# Allow iso-latin1 characters to be inserted rather than converted to
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
# prefix-meta sequences.
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
set convert-meta off
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
# Display characters with the eighth bit set directly rather than as
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
# meta-prefixed characters.
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
set output-meta on
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
159
022803a4d179 Terminal driver rebound some keys. See output 'stty -a'. I like original
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
    21
# Terminal driver rebound some keys. See output 'stty -a'. I like original
022803a4d179 Terminal driver rebound some keys. See output 'stty -a'. I like original
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
    22
# control codes (to set 'C-w', etc).
022803a4d179 Terminal driver rebound some keys. See output 'stty -a'. I like original
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
    23
set bind-tty-special-chars off
022803a4d179 Terminal driver rebound some keys. See output 'stty -a'. I like original
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
    24
468
4a28df9cf5f0 Ignore hidden files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 238
diff changeset
    25
# Ignore hidden files.
4a28df9cf5f0 Ignore hidden files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 238
diff changeset
    26
set match-hidden-files off
4a28df9cf5f0 Ignore hidden files.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 238
diff changeset
    27
52
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    28
# Ignore case (on/off).
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    29
set completion-ignore-case on
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    30
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    31
set completion-query-items 100
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    32
37
5d56427b59a4 First tab suggests ambiguous variants.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 33
diff changeset
    33
# First tab suggests ambiguous variants.
5d56427b59a4 First tab suggests ambiguous variants.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 33
diff changeset
    34
set show-all-if-ambiguous on
5d56427b59a4 First tab suggests ambiguous variants.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 33
diff changeset
    35
175
dff101b7fff0 Replace common prefix with ...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
    36
# Replace common prefix with ...
dff101b7fff0 Replace common prefix with ...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
    37
set completion-prefix-display-length 1
dff101b7fff0 Replace common prefix with ...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
    38
819
6d313c0c6247 Do not duplicate completion if we in the middle of the word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 818
diff changeset
    39
# Do not duplicate completion if we in the middle of the word.
6d313c0c6247 Do not duplicate completion if we in the middle of the word.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 818
diff changeset
    40
set skip-completed-text on
722
9bd7ce98c7ce colored-stats
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 622
diff changeset
    41
52
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    42
# If set to 'on', completed directory names have a slash appended. The default is 'on'.
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    43
set mark-directories on
170
d67518019fe5 Reoder.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 169
diff changeset
    44
set mark-symlinked-directories on
52
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    45
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    46
# If set to 'on', a character denoting a file's type is appended to the
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    47
# filename when listing possible completions. The default is 'off'.
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    48
set visible-stats on
1481359f69d8 Useful competition settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 51
diff changeset
    49
818
ed6620260c69 colored-stats is Bash feature. It breaks Emacs 25. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
    50
$if Bash
ed6620260c69 colored-stats is Bash feature. It breaks Emacs 25. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
    51
  set colored-stats on
ed6620260c69 colored-stats is Bash feature. It breaks Emacs 25. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 730
diff changeset
    52
$endif
722
9bd7ce98c7ce colored-stats
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 622
diff changeset
    53
53
e38c00b4f0f0 Use beep if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 52
diff changeset
    54
# I like beep (audible/visible/none).
e38c00b4f0f0 Use beep if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 52
diff changeset
    55
set bell-style audible
e38c00b4f0f0 Use beep if possible.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 52
diff changeset
    56
51
5e6ee2b720fd Point to C-v key binding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
    57
# 'quoted-insert' binded to C-q or C-v by default, but C-q usually not worked
5e6ee2b720fd Point to C-v key binding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
    58
# because it handled by terminal driver before readline.
5e6ee2b720fd Point to C-v key binding.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 50
diff changeset
    59
C-v: quoted-insert
37
5d56427b59a4 First tab suggests ambiguous variants.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 33
diff changeset
    60
54
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    61
# Setting it to 'on' means that the text of the lines being edited will scroll
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    62
# horizontally on a single screen line when they are longer than the width of
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    63
# the screen, instead of wrapping onto a new screen line. By default, this
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    64
# variable is set to 'off'.
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    65
set horizontal-scroll-mode off
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    66
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    67
# This variable, when set to `on', causes Readline to display an asterisk
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    68
# ('*') at the start of history lines which have been modified. This variable
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    69
# is 'off' by default.
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    70
set mark-modified-lines off
95a79aeb9abb Misc readline customisation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 53
diff changeset
    71
55
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    72
$if Bash
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    73
# Invoke an editor on the current command line, and execute the result as
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    74
# shell commands. Bash attempts to invoke $FCEDIT, $EDITOR, and emacs as the
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    75
# editor, in that order.
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    76
"\C-x\C-e": edit-and-execute-command
730
2a20e23423d6 Space: magic-space
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 722
diff changeset
    77
Space: magic-space
55
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    78
$endif
8fd48debf4cc Point to 'C-x C-e' command in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 54
diff changeset
    79
91
42abfd52d36c Define my favorite Emacs key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 55
diff changeset
    80
# Define my favorite Emacs key bindings.
159
022803a4d179 Terminal driver rebound some keys. See output 'stty -a'. I like original
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 143
diff changeset
    81
"\C-@": set-mark
1015
64055295c18c Seems M- syntax doesn't work, replaced it with \e.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    82
"\e ": set-mark
91
42abfd52d36c Define my favorite Emacs key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 55
diff changeset
    83
"\C-w": kill-region
1015
64055295c18c Seems M- syntax doesn't work, replaced it with \e.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1014
diff changeset
    84
"\ew": copy-region-as-kill
91
42abfd52d36c Define my favorite Emacs key bindings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 55
diff changeset
    85
1014
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
    86
# Ctrl+Left/Right to move by whole words. XTerm/Mintty.
142
e77decd4520a Ctrl+Left/Right to move by whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 92
diff changeset
    87
"\e[1;5C": forward-word
e77decd4520a Ctrl+Left/Right to move by whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 92
diff changeset
    88
"\e[1;5D": backward-word
143
e78ca0a7e608 Ctrl+Backspace/Delete to delete whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
    89
# Same with Shift pressed.
142
e77decd4520a Ctrl+Left/Right to move by whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 92
diff changeset
    90
"\e[1;6C": forward-word
e77decd4520a Ctrl+Left/Right to move by whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 92
diff changeset
    91
"\e[1;6D": backward-word
1014
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
    92
# Same but in Putty.
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
    93
"\eOC": forward-word
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
    94
"\eOD": backward-word
142
e77decd4520a Ctrl+Left/Right to move by whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 92
diff changeset
    95
1014
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
    96
# Ctrl+Backspace/Delete to delete whole words. XTerm/Mintty.
143
e78ca0a7e608 Ctrl+Backspace/Delete to delete whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
    97
"\e[3;5~": kill-word
e78ca0a7e608 Ctrl+Backspace/Delete to delete whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
    98
"\C-_": backward-kill-word
1014
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
    99
# Alt+DEL delete word forward. Putty.
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
   100
"\e\e[3~": kill-word
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
   101
# Alt+DEL delete word forward. XTerm, Mintty.
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
   102
"\e[3;3~": kill-word
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
   103
# Alt+BACKSPACE delete word backward. Putty.
8a5b395a94f7 Added navigation and word deleting commands for Putty.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 911
diff changeset
   104
"\e\d": backward-kill-word
143
e78ca0a7e608 Ctrl+Backspace/Delete to delete whole words.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 142
diff changeset
   105
160
d45758677427 UP/DOWN filter history by typed string as prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 159
diff changeset
   106
# UP/DOWN filter history by typed string as prefix.
d45758677427 UP/DOWN filter history by typed string as prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 159
diff changeset
   107
"\e[A": history-search-backward
d45758677427 UP/DOWN filter history by typed string as prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 159
diff changeset
   108
"\C-p": history-search-backward
488
e7c174f182b3 Use history search for UP/DOWN in Emacs term mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   109
"\eOA": history-search-backward
160
d45758677427 UP/DOWN filter history by typed string as prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 159
diff changeset
   110
"\e[B": history-search-forward
d45758677427 UP/DOWN filter history by typed string as prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 159
diff changeset
   111
"\C-n": history-search-forward
488
e7c174f182b3 Use history search for UP/DOWN in Emacs term mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 468
diff changeset
   112
"\eOB": history-search-forward
160
d45758677427 UP/DOWN filter history by typed string as prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 159
diff changeset
   113
911
626904acdc85 Set default binding for complete-filename, which was somehow missing.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 819
diff changeset
   114
"\e/" complete-filename
238
1ae5fbcaea7c Use 'Control+TAB' for cycling possible completion in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 225
diff changeset
   115
# Bind 'Shift+TAB' to complete as in Python TAB was need for another purpose.
225
29a3658af2d3 Bind "Shift TAB" to complete as in Python TAB was need for another purpose.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 175
diff changeset
   116
"\e[Z": complete
597
bf045b4083cb Cycling possible completion forward and backward in place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 488
diff changeset
   117
# Cycling possible completion forward and backward in place.
bf045b4083cb Cycling possible completion forward and backward in place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 488
diff changeset
   118
"\e[1;3C": menu-complete                    # M-Right
bf045b4083cb Cycling possible completion forward and backward in place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 488
diff changeset
   119
"\e[1;3D": menu-complete-backward           # M-Left
bf045b4083cb Cycling possible completion forward and backward in place.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 488
diff changeset
   120
"\e[1;5I": menu-complete                    # C-TAB
175
dff101b7fff0 Replace common prefix with ...
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
   121
33
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
# Local Variables:
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
# mode: shell-script
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
# fill-column: 78
961fa02a30ff Allow display and input russial letter in bash/rxvt on Cygwin.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
# End: