dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 070ed9113a24c4f5444e5962c2d3075c8db20074
parent 027d6e352367775e3a142f6f63b51dedf73f3460
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Sat, 14 Dec 2019 23:46:59 +0100

Add function to start nnn

Adds the functionality for nnn to end in the current dir when quiting

Diffstat:
Mzsh/zsh_functions | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/zsh/zsh_functions b/zsh/zsh_functions @@ -79,3 +79,17 @@ git_prompt_string() { [ ! -n "$git_where" ] && echo "" } +n() +{ + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, export NNN_TMPFILE after the call to nnn + + nnn "$@" + + export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd + + if [ -f $NNN_TMPFILE ]; then + . $NNN_TMPFILE + rm $NNN_TMPFILE + fi +}