]> Sergey Matveev's repositories - nnn.git/commitdiff
Improve docs in cd on quit scripts
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 29 Sep 2021 13:46:58 +0000 (19:16 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 29 Sep 2021 13:46:58 +0000 (19:16 +0530)
misc/quitcd/quitcd.bash_zsh
misc/quitcd/quitcd.csh
misc/quitcd/quitcd.fish

index 40d94a60837877f6003ad0d3968d3f1b0ce9adc8..76b9d4029aed0da0906380a7bd531aa0f065ece5 100644 (file)
@@ -6,9 +6,11 @@ n ()
         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"
+    # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
+    # To cd on quit only on ^G, either remove the "export" as in:
+    #    NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
+    #    (or, to a custom path: NNN_TMPFILE=/tmp/.lastd)
+    # or, export NNN_TMPFILE after nnn invocation
     export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
 
     # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
index d0427430774fb9190a9c0d1de54cd0302979d257..c1ca743b7747a2a0c12cd554247f841ee2bdec2f 100644 (file)
@@ -1,7 +1,8 @@
 # NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
 
-# 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
+# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
+# To cd on quit only on ^G, set NNN_TMPFILE after nnn invocation
+# A custom path can also be set e.g. set NNN_TMPFILE=/tmp/.lastd
 set NNN_TMPFILE=~/.config/nnn/.lastd
 
 # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
index 33fb991beadc1c04a663d1ed119f53212832fcbe..2e63395f4a9c7c9fedc2e3aafc72431a8db06b6d 100644 (file)
@@ -11,9 +11,11 @@ function n --wraps nnn --description 'support nnn quit and change directory'
         end
     end
 
-    # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
+    # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
     # To cd on quit only on ^G, remove the "-x" as in:
     #    set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
+    #    (or, to a custom path: set NNN_TMPFILE "/tmp/.lastd")
+    # or, export NNN_TMPFILE after nnn invocation
     if test -n "$XDG_CONFIG_HOME"
         set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
     else