From cf0544b0a507d9d501c27017bee9d5edcfe484ce Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 29 Aug 2023 22:44:55 +0200 Subject: [PATCH] papis: Add styling to papis-tui --- writing/.config/papis/papistui.yaml | 90 +++++++++++++++++++---------- 1 file changed, 61 insertions(+), 29 deletions(-) diff --git a/writing/.config/papis/papistui.yaml b/writing/.config/papis/papistui.yaml index f82e51d..2570a70 100644 --- a/writing/.config/papis/papistui.yaml +++ b/writing/.config/papis/papistui.yaml @@ -1,52 +1,74 @@ +base: + vimflavour: nvim documentlist: defaultstyle: multiline - marked-icon: '*' + marked-icon: "" multilinestyle: rows: - - {doc.html_escape["ref"]} - - {doc.html_escape["title"]} - - {doc.html_escape["author"]} + - "{doc.alias('type')} {doc['ref']} {doc.forfile('')}" + - "{doc.html_escape['title']}" + - "{doc.html_escape['author']}" + - "{doc.foreach('tags', '({})', split = ', ', sep = ' ')}" tablestyle: + separator: " " + headerstyle: "underline|bold" + rowstyle: "white_bg" + cursorrowstyle: "black_white|bold" columns: - - content: '{doc.html_escape["ref"]}' - header: Ref - width: 15 - - content: '{doc.html_escape["author"]}' - header: Author - width: 30 - - content: '{doc.html_escape["year"]}' - header: Year - width: 4 - - content: '{doc.html_escape["title"]}' - header: Titel - width: 400 - cursorrowstyle: black_white - headerstyle: underline|bold - rowstyle: white_bg - separator: " \u2502 " + - { + header: " #", + content: "{doc.alias('type')} {str(len(doc.get_files()) if len(doc.get_files()) > 0 else '')}", + width: 3, + } + - { header: "Reference", content: "@{doc['ref']}", width: 15 } + - { header: "Year", content: "{str(doc['year'])}", width: 4 } + - { header: "Authors", content: "{doc['author']}", width: 20 } + - { header: "Title", content: "{doc['title']}", width: 200 } + aliases: + type: + { + article: "", + book: "", + incollection: "󰪧", + inbook: '', + software: "", + presentation: "󰐨", + thesis: "", + _default_: "", + } keymappings: - ' ': mark_down + q: quit + "?": help + S: toggle_style /: search_mode : scroll_down : scroll_up : page_down : page_up - '?': help G: jump_to_bottom gg: jump_to_top j: scroll_down k: scroll_up - o: open + o: open -r "pdf$" + O: open -d + r: view_reset + R: reload e: edit n: papis edit -n papis_id:{doc['papis_id']} - q: quit - t: tag - ii: + " ": mark_selected + mm: mark_selected + M: mark_down + mu: unmark_all + mv: mark_view + t: cmd "tag " + i: - info_toggle - "Toggle info window" - ij: + I: - info_cycle - "Cycle info windows" + # TODO look into https://github.com/supersambo/papis-tui vim-send mappings + infowindow: default_on: False views: @@ -56,8 +78,18 @@ infowindow: content: "{doc['abstract']}" linewrap: True height: 8 + +commandline: + search: + keyword_aliases: {a: 'author:', t: 'title:', y: 'year:', k: 'tags:'} + statusbar: left: - default: {info["mode_upper"]} + default: " {info['mode_upper']} " + normal: " {info['mode_upper']} " + command: " {info['mode_upper']} " + select: " {info['mode_upper']} " + search: " {info['mode_upper']} " right: - default: {info["idx"]} < {info["marked"]} < {info["view"]} < {info["items"]} + default: "{info['sortkeys']} {info['idx']} < {info['marked']} < {info['view']} < {info['items']} " +