aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/.nnn-plugin-helper
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/.nnn-plugin-helper')
-rw-r--r--plugins/.nnn-plugin-helper6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/.nnn-plugin-helper b/plugins/.nnn-plugin-helper
index c26566d..a42ee69 100644
--- a/plugins/.nnn-plugin-helper
+++ b/plugins/.nnn-plugin-helper
@@ -8,6 +8,10 @@
selection=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
export selection
+## Set CUR_CTX to 1 to open directory in current context
+CUR_CTX=0
+export CUR_CTX
+
## Ask nnn to switch to directory $1 in context $2.
## If $2 is not provided, the function asks explicitly.
nnn_cd () {
@@ -20,7 +24,7 @@ nnn_cd () {
if [ -n "$2" ]; then
context=$2
- else
+ elif [ $CUR_CTX -ne 1 ]; then
printf "Choose context 1-4 (blank for current): "
read -r context
fi