Skip to content

Commit

Permalink
update recommended mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Feb 26, 2024
1 parent c36a98e commit d2b47d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Call `setup` to initialise the plugin:
require("lsplinks").setup()
```

Replace your existing goto-defintion mapping with the following:
Replace the `gx` mapping with the following:

``` lua
vim.keymap.set("n", "gd", function()
vim.keymap.set("n", "gx", function()
local lsplinks = require("lsplinks")
-- jump returns false when there's no link under the cursor
if not lsplinks.jump() then
vim.lsp.buf.definition()
vim.ui.open(vim.fn.expand("<cfile>"))
end
end)
```
Expand All @@ -36,10 +36,10 @@ end)
config = function()
local lsplinks = require("lsplinks")
lsplinks.setup()
vim.keymap.set("n", "gd", function()
vim.keymap.set("n", "gx", function()
local lsplinks = require("lsplinks")
if not lsplinks.jump() then
vim.lsp.buf.definition()
vim.ui.open(vim.fn.expand("<cfile>"))
end
end)
end
Expand Down

0 comments on commit d2b47d0

Please sign in to comment.