From 924c4daae8375447bb3bbbba1cb562e8b3ddf4b4 Mon Sep 17 00:00:00 2001 From: Niverton Date: Sun, 11 Feb 2024 22:03:48 +0100 Subject: [PATCH] Add clangd switch source/header mapping --- lua/plugins/20-lsp.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/plugins/20-lsp.lua b/lua/plugins/20-lsp.lua index daf5402..4298dc6 100644 --- a/lua/plugins/20-lsp.lua +++ b/lua/plugins/20-lsp.lua @@ -13,8 +13,15 @@ return { }, timeout_ms = 1000, }, - -- mappings to be set up on attaching of a language server - mappings = {}, + mappings = { + n = { + gh = { + require("clangd_extensions.switch_source_header").switch_source_header, + desc = "Switch to matching source or header file", + cond = "textDocument/switchSourceHeader", + }, + }, + }, ---@diagnostic disable: missing-fields config = { clangd = {