Skip to content

Migrate to Neovim v0.7#36

Open
bmrips wants to merge 4 commits intoLionC:masterfrom
bmrips:feature/migrate-to-neovim-v0.7
Open

Migrate to Neovim v0.7#36
bmrips wants to merge 4 commits intoLionC:masterfrom
bmrips:feature/migrate-to-neovim-v0.7

Conversation

@bmrips
Copy link
Copy Markdown

@bmrips bmrips commented Oct 19, 2022

Use Vim's table functions and vim.keymap.set instead of nvim_set_keymap; the latter was introduced with Neovim v0.7. IMO, vim.keymap.set is more flexible as it allows lua functions as RHS and disables remap by default, so that the refactored code is less complex.

One may extend this change to adapt the API of vim.keymap.set:

  1. Specify the mode as a single letter (or empty string) or as a list of single-letter strings. This frees us from handling mode="_" specially.
  2. Move the buffer option to the options table.

These changes would -- of course -- not be backwards compatible, but would be consistent with vim.keymap.set and reduce code complexity.

What do you think?

bmrips added 4 commits October 8, 2022 10:32
As opposed to `vim.api.nvim_set_keymap`, it accepts Lua functions as
RHS.
Since `remap = false` is the default value of `vim.keymap.set`.
`vim.keymap.set` accepts boolean values for the `buffer` option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant