mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-13 13:42:56 +01:00
mzte-nv: add LSP hover highlights
This commit is contained in:
parent
707bdd9e77
commit
ba29e7305b
4 changed files with 25 additions and 0 deletions
|
@ -3,5 +3,6 @@
|
|||
(require :settings)
|
||||
(require :plugins)
|
||||
(require :maps)
|
||||
(require :lsp)
|
||||
(require :neovide)
|
||||
(require :pipe)
|
||||
|
|
20
mzte-nv/conf/lua/lsp.fnl
Normal file
20
mzte-nv/conf/lua/lsp.fnl
Normal 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"}))
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
(setup :clangd {:on_attach (fn [c b] (disable-formatter c b)
|
||||
(check-conjure c b))})
|
||||
|
||||
(setup :cssls)
|
||||
(setup :elixirls {:cmd [:elixir-ls]})
|
||||
(setup :eslint)
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
(cmd "syntax on")
|
||||
|
||||
;; Quicker updatetime
|
||||
(set opt.updatetime 1000)
|
||||
|
||||
;; Indentation
|
||||
(set opt.tabstop 4)
|
||||
(set opt.shiftwidth 4)
|
||||
|
|
Loading…
Reference in a new issue