From 8589a263ffbe2475d801a2cf1e67ea458a6ca29e Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 11 Nov 2021 12:08:51 -0600 Subject: [PATCH] Fixes for nnn and ^G functionality and add lat alias --- common/fish/functions.fish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/fish/functions.fish b/common/fish/functions.fish index 838532e..1b8e14d 100644 --- a/common/fish/functions.fish +++ b/common/fish/functions.fish @@ -4,8 +4,10 @@ end if has_command exa alias ls 'exa --group-directories-first' + alias l ls alias tree 'ls --tree --level=3' alias lt 'll --sort=modified' + alias lat 'la --sort=modified' alias lc 'lt --sort=accessed' alias lT 'lt --reverse' alias lC 'lc --reverse' @@ -56,9 +58,10 @@ if has_command nnn function r --wraps nnn --description 'Run nnn with support for jump-to-directory-on-exit via ^G' # TODO: this would break with multiple nnn instances, right? # probably need to mktemp instead - set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + set -u NNN_TMPFILE (mktemp) + export NNN_TMPFILE nnn -P p $argv - test -e $NNN_TMPFILE && source $NNN_TMPFILE && rm $NNN_TMPFILE + test -e $NNN_TMPFILE && source $NNN_TMPFILE && cp $NNN_TMPFILE ~/.nnn-last-tmpfile && rm $NNN_TMPFILE end alias l r end