-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
82 lines (72 loc) · 2.52 KB
/
.inputrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This configuration file sets modes/bindings for the GNU readline
# library. It is used in the history and command editing interfaces
# to gdb and bash.
#
set editing-mode vi
C-D: possible-completions
C-L: clear-screen
"\C-x\C-x": "!!\C-m"
set horizontal-scroll-mode Off
# Show extra file information when completing, like `ls -F` does
set visible-stats On
TAB: complete
set meta-flag On
# Allow UTF-8 input and output, instead of showing stuff like $'\0123\0456'
set input-meta On
set output-meta On
set convert-meta Off
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories On
# Show all autocomplete results at once
set page-completions Off
# # If there are more than 200 possible completions for a word, ask to show them all
set completion-query-items 200
# Be more intelligent when autocompleting by also looking at the text after
# the cursor. For example, when the current line is "cd ~/src/mozil", and
# the cursor is on the "z", pressing Tab will not autocomplete it to "cd
# ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the
# Readline used by Bash 4.)
set skip-completed-text on
"\C-?": backward-delete-char
"\C-[": vi-movement-mode
"\C-_": undo
"\C-b": shell-expand-line
"\C-d": possible-completions
"\C-h": backward-delete-char
"\C-i": complete
"\C-j": accept-line
"\C-l": clear-screen
# Use Alt/Meta + Delete to delete the preceding word
"\e[3;3~": kill-word
"\C-k": kill-line
"\C-m": accept-line
"\C-r": reverse-search-history
"\C-s": forward-search-history
"\C-t": transpose-chars
"\C-u": unix-line-discard
"\C-v": quoted-insert
"\C-w": unix-word-rubout
"\C-y": yank
C-G: re-read-init-file
"\e[A": history-search-backward
"\e[B": history-search-forward
"\C-p": previous-history
"\C-n": next-history
"\C-w": backward-delete-word
# Set the mode string and cursor to indicate the vim mode
# # for the number after `\e[`:
# # 0: blinking block
# # 1: blinking block (default)
# # 2: steady block
# # 3: blinking underline
# # 4: steady underline
# # 5: blinking bar (xterm)
# # 6: steady bar (xterm)
# Also see https://stackoverflow.com/questions/44534678/how-to-change-cursor-shape-depending-on-vi-mode-in-bash
# and https://stackoverflow.com/questions/1039713/different-bash-prompt-for-different-vi-editing-mode
#
# Stolen from https://github.com/davxy/dotfiles/blob/f6f3eb3f920e9aaeb57f9652e005d0cb71bb3abb/bash/inputrc#L1
# Show the Vim mode in prompt (command or insert)
set show-mode-in-prompt on
set vi-ins-mode-string "\1\e[1 q\2"
set vi-cmd-mode-string "\1\e[5 q\2"