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