summaryrefslogtreecommitdiff
path: root/home/xyz/.config/.inputrc
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-12-14 19:43:47 -0800
committerxyz <gky44px1999@gmail.com>2021-12-14 19:43:47 -0800
commit46925ea55880d733352137cbd060ee312bfb3848 (patch)
treea0cb95f93038754e3b6d2758b6e209a2c037986d /home/xyz/.config/.inputrc
parentae8868451352df27a30c7869e8f1b643fe726a63 (diff)
must source .bashrc after export _ZO_ECHO=1 and INPUTRC=..., else these two env will has no effect,I do not know why
Diffstat (limited to 'home/xyz/.config/.inputrc')
-rw-r--r--home/xyz/.config/.inputrc39
1 files changed, 39 insertions, 0 deletions
diff --git a/home/xyz/.config/.inputrc b/home/xyz/.config/.inputrc
new file mode 100644
index 00000000..b686fd80
--- /dev/null
+++ b/home/xyz/.config/.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