# 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`) # r: use patched `mv` and `cp` if available # see https://github.com/jarun/nnn/wiki/Advanced-use-cases#cp-mv-progress # https://github.com/jarun/advcpmv export NNN_OPTS="Adeo" which cpg >/dev/null 2>&1 &&\ export NNN_OPTS="${NNN_OPTS}r" # 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="c:$XDG_CONFIG_HOME/nnn/mounts;d:$DOWNLOADS;g:$GIT;m:/media;M:$HOME/.local/media;s:/var/spool/cups-pdf;z:$NOTES" # Plugin/commands keybindings NNN_PLUGINS='a:mailsend;c:chksum;i:imgview;m:nmount;M:mtpmount' NNN_CMDS_NEXTCLOUD='N:-!rclone copy -P --immutable --no-traverse $nnn nextcloud:filedrop/' NNN_CMDS_PAGER='l:-!less -R $nnn*' NNN_CMDS_SUDOEDIT='E:-!sudoedit -E $nnn*' export NNN_PLUG="$NNN_PLUGINS;$NNN_CMDS_NEXTCLOUD;$NNN_CMDS_PAGER;$NNN_CMDS_SUDOEDIT" # `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 }