From f23fa16e867a570ab0ba36cf2c6501e0dee7b6eb Mon Sep 17 00:00:00 2001 From: CramMK Date: Tue, 23 Jun 2020 16:47:49 +0200 Subject: [PATCH] Add vi-cursor zo zsh --- config.yaml | 1 + dotdrop | 2 +- dotfiles/dunst/dunstrc | 16 ++++++++-------- dotfiles/polybar/config | 4 ++-- dotfiles/rofi/config.rasi | 2 +- dotfiles/zsh/zshrc | 26 ++++++++++++++++++++++++++ 6 files changed, 39 insertions(+), 12 deletions(-) diff --git a/config.yaml b/config.yaml index 8ffbca3..4b1a3cc 100644 --- a/config.yaml +++ b/config.yaml @@ -110,6 +110,7 @@ profiles: - scripts dev: include: + - zsh - vim - tmux diff --git a/dotdrop b/dotdrop index 2a67c49..f1ce2eb 160000 --- a/dotdrop +++ b/dotdrop @@ -1 +1 @@ -Subproject commit 2a67c49eddb84cf0369007adf58ff507b1a1f693 +Subproject commit f1ce2eb198ce5fb5e6e3ea4a059a8e201a73cf26 diff --git a/dotfiles/dunst/dunstrc b/dotfiles/dunst/dunstrc index 1b90a4a..be4ffb5 100644 --- a/dotfiles/dunst/dunstrc +++ b/dotfiles/dunst/dunstrc @@ -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 diff --git a/dotfiles/polybar/config b/dotfiles/polybar/config index 8747534..53bcbe8 100644 --- a/dotfiles/polybar/config +++ b/dotfiles/polybar/config @@ -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 = ############################################################################### diff --git a/dotfiles/rofi/config.rasi b/dotfiles/rofi/config.rasi index b34e6ae..a225c7a 100644 --- a/dotfiles/rofi/config.rasi +++ b/dotfiles/rofi/config.rasi @@ -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: "язд"; diff --git a/dotfiles/zsh/zshrc b/dotfiles/zsh/zshrc index a0c983c..482c636 100644 --- a/dotfiles/zsh/zshrc +++ b/dotfiles/zsh/zshrc @@ -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