Adding the ability to switch between source and header files
This commit is contained in:
parent
c570c90d44
commit
458c249266
@ -45,6 +45,13 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
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<CR>", '[T]oggle [H]eader' )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user