diff options
Diffstat (limited to 'zsh/.zsh')
-rw-r--r-- | zsh/.zsh/.gitignore | 1 | ||||
-rw-r--r-- | zsh/.zsh/.zprofile | 8 | ||||
-rw-r--r-- | zsh/.zsh/.zshrc | 29 |
3 files changed, 38 insertions, 0 deletions
diff --git a/zsh/.zsh/.gitignore b/zsh/.zsh/.gitignore new file mode 100644 index 0000000..4d45295 --- /dev/null +++ b/zsh/.zsh/.gitignore @@ -0,0 +1 @@ +.zcompdump* diff --git a/zsh/.zsh/.zprofile b/zsh/.zsh/.zprofile new file mode 100644 index 0000000..13942bb --- /dev/null +++ b/zsh/.zsh/.zprofile @@ -0,0 +1,8 @@ +export EDITOR=vim +export HISTSIZE=1000000 + +# We need to reset $PATH because /etc/profile is read after ~/.zshenv +export PATH="$HOME/bin:$HOME/.guix-profile/bin:$HOME/bin:/usr/lib/surfraw${PATH:+:}$PATH" + +# Start X automatically +[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx 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 |