feat(zsh): n³ & undo

This commit is contained in:
Michel 2024-01-12 10:55:31 +01:00
parent 65e7a2483e
commit 010ee78078
1 changed files with 8 additions and 4 deletions

12
.zshrc
View File

@ -229,13 +229,13 @@ compdef hg=rg
# nnn - n³
#
# See https://github.com/jarun/nnn/wiki/Usage#configuration
export NNN_ARCHIVE='\.(7z|bz2|gz|tar|tbz|tgz|xz|zip|zst)$'
export NNN_ARCHIVE='\.(7z|bz2|cbz|cbr|gz|tar|tbz|tgz|xz|zip|zst)$'
if (( ${+commands[fuse-archive]} )); then
export NNN_ARCHMNT='fuse-archive'
fi
export NNN_BMS="d:~/Downloads"
export NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
export NNN_OPTS='ABeGHo'
export NNN_OPTS='ABeGo'
export NNN_ORDER="t:$HOME/Downloads"
export NNN_PLUG='d:fzcd;o:-!xdg-open "$nnn"*;z:fzopen'
if (( ${+commands[trash-put]} )); then
@ -257,9 +257,12 @@ n()
command nnn "$@"
if [ -f $NNN_TMPFILE ]; then
setopt autopushd
# Tmp file contains a `cd` directive that will
# behave like a `pushd`, ignoring duplicates.
setopt autopushd pushdignoredups
. $NNN_TMPFILE
rm -f $NNN_TMPFILE > /dev/null
dirs -v
fi
}
@ -355,7 +358,8 @@ HISTORY_IGNORE="(?|??|???|cd [a-zA-Z]*|* --help|#*|builtin *|run-help *)"
# `showkey -a` to print keys
# Undo (useful to cancel completion -- borrowed from emacs keymap)
bindkey "^_" undo
bindkey -M vicmd "^_" undo
bindkey -M viins "^_" undo
###