Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/icholy/lsplinks.nvim
LSP textDocument/documentLink support for neovim
https://github.com/icholy/lsplinks.nvim
neovim-plugin neovim-plugin-lua neovim-plugins
Last synced: 3 days ago
JSON representation
LSP textDocument/documentLink support for neovim
- Host: GitHub
- URL: https://github.com/icholy/lsplinks.nvim
- Owner: icholy
- Created: 2024-02-20T16:02:53.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-10-27T11:44:32.000Z (24 days ago)
- Last Synced: 2024-11-09T20:43:59.057Z (11 days ago)
- Topics: neovim-plugin, neovim-plugin-lua, neovim-plugins
- Language: Lua
- Homepage:
- Size: 1.76 MB
- Stars: 74
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LSPLINKS
> Support for [document links](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentLink) for neovim **0.9+**.
### Usage
The default behaviour of [gx](https://neovim.io/doc/user/various.html#gx) is described in the neovim help as:
> Opens the current filepath or URL (decided by
> ``, 'isfname') at cursor using the system
> default handler, by calling vim.ui.open().This plugin extends this behaviour to support LSP document links.
### Prerequisites:
An LSP server which supports `textDocument/documentLink`.
### Configuration:
Call `setup` to initialise the plugin:
``` lua
local lsplinks = require("lsplinks")
lsplinks.setup()
vim.keymap.set("n", "gx", lsplinks.gx)
```### Lazy Configuration:
``` lua
{
"icholy/lsplinks.nvim",
config = function()
local lsplinks = require("lsplinks")
lsplinks.setup()
vim.keymap.set("n", "gx", lsplinks.gx)
end
}
```### Default Configuration:
``` lua
lsplinks.setup({
highlight = true,
hl_group = "Underlined",
})
```### Demo 1:
Jump to `$ref` links in swagger/openapi files.
![](https://i.imgur.com/oSDPU1e.gif)
### Demo 2:
Open https://pkg.go.dev from your `go.mod` or import statements.
![](https://i.imgur.com/z0Kpslr.gif)