Add vi-cursor zo zsh

This commit is contained in:
CramMK
2020-06-23 16:47:49 +02:00
parent aa3150e677
commit f23fa16e86
6 changed files with 39 additions and 12 deletions

View File

@@ -110,6 +110,7 @@ profiles:
- scripts
dev:
include:
- zsh
- vim
- tmux

Submodule dotdrop updated: 2a67c49edd...f1ce2eb198

View File

@@ -73,7 +73,7 @@
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
separator_color = auto
# Sort messages by urgency.
sort = yes
@@ -247,25 +247,25 @@
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#A3BE8C"
foreground = "#2E3440"
background = "#2E3440"
foreground = "#ECEFF4"
frame_color = "#A3BE8C"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#A3BE8C"
foreground = "#2E3440"
background = "#2E3440"
foreground = "#ECEFF4"
frame_color = "#A3BE8C"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#A3BE8C"
foreground = "#2E3440"
frame_color = "#A3BE8C"
background = "#2E3440"
foreground = "#ECEFF4"
frame_color = "#BF616A"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon

View File

@@ -65,7 +65,7 @@ module-margin = 1
modules-left = i3tabs title
modules-center = spotify_current
modules-right = firefox spotify discord pipe backlight volume battery pipe network pipe date time pipe
modules-right = firefox spotify discord pipe backlight volume battery pipe date time pipe
separator =
wm-name = i3
@@ -81,7 +81,7 @@ monitor = ${env:MONITOR:}
modules-left = i3tabs title
modules-center = spotify_current
modules-right = firefox spotify discord pipe volume battery pipe network pipe date time
modules-right = firefox spotify discord pipe volume battery pipe date time
separator =
###############################################################################

View File

@@ -3,7 +3,7 @@ configuration {
hide-scrollbar: true;
separator-style: none;
show-icons: true;
terminal: "xterm";
terminal: "alacritty";
font: "Inconsolata 13";
lines: 7;
display-drun: "理";

View File

@@ -49,6 +49,9 @@ if [ -f ~/.zshrc_local ]; then
source ~/.zshrc_local
fi
## Keybinds
bindkey -s "^e" "ranger\n"
## Completion
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
@@ -94,6 +97,29 @@ fi
bindkey -v
export KEYTIMEOUT=1
# Change cursor shape for different vi modes.
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.
precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
# Enable backspace to delete in vi-mode
bindkey -v '^?' backward-delete-char