~pf_info setting and +vim cursor changes for zsh

This commit is contained in:
oreodave
2020-04-12 01:51:53 +01:00
parent 01f38cf093
commit f8a2caa5a2

34
zshrc
View File

@@ -3,7 +3,7 @@
# Important variables and stuff # Important variables and stuff
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:~/.local/bin:~/Bin/binaries:~/.emacs.d/bin:~/.cargo/bin:~/Scripts export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:~/.local/bin:~/Bin/binaries:~/.emacs.d/bin:~/.cargo/bin:~/Scripts
export guile=guile2.2 export guile=guile2.2
export PF_INFO="ascii title os memory uptime editor shell" export PF_INFO="ascii title os memory uptime editor wm shell"
export EDITOR="emacs" export EDITOR="emacs"
export SHELL="zsh" export SHELL="zsh"
alias yapf='python2 -m yapf' alias yapf='python2 -m yapf'
@@ -49,7 +49,37 @@ zstyle ':completion:*' verbose true
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,' zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,'
# Programming ## Vim binds
bindkey -v
# Cursor
function zle-keymap-select {
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 -N zle-keymap-select
zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
# Menu
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'j' vi-up-line-or-history
bindkey -M menuselect 'k' vi-down-line-or-history
bindkey -M menuselect 'l' vi-forward-char
## Programming
editor() { editor() {
nohup emacs $@ > /dev/null & nohup emacs $@ > /dev/null &
} }