diff --git a/lua/astrocommunity/pack/typescript/README.md b/lua/astrocommunity/pack/typescript/README.md index 66911d51b..5e21767bd 100644 --- a/lua/astrocommunity/pack/typescript/README.md +++ b/lua/astrocommunity/pack/typescript/README.md @@ -11,6 +11,7 @@ This plugin pack does the following: - Adds [package-info.nvim](https://github.com/vuki656/package-info.nvim) for project package management - Adds [nvim-lsp-file-operations](https://github.com/antosha417/nvim-lsp-file-operations) to handles file imports on rename or move within neo-tree - Adds [neotest-jest](https://github.com/nvim-neotest/neotest-jest) to ease the test running if `neotest` is installed +- Adds `gs` mapping for [goto_source_definition](https://github.com/yioneko/nvim-vtsls?tab=readme-ov-file#commands) instead of typings. ## How do I enable HTML and CSS support? diff --git a/lua/astrocommunity/pack/typescript/init.lua b/lua/astrocommunity/pack/typescript/init.lua index 898bbae3b..cc9a44e5d 100644 --- a/lua/astrocommunity/pack/typescript/init.lua +++ b/lua/astrocommunity/pack/typescript/init.lua @@ -88,6 +88,15 @@ return { "AstroNvim/astrolsp", ---@type AstroLSPOpts opts = { + mappings = { + n = { + gs = { + function() require("vtsls").commands.goto_source_definition() end, + desc = "Goto Source Definition (vtsls)", + cond = function(client) return client.name == "vtsls" end, + }, + }, + }, autocmds = { eslint_fix_on_save = { cond = function(client) return client.name == "eslint" and vim.fn.exists ":EslintFixAll" > 0 end,