mzte-nv: add LSP hover highlights

This commit is contained in:
LordMZTE 2023-04-22 17:26:08 +02:00
parent 707bdd9e77
commit ba29e7305b
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
4 changed files with 25 additions and 0 deletions

View file

@ -3,5 +3,6 @@
(require :settings) (require :settings)
(require :plugins) (require :plugins)
(require :maps) (require :maps)
(require :lsp)
(require :neovide) (require :neovide)
(require :pipe) (require :pipe)

20
mzte-nv/conf/lua/lsp.fnl Normal file
View file

@ -0,0 +1,20 @@
;; Hover-Highlights
(fn on-lsp-attach [args]
(local buf args.buf)
(local client (vim.lsp.get_client_by_id args.data.client_id))
(when client.server_capabilities.documentHighlightProvider
;; Symbol highlighting
(vim.api.nvim_create_autocmd :CursorHold
{:callback vim.lsp.buf.document_highlight})
(vim.api.nvim_create_autocmd :CursorHoldI
{:callback vim.lsp.buf.document_highlight})
(vim.api.nvim_create_autocmd :CursorMoved
{:callback vim.lsp.buf.clear_references})))
(vim.api.nvim_create_autocmd :LspAttach {:callback on-lsp-attach})
;; Highlight in bold font
(local hlgroups [:LspReferenceText :LspReferenceRead :LspReferenceWrite])
(each [_ hl (ipairs hlgroups)]
(vim.api.nvim_set_hl 0 hl {:bold true
:bg "#6272a4"}))

View file

@ -27,6 +27,7 @@
(setup :clangd {:on_attach (fn [c b] (disable-formatter c b) (setup :clangd {:on_attach (fn [c b] (disable-formatter c b)
(check-conjure c b))}) (check-conjure c b))})
(setup :cssls) (setup :cssls)
(setup :elixirls {:cmd [:elixir-ls]}) (setup :elixirls {:cmd [:elixir-ls]})
(setup :eslint) (setup :eslint)

View file

@ -7,6 +7,9 @@
(cmd "syntax on") (cmd "syntax on")
;; Quicker updatetime
(set opt.updatetime 1000)
;; Indentation ;; Indentation
(set opt.tabstop 4) (set opt.tabstop 4)
(set opt.shiftwidth 4) (set opt.shiftwidth 4)