diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 84f5af8..0f725d9 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -45,6 +45,13 @@ vim.api.nvim_create_autocmd('LspAttach', { -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- Add the ability to toggle between source and header files, but only for the + -- clangd clients + local client = vim.lsp.get_client_by_id(event.data.client_id) + if (client.name == "clangd") then + map('th', ":ClangdSwitchSourceHeader", '[T]oggle [H]eader' ) + end end })