mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
2 Commits
3539207913
...
26921309ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26921309ec | ||
|
|
a6f716558b |
@ -1,3 +1,5 @@
|
|||||||
|
local api = vim.api
|
||||||
|
local keymap = vim.keymap
|
||||||
local dashboard = require("dashboard")
|
local dashboard = require("dashboard")
|
||||||
|
|
||||||
dashboard.custom_header = {
|
dashboard.custom_header = {
|
||||||
@ -56,10 +58,11 @@ dashboard.custom_center = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.cmd([[
|
api.nvim_create_autocmd("FileType", {
|
||||||
augroup dashboard_enter
|
pattern = "dashboard",
|
||||||
au!
|
group = api.nvim_create_augroup("dashboard_enter", { clear = true }),
|
||||||
autocmd FileType dashboard nnoremap <buffer> q :qa<CR>
|
callback = function ()
|
||||||
autocmd FileType dashboard nnoremap <buffer> e :enew<CR>
|
keymap.set("n", "q", ":qa<CR>", { buffer = true, silent = true })
|
||||||
augroup END
|
keymap.set("n", "e", ":enew<CR>", { buffer = true, silent = true })
|
||||||
]])
|
end
|
||||||
|
})
|
||||||
|
|||||||
@ -69,12 +69,24 @@ local custom_attach = function(client, bufnr)
|
|||||||
hi! link LspReferenceRead Visual
|
hi! link LspReferenceRead Visual
|
||||||
hi! link LspReferenceText Visual
|
hi! link LspReferenceText Visual
|
||||||
hi! link LspReferenceWrite Visual
|
hi! link LspReferenceWrite Visual
|
||||||
augroup lsp_document_highlight
|
|
||||||
autocmd! * <buffer>
|
|
||||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
|
||||||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
|
||||||
augroup END
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
local gid = api.nvim_create_augroup("lsp_document_highlight", { clear = true })
|
||||||
|
api.nvim_create_autocmd("CursorHold" , {
|
||||||
|
group = gid,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function ()
|
||||||
|
lsp.buf.document_highlight()
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
api.nvim_create_autocmd("CursorMoved" , {
|
||||||
|
group = gid,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function ()
|
||||||
|
lsp.buf.clear_references()
|
||||||
|
end
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.g.logging_level == "debug" then
|
if vim.g.logging_level == "debug" then
|
||||||
@ -83,9 +95,7 @@ local custom_attach = function(client, bufnr)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local capabilities = lsp.protocol.make_client_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user