From 24c82b8e2dd275c8d249730dfb8397fa3c33f757 Mon Sep 17 00:00:00 2001 From: juan Date: Sun, 17 Oct 2021 23:11:38 +0800 Subject: [PATCH] update nnn config --- .zshrc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.zshrc b/.zshrc index 9767755..23748ae 100644 --- a/.zshrc +++ b/.zshrc @@ -71,20 +71,18 @@ zz () { } alias zc="z -c" - n () { - # Block nesting of nnn in subshells - if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then - echo "nnn is already running" - return - fi - NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" - nnn "$@" "-G" - if [ -f "$NNN_TMPFILE" ]; then - . "$NNN_TMPFILE" - rm -f "$NNN_TMPFILE" > /dev/null - fi + if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then + echo "nnn is already running" + return + fi + NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + nnn "$@" + if [ -f "$NNN_TMPFILE" ]; then + . "$NNN_TMPFILE" + rm -f "$NNN_TMPFILE" > /dev/null + fi } # get cheat sheet