aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/auto-completion/bash/nnn-completion.bash4
-rw-r--r--misc/quitcd/quitcd.bash4
-rw-r--r--misc/quitcd/quitcd.zsh4
3 files changed, 6 insertions, 6 deletions
diff --git a/misc/auto-completion/bash/nnn-completion.bash b/misc/auto-completion/bash/nnn-completion.bash
index 638df49..6b73d05 100644
--- a/misc/auto-completion/bash/nnn-completion.bash
+++ b/misc/auto-completion/bash/nnn-completion.bash
@@ -8,7 +8,7 @@
_nnn ()
{
COMPREPLY=()
- local IFS=$' \n'
+ local IFS=$'\n'
local cur=$2 prev=$3
local -a opts
opts=(
@@ -37,7 +37,7 @@ _nnn ()
COMPREPLY=( $(compgen -f -d -- "$cur") )
elif [[ $prev == -e ]]; then
local sessions_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
- COMPREPLY=( $(compgen -W "$(ls "$sessions_dir")" -- "$cur") )
+ COMPREPLY=( $(cd "$sessions_dir" && compgen -f -d -- "$cur") )
elif [[ $cur == -* ]]; then
COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") )
else
diff --git a/misc/quitcd/quitcd.bash b/misc/quitcd/quitcd.bash
index 5c94b11..5ea82c4 100644
--- a/misc/quitcd/quitcd.bash
+++ b/misc/quitcd/quitcd.bash
@@ -1,14 +1,14 @@
n ()
{
# Block nesting of nnn in subshells
- if [ "$((NNNLVL + 0))" -ge 1 ]; then
+ if [ "${NNNLVL:-0}" -ge 1 ]; then
echo "nnn is already running"
return
fi
# 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
- export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
+ export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
diff --git a/misc/quitcd/quitcd.zsh b/misc/quitcd/quitcd.zsh
index 5c94b11..5ea82c4 100644
--- a/misc/quitcd/quitcd.zsh
+++ b/misc/quitcd/quitcd.zsh
@@ -1,14 +1,14 @@
n ()
{
# Block nesting of nnn in subshells
- if [ "$((NNNLVL + 0))" -ge 1 ]; then
+ if [ "${NNNLVL:-0}" -ge 1 ]; then
echo "nnn is already running"
return
fi
# 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
- export NNN_TMPFILE=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd
+ export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef