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

Keymapping #93

Closed
tanvirtin opened this issue Aug 21, 2021 · 0 comments · Fixed by #112
Closed

Keymapping #93

tanvirtin opened this issue Aug 21, 2021 · 0 comments · Fixed by #112
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tanvirtin
Copy link
Owner

It would be nice for users to pass in key mappings for commands in VGit. Based on how users instantiate the plugin, this could be a nice alternative that our plugin provides. An example of an interface might look like this:

function set_keymap(mode, key, action)
  options = options or {}
  vim.api.nvim_set_keymap(mode, key, action, {
    noremap = true,
    silent = true
  })
end

The function above can then be used to create something like this:

keymap = {
   '<mode> <key>' = 'hunk_down',
   'n <c-k' = function(vgit) vgit.hunk_up() end
}
@tanvirtin tanvirtin added enhancement New feature or request good first issue Good for newcomers labels Aug 21, 2021
tanvirtin added a commit that referenced this issue Sep 10, 2021
@tanvirtin tanvirtin linked a pull request Sep 10, 2021 that will close this issue
tanvirtin added a commit that referenced this issue Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant