From 2c3b0dc32b81991eb4901deb2909d2aaf985901b Mon Sep 17 00:00:00 2001 From: xyz Date: Tue, 14 Dec 2021 03:15:25 -0800 Subject: mv .inputrc to default location, bash does not follow INPUTRC env when in tty, maybe bug --- home/xyz/.config/readline/inputrc | 39 --------------------------------------- home/xyz/.inputrc | 39 +++++++++++++++++++++++++++++++++++++++ home/xyz/.profile | 3 +-- 3 files changed, 40 insertions(+), 41 deletions(-) delete mode 100644 home/xyz/.config/readline/inputrc create mode 100644 home/xyz/.inputrc (limited to 'home/xyz') diff --git a/home/xyz/.config/readline/inputrc b/home/xyz/.config/readline/inputrc deleted file mode 100644 index b686fd80..00000000 --- a/home/xyz/.config/readline/inputrc +++ /dev/null @@ -1,39 +0,0 @@ -$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 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 diff --git a/home/xyz/.profile b/home/xyz/.profile index 464e9938..b80eb4b4 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/dash # here `. ~/.bashrc` same as `source ~/.bashrc`, see `source filename` in `man bash`, and `. file` in `man dash` # `. file` is POSIX compliant, while `source file` is not @@ -41,7 +41,6 @@ export MANPAGER='nvim -M +Man!' export MANSECT='1p:1:n:l:8:3p:3:0p:0:2:5:4:9:6:7' export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" -export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc" #export QT_QPA_PLATFORMTHEME=qt5ct export QT_QPA_PLATFORMTHEME=gtk2 #export QT_STYLE_OVERRIDE=kvantum -- cgit v1.2.3-70-g09d2