-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
79 lines (67 loc) · 2.43 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
$if Bash
# key mapping
"\C-p": history-search-backward
"\C-n": history-search-forward
# up
"\e[A": history-search-backward
# down
"\e[B": history-search-forward
# shift left
"\e[1;2D": backward-word
# shift right
"\e[1;2C": forward-word
# shift + tab
"\e[Z": backward-kill-word
# default is c-x,c-e
# this command is valid only bash
"\C-x\C-f": edit-and-execute-command
# NOTE: to avoid running command when paste by clipboard with new lines
set enable-bracketed-paste on
# NOTE: show all completions as soon as one press tab, even if there's more than one
# if this option is off, you have to press twice
set show-all-if-ambiguous on
set completion-ignore-case on
# add '*','/' mark to end of executable or directory at completion
set visible-stats on
# [bash \- is there a way to set coloring for cd tab complete? \- Unix & Linux Stack Exchange]( https://unix.stackexchange.com/questions/16243/is-there-a-way-to-set-coloring-for-cd-tab-complete )
# NOTE: readline 6.3 and later
# add color (LS_COLORS) to executable or directory at completion
set colored-stats on
set colored-completion-prefix on
set mark-symlinked-directories on
set menu-complete-display-prefix on
set bell-style none
$endif
$if Gdb
"\C-p": history-search-backward
"\C-n": history-search-forward
# normal history search
"\C-r": reverse-search-history
# NOTE:
"\C-s": forward-search-history
# fzf history search
"\C-x\C-r": "\C-b\C-k!f\C-m\C-b\C-r\C-b\C-z"
"\C-x\C-x": "\C-b\C-k!fs\C-m\C-b\C-r\C-b\C-z"
"\C-b\C-k": kill-whole-line
"\C-b\C-r": re-read-init-file
"\C-b\C-z": "hello world" # dummy text
# NOTE: ignored if nothing without log
$include ~/.config/gdb/.tmp.inputrc
# hook enter for catch new command history
# "\C-m": accept-line
# 下記のコマンドの後にコマンドを挿入するようにすればプロセス起動中のコマンド履歴を取得可能
# show commands ,n,+を駆使すれば無理やり可能ではあるので,gdbのpython bindを利用することになる
# "\C-b": "\C-a!echo \C-e>~/tmp/history.log\C-m"
# copy to clipboard
"\C-y": "\C-a!echo '\C-e' | { xclip -sel clip || xsel --clipboard --input || pbcopy; } >/dev/null 2>&1\C-m"
# up
"\e[A": history-search-backward
# down
"\e[B": history-search-forward
# shift left
"\e[1;2D": backward-word
# shift right
"\e[1;2C": forward-word
# shift + tab
"\e[Z": backward-kill-word
$endif