mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +02:00
feat(python): add semantic highlighting (#1149)
* feat(python): add semantic highlighting * refactor: moved to python-semshi --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
6b2c648878
commit
012ca50b28
1 changed files with 31 additions and 0 deletions
31
lua/lazyvim/plugins/extras/lang/python-semshi.lua
Normal file
31
lua/lazyvim/plugins/extras/lang/python-semshi.lua
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
return {
|
||||||
|
-- "numiras/semshi",
|
||||||
|
"wookayin/semshi", -- use a maintained fork
|
||||||
|
ft = "python",
|
||||||
|
build = ":UpdateRemotePlugins",
|
||||||
|
init = function()
|
||||||
|
-- Disabled these features better provided by LSP or other more general plugins
|
||||||
|
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,
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue