From 46925ea55880d733352137cbd060ee312bfb3848 Mon Sep 17 00:00:00 2001 From: xyz Date: Tue, 14 Dec 2021 19:43:47 -0800 Subject: must source .bashrc after export _ZO_ECHO=1 and INPUTRC=..., else these two env will has no effect,I do not know why --- home/xyz/.bashrc | 4 ++-- home/xyz/.config/.inputrc | 39 +++++++++++++++++++++++++++++++++++++++ home/xyz/.inputrc | 39 --------------------------------------- home/xyz/.profile | 15 +++++++++------ 4 files changed, 50 insertions(+), 47 deletions(-) create mode 100644 home/xyz/.config/.inputrc delete mode 100644 home/xyz/.inputrc (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index a7a4e65d..8eb18704 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -88,14 +88,14 @@ eval "$(zoxide init bash --no-aliases)" z () { if __zoxide_z "$@"; then l - echo "$PWD" + #echo "$PWD" fi } zi () { if __zoxide_zi "$@"; then l - echo "$PWD" + #echo "$PWD" fi } 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 diff --git a/home/xyz/.inputrc b/home/xyz/.inputrc deleted file mode 100644 index b686fd80..00000000 --- a/home/xyz/.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/.profile b/home/xyz/.profile index 7ac7405a..29cf48d6 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -1,11 +1,5 @@ #!/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 -# https://github.com/koalaman/shellcheck/wiki/SC3046 -#[[ -f ~/.bashrc ]] && . ~/.bashrc -[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" - export XDG_CONFIG_HOME="$HOME/.config/" export XDG_CACHE_HOME="$HOME/.cache/" export XDG_DATA_HOME="$HOME/.local/share/" @@ -41,10 +35,12 @@ 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/.inputrc" #export QT_QPA_PLATFORMTHEME=qt5ct export QT_QPA_PLATFORMTHEME=gtk2 #export QT_STYLE_OVERRIDE=kvantum export SXHKD_SHELL=sh +export _ZO_ECHO=1 # enable color for `tree` command, not forced export CLICOLOR=1 # for pacdiff, without using aur neovim-drop-in or neovim-symlinks @@ -82,6 +78,13 @@ export SCR_HEIGHT=900 #export GDK_SCALE=2 #export GDK_DPI_SCALE=0.5 +# must source .bashrc after export _ZO_ECHO=1 and INPUTRC=..., else these two env will has no effect, don't know why +# 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 +# https://github.com/koalaman/shellcheck/wiki/SC3046 +#[[ -f ~/.bashrc ]] && . ~/.bashrc +[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" + # startx when login, should be put after environmental variables for .xinitrc to use if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then exec startx -- cgit v1.2.3-70-g09d2