diff --git a/.zshrc b/.zshrc index 2ef2e1a..b8b578b 100644 --- a/.zshrc +++ b/.zshrc @@ -233,11 +233,11 @@ export NNN_ARCHIVE='\.(7z|bz2|gz|tar|tbz|tgz|xz|zip|zst)$' if (( ${+commands[fuse-archive]} )); then export NNN_ARCHMNT='fuse-archive' fi -export NNN_BMS="d:$HOME/Downloads" +export NNN_BMS="d:~/Downloads" export NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke" -export NNN_OPTS='ABcGHin' +export NNN_OPTS='ABeGHo' export NNN_ORDER="t:$HOME/Downloads" -export NNN_PLUG="d:diffs;D:dragdrop;M:xdgdefault" +export NNN_PLUG='d:fzcd;o:-!xdg-open "$nnn"*;z:fzopen' if (( ${+commands[trash-put]} )); then export NNN_TRASH=1 elif (( ${+commands[gio]} )); then @@ -251,16 +251,29 @@ n() return fi - LESS=${LESS/F} + export GUI=1 # plugins: nuke, xdgdefault + export LESS=${LESS/F} + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit" command nnn "$@" - NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" if [ -f $NNN_TMPFILE ]; then + setopt autopushd . $NNN_TMPFILE rm -f $NNN_TMPFILE > /dev/null fi } +nnn-file-widget() { + local item + nnn -p- <"$TTY" | + while read item; do + LBUFFER+="${(q-)item} " + done +} +zle -N nnn-file-widget +bindkey -M vicmd '\en' nnn-file-widget +bindkey -M viins '\en' nnn-file-widget + ### ### Aliases -- Global & automatic expansion ###