feat: zsh cursor to mimic vim cursor
This commit is contained in:
parent
209041a90e
commit
e4a115c325
3 changed files with 23 additions and 2 deletions
|
@ -23,7 +23,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
|
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||||
LOCAL_PATH="$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')${PATH:+:${PATH}}"
|
LOCAL_PATH="$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')${PATH:+:${PATH}}"
|
||||||
fi
|
fi
|
||||||
PATH="$HOME/.local/share/go/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_AVD_HOME:$HOME/.local/share/npm/bin:$HOME/.local/share/cargo/bin:$LOCAL_PATH${PATH:+:${PATH}}"
|
PATH="$HOME/.pub-cache/bin:$HOME/.local/share/go/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_AVD_HOME:$HOME/.local/share/npm/bin:$HOME/.local/share/cargo/bin:$LOCAL_PATH${PATH:+:${PATH}}"
|
||||||
# export RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/library
|
# export RUST_SRC_PATH=$(rustc --print sysroot)/lib/rustlib/src/rust/library
|
||||||
|
|
||||||
# -- IBus stuff (IME)
|
# -- IBus stuff (IME)
|
||||||
|
|
|
@ -6,6 +6,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
alias brew="sudo -H -u maintenance brew"
|
alias brew="sudo -H -u maintenance brew"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
alias punten='doas'
|
||||||
#sudo + vim without sacrificing config
|
#sudo + vim without sacrificing config
|
||||||
alias sudovim='sudoedit'
|
alias sudovim='sudoedit'
|
||||||
alias doasvim='doasedit'
|
alias doasvim='doasedit'
|
||||||
|
@ -128,3 +129,4 @@ alias docx2pdf='lowriter --convert-to pdf'
|
||||||
|
|
||||||
alias mirror-update='curl -s "https://archlinux.org/mirrorlist/?country=ID&country=SG&country=US&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 -'
|
alias mirror-update='curl -s "https://archlinux.org/mirrorlist/?country=ID&country=SG&country=US&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 -'
|
||||||
alias center-pfetch="printf '\n'; pfetch | sed '\$d' | center -l"
|
alias center-pfetch="printf '\n'; pfetch | sed '\$d' | center -l"
|
||||||
|
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
|
||||||
|
|
|
@ -30,12 +30,31 @@ function zle-line-init zle-keymap-select {
|
||||||
PS2="%B%F{blue}?>%f%b "
|
PS2="%B%F{blue}?>%f%b "
|
||||||
# RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
|
# RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
|
||||||
# RPS2=$RPS1
|
# RPS2=$RPS1
|
||||||
|
|
||||||
|
if [[ ${KEYMAP} == vicmd ]] ||
|
||||||
|
[[ $1 = 'block' ]]; then
|
||||||
|
echo -ne '\e[1 q'
|
||||||
|
|
||||||
|
elif [[ ${KEYMAP} == main ]] ||
|
||||||
|
[[ ${KEYMAP} == viins ]] ||
|
||||||
|
[[ ${KEYMAP} = '' ]] ||
|
||||||
|
[[ $1 = 'beam' ]]; then
|
||||||
|
echo -ne '\e[5 q'
|
||||||
|
fi
|
||||||
|
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
}
|
}
|
||||||
zle -N zle-line-init
|
zle -N zle-line-init
|
||||||
zle -N zle-keymap-select
|
zle -N zle-keymap-select
|
||||||
|
|
||||||
precmd () { vcs_info }
|
_fix_cursor() {
|
||||||
|
echo -ne '\e[5 q'
|
||||||
|
}
|
||||||
|
|
||||||
|
precmd () {
|
||||||
|
vcs_info
|
||||||
|
_fix_cursor
|
||||||
|
}
|
||||||
#RPROMPT=\$vcs_info_msg_0_
|
#RPROMPT=\$vcs_info_msg_0_
|
||||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#60C0FF,bold,underline"
|
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#60C0FF,bold,underline"
|
||||||
ZSH_AUTOSUGGEST_HISTORY_IGNORE="ls *,cd *"
|
ZSH_AUTOSUGGEST_HISTORY_IGNORE="ls *,cd *"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue