From c2e162a4ac179c12c1d4a8a2bfd236a615ff596c Mon Sep 17 00:00:00 2001 From: 0scar Date: Sat, 29 Oct 2022 01:24:25 +0200 Subject: Add comments and visual bindings to zshrc --- .config/zsh/.zshrc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to '.config/zsh/.zshrc') diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index ba4f07b..04db407 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -77,12 +77,22 @@ zle -N zle-keymap-select 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. +# Allow editing command line in editor autoload -Uz edit-command-line zle -N edit-command-line + +# Bind it to space bindkey -M vicmd ' ' edit-command-line -bindkey -a "^e" vi-end-of-line +# Bind ^A and ^E in visual mode +bindkey -M vicmd '^e' vi-end-of-line +bindkey -M vicmd '^a' beginning-of-line + +# Regular bindings +bindkey "^e" vi-end-of-line bindkey "^a" beginning-of-line + +# Reverse search bindkey "^r" history-incremental-search-backward bindkey "${terminfo[khome]}" beginning-of-line @@ -92,10 +102,13 @@ bindkey "^[3;5~" delete-char bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word +# Load searching upwards with beginning of the line autoload -U up-line-or-beginning-search autoload -U down-line-or-beginning-search zle -N up-line-or-beginning-search zle -N down-line-or-beginning-search + +# Binded twice for compatability bindkey "^[A" up-line-or-beginning-search bindkey "^[OA" up-line-or-beginning-search bindkey "^[B" down-line-or-beginning-search @@ -134,13 +147,6 @@ function screengrab() { ffmpeg -f x11grab -r 20 -s ${SIZE} -i :0.0+${POS} -r 20 out.gif } -function timeuntil() { - if ! [[ "${1}" =~ "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{2}:[0-9]{2}" ]]; then - echo "argument must be of the form \"YYYY-DD-MM hh:mm\"" - else - date -u -d @$(($(date -d "${1}" +%s) - $(date +%s) - 24 * 60 * 60)) '+[%d %H:%M:%S]' - fi -} fr () { which futhark > /dev/null -- cgit v1.3