Pārlūkot izejas kodu

Plugin improvements (#531)

* Added padding for numbers in .nmv

* Add skim as an option in fzopen

* Remove unnecessary eval

Thanks @leovilok!

Co-Authored-By: lvgx <l@vgx.fr>

* Added note about whitespace

Co-authored-by: lvgx <l@vgx.fr>
master
KlzXS GitHub pirms 5 gadiem
vecāks
revīzija
00148360e4
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
2 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. +6
    -1
      plugins/.nmv
  2. +2
    -0
      plugins/fzopen

+ 6
- 1
plugins/.nmv Parādīt failu

@@ -3,6 +3,8 @@
# Description: An almost fully POSIX compliant batch file renamer # Description: An almost fully POSIX compliant batch file renamer
# #
# Note: nnn auto-detects and invokes this plugin if available # Note: nnn auto-detects and invokes this plugin if available
# Whitespace is used as delimiter for read.
# The plugin doesn't support filenames with leading or trailing whitespace
# #
# Capabilities: # Capabilities:
# 1. Basic file rename # 1. Basic file rename
@@ -43,7 +45,10 @@ else
fi fi
fi fi


printf "%s" "$arr" | awk '{print NR " " $0}' > "$dst_file" lines=$(printf "%s\n" "$arr" | wc -l)
width=${#lines}

printf "%s" "$arr" | awk '{printf("%'"${width}"'d %s\n", NR, $0)}' > "$dst_file"


items=("~") items=("~")
while IFS='' read -r line; do while IFS='' read -r line; do


+ 2
- 0
plugins/fzopen Parādīt failu

@@ -17,6 +17,8 @@ if which fzf >/dev/null 2>&1; then
# entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden) # entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden)
elif which fzy >/dev/null 2>&1; then elif which fzy >/dev/null 2>&1; then
entry=$(find . -type f 2>/dev/null | fzy) entry=$(find . -type f 2>/dev/null | fzy)
elif which sk >/dev/null 2>&1; then
entry=$(find . -type f 2>/dev/null | sk)
else else
exit 1 exit 1
fi fi


||||||
x
 
000:0
Notiek ielāde…
Atcelt
Saglabāt