diff options
Diffstat (limited to '%HOME%/.bashrc')
-rw-r--r-- | %HOME%/.bashrc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc index 164d7b1..8264895 100644 --- a/%HOME%/.bashrc +++ b/%HOME%/.bashrc @@ -114,3 +114,26 @@ ranger() { exit fi } + +# nnn + +# The selected paths. +alias ncp="cat ${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} | tr '\0' '\n'" + +# Like quitcd.bash_zsh, but better. +n() { + [ -n "$NNNLVL" ] && [ "${NNNLVL:-0}" -ge 1 ] && exit + + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + + /usr/bin/nnn "$@" + + if [ -f "$NNN_TMPFILE" ]; then + . "$NNN_TMPFILE" + rm -f -- "$NNN_TMPFILE" > /dev/null + fi +} + +nnn() { + n "$@" +} |