papis: Improve tui rendering and add priority maps

We render the priority of an entry in both table and multiline mode,
with priority >=1 being highest, >=3 being medium and everything
>5 being low priority.

We also have some maps for quickly setting the priority of an entry
from the tui:

`,ph` | `,pm` | `,pl` (for high, medium, low - so 1,3,5).

Lastly, I quickly added some to-dos that require the input of the
maintainer or some work in a fork, so I don't forget.
I also should not forget that I implemented some of them locally already
and am using them.
This commit is contained in:
Marty Oehme 2023-09-16 11:23:23 +02:00
parent 061e341253
commit 6e60101b9b
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -1,12 +1,22 @@
# current issues/requests
# - [ ] call arbitrary shell command
# - [ ] non-blocking opening of files
# - [ ] distinguish in config between aliases for multiline/table
# - [ ] update view after more operations
# - if I call an 'update' command (e.g. set new tag or read status), it will not update in list until 'edit' command invoked and rebuilding the list
# - two selection additions:
# - [ ] select all in view
# - [ ] limit view to currently selected
#
base:
vimflavour: nvim
documentlist:
defaultstyle: multiline
marked-icon: ""
marked-icon: "󰁔"
multilinestyle:
rows:
# TODO: show if already note attached; have info window display note content?
- "<cyan>{doc.alias('type')} {doc['ref']}</cyan>{' 󰘓 ' if doc['file'] else ''} {doc.alias('readstatus')}"
- "{' ' if 'priority' not in doc or doc['priority'] > 3 else '<red>󱝇 </red>' if doc['priority'] <= 1 else '<yellow>󱝇 </yellow>'}<cyan>{doc.alias('type')} {doc['ref']}</cyan> {doc.alias('readstatus')} {' 󰘓 ' if doc['notes'] else ''}"
- "<white><bold>{doc.html_escape['title']}</bold></white>"
- "<blue>{doc.html_escape['author']}</blue>"
- "{doc.foreach('tags', '<lightgray>(</lightgray><gray><dim>{}</dim></gray><lightgray>)</lightgray>', split = ', ', sep = ' ')}"
@ -16,6 +26,11 @@ documentlist:
rowstyle: "white_bg"
cursorrowstyle: "black_white|bold"
columns:
- {
header: "󱝇",
content: "{'' if 'priority' not in doc or doc['priority'] > 3 else '󰝥' if doc['priority'] <= 1 else '󰝦'}",
width: 1,
}
- {
header: "󰑇",
content: "{'󰗠' if doc['readstatus'] == 'read' else '󰗡' if doc['readstatus'] == 'skimmed' else ' '}",
@ -46,11 +61,12 @@ documentlist:
{
article: "",
book: "",
incollection: "󰪧",
inbook: "",
software: "",
incollection: "󰪧",
software: "󰅩",
presentation: "󰐨",
thesis: "",
techreport: "󰁰",
_default_: "",
}
readstatus:
@ -90,16 +106,17 @@ keymappings:
- limit to entries with notes
"'u":
- search "readstatus:read OR readstatus:skimmed"
- limit to unread entries
- limit to read entries
"'r":
- search "NOT readstatus:read AND NOT readstatus:skimmed"
- limit to read entries
- limit to unread entries
" ": mark_selected
mm: mark_selected
M: mark_down
J: mark_down
mu: unmark_all
mv: mark_view
",t": cmd "tag "
",r":
- papis update -s readstatus read papis_id:{doc['papis_id']}
- set readstatus read
@ -109,7 +126,15 @@ keymappings:
",u":
- papis update -s readstatus "" papis_id:{doc['papis_id']}
- set readstatus unread
",t": cmd "tag "
",ph":
- papis update -s priority 1 papis_id:{doc['papis_id']}
- set priority high
",pm":
- papis update -s priority 2 read papis_id:{doc['papis_id']}
- set priority medium
",pl":
- papis update -s priority 3 read papis_id:{doc['papis_id']}
- set priority low
i:
- info_toggle
- "Toggle info window"