Skip to content

Latest commit

 

History

History
46 lines (42 loc) · 1.83 KB

01-installation.md

File metadata and controls

46 lines (42 loc) · 1.83 KB

Installation

Setup example for lazy.nvim:

local function open_terminal()
    vim.cmd.terminal()
    vim.cmd("MatchList attach")
end

return {
    "ollbx/match-list.nvim",
    cmd = "MatchList",
    opts = {
        groups = {
            default = {
                { [[\(error\|warning\|warn\|info\|debug\):\s*\(.*\)]], { "type", "message" } }
            },
            rust = {
                {
                    { [[\(error\|warning\)[^:]*:\s*\(.*\)]], { "type", "message" } },
                    { [[-->\s*\(.*\):\(\d\+\):\(\d\+\)]], { "file", "lnum", "col" } }
                }
            }
        },
    },
    keys = {
        { "[m",         "<cmd>MatchList prev<cr>", desc = "Previous match" },
        { "]m",         "<cmd>MatchList next<cr>", desc = "Next match" },
        { "[w",         "<cmd>MatchList prev warning warn<cr>", desc = "Previous warning" },
        { "]w",         "<cmd>MatchList next warning warn<cr>", desc = "Next warning" },
        { "[e",         "<cmd>MatchList prev error fatal<cr>", desc = "Previous error" },
        { "]e",         "<cmd>MatchList next error fatal<cr>", desc = "Next error" },
        { "<leader>ma", "<cmd>MatchList attach<cr>", desc = "Attach to buffer" },
        { "<leader>md", "<cmd>MatchList detach<cr>", desc = "Detach from buffer" },
        { "<leader>mg", "<cmd>MatchList group<cr>", desc = "Select match group" },
        { "<leader>mt", open_terminal, desc = "Open match terminal" },
    }
}
  • You can find an overview of the configuration options under setup.
  • For the :MatchList command, please refer to command.
  • For the Lua API see API.
  • Please note: the plugin will only actually do anything, if you attach it to a buffer, using the :MatchList attach command.