Skip to content
Snippets Groups Projects
Commit 00310076 authored by Jens Nolte's avatar Jens Nolte
Browse files

Add zsh key bindings

parent 7f4598a1
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,17 @@ in ...@@ -124,6 +124,17 @@ in
setopt autocd setopt autocd
setopt extendedglob setopt extendedglob
unsetopt flowcontrol
# Set up fzf for ctrl-t (paste selected paths) and alt-c (cd into selected directory)
# This also binds ctrl-r, but that binding is reverted later
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
# bind ctrl-r and ctrl-s to perform emacs-style history search
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
# Shift-Tab reverse tab through completions # Shift-Tab reverse tab through completions
bindkey '^[[Z' reverse-menu-complete bindkey '^[[Z' reverse-menu-complete
...@@ -172,9 +183,6 @@ in ...@@ -172,9 +183,6 @@ in
bindkey '^P' up-history bindkey '^P' up-history
bindkey '^N' down-history bindkey '^N' down-history
# bind ctrl-r to perform backward search in history
bindkey '^r' history-incremental-search-backward
# bind ctrl-a and ctrl-e to move to beginning/end of line # bind ctrl-a and ctrl-e to move to beginning/end of line
bindkey '^a' beginning-of-line bindkey '^a' beginning-of-line
bindkey '^e' end-of-line bindkey '^e' end-of-line
...@@ -187,17 +195,19 @@ in ...@@ -187,17 +195,19 @@ in
zle -N backward-kill-dir zle -N backward-kill-dir
bindkey '^[^?' backward-kill-dir bindkey '^[^?' backward-kill-dir
set-cursor-bar (){
if [[ "$TERM" = xterm* ]]; then set-cursor-bar () {
if [[ "$TERM" = xterm* || "$TERM" = tmux* || "$TERM" = screen* ]]; then
echo -ne "\e[6 q" echo -ne "\e[6 q"
fi fi
} }
set-cursor-block() { set-cursor-block() {
if [[ "$TERM" = xterm* ]]; then if [[ "$TERM" = xterm* || "$TERM" = tmux* || "$TERM" = screen* ]]; then
echo -ne "\e[2 q" echo -ne "\e[2 q"
fi fi
} }
# change cursor on vi mode switch # change cursor on vi mode switch
zle-keymap-select() { zle-keymap-select() {
# FIXME: Activating vi-command-mode (typing ":" in vicmd-keymap) results in incorrect bar cursor # FIXME: Activating vi-command-mode (typing ":" in vicmd-keymap) results in incorrect bar cursor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment