Git Product home page Git Product logo

papis.nvim's Introduction

papis.nvim

Manage your bibliography from within your favourite editor


Papis.nvim is a neovim companion plugin for the bibliography manager Papis. It's meant for all those who do academic and other writing in neovim and who want quick access to their bibliography from within the comfort of their editor.

Papis search

  • Search your bibliography with telescope
  • Place your cursor over a citation key and get information about the entry
  • Automatically format new notes
  • Tag completion in info.yaml files
  • Insert formatted references

And this is just the beginning! With its fast and always up-to-date sqlite database (courtesy of sqlite.lua), a host of additional features are just waiting to be implemented. My hope is for this plugin to eventually become neovim's answer to emacs plugins such as org-ref, helm-bibtex, and citar.

This plugin is in beta and breaking changes are expected. Breaking changes are communicated in a pinned issue and commit messages.

Features

A number of features (bundled into modules) are shipped with papis.nvim. These can be (de)activated as desired.

Search module

search (trimmed)

Papis.nvim integrates with telescope to easily and quickly search one's bibliography. Open the picker and enter the title (or author, year, etc.) of the article you're looking for. Once you've found it, you can insert a citation, open attached files and notes, and edit the info.yaml file. When attempting to open a note where none exists, papis.nvim will ask to create a new one.

Commands:

  • :Papis search: Opens the papis.nvim telescope picker

With the picker open, the following (currently hardcoded) keymaps become available:

  • of (normal) / <c-o>f (insert): Opens files attached to the entry
  • on (normal) / <c-o>n (insert): Opens notes attached to the entry (asks for the creation of a new one if none exists)
  • e (normal) / c-e (insert): Opens the info.yaml file
  • f (normal) / c-f (insert): Insert a formatted reference

Completion module

completion (trimmed)

When editing tags in info.yaml files, papis.nvim will suggest tags found in the database. This module is implemented as a nvim-cmp source.

At-cursor module

at-cursor (trimmed)

When the cursor is positioned over a citation key (e.g. Kant1781Critique), papis.nvim allows you to interact with the bibliography item referenced by it.

Commands:

  • :Papis at-cursor show-popup: Opens a floating window with information about the entry
  • :Papis at-cursor open-file: Opens files attached to the entry
  • :Papis at-cursor open-note: Opens notes attached to the entry (asks for the creation of a new one if none exists)
  • :Papis at-cursor edit: Opens the info.yaml file

Formatter module

formatter_trimmed

When creating new notes (via :Papis search or :Papis at-cursor open-note), papis.nvim can be set up to format the new note with a custom function. You can, for example, give the note a title that corresponds to the entry's title or provide it with a skeleton structure. Below, in the setup section, there's an example suitable for the markdown format.

The database

All of papis.nvim's features are made possible by a sqlite database that is created when you run :Papis reload data. This might take a while, so be patient. From then on, the database is automatically (and very quickly) updated whenever info.yaml files are added, changed, or deleted. The database is synchronised when papis.nvim is started and is then kept up-to-date continuously while at least one neovim instance with a running papis.nvim session exists.

Note that fiddling with the plugin's options can leave the database in a messy state. If strange errors appear, use :Papis reload data to re-initialise the database.

Installation

Note that papis.nvim is only tested with the latest stable version of Neovim. It should work across various OSs, but most development has been done on Linux (do feel free to open issues if you run into trouble on non-Linux systems). An installation of Papis is required.

To run, papis.nvim requires:

  • yq. This is used to convert .yaml files to .json (which can then be read by neovim). Note that papis.nvim doesn't (currently) support the python yq.
  • sqlite. Needed by the sqlite.lua dependency.

Optionally, you'll need:

Neovim package managers

In addition to the below snippets, you might also need to install:

  • treesitter yaml parser (if you want the completion module)
rocks.nvim
:Rocks install papis.nvim

Additionally, may want to install telescope (for search) and cmp (for completion).

lazy.nvim
{
  "jghauser/papis.nvim",
  dependencies = {
    "kkharji/sqlite.lua",
    "MunifTanjim/nui.nvim",
    "pysan3/pathlib.nvim",
    "nvim-neotest/nvim-nio",
    -- if not already installed, you may also want:
    -- "nvim-telescope/telescope.nvim",
    -- "hrsh7th/nvim-cmp",

  },
  config = function()
    require("papis").setup({
    -- Your configuration goes here
    })
  end,
}
packer
use({
  "jghauser/papis.nvim",
  after = { "telescope.nvim", "nvim-cmp" },
  requires = {
    "kkharji/sqlite.lua",
    "MunifTanjim/nui.nvim",
    "pysan3/pathlib.nvim",
    "nvim-neotest/nvim-nio",
    -- if not already installed, you may also want:
    -- "nvim-telescope/telescope.nvim",
    -- "hrsh7th/nvim-cmp",
  },
  config = function()
    require("papis").setup(
    -- Your configuration goes here
    )
  end,
})

Nix

The flake.nix provides an overlay that can be used to install papis.nvim. With home-manager, this can be achieved with something along the following lines:

Nix configuration
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager";
    papis-nvim.url = "github:jghauser/papis.nvim";
  };
  outputs = { self, nixpkgs, home-manager, ... }: {
    nixosConfigurations.machine = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        home-manager.nixosModules.home-manager
        {
          nixpkgs.overlays = [ papis-nvim.overlays.default ];
          home-manager.users.myuser = {
            programs.neovim = {
              enable = true;
              extraPackages = [
                pkgs.yq-go
              ];
              plugins = with pkgs.vimPlugins; [
                papis-nvim
                # if not already installed, you may also want:
                # telescope-nvim
                # nvim-cmp",
              ]
            };
          };
        }
      ];
    };
  };
}

Setup

Papis.nvim exposes a rather large number of configuration options, most of which can be left alone -- and quite a few of which probably should be left alone (or not, if you're feeling brave). Currently, papis.nvim doesn't check whether you've managed to set incompatible options, and weird failures will likely occur in such instances.

Minimal setup:

require("papis").setup({
  -- Enable the default keymaps (defaults to `false`)
  enable_keymaps = true,
  -- You might want to change the filetypes activating papis.nvim
  -- init_filetypes = { "markdown", "norg", "yaml" },
  -- If you don't have an appropriate font (like Nerd Font), you
  -- may want to disable icons. This may require a `:Papis reload data`.
  -- to take effect.
  -- enable_icons = false,
})
All configuration options (with defaults)
-- List of enabled papis.nvim modules.
enable_modules = {
  ["search"] = true,          -- Enables/disables the search module
  ["completion"] = true,      -- Enables/disables the completion module
  ["at-cursor"] = true,  -- Enables/disables the at-cursor module
  ["formatter"] = true,       -- Enables/disables the formatter module
  ["colors"] = true,          -- Enables/disables default highlight groups (you
                              -- probably want this)
  ["base"] = true,            -- Enables/disables the base module (you definitely
                              -- want this)
  ["debug"] = false,          -- Enables/disables the debug module (useful to
                              -- troubleshoot and diagnose issues)
},

-- Defines citation formats for various filetypes. They define how citation strings
-- are parsed and formatted when inserted. For each filetype, we may define:
-- - `start_str`: precedes the citation
-- - `end_str`: appended after the citation
-- - `ref_prefix`: precedes each `ref` in a citation
-- - `separator_str`: gets added between `ref`s if there are multiple in a citation
-- For example, for the `org` filetype if we insert a citation with `Ref1` and `Ref2`,
-- we end up with `[cite:@Ref1;@Ref2]`.
cite_formats = {
  tex = {
    start_str = [[\cite{]],
    end_str = "}",
    separator_str = ", ",
  },
  markdown = {
    ref_prefix = "@",
    separator_str = "; "
  },
  rmd = {
    ref_prefix = "@",
    separator_str = "; "
  },
  plain = {
    separator_str = ", "
  },
  org = {
    start_str = "[cite:",
    end_str = "]",
    ref_prefix = "@",
    separator_str = ";",
  },
  norg = {
    start_str = "{= ",
    end_str = "}",
    separator_str = "; ",
  },
},

-- What citation format to use when none is defined for the current filetype.
cite_formats_fallback = "plain",

-- Enable default keymaps.
enable_keymaps = false,

-- Whether to enable the file system event watcher. When disabled, the database
-- is only updated on startup.
enable_fs_watcher = true,

-- The sqlite schema of the main `data` table. Only the "text" and "luatable"
-- types are allowed.
data_tbl_schema = {
  id = { "integer", pk = true },
  papis_id = { "text", required = true, unique = true },
  ref = { "text", required = true, unique = true },
  author = "text",
  editor = "text",
  year = "text",
  title = "text",
  shorttitle = "text",
  type = "text",
  abstract = "text",
  time_added = "text",
  notes = "luatable",
  journal = "text",
  volume = "text",
  number = "text",
  author_list = "luatable",
  tags = "luatable",
  files = "luatable",
},

-- Path to the papis.nvim database.
db_path = vim.fn.stdpath("data") .. "/papis_db/papis-nvim.sqlite3",

-- Name of the `yq` executable.
yq_bin = "yq",

-- Function to execute when adding a new note. `ref` is the citation key of the
-- relevant entry and `notes_name` is the name of the notes file.
create_new_note_fn = function(papis_id, notes_name)
  vim.fn.system(
    string.format(
      "papis update --set notes %s papis_id:%s",
      vim.fn.shellescape(notes_name),
      vim.fn.shellescape(papis_id)
    )
  )
end,

-- Filetypes that start papis.nvim.
init_filetypes = { "markdown", "norg", "yaml" },

-- Papis options to import into papis.nvim.
papis_conf_keys = { "info-name", "notes-name", "dir", "opentool" },

-- Whether to enable pretty icons (requires something like Nerd Fonts)
enable_icons = true,

-- Configuration of the search module.
["search"] = {

  -- Whether to enable line wrap in the telescope previewer.
  wrap = true,

  -- Whether to initially sort entries by time-added.
  initial_sort_by_time_added = true,

  -- What keys to search for matches.
  search_keys = { "author", "editor", "year", "title", "tags" },

  -- Papis.nvim uses a common configuration format for defining the formatting
  -- of strings. Sometimes -- as for instance in the below `preview_format` option --
  -- we define a set of lines. At other times -- as for instance in the `results_format`
  -- option -- we define a single line. Sets of lines are composed of single lines.
  -- A line can be composed of either a single element or multiple elements. The below
  -- `preview_format` shows an example where each line is defined by a table with just
  -- one element. The `results_format` and `popup_format` are examples where (some) of
  -- the lines contain multiple elements (and are represented by a table of tables).
  -- Each element contains:
  --   1. The key whose value is shown
  --   2. How it is formatted (here, each is just given as is)
  --   3. The highlight group
  --   4. (Optionally), `show_key` causes the key's name to be displayed in addition
  --      to the value. When used, there are then another two items defining the
  --      formatting of the key and its highlight group. The key is shown *before*
  --      the value in the preview (even though it is defined after it in this
  --      configuration (e.g. `title = Critique of Pure Reason`)).
  -- An element may also just contain `empty_line`. This is used to insert an empty line
  -- Strings that define the formatting (such as in 2. and 4. above) can optionally
  -- be a table, defining, first, an icon, and second, a non-icon version. The 
  -- `enable_icons` option determines what is used.
  preview_format = {
    { "author", "%s", "PapisPreviewAuthor" },
    { "year", "%s", "PapisPreviewYear" },
    { "title", "%s", "PapisPreviewTitle" },
    { "empty_line" },
    { "journal", "%s", "PapisPreviewValue", "show_key", { "󱀁  ", "%s: " }, "PapisPreviewKey" },
    { "type", "%s", "PapisPreviewValue", "show_key", { "", "%s: " }, "PapisPreviewKey" },
    { "ref", "%s", "PapisPreviewValue", "show_key", { "", "%s: " }, "PapisPreviewKey" },
    { "tags", "%s", "PapisPreviewValue", "show_key", { "", "%s: " }, "PapisPreviewKey" },
    { "abstract", "%s", "PapisPreviewValue", "show_key", { "󰭷  ", "%s: " }, "PapisPreviewKey" },
  },

  -- The format of each line in the the results window. Here, everything is show on
  -- one line (otherwise equivalent to points 1-3 of `preview_format`). The `force_space`
  -- value is used to force whitespace for icons (so that if e.g. a file is absent, it will
  -- show "  ", ensuring that columns are aligned.)
  results_format = {
    { "files", { "", "F " }, "PapisResultsFiles", "force_space" },
    { "notes", { "󰆈 ", "N " }, "PapisResultsNotes", "force_space" },
    { "author", "%s ", "PapisResultsAuthor" },
    { "year", "(%s) ", "PapisResultsYear" },
    { "title", "%s", "PapisResultsTitle" },
  },
},

-- Configuration of the at-cursor module.
["at-cursor"] = {

  -- The format of the popup shown on `:Papis at-cursor show-popup` (equivalent to points 1-3
  -- of `preview_format`). Note that one of the lines is composed of multiple elements. Note
  -- also the `{ "vspace", "vspace" },` line which is exclusive to `popup_format` and which tells
  -- papis.nvim to fill the space between the previous and next element with whitespace (and
  -- in effect make whatever comes after right-aligned). It can only occur once in a line.
  popup_format = {
    {
      { "author", "%s", "PapisPopupAuthor" },
      { "vspace", "vspace" },
      { "files", { "", "F " }, "PapisResultsFiles" },
      { "notes", { "󰆈 ", "N " }, "PapisResultsNotes" },
    },
    { "year",  "%s", "PapisPopupYear" },
    { "title", "%s", "PapisPopupTitle" },
  },
},

-- Configuration of formatter module.
["formatter"] = {

  -- This function runs when first opening a new note. The `entry` arg is a table
  -- containing all the information about the entry (see above `data_tbl_schema`).
  -- This example is meant to be used with the `markdown` filetype. The function
  -- must return a set of lines, specifying the lines to be added to the note.
  format_notes = function(entry)
    -- Some string formatting templates (see above `results_format` option for
    -- more details)
    local title_format = {
      { "author", "%s ", "" },
      { "year", "(%s) ", "" },
      { "title", "%s", "" },
    }
    -- Format the strings with information in the entry
    local title = require("papis.utils"):format_display_strings(entry, title_format, true)
    -- Grab only the strings (and disregard highlight groups)
    for k, v in ipairs(title) do
      title[k] = v[1]
    end
    -- Define all the lines to be inserted
    local lines = {
      "---",
      'title: "Notes -- ' .. table.concat(title) .. '"',
      "---",
      "",
    }
    return lines
  end,
  -- This function runs when inserting a formatted reference (currently by `f/c-f` in
  -- Telescope). It works similarly to the `format_notes` above, except that the set
  -- of lines should only contain one line (references using multiple lines aren't
  -- currently supported).
  format_references = function(entry)
    local reference_format = {
      { "author",  "%s ",   "" },
      { "year",    "(%s). ", "" },
      { "title",   "%s. ",  "" },
      { "journal", "%s. ",    "" },
      { "volume",  "%s",    "" },
      { "number",  "(%s)",  "" },
    }
    local reference_data = require("papis.utils"):format_display_strings(entry, reference_format)
    for k, v in ipairs(reference_data) do
      reference_data[k] = v[1]
    end
    local lines = { table.concat(reference_data) }
    return lines
  end,
},

-- Configurations relevant for parsing `info.yaml` files.
["papis-storage"] = {

  -- As lua doesn't deal well with '-', we define conversions between the format
  -- in the `info.yaml` and the format in papis.nvim's internal database.
  key_name_conversions = {
    time_added = "time-added",
  },

  -- The format used for tags. Will be determined automatically if left empty.
  -- Can be set to `tbl` (if a lua table), `,` (if comma-separated), `:` (if
  -- semi-colon separated), ` ` (if space separated).
  tag_format = nil,

  -- The keys which `.yaml` files are expected to always define. Files that are
  -- missing these keys will cause an error message and will not be added to
  -- the database.
  required_keys = { "papis_id", "ref" },
},

In order to use the cmp source, you need to add it to the sources loaded by cmp.

cmp.setup({
  sources = cmp.config.sources({
  -- your other source
  { name = "papis" },
  })
})

Usage

Papis.nvim will start automatically according to the filetypes defined in init_filetypes (see the setup section). When first starting, papis.nvim will import some configuration values from Papis and save them in the database. It will then prompt you to run :Papis reload data to import all of your library into the database. If you update your Papis configuration, you should re-import the configuration into papis.nvim with :Papis reload config and run :Papis relad data again.

Keymaps

By default, papis.nvim doesn't set any keymaps (except in Telescope). You can, however, enable them by setting enable_keymaps to true. This provides you with the following:

  • <leader>pp (normal) / <c-o>p (insert): Open the telescope picker
  • <leader>pof (normal): Open file under cursor
  • <leader>pe (normal): Edit entry under cursor
  • <leader>pon (normal): Open note under cursor
  • <leader>pi (normal): Show entry info popup

Highlights

Papis.nvim defines and links a number of default highlight groups. In order to change the colours, simply override them with whatever you desire.

Highlight groups
  • PapisPreviewAuthor: The author field in the Telescope previewer
  • PapisPreviewYear: The year field in the Telescope previewer
  • PapisPreviewTitle: The title field in the Telescope previewer
  • PapisPreviewKey: The keys in the Telescope previewer (when set with show_key, see the setup section).
  • PapisPreviewValue: The values in the Telescope previewer (when set with show_key, see the setup section).
  • PapisResultsAuthor: The author in the Telescope results window
  • PapisResultsYear: The year in the Telescope results window
  • PapisResultsTitle: The title in the Telescope results window
  • PapisResultsFiles: The files in the Telescope results window
  • PapisResultsNotes: The notes in the Telescope results window
  • PapisPopupAuthor: The author in the cursor action popup
  • PapisPopupYear: The year in the cursor action popup
  • PapisPopupTitle: The title in the cursor action popup

Issues/Troubleshooting

You can use :checkhealth papis for some basic troubleshooting. In addition, you can enable the debug module, which exposes the following commands and a log:

  • :Papis debug info: Get the path to the log file
  • :Papis debug stop-watchers: Stops file watching for the current neovim instance. Helps if you want to use one particular instance to try things out, but have other neovim instances open on the system.
  • :Papis debug start-watchers: Starts file watching for the current neovim instance

Please open an issue when you find bugs!

Contributing

I am quite new to programming and there's a million things that I want to improve and probably another million things that I should improve but don't yet know about. I'm more than happy about any contributions, ideas for improvements, ideas for new features, bug reports, and so on. If you have a cool idea for a new functionality you want to implement, I'd be happy to guide you through the process of creating a new module. PRs should be formatted to have indents of 2 spaces and have emmydoc comments.

Planned features and improvements

I'm open to suggestions and PRs. Here are some things I've thought of:

  • better search
    • by entry keys (e.g. tags)
    • full text (with rga?)
  • adding new entries (both automatic and manual)
  • bib(la)tex backend (in addition to Papis)
    • I'm unlikely to do this myself as I don't need it. I'd be more than happy to help with the implemention however!
  • sharing functionality
  • insert formatted references and bibliographies (using .csl)
  • tests

Thanks

Big thanks to Irteza Rehman for generously contributing the beautiful logo.

papis.nvim's People

Contributors

davvil avatar github-actions[bot] avatar jghauser avatar maxmahlke avatar panosz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

papis.nvim's Issues

Setup not working correctly

Hi, I'm trying to install papis.nvim on LazyVim (on my Arch laptop) today.
:Telescope papis comes up with empty results, and I'm running into this error every time I try to run :PapisReInitData.

Error executing Lua callback: ....local/share/nvim/lazy/plenary.nvim/lua/plenary/path.lua:256: assertion failed!
stack traceback:
	[C]: in function 'assert'
	....local/share/nvim/lazy/plenary.nvim/lua/plenary/path.lua:256: in function 'new'
	...l/share/nvim/lazy/papis.nvim/lua/papis/papis-storage.lua:129: in function 'make_full_paths'
	...l/share/nvim/lazy/papis.nvim/lua/papis/papis-storage.lua:187: in function 'get_data_full'
	...are/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:57: in function 'update_main_tbls'
	...are/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:127: in function 'sync_storage_data'
	...are/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:161: in function 'sync_db'
	...are/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:155: in function 'reset_db'
	....local/share/nvim/lazy/papis.nvim/lua/papis/commands.lua:25: in function <....local/share/nvim/lazy/papis.nvim/lua/papis/commands.lua:24>

Thanks for the help.


Here's my papis.nvim config

return {
  "jghauser/papis.nvim",
  dependencies = {
    "kkharji/sqlite.lua",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
    "nvim-treesitter/nvim-treesitter",
  },
  config = function()
    require("papis").setup({
      -- Your configuration goes here
      papis_python = {
        dir = "~/Documents/Papers",
        info_name = "info.yaml", -- (when setting papis options `-` is replaced with `_`
        -- in the keys names)
        notes_name = [[notes.norg]],
      },
      -- Enable the default keymaps
      enable_keymaps = true,
    })
  end,
}

nvim -v output

NVIM v0.11.0-dev-58+gbdf15dbe69
Build type: RelWithDebInfo
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

cmp source for completing references

Thanks for making this plugin - it's awesome so far. When I'm in a markdown file, for example, it would be great to be able to do autocompletion of citation tags. Suppose I have a document in my papis library with the field ref: smith1992optimal, and I'm editing a markdown document in which I want to cite this reference. One option, which currently works is to type @| (the pipe character denotes the cursor position) and then enter Normal mode and hit Spacepp to open the papis.nvim telescope picker, begin typing smith19... and the fuzzy finder eventually matches and then hit enter, which puts smith1992optimal at the cursor position. My suggestion is to feed the refs as a source for cmp - that way, one need not exit Insert mode to search/match/input the desired citation.

Icons are shown in picker even if `enable_icons=false` is set

Using the following setup, I still see the icons in front of every line in the telescope picker. This is straight from the docs, so I believe this should work.

require("papis").setup({
   enable_icons = false,
 })

I synced the repo just now and the issue persists.

Papis startup fails

After installing Papis with lazy.nvim and configuring to load on markdown files, I get below error. None of the Papis commands are available, also telescope picker is not available to run.

Even if it is not lazy loaded, it still isn't working, but I don't see the following error if it is not lazy loaded.

Failed to run `config` for papis.nvim

...l/share/nvim/lazy/pathlib.nvim/lua/pathlib/utils/nuv.lua:60: bad argument #2 to '?' (number expected, got nil)

# stacktrace:
  - /pathlib.nvim/lua/pathlib/utils/nuv.lua:60 _in_ **mkdir**
  - /papis.nvim/lua/papis/sqlite-wrapper.lua:24
  - /papis.nvim/lua/papis/config.lua:223 _in_ **update**
  - /papis.nvim/lua/papis/init.lua:31 _in_ **setup**
  - /usr/share/nvim/runtime/filetype.lua:36
  - /usr/share/nvim/runtime/filetype.lua:35

Papis installation is as follows:

{
    "jghauser/papis.nvim",
    lazy = true,
    ft = "markdown",
    dependencies = {
      "kkharji/sqlite.lua",
      "MunifTanjim/nui.nvim",
      "pysan3/pathlib.nvim",
      "nvim-neotest/nvim-nio",
    },
    opts = {},
  }

Dependency libyaml-dev

I'm pretty sure libyaml-dev is a dependency in order to install lyaml.
When installing via packer, the installation of lyaml fails without giving any further information.
It would maybe be a good idea to mention it somewhere.

Opening files should respect papis config

Currently when I am hovering over a citation and hit <leader>po to open the associated PDF it opens up in Adobe (which is my system's default). However, I usually use rifle to open most things and I have a different PDF reader set as my default there. In my papis config I have opentool = rifle and when I run, e.g., papis open from the command line the PDF opens in my desired reader. I am thinking that papis.nvim should adhere to the configuration of papis itself (although maybe this can be debated).

BTW, I love this package!

vim.loop.os_uname().sysname returns "Windows_NT"

On Windows 10 (and other 64-bit Windows systems) the return value for vim.loop.os_uname().sysname is "Windows_NT".
In papis/utils.lua line 19, is_windows expects a return value from vim.loop.os_uname().sysname of "Windows" and will therefore return false even when the system is Windows.
FWIW, nvim-lspconfig addresses this issue by using version instead of sysname:
local is_windows = uv.os_uname().version:match("Windows")
(neovim/nvim-lspconfig@2c6f8db)

`read_yaml` should fail gracefully if yaml is malformatted

I got a rather ugly error message when my database was being built (did not save the traceback) which was due to a malformatted yaml file. I had to go through the traceback and add log.debug(filepath) to see which file was broken.

I suggest that in this function below

local function read_yaml(path)
log.trace("Reading path: " .. path)
local filepath = Path:new(path)
local entry = lyaml.load(filepath:read())
return entry
end

we add

  1. Catch the error: if read_yaml fails, just continue with the next one
  2. A notify and log.debug event: notify the user which file failed

Edit: Found the error traceback here

| Error detected while processing BufEnter Autocommands for "*.tex":
|| Error executing lua callback: 6:11: did not find expected key
|| stack traceback:
|| 	[C]: in function 'error'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:306: in function 'error'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:325: in function 'parse'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:443: in function 'load_node'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:340: in function 'load_node'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:393: in function 'load_node'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:378: in function 'load_node'
|| 	...acker_hererocks/2.1.0-beta3/share/lua/5.1/lyaml/init.lua:497: in function 'load'
|| 	...e/pack/packer/opt/papis.nvim/lua/papis/papis-storage.lua:90: in function 'read_yaml'
|| 	...e/pack/packer/opt/papis.nvim/lua/papis/papis-storage.lua:149: in function 'get_data_full'
|| 	.../nvim/site/pack/packer/opt/papis.nvim/lua/papis/data.lua:54: in function 'update_main_tbls'
|| 	.../nvim/site/pack/packer/opt/papis.nvim/lua/papis/data.lua:124: in function 'sync_storage_data'
|| 	.../nvim/site/pack/packer/opt/papis.nvim/lua/papis/data.lua:158: in function 'sync_db'
|| 	.../nvim/site/pack/packer/opt/papis.nvim/lua/papis/init.lua:103: in function <.../nvim/site/pack/packer/opt/papis.nvim/lua/papis/init.lua:49>

ps: illegal option -- q

I get this problem when starting papis using this plugin which supposedly originates from here:

cmd = "ps -q " .. pid

When I run ps -q I get an error saying ps: illegal option -- q. These are followed errors saying that my library files are faulty and will not be added to the database. As such, I see no files inside of neovim, even though the normal commands work fine.

I'm on Darwin version 13.5 Beta. I use Nix as my package manager, and even if I pull the ps command from Nix sources, I still get the same error.

Enable multiple-selection in telescope picker

I would like to be able to select more than one paper and insert multiple references into my document. I got this to work on my side: <tab> is used to mark entries in the picker (default), and hitting enter inserts the references separated by comma into the buffer. It's quite neat.

More difficult could be the integration of multiple references into the filetype-specific formatter function.

As said, if you think it makes sense, I'll open a PR.

Improve Telescope picker

Currently, the Telescope picker is quite slow. The reason for this is probably the entry_display.create() function that is called for each line in the results window (that's the list of Author (Year) Title lines). The function is used to define which part of the string is to be highlighted with which highlight group (e.g. chars 1-5 with highlight group X, chars 6-10 with group Y, etc.). Because the length of the author and title string is different for each line, the function needs to be called for each line. Telescope's creators explicitly say in :h telescope.pickers.entry_display that this can slow things down.

An alternative is to have predefined lengths for each element in the results window (e.g. year -> 4 chars , author -> 20 chars, title -> remaining chars). It would look something like how citar does it:

citar

Advantages:

  • entry_display.create() only has to be called once when the picker is opened, which should speed things up

Disadvantages:

  • wastes space, which can be relevant especially when the picker window is small (applies to me as I usually have two documents open side-by-side

What do you think?

Move from lyaml luarock to yq

Because of the difficulties of managing luarocks in neovim (especially with lazy.nvim), I'm considering alternatives. One possibility I'm thinking about is to ditch the lyaml luarock (or make it optional) and instead depend on yq (or the python yq) to convert from yaml to json and then import the json with neovim's internal capabilities.

At the moment, I'm just putting this out there. We would still need something external to papis.nvim, but potentially it's easier to install for many people. If anyone has any thoughts about this, let me know here.

Missing log.lua?

When updating to the latest head (or relase 0.3.0), papis fails to load with message

.../share/nvim/lazy/papis.nvim/lua/papis/sqlite-wrapper.lua:8: module 'papis.log' not found:No LuaRocks module found for papis.log

Version 0.2.0 works (which uses logger instead of log).

Setup impossible

My config is here
https://gitlab.gnugen.ch/dorsch/nvim_config

Running
:Telescope papis
in nvim gives the following error

Error executing Lua callback: ...acker/opt/papis.nvim/lua/telescope/_ext
ensions/papis.lua:49: attempt to index field 'search' (a nil value)
stack traceback:
...acker/opt/papis.nvim/lua/telescope/_extensions/papis.lua:49:
in function 'entry_maker'
...scope.nvim/lua/telescope/finders/async_static_finder.lua:17:
in function 'new_table'
...acker/opt/papis.nvim/lua/telescope/_extensions/papis.lua:46:
in function <...acker/opt/papis.nvim/lua/telescope/_extensions/papis.lua
:38>
...ck/packer/start/telescope.nvim/lua/telescope/command.lua:199:
in function 'run_command'
...ck/packer/start/telescope.nvim/lua/telescope/command.lua:259:
in function 'load_command'
...te/pack/packer/start/telescope.nvim/plugin/telescope.lua:108:
in function <...te/pack/packer/start/telescope.nvim/plugin/telescope.lu
a:107>
Press ENTER or type command to continue

Problem with loading after v0.3.1

There seems to be some issue with pathlib:

...nosz/.local/share/nvim/lazy/papis.nvim/lua/papis/log.lua:12: module 'pathlib' not found:
    no field package preload['pathlib']
    cache_loader: module pathlib not found
    cache_loader_lib: module pathlib not found
        no file './pathlib.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1/pathlib.lua'
        no file '/usr/local/share/lua/5.1/pathlib.lua'
        no file '/usr/local/share/lua/5.1/pathlib/init.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/pathlib.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/pathlib/init.lua'
        no file './pathlib.so'
        no file '/usr/local/lib/lua/5.1/pathlib.so'
        no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/pathlib.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

<c-p> in telescope works with huge delay (possible issue with <c-p>p).

Just for someone who can have same issue.
I use <c-p> key to navigate to previous item in telescope.
If papis enable_keymaps is true, I have very strange behaviour. Nvim insert some escape sequence (or something like this) and selecting previous item is processing with huge delay.

I have this issue in xtrem and kitty.

2023-06-12-04-46-09-.mp4

Invalid `jq` options `-oj` lead to Invalid YAML error

First, I'm really happy to see #19, the luarocks lyaml business often posed problems to me and to see it gone is great!

To the issue: I just set up my system from scratch and cloned papis.nvim. On PapisStart, I got an "The entry at xyz.yaml is faulty and will not be added" error for all yamls in my papis database. I ensured that the YAML in the files is correct using a linter. I then found the culprit to be

local handler = io.popen(yq_bin .. ' -oj "' .. filepath:absolute() .. '" 2>/dev/null')

In my version of jq, the -oj options are not valid filters, and the whole command with yq just echoed the yq --help text instead of the YAML converted to JSON. Replacing -oj with -j . worked for me, the JSON is now correctly echoed and the database is built.

My guess is that the jq options changed and are no longer valid. My jq and yq versions are

$ yq --version
yq 3.2.2
$ jq --version
jq-1.6

Entries are faulty

When papis.nvim initializes it gives me an error message like this for every entry in my database.

The entry at '/path/to/library/folder-name/info.yaml' is faulty and will not be added.

The info.yaml files all have the papis_id and ref fields, and papis doctor gives no errors, so I have no idea how the entries could be faulty.

Attempt to concatenate upvalue 'tag_delimiter' (a nil value) in completion/source.lua

With a fresh setup of papis (only one article was added) and papis.nvim I get the following error when entering insert mode in any info.yaml file.

Error executing vim.schedule lua callback: ...ck/packer/opt/papis.nvim/lua/papis/completion/source.lua:66: attempt to concatenate upvalue 'tag_delimiter' (a nil value)                                                                                                       
stack traceback:                                                                                                                                                                                                                                                              
        ...ck/packer/opt/papis.nvim/lua/papis/completion/source.lua:66: in function 'is_available'                                                                                                                                                                            
        ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:99: in function 'get_sources'                                                                                                                                                                             
        ...re/nvim/site/pack/packer/start/nvim-cmp/lua/cmp/core.lua:311: in function 'fn'                                                                                                                                                                                     
        .../site/pack/packer/start/nvim-cmp/lua/cmp/utils/async.lua:57: in function <.../site/pack/packer/start/nvim-cmp/lua/cmp/utils/async.lua:55> 

The error goes away after adding some comma separated tags to an info.yaml file and running :PapisReInitData.

Add option to insert unformatted reference

Hi again! I'm finally getting back to writing a paper and using papis.nvim. You've done a lot of work on this plugin, that's great!
I have had some issue/ideas for this plugin, I will open a series (edit: only two ideas, I figured out the two issues I had while writing their bug reports) of issues to discuss them :-) For the feature requests, I have some working code on my side, so if you agree that they make sense, I'm happy to open a PR.

First up: I would like the option to insert unformatted references, rather than having them formatted according to filetype. I use snippets a lot (eg cp and ct for \citep{|} and \citet{|} in tex) and don't need the formatting.

opening references picker causes telescope error

Error executing vim.schedule lua callback: .../cal/share/nvim/rocks/rocks_rtp/lua/telescope/pickers.lua:1467: Cursor position outside buffer
stack traceback:
    [C]: in function 'nvim_win_set_cursor'
    ...cal/share/nvim/rocks/rocks_rtp/lua/telescope/pickers.lua:1467: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

The telescope overlay opens and the error is repeated after every keypress. Telescope seems to be working fine for everything else other than papis.nvim. I tried the latest release of Telescope (0.1.6) and got the same error (although it pointed to line 1345 instead of 1467).

Include nix output

Since you already seem to be using nix flakes to manage this, it might be a good idea to expose an output so that it's easier to use this plugin.

Trouble running package on macos (apple silicon)

I had a working setup on my previous intel-based macos. Since migrating to the new machine, I cannot get papis.nvim to work. One thing that was necessary at some point was to install an arm64-specific version of sqlite3. Previously, I had in my config:

 vim.g.sqlite_clib_path = "/Users/.../homebrew/opt/sqlite/bin/sqlite3"

but running :checkhealth papis showed that it couldn't find the associated library, so I switched to

vim.g.sqlite_clib_path = "/Users/.../homebrew/opt/sqlite/lib/libsqlite3.dylib"

Now, running :checkhealth papis shows

papis: require("papis.health").check()

- ERROR Failed to run healthcheck for "papis" plugin. Exception:
  .../.local/share/nvim/lazy/papis.nvim/lua/papis/health.lua:26: attempt to index field 'data' (a nil value)

I went ahead and deleted the previous papis_db folder from ~/.local/share/nvim in case that folder (copied from previous mac) was causing issues. So it looks like something in the papis/sqlite-wrapper.lua file isn't running correctly, but that's about all I can figure out on my end.

`get_ref_under_cursor` should fail gracefully if reference is not recognized

If the reference under the cursor when running :PapisOpenNote is not in the expected format given the filetype, the string.find function below fails with the following traceback.

local _, ref_start = string.find(word_under_cursor, cite_format_prefix)

Error executing Lua callback: .../packer/opt/papis.nvim/lua/papis/cursor-actions/init.lua:40: malformed pattern (
missing ']')                                                                                                     
stack traceback:                                                                                                 
        [C]: in function 'find'                                                                                  
        .../packer/opt/papis.nvim/lua/papis/cursor-actions/init.lua:40: in function 'get_ref_under_cursor'       
        .../packer/opt/papis.nvim/lua/papis/cursor-actions/init.lua:56: in function 'if_ref_valid_run_fun'       
        .../packer/opt/papis.nvim/lua/papis/cursor-actions/init.lua:109: in function <.../packer/opt/papis.nvim/l
ua/papis/cursor-actions/init.lua:108>     

The reference is not in the expected format as I had inserted it into another filetype and the copied it over into a different one.
Either way, I suggest that this function should perform three steps:

  1. Match reference under cursor against the expected pattern based on filetype, if not successful -> 2
  2. Match reference under cursor against all other possible patterns. If successful, notify user that it matched with an unexpected pattern. Else -> 3
  3. No match found, fail gracefully by notifying user that no match was found based on the reference pattern

Having issues with read_yaml function in papis-storage.lua

I've been trying to install and config papis.nvim for a couple of days and am having issues when :PapisStart tries to add and convert yaml files. I know my install of yq is fine- I can run yq -oj info.yaml from the command line with no issue and it produces the correct json output. I know the function can find the yq executable, but it returns nil. I've saved the error from the yq golang code: panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x28 pc=0x1366b55] which makes me think that it can't find or read the yaml file. I don't know if this is an issue with the yq code or the papis-storage. Any suggestions?

Search depth in the library

Hi. Thank you for the amazing plugin.
Currently my papis library is structed like below

papis_library
├── author 1
│   └── paper 1
│       ├── info.yaml
│       └── author 1 - paper 1.pdf
├── author 2
│   ├── paper 1
│   │   ├── author 2 - paper 1.pdf
│   │   └── info.yaml
│   ├── paper 2
│   │   ├── author 2 - paper 2.pdf
│   │   └── info.yaml
│   └── paper 3
│       ├── author 2 - paper 3.pdf
│       └── info.yaml

When I set dir = papis_library this does not detect my info.yaml files. I got papis.nvim working if i set the dir to papis_library/author 2. But this gives me access to the articles by author 2. I guess this is because of the search depth implemented in the plugin.

Restructuring my library would resolve it. But I feel implementing a deeper search would be nice for folder structure arrangement.

NixVim documentation

I am currently rocking NixVim to manage my (neo)vim plugins, and I noted that Papis is missing from the list. It would be cool to include it in there. I am still a noob at Nix(OS), but if I get more experience, I would be willing to include it in there too.

I will try in the future also including it as an external plugin:

{pkgs, ...}: {
  programs.nixvim = {
    extraPlugins = [
      (pkgs.vimUtils.buildVimPlugin {
        name = "papis";
        src = builtins.fetchGit {
          url = "https://github.com/jghauser/papis.nvim";
          ref = "main";
        };
      })
    ];
  };
}

but further config need to be added at extraConfigLua then.

Error in startup after #48

After pulling #48, i get the following error on nvim startup:

lazy.nvim  ERROR Failed to run `config` for papis.nvim
                                                                                                                 
...z/.local/share/nvim/lazy/papis.nvim/lua/papis/config.lua:163: attempt to concatenate local 'testing_conf_path'
 (a nil value)                                                                                                   
                                                                                                                 
# stacktrace:                                                                                                    
  - /papis.nvim/lua/papis/config.lua:163 _in_ **get_papis_py_conf**                                              
  - /papis.nvim/lua/papis/config.lua:236 _in_ **update**                                                         
  - /papis.nvim/lua/papis/init.lua:31 _in_ **setup**                                                             
  ...

data db issues

I think recent changes introduced a bug with the data table of the db. It seems to be cleared out at times for reasons that I don't yet quite understand. In fact, sometimes running :Papis reload data seems to lead to an empty data table. But that's not the only cause of it.

Library directory not accessible

First, congrats on this nice plugin and the extensive documentation you provide! It gives a good impression of what the plugin provides and its extensive config options.

I'm having trouble getting started. I set the config as explained in the readme:

papis_python = {
  dir = "/home/max/astro/papers",
  info_name = "info.yaml",
  notes_name = [[notes.org]],
}

yet when I run :PapisStart I get the following output:

/home/max/~/astro/papers/ is not accessible by the current user!                                                 
/home/max/~/astro/papers/ is not accessible by the current user!                                                 
Press ENTER or type command to continue   

I tried different values for dir: ~/astro/papers/, astro/papers/, astro/papers, always the same message. The directory exists and is accessible to my user. Just to make sure it's the directory that the variable requires, it is the directory which contains my papers:

~ ❯ ls ~/astro/papers | head -3
0023fdcfceb1927113193f3bba1c3a80-marchi-s-and-lazzar
006e027d026931904dbe4c331f2a79b4-levison-harold-f.-a
0188fb24dfc019dd6986c965ef4dd07f-fedkin-a.-v.-and

Importing database fails (non unique entries ?)

Hi,

Trying to import the papis database with :Papis reload data fails with :

Error executing Lua callback: ...is/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/stmt.lua:57: sqlite.l
ua: couldn't finalize statement, ERRMSG: UNIQUE constraint failed: data.ref stmt = (insert into data (
author, author_list, files, journal, papis_id, ref, tags, time_added, title, type, volume, year) value
s(:author, :author_list, :files, :journal, :papis_id, :ref, :tags, :time_added, :title, :type, :volume
, :year))                                                                                             
stack traceback:                                                                                      
        [C]: in function 'assert'                                                                     
        ...is/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/stmt.lua:57: in function 'finalize'        
        ...exis/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/db.lua:465: in function 'fn'             
        ...is/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/defs.lua:665: in function 'wrap_stmts'     
        ...exis/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/db.lua:459: in function 'insert'         
        ...xis/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/tbl.lua:380: in function 'insert'         
        ...xis/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:72: in function 'update_main_tbls'
                                                                                                      
        ...xis/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:128: in function 'sync_storage_dat
a'                                                                                                    
        ...xis/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:164: in function 'sync_db'        
        ...xis/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:158: in function 'reset_db'       
        ....local/share/nvim/lazy/papis.nvim/lua/papis/commands.lua:20: in function 'impl'            
        ....local/share/nvim/lazy/papis.nvim/lua/papis/commands.lua:53: in function <....local/share/n
vim/lazy/papis.nvim/lua/papis/commands.lua:42>   

I don't think there are duplicated entries thouhg,

Thanks !

ERROR Failed to run healthcheck for "papis" plugin.

Hello there , thanks for this addition for neovim. I am facing problem to run this plugin using on neovim , OSX 13.6.1 . This is the output of checkhealth papis

dressing: require("dressing.health").check()

dressing.nvim ~
- WARNING vim.ui.input not enabled
- OK vim.ui.select active: telescope

==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- WARNING Missing user config file: /Users/enricopirani/.config/lvim/init.lua
  - ADVICE:
    - :help |config|

Runtime ~
- OK $VIMRUNTIME: /Users/enricopirani/Downloads/nvim-macos-x86_64/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=^H`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="WezTerm"
- $COLORTERM="truecolor"

External Tools ~
- OK ripgrep 14.1.0 (/usr/local/bin/rg)

==============================================================================
papis: require("papis.health").check()

- ERROR Failed to run healthcheck for "papis" plugin. Exception:
  ...e/pack/lazy/opt/papis.nvim/lua/papis/completion/init.lua:22: loop or previous error loading module 'papis.completion.source'
  

==============================================================================
provider.clipboard: require("provider.clipboard.health").check()

Clipboard (optional) ~
- OK Clipboard tool found: pbcopy

==============================================================================
provider.node: require("provider.node.health").check()

Node.js provider (optional) ~
- Node.js: v22.5.1
  
- Nvim node.js host: /usr/local/lib/node_modules/neovim/bin/cli.js
- OK Latest "neovim" npm/yarn/pnpm package is installed: 5.1.0
  

==============================================================================
provider.perl: require("provider.perl.health").check()

Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
  - ADVICE:
    - See :help |provider-perl| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim
- WARNING No usable perl executable found

==============================================================================
provider.python: require("provider.python.health").check()

Python 3 provider (optional) ~
- pyenv: Path: /usr/local/Cellar/pyenv/2.4.5/libexec/pyenv
- pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
- WARNING pyenv: Root does not exist: /Users/enricopirani/.pyenv
  . Ignoring pyenv for all following checks.
- `g:python3_host_prog` is not set. Searching for python3 in the environment.
- Executable: /Users/enricopirani/.virtualenvs/data_analisi/bin/python3
- Python version: 3.12.4
- pynvim version: 0.5.0
- OK Latest pynvim is installed.

Python virtualenv ~
- $VIRTUAL_ENV is set to: /Users/enricopirani/.virtualenvs/data_analisi
- Python version: 3.12.4
- OK $VIRTUAL_ENV provides :!python.

==============================================================================
provider.ruby: require("provider.ruby.health").check()

Ruby provider (optional) ~
- Ruby: ruby 3.3.4 (2024-07-09 revision be1089c8ec) [x86_64-darwin22]
- WARNING `neovim-ruby-host` not found.
  - ADVICE:
    - Run `gem install neovim` to ensure the neovim RubyGem is installed.
    - Run `gem environment` to ensure the gem bin directory is in $PATH.
    - If you are using rvm/rbenv/chruby, try "rehashing".
    - See :help |g:ruby_host_prog| for non-standard gem installations.
    - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

==============================================================================
rnvimr: health#rnvimr#check

OS ~
- WARNING health#report_start is deprecated, use vim.health.start instead. :help |deprecated|
  Feature will be removed in Nvim 0.11
- OK Name: Mac
- WARNING health#report_ok is deprecated, use vim.health.ok instead. :help |deprecated|
  Feature will be removed in Nvim 0.11

Ranger ~
- OK Version: ranger-master 

Python ~
- OK Version: 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]

Pynvim ~
- OK Version: 0.5.0

Ueberzug (optional) ~
- Ueberzug is not support for Mac
- WARNING health#report_info is deprecated, use vim.health.info instead. :help |deprecated|
  Feature will be removed in Nvim 0.11

RPC ~
- OK RPC echo: Neovim send "Give me five!" and receive "Give me five!"

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /Users/enricopirani/.local/state/lvim/lsp.log
- Log size: 506 KB

vim.lsp: Active Clients ~
- No active clients

vim.lsp: File watcher ~
- file watching "(workspace/didChangeWatchedFiles)" disabled on all clients

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: comment              ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/comment.so
- OK Parser: json                 ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/json.so
- OK Parser: lua                  ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/lua.so
- OK Parser: markdown             ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline      ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/markdown_inline.so
- OK Parser: python               ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/python.so
- OK Parser: regex                ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/regex.so
- OK Parser: vim                  ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/vim.so
- OK Parser: vimdoc               ABI: 14, path: /Users/enricopirani/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/vimdoc.so
- OK Parser: bash                 ABI: 14, path: /usr/local/lib/nvim/parser/bash.so
- OK Parser: c                    ABI: 14, path: /usr/local/lib/nvim/parser/c.so
- OK Parser: lua                  ABI: 14, path: /usr/local/lib/nvim/parser/lua.so
- OK Parser: markdown             ABI: 14, path: /usr/local/lib/nvim/parser/markdown.so
- OK Parser: markdown_inline      ABI: 14, path: /usr/local/lib/nvim/parser/markdown_inline.so
- OK Parser: python               ABI: 14, path: /usr/local/lib/nvim/parser/python.so
- OK Parser: query                ABI: 14, path: /usr/local/lib/nvim/parser/query.so
- OK Parser: vim                  ABI: 14, path: /usr/local/lib/nvim/parser/vim.so
- OK Parser: vimdoc               ABI: 14, path: /usr/local/lib/nvim/parser/vimdoc.so

==============================================================================
which-key: require("which-key.health").check()

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"yS"**
- rhs: `<Plug>YSurround`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"ys"**
- rhs: `<Plug>Ysurround`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- rhs: ` `
- WARNING conflicting keymap exists for mode **"n"**, lhs: **" rm"**
- rhs: ` `
- WARNING conflicting keymap exists for mode **"n"**, lhs: **" c"**
- rhs: `<Cmd>BufferKill<CR>`

==============================================================================
yazi: require("yazi.health").check()

yazi ~
- Running yazi.nvim version 3.1.0
- Found `yazi` version `Yazi 0.2.5 (Homebrew 2024-04-23)` 👍
- yazi.nvim log file is at /Users/enricopirani/.local/state/lvim/yazi.log
-     hint: use `gf` to open the file path under the cursor
- OK yazi

Cannot start the plugin. Any help would appreciated
Enrico

Setup not working correctly; database file apparently inaccessible

Hi. I've been trying to set up papis and papis.nvim on my Windows machine for a day or two now, and I'm running into issues. papis, by this point, works fine sans a single warning message which seems to not impede the actual use of the system. I've tested the serve webapp and it behaves as expected. However, when I try to use papis.nvim, I continually run into the following error when trying to initialize it (either manually or by opening a markdown file, for example). Any idea what's going on here?

Error executing lua callback: ...Data/Local/nvim-data/lazy/sqlite.lua/lua/sqlite /defs.lua:709: sqlite.lua: couldn't connect to sql database, ERR: unable to open database file stack traceback: [C]: in function 'error' ...Data/Local/nvim-data/lazy/sqlite.lua/lua/sqlite/defs.lua:709: in func tion 'connect' ...ppData/Local/nvim-data/lazy/sqlite.lua/lua/sqlite/db.lua:162: in func tion 'open' ...ppData/Local/nvim-data/lazy/sqlite.lua/lua/sqlite/db.lua:215: in func tion 'run' ...pData/Local/nvim-data/lazy/sqlite.lua/lua/sqlite/tbl.lua:63: in funct ion 'tbl' ...l/nvim-data/lazy/papis.nvim/lua/papis/sqlite-wrapper.lua:80: in main chunk [C]: in function 'require' ...pData/Local/nvim-data/lazy/papis.nvim/lua/papis/init.lua:64: in funct ion <...pData/Local/nvim-data/lazy/papis.nvim/lua/papis/init.lua:54>

new updates seem to break plugin on LazyVim

Hi I was looking forward to the new updates to the plugin. However, I cannot seem to setup the latest master branch or the latest stable release.

Here's my config in in LazyVim

  {
    "jghauser/papis.nvim",
    dependencies = {
      "kkharji/sqlite.lua",
      "MunifTanjim/nui.nvim",
      "pysan3/pathlib.nvim",
      "nvim-neotest/nvim-nio",
    },
    version = "*",
    lazy = false,
    -- ft = { "tex", "markdown", "norg" },
    config = function()
      require("papis").setup({
        -- Your configuration goes here
        -- db_path = vim.fn.stdpath("data") .. "/papis_db/papis-nvim.sqlite3",
        init_filetypes = { "tex", "latex", "markdown", "norg", "yaml" },
        papis_python = {
          dir = "~/Books/Research",
          info_name = "info.yaml",
          notes_name = [[notes.md]],
        },
        enable_keymaps = true,
      })
    end,
  },

And this is the error I get anytime I open any relevant filetype

Error Message
11:54:51 AM msg_show Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "tex"..FileType Autocommands for "tex": Vim(append):Error executing lua callback: ...joel/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/db.lua:223: ...el/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/stmt.lua:57: sqlite.lua: couldn't finalize statement, ERRMSG: UNIQUE constraint failed: data.ref stmt = (insert into data (abstract, author, author_list, files, papis_id, ref, tags, time_added, title, type, year) values(:abstract, :author, :author_list, :files, :papis_id, :ref, :tags, :time_added, :title, :type, :year))
stack traceback:
	[C]: in function 'error'
	...joel/.local/share/nvim/lazy/sqlite.lua/lua/sqlite/db.lua:223: in function 'insert'
	...oel/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:71: in function 'update_main_tbls'
	...oel/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:127: in function 'sync_storage_data'
	...oel/.local/share/nvim/lazy/papis.nvim/lua/papis/data.lua:161: in function 'sync_db'
	...oel/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:98: in function <...oel/.local/share/nvim/lazy/papis.nvim/lua/papis/init.lua:53>
	[C]: in function 'nvim_exec_autocmds'
	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:157: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156>
	[C]: in function 'xpcall'
	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:156: in function 'trigger'
	...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:87: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:72>
	[C]: in function 'nvim_cmd'
	/usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>
	[C]: in function 'nvim_buf_call'
	/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
	[C]: in function 'nvim_cmd'
	/usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>
	[C]: in function 'nvim_buf_call'
	/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
	[C]: in function 'nvim_buf_call'
	/usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>

neovim: v0.10.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.