Skip to content

Key mapping improvement #59

@psmolak

Description

@psmolak

Hello!

I've came up with a little bit more reliable keybinding for <Plug>(cokeline-focus-<index>).
Instead of setting up new keybinding for each buffer number separately in a loop, we could use count variable like so:

vim.keymap.set('n', '<tab>', function()
  return ('<Plug>(cokeline-focus-%s)'):format(vim.v.count > 0 and vim.v.count or 'next')
end, { silent = true, expr = true })

now whenever we precede Tab with a count, we will go directly to that buffer. Otherwise the Tab will just move to the next buffer in a list. You can add this into the documentation if you feel like it's worth mentioning.

Thank you for creating nvim-cokeline!

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions