diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2022-04-30 17:15:45 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2022-04-30 17:15:45 -0400 |
| commit | fc6dc7b761ad639adc23e75bcf202bfe159fcc82 (patch) | |
| tree | 2261c0a82cc7b2dad989641d3e702185f64589c4 /.config/zsh/.zshrc | |
| parent | 58b06ee021ca27bb87ed1390c1436ee9871ea8cc (diff) | |
| download | eibhear-fc6dc7b761ad639adc23e75bcf202bfe159fcc82.tar.gz eibhear-fc6dc7b761ad639adc23e75bcf202bfe159fcc82.tar.zst eibhear-fc6dc7b761ad639adc23e75bcf202bfe159fcc82.zip | |
close #1115
Diffstat (limited to '.config/zsh/.zshrc')
| -rw-r--r-- | .config/zsh/.zshrc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 22a166e..7e96734 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -10,7 +10,7 @@ setopt interactive_comments # History in cache directory: HISTSIZE=10000000 SAVEHIST=10000000 -HISTFILE=~/.cache/zsh/history +HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" # Load aliases and shortcuts if existent. [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" @@ -53,25 +53,28 @@ preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. # Use lf to switch directories and bind it to ctrl-o lfcd () { - tmp="$(mktemp)" + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT lf -last-dir-path="$tmp" "$@" if [ -f "$tmp" ]; then dir="$(cat "$tmp")" - rm -f "$tmp" >/dev/null [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" fi } -bindkey -s '^o' 'lfcd\n' +bindkey -s '^o' '^ulfcd\n' -bindkey -s '^a' 'bc -lq\n' +bindkey -s '^a' '^ubc -lq\n' -bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n' +bindkey -s '^f' '^ucd "$(dirname "$(fzf)")"\n' bindkey '^[[P' delete-char # Edit line in vim with ctrl-e: autoload edit-command-line; zle -N edit-command-line bindkey '^e' edit-command-line +bindkey -M vicmd '^[[P' vi-delete-char +bindkey -M vicmd '^e' edit-command-line +bindkey -M visual '^[[P' vi-delete # Load syntax highlighting; should be last. source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null |
