@@ -314,8 +314,15 @@ enable_icons = true,
314
314
-- What keys to search for matches.
315
315
search_keys = { " author" , " editor" , " year" , " title" , " tags" },
316
316
317
- -- The format for the previewer. Each line in the config represents a line in
318
- -- the preview. For each line, we define:
317
+ -- Papis.nvim uses a common configuration format for defining the formatting
318
+ -- of strings. Sometimes -- as for instance in the below `preview_format` option --
319
+ -- we define a set of lines. At other times -- as for instance in the `results_format`
320
+ -- option -- we define a single line. Sets of lines are composed of single lines.
321
+ -- A line can be composed of either a single element or multiple elements. The below
322
+ -- `preview_format` shows an example where each line is defined by a table with just
323
+ -- one element. The `results_format` and `popup_format` are examples where (some) of
324
+ -- the lines contain multiple elements (and are represented by a table of tables).
325
+ -- Each element contains:
319
326
-- 1. The key whose value is shown
320
327
-- 2. How it is formatted (here, each is just given as is)
321
328
-- 3. The highlight group
@@ -324,10 +331,10 @@ enable_icons = true,
324
331
-- formatting of the key and its highlight group. The key is shown *before*
325
332
-- the value in the preview (even though it is defined after it in this
326
333
-- configuration (e.g. `title = Critique of Pure Reason`)).
327
- -- `empty_line` is used to insert an empty line
334
+ -- An element may also just contain `empty_line`. This is used to insert an empty line
328
335
-- Strings that define the formatting (such as in 2. and 4. above) can optionally
329
- -- be a table, defining, first, an icon, and second, a non-icon version. What is
330
- -- used is defined by the `enable_icons` option.
336
+ -- be a table, defining, first, an icon, and second, a non-icon version. The
337
+ -- `enable_icons` option determines what is used .
331
338
preview_format = {
332
339
{ " author" , " %s" , " PapisPreviewAuthor" },
333
340
{ " year" , " %s" , " PapisPreviewYear" },
@@ -357,10 +364,18 @@ enable_icons = true,
357
364
[" at-cursor" ] = {
358
365
359
366
-- The format of the popup shown on `:Papis at-cursor show-popup` (equivalent to points 1-3
360
- -- of `preview_format`)
367
+ -- of `preview_format`). Note that one of the lines is composed of multiple elements. Note
368
+ -- also the `{ "vspace", "vspace" },` line which is exclusive to `popup_format` and which tells
369
+ -- papis.nvim to fill the space between the previous and next element with whitespace (and
370
+ -- in effect make whatever comes after right-aligned). It can only occur once in a line.
361
371
popup_format = {
362
- { " author" , " %s" , " PapisPopupAuthor" },
363
- { " year" , " %s" , " PapisPopupYear" },
372
+ {
373
+ { " author" , " %s" , " PapisPopupAuthor" },
374
+ { " vspace" , " vspace" },
375
+ { " files" , { " " , " F " }, " PapisResultsFiles" },
376
+ { " notes" , { " " , " N " }, " PapisResultsNotes" },
377
+ },
378
+ { " year" , " %s" , " PapisPopupYear" },
364
379
{ " title" , " %s" , " PapisPopupTitle" },
365
380
},
366
381
},
0 commit comments