Similar to this vscode plugin but for neovim.
Using lsp Go to Definition
on a vue component in nuxt will take you to a .d.ts
file. This plugin will redirect you to the correct definition source instead.
Please see Anthonys readme here for a better explanation on why this is necessary.
--Packer
use("rushjs1/nuxt-goto.nvim")
-- lspconfig.lua -- or wherever your lsp keymaps are set
-- enable keybinds for available lsp server
local on_attach = function(client, bufnr)
local opts = { noremap = true, silent = true, buffer = bufnr }
--set keybind for go to definition
keymap.set("n", "gd", vim.lsp.buf.definition, opts)
end
Please ensure the .nuxt directory is present in your project