Skip to content

How to make description column the 2nd column ? #290

Answered by mrjones2014
towry asked this question in Q&A
Discussion options

You must be logged in to vote

You can override the columns via config.default_item_formatter which takes an item and returns a list of strings, one string per column. Here's the default formatter code:

---Default format
---@param item LegendaryItem
---@return string[]
function M.default_format(item)
  if Toolbox.is_keymap(item) then
    return {
      table.concat(item:modes(), ', '),
      item.keys,
      item.description,
    }
  elseif Toolbox.is_command(item) then
    return {
      '',
      item.cmd,
      item.description,
    }
  elseif Toolbox.is_autocmd(item) then
    return {
      table.concat(item.events, ', '),
      table.concat(vim.tbl_get(item, 'opts', 'pattern') or { '*' }, ', '),
      item.descri…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mrjones2014
Comment options

Answer selected by mrjones2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants