[misc] add command e for editing file

This commit is contained in:
Klesh Wong 2021-06-24 11:17:06 +08:00
parent 3ffe18906a
commit b20a586bea
2 changed files with 8 additions and 6 deletions

View File

@ -10,7 +10,9 @@ fi
log 'Setting up lf'
# install lf
env GOPROXY= CGO_ENABLED=0 GO111MODULE=on go get -u -ldflags="-s -w" github.com/gokcehan/lf
if ! has_cmd "lf"; then
env GOPROXY= CGO_ENABLED=0 GO111MODULE=on go get -u -ldflags="-s -w" github.com/gokcehan/lf
fi
# linking configuration files
lnsf "$DIR/lf/lfrc" "$XDG_CONFIG_HOME/lf/lfrc"

View File

@ -1,13 +1,9 @@
set drawbox
set icons
cmd mkdir %mkdir "$@"
cmd copyfilepath %echo "$f" | xsel -b
map Yp copyfilepath
cmd copyfilename %basename "$f" | xsel -b
map Yn copyfilename
cmd pasteoverwrite %{{
load=$(lf -remote 'load')
mode=$(echo "$load" | sed -n '1p')
@ -20,4 +16,8 @@ cmd pasteoverwrite %{{
lf -remote 'send load'
lf -remote 'send clear'
}}
cmd e $$EDITOR "$@"
map Yp copyfilepath
map Yn copyfilename
map P pasteoverwrite