From 49032218a03fd4c6b991004a2d64cfb94d83a682 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 17 Jun 2020 13:54:14 +0300 Subject: nnn config --- .zshrc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.zshrc b/.zshrc index dff9d43..fe2d2a9 100644 --- a/.zshrc +++ b/.zshrc @@ -165,5 +165,38 @@ function te { source /home/yigit/.config/broot/launcher/bash/br +n () +{ + # Block nesting of nnn in subshells + if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then + echo "nnn is already running" + return + fi + + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, remove the "export" as in: + # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + # NOTE: NNN_TMPFILE is fixed, should not be modified + NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + export NNN_OPENER=nuke + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + nnn -c "$@" + + if [ -f "$NNN_TMPFILE" ]; then + . "$NNN_TMPFILE" + rm -f "$NNN_TMPFILE" > /dev/null + fi +} + +export NNN_BMS='w:~/Nextcloud/personal_wiki;r:~/Nextcloud/remind' +export NNN_COLORS="2136" # use a different color for each context +export NNN_PLUG='d:dragdrop' + # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. export PATH="$PATH:$HOME/.rvm/bin" -- cgit v1.2.3-70-g09d2