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
|
||||
exit
|
||||
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 {}"
|
||||
#--bind='ctrl-d:execute(rm -i $(echo {}|$HOME/.zsh/journaling/filefromline))' \
|
||||
selection=$(__lines | fzf --ansi \
|
||||
--preview="$0 --preview {}" \
|
||||
--bind="ctrl-d:execute($0 --delete {})"
|
||||
#--bind='ctrl-n:execute($HOME/.zsh/journaling/add)' \
|
||||
#--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
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user