Skip to content

Hdoc1509/vim-map-side.nvim

Repository files navigation

vim-map-side.nvim

Plugin that improves support for Vim's map side (lhs and rhs) in Neovim.

lua injection

Lua injection

vim injection

Vim injection

Features

Requirements

  • Neovim >= 0.9.0
  • nvim-treesitter
  • lua parser: injection to lhs and rhs of vim.keymap.set() function
  • printf parser (optional): for printf() expression
  • vim parser (optional): for rhs that starts with : and command nodes of tree-siter-vim-map-side

Install

{
  "nvim-treesitter/nvim-treesitter",
  dependencies = { "Hdoc1509/vim-map-side.nvim" },
  config = function()
    -- NOTE: call this before calling `nvim-treesitter.configs.setup()`
    require("vim-map-side.tree-sitter").setup()

    require("nvim-treesitter.configs").setup({
      ensure_installed = {
        "lua", -- required
        "printf", -- optional
        "vim", -- optional
        "vim_map_side", -- required
      }
    })
  end,
}
use({
  "nvim-treesitter/nvim-treesitter",
  requires = { "Hdoc1509/vim-map-side.nvim" },
  config = function()
    -- NOTE: call this before calling `nvim-treesitter.configs.setup()`
    require("vim-map-side.tree-sitter").setup()

    require("nvim-treesitter.configs").setup({
      ensure_installed = {
        "lua", -- required
        "printf", -- optional
        "vim", -- optional
        "vim_map_side", -- required
      }
    })
  end,
})

Specific version of tree-sitter-vim-map-side

Use the revision option of the vim-map-side.tree-sitter module:

require("vim-map-side.tree-sitter").setup({
  revision = 'deploy-v0.1.0'
})

Check the General Installation of tree-sitter-vim-map-side for more information.

Note

Be sure to use any compatible version.

Troubleshooting

Important

Be sure to run :checkhealth vim.treesitter before checking the following errors.

Incompatible ABI version

If you found the following error:

- ERROR Parser "vim_map_side" failed to load
  (path: .../vim_map_side.so): ...: ABI version mismatch for
  .../vim_map_side.so: supported between X and Y, found Z

Note

X and Y are the interval of ABI versions supported by neovim. Z is the ABI version that was used to develop the parser.

  1. Install the following tools:

  2. Add the from_grammar option to the setup function of the vim-map-side.tree-sitter module:

    require("vim-map-side.tree-sitter").setup({ from_grammar = true })
  3. Reload your neovim config.

  4. Run :TSInstall vim_map_side to re-install the parser with the correct ABI version.

Updates

This plugin will follow changes of tree-sitter-vim-map-side:

About

Plugin that improves support for Vim's map side (lhs and rhs) in Neovim.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published