From baeff4bc810426e015e73d7c51c6cc740dcbd178 Mon Sep 17 00:00:00 2001 From: MysticalDevil Date: Sat, 14 Oct 2023 20:40:06 +0800 Subject: [PATCH] Fix semshi plugin autocmd errors --- lua/configs/core/autocmds.lua | 20 -------------------- lua/plugins/languages.lua | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/lua/configs/core/autocmds.lua b/lua/configs/core/autocmds.lua index fd329e2..0ff2ee2 100644 --- a/lua/configs/core/autocmds.lua +++ b/lua/configs/core/autocmds.lua @@ -4,7 +4,6 @@ local augroup = vim.api.nvim_create_augroup local commonAutoGroup = augroup("commonAutoGroup", { clear = true }) local indentAutoGroup = augroup("indentAutoGroup", { clear = true }) local writeAutoGroup = augroup("writeAutoGroup", { clear = true }) -local SemanticHighlight = augroup("SemanticHighlight", { clear = true }) local lispFiletypes = { "clj", "*.el", "*.fnl", "*.hy", "*.janet", "*.lisp", "*.rkt", "*.scm" } @@ -77,22 +76,3 @@ autocmd("BufNewFile", { }) end, }) - --- Set python semshi colors --- This autocmd must be defined in init to take effect -vim.api.nvim_create_autocmd({ "VimEnter", "ColorScheme" }, { - group = SemanticHighlight, - callback = function() - -- Only add style, inherit or link to the LSP's colors - vim.cmd([[ - highlight! semshiGlobal gui=italic - highlight! semshiImported gui=bold - highlight! link semshiParameter @lsp.type.parameter - highlight! link semshiParameterUnused DiagnosticUnnecessary - highlight! link semshiBuiltin @function.builtin - highlight! link semshiAttribute @attribute - highlight! link semshiSelf @lsp.type.selfKeyword - highlight! link semshiUnresolved @lsp.type.unresolvedReference - ]]) - end, -}) diff --git a/lua/plugins/languages.lua b/lua/plugins/languages.lua index d2a5a48..5897359 100644 --- a/lua/plugins/languages.lua +++ b/lua/plugins/languages.lua @@ -241,7 +241,24 @@ return { vim.g["semshi#error_sign"] = false vim.g["semshi#simplify_markup"] = false vim.g["semshi#mark_selected_nodes"] = false - vim.g["semshi#update_delay_factor"] = 0.001 + + -- This autocmd must be defined in init to take effect + vim.api.nvim_create_autocmd({ "VimEnter", "ColorScheme" }, { + group = vim.api.nvim_create_augroup("SemanticHighlight", {}), + callback = function() + -- Only add style, inherit or link to the LSP's colors + vim.cmd([[ + highlight! semshiGlobal gui=italic + highlight! semshiImported gui=bold + highlight! link semshiParameter @lsp.type.parameter + highlight! link semshiParameterUnused DiagnosticUnnecessary + highlight! link semshiBuiltin @function.builtin + highlight! link semshiAttribute @attribute + highlight! link semshiSelf @lsp.type.selfKeyword + highlight! link semshiUnresolved @lsp.type.unresolvedReference + ]]) + end, + }) end, },