LSP's Go To Definition plugin for neovim.
This plugin is highly experimental.The breaking changes will be applied without notice.
- Run
textDocument/definition andgf in one mapping. - Open the path as much as possible
---@classgtd.kit.App.Config.Schema---@fieldpublicsources{name:string,option?:table}[]# Specify the source that will be used to search for the definition---@fieldpublicget_buffer_path fun():string# Specify the function to get the current buffer path. It's useful for searching path from terminal buffer etc.---@fieldpublicon_event fun(event:gtd.Event)---@fieldpublicon_context fun(context:gtd.Context) # Modify context on user-land.---@fieldpublicon_cancel fun(params:gtd.Params)---@fieldpublicon_nothing fun(params:gtd.Params)---@fieldpublicon_location fun(params:gtd.Params,location:gtd.kit.LSP.LocationLink)---@fieldpublicon_locations fun(params:gtd.Params,locations:gtd.kit.LSP.LocationLink[])-- The `findup` and `lsp` source are enabled by default (at the moment).require('gtd').setup {...gtd.kit.App.Config.Schema...}vim.keymap.set('n','gf<CR>',function()require('gtd').exec({command='edit'})end)vim.keymap.set('n','gfs',function()require('gtd').exec({command='split'})end)vim.keymap.set('n','gfv',function()require('gtd').exec({command='vsplit'})end)The following sources are built-in.
(Default: enabled)
Find definitions via LSPtextDocument/definition.
(Default: enabled)
Find definitions via LSPtextDocument/typeDefinition.
(Default: enabled)
Find definitions via LSPtextDocument/implementation.
(Default: enabled)
Find definitions viavim.fn.findfile with; flag.
(Default: disabled)
Traverse all filepaths under project.
| option-name | type | description |
|---|
| root_markers | string[] | Specify root markers like{ '.git', 'tsconfig.json' }. |
| ignore_patterns | string[] | Specify ignore patterns like{ '/node_modules', '/.git' } |