# NNN specific config options imported by .bashrc # Default options: # A: no directory autoselection in Nav-as-you-Type mode # d: open in detailed mode # e: open text files in $VISUAL/$EDITOR/vi # o: disable file opening with `l` or `→` (only with `Enter`) export NNN_OPTS="Adeo" # Use trash-cli when deleting files export NNN_TRASH=1 # Set per-context colors export NNN_COLORS=4523 # nnn selection file export NNN_SEL="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection" # Bookmarks export NNN_BMS="m:/media;M:$HOME/.local/media;g:$GIT;z:$NOTES" # Plugin/commands keybindings export NNN_PLUG="c:chksum;i:imgview;m:nmount;M:mtpmount" export NNN_PLUG="$NNN_PLUG;z:-_vim $NOTES/index.md*" # `cd-on-quit` functionality based on # # https://github.com/jarun/nnn/wiki/Basic-use-cases#configure-cd-on-quit # 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" # 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 "$@" if [ -f $NNN_TMPFILE ]; then . $NNN_TMPFILE rm -f $NNN_TMPFILE > /dev/null fi }