gsuuon / note.nvim

Notes in neovim
66 stars 1 forks source link

Prefix not working #5

Closed jrebs closed 1 month ago

jrebs commented 1 month ago

The prefix definition doesn't seem to be working for me. I'm using nvim 0.10.1 and pulling note.nvim in with Lazy using a basic setup built off of the kickstart.nvim repo.

I'm loading the plugin using the sample script from the README exactly as suggested (see below), but for some reason the prefix is not working. When I use <Leader>n, nvim doesn't seem to regard this as a keymap and falls back on the 'n' functionality (next search result). If I type the :Note command, the notes plugin does load my daily note and within the note the various commands like :NoteTime are available. The issue seems only to be that the prefix is not being registered somehow.

return {
  'gsuuon/note.nvim',
  opts = {
    -- opts.spaces are note workspace parent directories.
    -- These directories contain a `notes` directory which will be created if missing.
    -- `<space path>/notes` acts as the note root, so for space '~' the note root is `~/notes`.
    -- Defaults to { '~' }.
    spaces = {
      '~',
      -- '~/projects/foo'
    },

    -- Set keymap = false to disable keymapping
    keymap = {
      prefix = '<Leader>n',
    },
  },
  cmd = 'Note',
  ft = 'note',
}
jrebs commented 1 month ago

My bad. I misunderstood things and was thinking that the n command would invoke the :Note command. I just added a keymap so that nn runs :Note, and once I'm in a note file, the rest of the prefixed commands, like <prefix>t or <prefix>n/p work as expected.