-
Notifications
You must be signed in to change notification settings - Fork 1
/
.inputrc
82 lines (77 loc) · 2.98 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
82
set blink-matching-paren on
#set colored-completion-prefix on # doesn't work???
set colored-stats on
set completion-prefix-display-length 10
set echo-control-characters off
set skip-completed-text on
#set operate-and-get-next on # repeat set of commands from history using ^C-o
"\e,": menu-complete
"\C-x\C-p": dabbrev-expand # complete word (used before)
"\C-x\C-i": dynamic-complete-history
"\C-x\C-m": print-last-kbd-macro # print macro definition
"\C-x\C-f": dump-macros
"\e\C-l": redraw-current-line
"\e[5~": history-search-backward # type part of command, page-up to search in history backward
"\e[6~": history-search-forward # type part of command, page-up to search in history forward
# Applications
$if bash
Space: magic-space # expand short
"\e\C-d": forward-backward-delete-char
"\C-e\C-w": unix-filename-rubout # kill backward, stop by / and space
"\C-e\C-d": "\e\C-]|\C-f\C-k" # delete to last pipe
"\C-x\C-w": "\C-awhile :;do \C-e\C-e;sleep 60;done" # Wrap current line in while with 60s delay
"\e\C-b": "\e\C-]/" # jump backward to /
"\e\C-f": "\C-]/" # jump forward to /
"\C-xq": "\eb\"\ef\"" # wrap current word in "
"\e\C-m": "\C-a \C-m" # execute, no bash history - ESC-Enter
#"\C-x\C-r": "\C-a#\C-mhistory | sed 'x;$!d' | cut -f 2 -d '#' | pbcopy\C-m" # comments command, executes it and then copies it from history into clipboard
"\C-]": "\C-e\C-u pbcopy <<EOF\n\C-y\nEOF\n \# content of previous prompt was coppied into OS clipboard\n"
$endif
$if mysql
"\C-e\C-p": "SHOW PROCESSLIST;\C-j"
"\C-e\C-f": "SHOW FULL PROCESSLIST;\C-j"
"\C-e\C-m": "SHOW MASTER STATUS;\C-j"
"\C-e\C-n": "SHOW SLAVE STATUS\\\G\C-j"
"\C-e\C-h": "SHOW SLAVE HOSTS;\C-j"
"\C-e\C-v": "SHOW VARIABLES;\C-j"
"\C-e\C-d": "SHOW DATABASES;\C-j"
"\C-e\C-t": "SHOW TABLES;\C-j"
"\C-e1": "source /tmp/1.sql;\C-j"
"\C-e2": "source /tmp/2.sql;\C-j"
"\C-e3": "source /tmp/3.sql;\C-j"
"\C-e4": "source /tmp/4.sql;\C-j"
"\C-e5": "source /tmp/5.sql;\C-j"
"\C-e6": "source /tmp/6.sql;\C-j"
"\C-e7": "source /tmp/7.sql;\C-j"
"\C-e8": "source /tmp/8.sql;\C-j"
"\C-e9": "source /tmp/9.sql;\C-j"
"\C-e0": "source /tmp/0.sql;\C-j"
$endif
$if psql
"\C-e\C-p": "SELECT * FROM pg_stat_activity;\C-j"
"\C-e\C-m": "SELECT * FROM pg_stat_replication;\C-j"
"\C-e\C-d": "SELECT NOW() - pg_last_xact_replay_timestamp() AS replag;\C-j"
"\C-e\C-v": "SHOW ALL;\C-j"
"\C-e1": "\\i /tmp/1.sql;\C-j"
"\C-e2": "\\i /tmp/2.sql;\C-j"
"\C-e3": "\\i /tmp/3.sql;\C-j"
"\C-e4": "\\i /tmp/4.sql;\C-j"
"\C-e5": "\\i /tmp/5.sql;\C-j"
"\C-e6": "\\i /tmp/6.sql;\C-j"
"\C-e7": "\\i /tmp/7.sql;\C-j"
"\C-e8": "\\i /tmp/8.sql;\C-j"
"\C-e9": "\\i /tmp/9.sql;\C-j"
"\C-e0": "\\i /tmp/0.sql;\C-j"
$endif
## Modes
#set show-mode-in-prompt on
#set keymap emacs
# "\C-e\C-m": vi-editing-mode
#
#set keymap vi-command
# "\C-e\C-m": emacs-editing-mode
# "k": history-search-backward
# "j": history-search-forward
#
#set keymap vi-insert
# "\C-e\C-m": emacs-editing-mode