Compare commits

...

2 Commits

Author SHA1 Message Date
924c4daae8 Add clangd switch source/header mapping 2024-02-11 22:03:48 +01:00
84695b7700 Try to fix luasnip jumps 2024-02-11 22:03:26 +01:00
2 changed files with 32 additions and 2 deletions

View File

@@ -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 = {

23
lua/plugins/25-comp.lua Normal file
View File

@@ -0,0 +1,23 @@
---@type LazySpec
return {
{
"astronvim/astrocore",
opts = {
commands = {
LuaSnipExitOnModeChange = {
function(evt)
local ok, luasnip = pcall(require, "luasnip")
if
ok
and luasnip.session
and luasnip.session.current_nodes[evt.buf]
and not luasnip.session.jump_active
then
luasnip.unlink_current()
end
end,
},
},
},
},
}