diff options
author | oreodave <aryadevchavali1@gmail.com> | 2020-04-12 01:51:53 +0100 |
---|---|---|
committer | oreodave <aryadevchavali1@gmail.com> | 2020-04-12 01:51:53 +0100 |
commit | f8a2caa5a22a07c4268627f2adc7b2847ab01028 (patch) | |
tree | 893495c266ddc71ba07f298feb23b3910855926b | |
parent | 01f38cf0931eed43b9c1918b6fa04a2af2d65a06 (diff) | |
download | dotfiles-f8a2caa5a22a07c4268627f2adc7b2847ab01028.tar.gz dotfiles-f8a2caa5a22a07c4268627f2adc7b2847ab01028.tar.bz2 dotfiles-f8a2caa5a22a07c4268627f2adc7b2847ab01028.zip |
~pf_info setting and +vim cursor changes for zsh
-rw-r--r-- | zshrc | 34 |
1 files changed, 32 insertions, 2 deletions
@@ -3,7 +3,7 @@ # 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 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 SHELL="zsh" 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:*' 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() { nohup emacs $@ > /dev/null & } |