Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Stepping away from the project (looking for new maintainer) #505

Open
mrjones2014 opened this issue Mar 20, 2025 · 3 comments
Open

Stepping away from the project (looking for new maintainer) #505

mrjones2014 opened this issue Mar 20, 2025 · 3 comments
Assignees
Labels
meta Something regarding repo steup, CI, issue templates, etc.

Comments

@mrjones2014
Copy link
Owner

Category

Other

Description

Hi all.

As time has gone on, I've found myself using this plugin less and less. At this point I have largely replaced it with which-key.nvim and snacks.picker.

With that said, I don't really have the time to maintain this project anymore, as its gotten quite complex and since I don't use it almost at all anymore, I'm not really invested.

Please chat in the thread if you're interested in maintaining the plugin! If nobody chimes in within a month or so, I'll archive the repo, at which point anyone can still fork it.

@mrjones2014 mrjones2014 added the meta Something regarding repo steup, CI, issue templates, etc. label Mar 20, 2025
@mrjones2014 mrjones2014 self-assigned this Mar 20, 2025
@mrjones2014 mrjones2014 pinned this issue Mar 20, 2025
@dundalek
Copy link

Hi, it is sad to discover the plugin gets discontinued, I found it very useful. Thank you for your work over the years!

I use legendary.nvim in complement with which-key.nvim, it does not look like it can be replaced by it alone. My use cases for legendary:

  1. Command palette to refresh memory for keybindings (defined by either which-key.nvim or by the lazy.nvim keys field).
  2. Command palette for commands/functions that are used less frequently and I did not decide and assign a key binding for them.

The great thing about legendary is that both are available within a single picker.

As for replacement I expect 1. can be probably replaced by :Telescope keymaps. But I am not sure about replacement for 2. ... is your new setup able to replace that?

@mrjones2014
Copy link
Owner Author

I switched away from telescope to snacks.picker, and you can do :lua Snacks.picker.keymaps() and :lua Snacks.picker.commands().

I just look at which-key for keys, I rely on commandline completion from blink.cmp for commands, and for arbitrary functions I've done this:

lua/my/cmd-palette.lua

---@class PaletteEntry
---@field text string|fun(buf:number, win:number):string
---@field on_selected fun(buf:number, win:number)

---@type PaletteEntry[]
return {
  {
    text = ' Copy relative filepath',
    on_selected = function(buf)
      local filepath = vim.api.nvim_buf_get_name(buf)
      if not filepath or #filepath == 0 then
        vim.notify('Could not expand filepath')
        return
      end

      local relpath = vim.fn.simplify(require('my.utils.path').relative(vim.fn.expand('%') --[[@as string]]))
      require('my.utils.clipboard').copy(relpath)
      vim.notify('Relative filepath copied to clipboard')
    end,
  },
  {
    text = '󰊢 Copy git branch name',
    on_selected = function(buf)
      local branch = vim.g.gitsigns_head or vim.b[buf].gitsigns_head
      if not branch or #branch == 0 then
        vim.notify('Could not determine git branch')
        return
      end
      require('my.utils.clipboard').copy(branch)
    end,
  },
}

then my which-key config I have a keymap

{
  '<C-p>',
  function()
    local buf = vim.api.nvim_get_current_buf()
    local win = vim.api.nvim_get_current_win()
    vim.ui.select(require('my.cmd_palette'), {
      prompt = 'Command Palette',
      format_item = function(
        item --[[@as PaletteEntry]]
      )
        if type(item.text) == 'function' then
          return item.text(buf, win)
        end
        return item.text
      end,
    }, function(
      choice --[[@as PaletteEntry]]
    )
      local callback = vim.tbl_get(choice or {}, 'on_selected')
      if type(callback) == 'function' then
        callback(buf, win)
      end
    end)
  end,
},

@dundalek
Copy link

Cool, great inspiration, thanks for sharing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
meta Something regarding repo steup, CI, issue templates, etc.
Projects
None yet
Development

No branches or pull requests

2 participants