Compare commits

..

No commits in common. "903c870dbac7954777743f1533b1b5e9d31bbeb0" and "16193b5554daa42d69b12000082af97e6ad3fea0" have entirely different histories.

3 changed files with 55 additions and 79 deletions

View File

@ -79,61 +79,39 @@ Here is the complete list of configuration options:
Usage Usage
----- -----
Use the default `fzf` keys to navigate your calendar entries, e.g., `ctrl-j`
and `ctrl-k` for going down/up in the list.
After starting `fzf-vcal`, you are presented with a view on the current week. After starting `fzf-vcal`, you are presented with a view on the current week.
You can navigate that week using `j` and `h` for going down and up.
Hit `<enter>` on any day, and you will see all entries for that date, including Hit `<enter>` on any day, and you will see all entries for that date, including
previews. In both, the week and day views, you can add entries by hitting previews. In both, the week and day views, you can add entries by hitting
`ctrl-n`. `ctrl-n`.
Here is the list of all available keybindings: Here is the list of available keybindings:
| Key | View | Action |
### Week view | --- | ---- | ------ |
| `enter` | week view | Switch to day view |
| Key | Action | | `ctrl-n` | week view | Make a new entry |
| --- | ------ | | any letter | week view | Search in the list of all entries |
| `enter` | open day | | `backspace` on empty query | week view | Undo search |
| `j` | down | | `ctrl-u` | week view | Go back one week |
| `k` | up | | `ctrl-d` | week view | Go forth one week |
| `l` | go to next week | | `ctrl-alt-u` | week view | Go back one month |
| `h` | go to previous week | | `ctrl-alt-d` | week view | Go forth one month |
| `ctrl-l` | go to next month | | `ctrl-s` | week view | Run the synchronization command |
| `ctrl-h` | go to previous month | | `ctrl-r` | week view | Go to current week |
| `alt-l` | go to next year | | `ctrl-g` | week view | Goto date |
| `alt-h` | go to previous year | | `ctrl-t` | week view | Change timezone |
| `ctrl-r` | reload and go to week that contains `today` | | `enter` | day view | Open selected calendar entry in your favorite `$EDITOR` |
| `ctrl-g` | interactively go to specified week | | `ctrl-n` | day view | Make a new entry |
| `ctrl-t` | set timezon | | `ctrl-l` | day view | Move to next day |
| `ctrl-s` | synchronize | | `ctrl-h` | day view | Move to previous day |
| `ctrl-n` | add new entry | | `esc`, `backspace` or `q` | day view | Go back to week view |
| `\` | search all appointment s| | `ctrl-s` | day view | Run the synchronization command |
| `ctrl-t` | day view | Change timezone |
### Day view | `ctrl-alt-d` | day view | Delete selected entry |
| `j` | day view | Scroll down in preview window |
| Key | Action | | `k` | day view | Scroll up in preview window |
| --- | ------ | | `w` | day view | Toggle line wrap in preview window ||
| `enter` | edit appointment |
| `j` | down |
| `k` | up |
| `l` | go to next day |
| `h` | go to previous day |
| `ctrl-l` | go to next week |
| `ctrl-h` | go to previous week |
| `alt-l` | go to next month |
| `alt-h` | go to previous month |
| `ctrl-r` | reload and go to `today` |
| `ctrl-g` | interactively go to specified day |
| `ctrl-t` | set timezon |
| `ctrl-s` | synchronize |
| `ctrl-n` | add new entry |
| `ctrl-alt-d` | delete entry |
| `w` | toggle line wrap in preview |
| `ctrl-d` | down in preview |
| `ctrl-u` | up in preview |
| `alt-v` | view raw iCalendar file |
| `esc` | return to week view, you can also do this with `q` or `backspace` |
### There is more
You may also invoke the script with `--help` to see further command-line options. You may also invoke the script with `--help` to see further command-line options.

View File

@ -110,7 +110,7 @@ END {
print "CREATED:" zulu; print "CREATED:" zulu;
print "SEQUENCE:1"; print "SEQUENCE:1";
print "LAST-MODIFIED:" zulu; print "LAST-MODIFIED:" zulu;
print "STATUS:VEVENT"; print "STATUS:FINAL";
print "DTSTART;VALUE=" from_type ":" from print "DTSTART;VALUE=" from_type ":" from
print "DTEND;VALUE=" to_type ":" to print "DTEND;VALUE=" to_type ":" to
if (summary) print_fold("SUMMARY:", summary, i, s); if (summary) print_fold("SUMMARY:", summary, i, s);

View File

@ -989,7 +989,7 @@ while true; do
--with-nth='{6}' \ --with-nth='{6}' \
--accept-nth='1,2,3,4,5' \ --accept-nth='1,2,3,4,5' \
--preview="$0 --preview-event {}" \ --preview="$0 --preview-event {}" \
--expect="ctrl-n,ctrl-t,ctrl-g,ctrl-alt-d,esc,backspace,q,alt-v" \ --expect="ctrl-n,ctrl-alt-d,ctrl-t,ctrl-g,esc,backspace,q,v" \
--bind="load:pos(1)+transform( --bind="load:pos(1)+transform(
echo change-border-label:🗓️ \$(date -d {1} +\"%A %e %B %Y\") echo change-border-label:🗓️ \$(date -d {1} +\"%A %e %B %Y\")
)+transform( )+transform(
@ -998,19 +998,15 @@ while true; do
echo {} | grep \|\| || echo show-preview echo {} | grep \|\| || echo show-preview
)" \ )" \
--bind="start:hide-preview" \ --bind="start:hide-preview" \
--bind="j:down+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \ --bind="ctrl-r:reload:$0 --reload-day {1}" \
--bind="k:up+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \ --bind="ctrl-j:down+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \
--bind="l:hide-preview+reload:$0 --reload-day {1} '+1 day'" \ --bind="ctrl-k:up+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \
--bind="h:hide-preview+reload:$0 --reload-day {1} '-1 day'" \ --bind="ctrl-l:hide-preview+reload:$0 --reload-day {1} '+1 day'" \
--bind="ctrl-l:hide-preview+reload:$0 --reload-day {1} '+1 week'" \ --bind="ctrl-h:hide-preview+reload:$0 --reload-day {1} '-1 day'" \
--bind="ctrl-h:hide-preview+reload:$0 --reload-day {1} '-1 week'" \
--bind="alt-l:hide-preview+reload:$0 --reload-day {1} '+1 month'" \
--bind="alt-h:hide-preview+reload:$0 --reload-day {1} '-1 month'" \
--bind="ctrl-r:hide-preview+reload:$0 --reload-day today" \
--bind="ctrl-s:execute($SYNC_CMD ; printf 'Press <enter> to continue.'; read -r tmp)" \ --bind="ctrl-s:execute($SYNC_CMD ; printf 'Press <enter> to continue.'; read -r tmp)" \
--bind="w:toggle-preview-wrap" \ --bind="j:preview-down" \
--bind="ctrl-d:preview-down" \ --bind="k:preview-down" \
--bind="ctrl-u:preview-up" --bind="w:toggle-preview-wrap"
) )
key=$(echo "$selection" | head -1) key=$(echo "$selection" | head -1)
line=$(echo "$selection" | tail -1) line=$(echo "$selection" | tail -1)
@ -1037,7 +1033,7 @@ while true; do
set -- "--set-tz" "--day" "$DISPLAY_DATE" set -- "--set-tz" "--day" "$DISPLAY_DATE"
elif [ "$key" = "esc" ] || [ "$key" = "backspace" ] || [ "$key" = "q" ]; then elif [ "$key" = "esc" ] || [ "$key" = "backspace" ] || [ "$key" = "q" ]; then
set -- "--week" "$DISPLAY_DATE" set -- "--week" "$DISPLAY_DATE"
elif [ "$key" = "alt-v" ] && [ -f "$ROOT/$fpath" ]; then elif [ "$key" = "v" ] && [ -f "$ROOT/$fpath" ]; then
$EDITOR "$ROOT/$fpath" $EDITOR "$ROOT/$fpath"
elif [ -z "$key" ] && [ -n "$fpath" ]; then elif [ -z "$key" ] && [ -n "$fpath" ]; then
__edit "$start" "$end" "$fpath" __edit "$start" "$end" "$fpath"
@ -1063,26 +1059,28 @@ while true; do
--ansi \ --ansi \
--gap 1 \ --gap 1 \
--no-scrollbar \ --no-scrollbar \
--no-input \
--info=right \ --info=right \
--info-command="printf \"$(date +"%R %Z")\"; [ -n \"\${TZ:-}\" ] && printf \" (\$TZ)\"" \ --info-command="printf \"$(date +"%R %Z")\"; [ -n \"\${TZ:-}\" ] && printf \" (\$TZ)\"" \
--preview-window=up,7,border-bottom \ --preview-window=up,7,border-bottom \
--preview="$0 --preview-week {}" \ --preview="$0 --preview-week {}" \
--bind="load:pos($DISPLAY_POS)" \
--expect="ctrl-n,ctrl-g,ctrl-t" \ --expect="ctrl-n,ctrl-g,ctrl-t" \
--bind="j:down" \ --bind="ctrl-j:transform:([ {1} = \"+\" ] && [ \$FZF_POS -le 1 ]) &&
--bind="k:up" \ echo unbind\(load\)+reload:$0 --reload-week {2} '+1 day'||
--bind="l:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \ echo down" \
--bind="h:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \ --bind="ctrl-k:transform:([ {1} = \"+\" ] && [ \$FZF_POS -ge 7 ]) &&
--bind="ctrl-l:unbind(load)+reload:$0 --reload-week {2} '+1 month'" \ echo unbind\(load\)+reload:$0 --reload-week {2} '-1 day'||
--bind="ctrl-h:unbind(load)+reload:$0 --reload-week {2} '-1 month'" \ echo up" \
--bind="alt-l:unbind(load)+reload:$0 --reload-week {2} '+1 year'" \ --bind="change:unbind(load)+reload($0 --reload-all)+hide-preview" \
--bind="alt-h:unbind(load)+reload:$0 --reload-week {2} '-1 year'" \ --bind="load:pos($DISPLAY_POS)" \
--bind="ctrl-r:rebind(load)+reload($0 --reload-week today)+show-preview" \ --bind="ctrl-h:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
--bind="ctrl-l:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
--bind="ctrl-u:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
--bind="ctrl-d:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
--bind="ctrl-alt-u:unbind(load)+reload:$0 --reload-week {2} '-1 month'" \
--bind="ctrl-alt-d:unbind(load)+reload:$0 --reload-week {2} '+1 month'" \
--bind="ctrl-s:execute($SYNC_CMD ; printf 'Press <enter> to continue.'; read -r tmp)" \ --bind="ctrl-s:execute($SYNC_CMD ; printf 'Press <enter> to continue.'; read -r tmp)" \
--bind="/:show-input+unbind(j)+unbind(k)+unbind(l)+unbind(h)+unbind(ctrl-l)+unbind(ctrl-h)+unbind(alt-l)+unbind(alt-h)+unbind(load)+hide-preview+reload:$0 --reload-all" \ --bind="backward-eof:rebind(load)+reload($0 --reload-week today)+show-preview" \
--bind="backward-eof:hide-input+rebind(j)+rebind(k)+rebind(l)+rebind(h)+rebind(ctrl-l)+rebind(ctrl-h)+rebind(alt-l)+rebind(alt-h)+rebind(load)+show-preview+reload:$0 --reload-week today" \ --bind="ctrl-r:rebind(load)+reload($0 --reload-week today)+show-preview"
--bind="esc:clear-query+hide-input+rebind(j)+rebind(k)+rebind(l)+rebind(h)+rebind(ctrl-l)+rebind(ctrl-h)+rebind(alt-l)+rebind(alt-h)+rebind(load)+show-preview+reload:$0 --reload-week today"
) )
key=$(echo "$selection" | head -1) key=$(echo "$selection" | head -1)