Added delete option
Using ctrl-k
This commit is contained in:
12
fzf-vjour
12
fzf-vjour
@@ -236,12 +236,18 @@ if [[ "${1:-}" == "--preview" ]]; then
|
|||||||
cat "$vjfile" | __vjournal2json | jq -r ".description" | batcat --color=always --style=numbers --language=md
|
cat "$vjfile" | __vjournal2json | jq -r ".description" | batcat --color=always --style=numbers --language=md
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
# Delete file from selection
|
||||||
|
if [[ "${1:-}" == "--delete" ]]; then
|
||||||
|
local vjfile=$(__filepath_from_selection "$2")
|
||||||
|
rm -v "$vjfile"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
selection=$(__lines | fzf --ansi --preview="$0 --preview {}"
|
selection=$(__lines | fzf --ansi \
|
||||||
#--bind='ctrl-d:execute(rm -i $(echo {}|$HOME/.zsh/journaling/filefromline))' \
|
--preview="$0 --preview {}" \
|
||||||
|
--bind="ctrl-d:execute($0 --delete {})"
|
||||||
#--bind='ctrl-n:execute($HOME/.zsh/journaling/add)' \
|
#--bind='ctrl-n:execute($HOME/.zsh/journaling/add)' \
|
||||||
#--bind='ctrl-s:execute(vdirsyncer sync journals)' \
|
#--bind='ctrl-s:execute(vdirsyncer sync journals)' \
|
||||||
#--preview='vjour2json < $(echo {}|$HOME/.zsh/journaling/filefromline) | jq -r ".description" | batcat --color=always --style=numbers --language=md')
|
|
||||||
)
|
)
|
||||||
if [[ -z "$selection" ]]; then
|
if [[ -z "$selection" ]]; then
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user