summaryrefslogtreecommitdiff
path: root/home/xyz/.inputrc
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-12-14 03:15:25 -0800
committerxyz <gky44px1999@gmail.com>2021-12-14 03:15:25 -0800
commit2c3b0dc32b81991eb4901deb2909d2aaf985901b (patch)
treef3e9549c6584352a06664dd60d3a86ac30ad7790 /home/xyz/.inputrc
parentb912bfbf0fc8a4921baaef759ae542e1f16a748b (diff)
mv .inputrc to default location, bash does not follow INPUTRC env when in tty, maybe bug
Diffstat (limited to 'home/xyz/.inputrc')
-rw-r--r--home/xyz/.inputrc39
1 files changed, 39 insertions, 0 deletions
diff --git a/home/xyz/.inputrc b/home/xyz/.inputrc
new file mode 100644
index 00000000..b686fd80
--- /dev/null
+++ b/home/xyz/.inputrc
@@ -0,0 +1,39 @@
+$include /etc/inputrc
+
+# from archwiki realine
+# Color files by types
+# Note that this may cause completion text blink in some terminals (e.g. xterm).
+set colored-stats On
+# Append char to indicate type
+set visible-stats On
+# Mark symlinked directories
+set mark-symlinked-directories On
+# Color the common prefix
+set colored-completion-prefix On
+# Color the common prefix in menu-complete
+set menu-complete-display-prefix On
+
+set editing-mode vi
+
+# https://github.com/LukeSmithxyz/voidrice/blob/2440ad83e9e9cf2f927efbaef618513e0df3cbda/.config/shell/inputrc
+$if mode=vi
+
+ set show-mode-in-prompt on
+ set vi-ins-mode-string \1\e[6 q\2
+ set vi-cmd-mode-string \1\e[2 q\2
+
+ #set keymap vi-command
+ # depreciated
+ # shell-expand-line expand all subshell `$()`? not perfect but ok
+ # if there's " or ', then after \\z the " and ' will be gone because shell-expand-line
+ # a lot of bugs compare to fzf's key-bindings.bash approach with `bind -x`
+ # zsh approach seems not easy too
+ # so I choose to just use a posix sh script
+ #"\\e": shell-expand-line
+ # https://unix.stackexchange.com/questions/439280/is-there-a-way-to-define-a-bash-readline-command
+ #"\\z": "a $(zoxide query -i)\e\\e"
+
+ set keymap vi-insert
+ "\C-l": clear-screen
+
+$endif