Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key mapping improvement #59

Closed
psmolak opened this issue Apr 25, 2022 · 1 comment
Closed

Key mapping improvement #59

psmolak opened this issue Apr 25, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@psmolak
Copy link

psmolak commented Apr 25, 2022

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!

@noib3 noib3 added the documentation Improvements or additions to documentation label May 10, 2022
@willothy
Copy link
Owner

Thanks! Moved to wiki page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants