Skip to content

HIDE-r/conductor.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

conductor.nvim

A curated command palette for Neovim.

Features

  • Register your own frequently used commands
  • No keymap indexing required
  • Works with Lua callbacks, Ex commands, or key sequences
  • Uses vim.ui.select() by default

Installation

Using lazy.nvim:

{
  "yourname/conductor.nvim",
  config = function()
    require("conductor").setup({
      default_keymap = "<leader><space>",
      commands = {
        {
          id = "files.find",
          title = "Find Files",
          desc = "Open file picker",
          group = "Telescope",
          cmd = "Telescope find_files",
        },
        {
          id = "git.status",
          title = "Git Status",
          desc = "Open Fugitive status",
          group = "Git",
          cmd = "Git",
        },
        {
          id = "buf.save",
          title = "Save Buffer",
          desc = "Write current file",
          group = "Buffer",
          cmd = "write",
        },
        {
          id = "diag.next",
          title = "Next Diagnostic",
          desc = "Jump to next diagnostic",
          group = "LSP",
          action = function()
            vim.diagnostic.goto_next()
          end,
        },
      },
    })
  end,
}

Usage :Conductor 打开面板 或使用 default_keymap

API setup(opts) require("conductor").setup({ default_keymap = "", commands = {...}, }) register(item) require("conductor").register({ id = "test.hello", title = "Say Hello", group = "Test", action = function() print("hello") end, }) register_many(items)

批量注册。

Command Item Schema { id = "unique.id", title = "Display Title", desc = "Optional description", group = "Optional group",

-- 三选一 action = function() ... end, cmd = "Telescope live_grep", keys = "ff",

-- keys 时可选 mode = "n", }


最小配置示例

require("conductor").setup({
  default_keymap = "<leader>p",
  commands = {
    {
      id = "edit.init",
      title = "Edit init.lua",
      desc = "Open Neovim config",
      group = "Config",
      cmd = "edit $MYVIMRC",
    },
    {
      id = "source.init",
      title = "Reload init.lua",
      desc = "Source current config",
      group = "Config",
      cmd = "source $MYVIMRC",
    },
    {
      id = "lazy.sync",
      title = "Lazy Sync",
      desc = "Sync plugins",
      group = "Plugins",
      cmd = "Lazy sync",
    },
  },
})

About

A curated command palette for Neovim.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages