[misc] add command e for editing file
This commit is contained in:
parent
3ffe18906a
commit
b20a586bea
|
@ -10,7 +10,9 @@ fi
|
|||
log 'Setting up lf'
|
||||
|
||||
# install 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"
|
||||
|
|
10
cli/lf/lfrc
10
cli/lf/lfrc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user