From 926c3860ad0ce0464eaad00804556b204b1b7d71 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 13 Dec 2017 12:26:48 +0100 Subject: Split zsh configuration in several file This allows the environment defined in .zshenv to be available when running commands with 'ssh user@host command' --- zsh/.zsh/.zshrc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 zsh/.zsh/.zshrc (limited to 'zsh/.zsh/.zshrc') diff --git a/zsh/.zsh/.zshrc b/zsh/.zsh/.zshrc new file mode 100644 index 0000000..a5fdea8 --- /dev/null +++ b/zsh/.zsh/.zshrc @@ -0,0 +1,29 @@ +# source /home/urbain/.nix-profile/etc/profile.d/nix.sh + +# Source configuration files +source "$HOME/.zsh/plugins" +source "$HOME/.zsh/functions" +source "$HOME/.zsh/alias" + +# Custom key bindings for built-in widgets +bindkey -a 'k' history-beginning-search-backward +bindkey -a 'j' history-beginning-search-forward +bindkey '^P' history-beginning-search-backward +bindkey '^N' history-beginning-search-forward + +PROMPT='%0~ $ ' + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +# Options +unsetopt histverify + +# Use fzf with z +unalias z 2> /dev/null +z() { + [ $# -gt 0 ] && _z "$*" && return + cd "$(_z -l 2>&1 | fzf --height 40% --reverse --inline-info +s --tac --query "$*" | sed 's/^[0-9,.]* *//')" + zle && zle reset-prompt +} +zle -N z +bindkey '^z' z -- cgit v1.2.3