From cffcb550a8200fc027432ba7567b6796999c4ef6 Mon Sep 17 00:00:00 2001 From: David Runge Date: Tue, 28 Sep 2021 23:16:59 +0200 Subject: zshrc: early include of functions .zshrc: To allow proper use of the functions, add them early. Add back settings for vi mode. Add back prepend-sudo. --- .zshrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 082c2d3..98d77c4 100644 --- a/.zshrc +++ b/.zshrc @@ -1,4 +1,6 @@ +# functions +for config_file ($HOME/.config/zsh/functions/*.zsh) source $config_file # dircolors # Set colors for ls output eval $(dircolors ~/.dircolors) @@ -12,6 +14,10 @@ zle -N self-insert url-quote-magic # enable vi mode setopt -o vi +bindkey -v +bindkey '^r' history-incremental-search-backward +bindkey '^a' beginning-of-line +bindkey '^e' end-of-line # General setopt BRACE_CCL # Allow brace character class list expansion. @@ -170,6 +176,9 @@ for keymap in 'emacs' 'viins'; do # Complete in the middle of word. bindkey -M "$keymap" "$key_info[Control]I" expand-or-complete + + # Insert 'sudo ' at the beginning of the line. + bindkey -M "$keymap" "$key_info[Control]X$key_info[Control]S" prepend-sudo done # Set the key layout to vi mode @@ -430,8 +439,6 @@ for p in ${history_substring}; do fi done -# functions -for config_file ($HOME/.config/zsh/functions/*.zsh) source $config_file # includes for config_file ($HOME/.config/zsh/includes/*.zsh) source $config_file -- cgit v1.2.3-70-g09d2