Compare commits
2 Commits
16193b5554
...
903c870dba
Author | SHA1 | Date | |
---|---|---|---|
903c870dba | |||
4a17512819 |
78
README.md
78
README.md
@ -79,39 +79,61 @@ 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 available keybindings:
|
Here is the list of all available keybindings:
|
||||||
| Key | View | Action |
|
|
||||||
| --- | ---- | ------ |
|
### Week view
|
||||||
| `enter` | week view | Switch to day view |
|
|
||||||
| `ctrl-n` | week view | Make a new entry |
|
| Key | Action |
|
||||||
| any letter | week view | Search in the list of all entries |
|
| --- | ------ |
|
||||||
| `backspace` on empty query | week view | Undo search |
|
| `enter` | open day |
|
||||||
| `ctrl-u` | week view | Go back one week |
|
| `j` | down |
|
||||||
| `ctrl-d` | week view | Go forth one week |
|
| `k` | up |
|
||||||
| `ctrl-alt-u` | week view | Go back one month |
|
| `l` | go to next week |
|
||||||
| `ctrl-alt-d` | week view | Go forth one month |
|
| `h` | go to previous week |
|
||||||
| `ctrl-s` | week view | Run the synchronization command |
|
| `ctrl-l` | go to next month |
|
||||||
| `ctrl-r` | week view | Go to current week |
|
| `ctrl-h` | go to previous month |
|
||||||
| `ctrl-g` | week view | Goto date |
|
| `alt-l` | go to next year |
|
||||||
| `ctrl-t` | week view | Change timezone |
|
| `alt-h` | go to previous year |
|
||||||
| `enter` | day view | Open selected calendar entry in your favorite `$EDITOR` |
|
| `ctrl-r` | reload and go to week that contains `today` |
|
||||||
| `ctrl-n` | day view | Make a new entry |
|
| `ctrl-g` | interactively go to specified week |
|
||||||
| `ctrl-l` | day view | Move to next day |
|
| `ctrl-t` | set timezon |
|
||||||
| `ctrl-h` | day view | Move to previous day |
|
| `ctrl-s` | synchronize |
|
||||||
| `esc`, `backspace` or `q` | day view | Go back to week view |
|
| `ctrl-n` | add new entry |
|
||||||
| `ctrl-s` | day view | Run the synchronization command |
|
| `\` | search all appointment s|
|
||||||
| `ctrl-t` | day view | Change timezone |
|
|
||||||
| `ctrl-alt-d` | day view | Delete selected entry |
|
### Day view
|
||||||
| `j` | day view | Scroll down in preview window |
|
|
||||||
| `k` | day view | Scroll up in preview window |
|
| Key | Action |
|
||||||
| `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.
|
||||||
|
|
||||||
|
@ -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:FINAL";
|
print "STATUS:VEVENT";
|
||||||
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);
|
||||||
|
54
src/main.sh
54
src/main.sh
@ -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-alt-d,ctrl-t,ctrl-g,esc,backspace,q,v" \
|
--expect="ctrl-n,ctrl-t,ctrl-g,ctrl-alt-d,esc,backspace,q,alt-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,15 +998,19 @@ while true; do
|
|||||||
echo {} | grep \|\| || echo show-preview
|
echo {} | grep \|\| || echo show-preview
|
||||||
)" \
|
)" \
|
||||||
--bind="start:hide-preview" \
|
--bind="start:hide-preview" \
|
||||||
--bind="ctrl-r:reload:$0 --reload-day {1}" \
|
--bind="j:down+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \
|
||||||
--bind="ctrl-j:down+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \
|
--bind="k:up+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \
|
||||||
--bind="ctrl-k:up+hide-preview+transform:echo {} | grep \|\| || echo show-preview" \
|
--bind="l:hide-preview+reload:$0 --reload-day {1} '+1 day'" \
|
||||||
--bind="ctrl-l:hide-preview+reload:$0 --reload-day {1} '+1 day'" \
|
--bind="h:hide-preview+reload:$0 --reload-day {1} '-1 day'" \
|
||||||
--bind="ctrl-h: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 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="j:preview-down" \
|
--bind="w:toggle-preview-wrap" \
|
||||||
--bind="k:preview-down" \
|
--bind="ctrl-d:preview-down" \
|
||||||
--bind="w:toggle-preview-wrap"
|
--bind="ctrl-u:preview-up"
|
||||||
)
|
)
|
||||||
key=$(echo "$selection" | head -1)
|
key=$(echo "$selection" | head -1)
|
||||||
line=$(echo "$selection" | tail -1)
|
line=$(echo "$selection" | tail -1)
|
||||||
@ -1033,7 +1037,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" = "v" ] && [ -f "$ROOT/$fpath" ]; then
|
elif [ "$key" = "alt-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"
|
||||||
@ -1059,28 +1063,26 @@ 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 {}" \
|
||||||
--expect="ctrl-n,ctrl-g,ctrl-t" \
|
|
||||||
--bind="ctrl-j:transform:([ {1} = \"+\" ] && [ \$FZF_POS -le 1 ]) &&
|
|
||||||
echo unbind\(load\)+reload:$0 --reload-week {2} '+1 day'||
|
|
||||||
echo down" \
|
|
||||||
--bind="ctrl-k:transform:([ {1} = \"+\" ] && [ \$FZF_POS -ge 7 ]) &&
|
|
||||||
echo unbind\(load\)+reload:$0 --reload-week {2} '-1 day'||
|
|
||||||
echo up" \
|
|
||||||
--bind="change:unbind(load)+reload($0 --reload-all)+hide-preview" \
|
|
||||||
--bind="load:pos($DISPLAY_POS)" \
|
--bind="load:pos($DISPLAY_POS)" \
|
||||||
--bind="ctrl-h:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
|
--expect="ctrl-n,ctrl-g,ctrl-t" \
|
||||||
--bind="ctrl-l:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
|
--bind="j:down" \
|
||||||
--bind="ctrl-u:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
|
--bind="k:up" \
|
||||||
--bind="ctrl-d:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
|
--bind="l:unbind(load)+reload:$0 --reload-week {2} '+1 week'" \
|
||||||
--bind="ctrl-alt-u:unbind(load)+reload:$0 --reload-week {2} '-1 month'" \
|
--bind="h:unbind(load)+reload:$0 --reload-week {2} '-1 week'" \
|
||||||
--bind="ctrl-alt-d:unbind(load)+reload:$0 --reload-week {2} '+1 month'" \
|
--bind="ctrl-l:unbind(load)+reload:$0 --reload-week {2} '+1 month'" \
|
||||||
|
--bind="ctrl-h:unbind(load)+reload:$0 --reload-week {2} '-1 month'" \
|
||||||
|
--bind="alt-l:unbind(load)+reload:$0 --reload-week {2} '+1 year'" \
|
||||||
|
--bind="alt-h:unbind(load)+reload:$0 --reload-week {2} '-1 year'" \
|
||||||
|
--bind="ctrl-r:rebind(load)+reload($0 --reload-week today)+show-preview" \
|
||||||
--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="backward-eof:rebind(load)+reload($0 --reload-week today)+show-preview" \
|
--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="ctrl-r: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="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)
|
||||||
|
Loading…
Reference in New Issue
Block a user