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

feat: allow arbitrary keymaps #9

Merged
merged 2 commits into from
Apr 16, 2021
Merged

feat: allow arbitrary keymaps #9

merged 2 commits into from
Apr 16, 2021

Conversation

folke
Copy link
Contributor

@folke folke commented Apr 13, 2021

This PR allows to add arbitrary keymaps (see #8).

For example to setup goto keyboard shortcuts for lsp:

local keymap_goto = {
    name = "+goto",
    h = { "<cmd>lua require'lspsaga.provider'.lsp_finder()<CR>", "References" },
    d = { "<cmd>lua require'lspsaga.provider'.preview_definition()<CR>", "Peek Definition" },
    D = { "<Cmd>lua vim.lsp.buf.definition()<CR>", "Goto Definition" },
    s = { "<cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>", "Signature Help" },
    i = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Goto Implementation" }
  }

wk.register_keymap("g", keymap_goto, { noremap = true, silent = true, bufnr = bufnr })

@AckslD AckslD mentioned this pull request Apr 13, 2021
@AckslD
Copy link
Owner

AckslD commented Apr 13, 2021

Cool! Thanks for the contribution @folke :) I made some further changes based on your PR, see #10. Feel free to check them out and let me know if you agree.

@AckslD AckslD merged commit 37793bc into AckslD:main Apr 16, 2021
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.

2 participants