summaryrefslogtreecommitdiff
path: root/ar/.config
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config')
-rw-r--r--ar/.config/lf/lfrc32
-rw-r--r--ar/.config/shell/aliasrc2
2 files changed, 21 insertions, 13 deletions
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc
index 64416d3..becd52c 100644
--- a/ar/.config/lf/lfrc
+++ b/ar/.config/lf/lfrc
@@ -101,16 +101,24 @@ cmd yank-basename $basename -a -- $fx | head -c-1 | xclip -i -selection clipboar
cmd yank-basename-without-extension &basename -a -- $fx | cut -d. -f1 | head -c-1 | xclip -i -selection clipboard
# Create
-cmd mkdir ${{ clear; tput cup $(($(tput lines)/3)); tput bold
- printf "Directory Name: "
- read ans
- mkdir -p $ans
-}}
-cmd mkfile ${{
- clear; tput cup $(($(tput lines)/3)); tput bold
- printf "File Name: "
- read ans
- $EDITOR $ans
+cmd mkdir %{{
+ IFS=" "
+ file="$*"
+ mkdir -p -- "$file"
+ lf -remote "send $id cd \"$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')\""
+}}
+cmd touch %{{
+ IFS=" "
+ file="$*"
+ case "$file" in
+ /*) ;;
+ *) file="$PWD/$file" ;;
+ esac
+ dir="${file%/*}"
+ [ "$dir" != "$file" ] && mkdir -p -- "$dir"
+ touch -- "$file"
+ file="$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')"
+ lf -remote "send $id :select \"$file\"; \$\$EDITOR \"$file\""
}}
cmd link %{{
set -- $(cat ~/.local/share/lf/files)
@@ -500,8 +508,8 @@ map yt $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/
map yy copy
# Create
-map Md mkdir
-map Mf mkfile
+map Md push :mkdir<space>
+map Mf push :touch<space>
map Ml link
# Cut
diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc
index 1e129f6..1cf6045 100644
--- a/ar/.config/shell/aliasrc
+++ b/ar/.config/shell/aliasrc
@@ -12,7 +12,7 @@
[ -f "$MBSYNCRC" ] && alias mbsync='mbsync -c $MBSYNCRC'
# sudo not required for some system commands
-for command in blkid lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
+for command in arp-scan blkid docker ecrypt lazydocker lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
alias $command="sudo $command"
done
unset command