refactor(nvim): better lsp file organization
This commit is contained in:
parent
c1f7efb478
commit
d4922a19c7
@ -1,5 +1,50 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function() end
|
||||
M.setup = function()
|
||||
local function lspSymbol(name, icon)
|
||||
local hl = 'DiagnosticSign' .. name
|
||||
vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl })
|
||||
end
|
||||
|
||||
lspSymbol('Error', '')
|
||||
lspSymbol('Warn', '')
|
||||
lspSymbol('Info', '')
|
||||
lspSymbol('Hint', '')
|
||||
|
||||
local border = {
|
||||
{ '╭', 'FloatBorder' },
|
||||
{ '─', 'FloatBorder' },
|
||||
{ '╮', 'FloatBorder' },
|
||||
{ '│', 'FloatBorder' },
|
||||
{ '╯', 'FloatBorder' },
|
||||
{ '─', 'FloatBorder' },
|
||||
{ '╰', 'FloatBorder' },
|
||||
{ '│', 'FloatBorder' },
|
||||
}
|
||||
|
||||
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = opts.border or border
|
||||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
|
||||
-- vim.o.updatetime = 100
|
||||
-- vim.cmd([[autocmd CursorHold,CursorHoldI,CmdlineEnter * lua vim.diagnostic.open_float(nil, {focus=false})]])
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -1,44 +0,0 @@
|
||||
local function lspSymbol(name, icon)
|
||||
local hl = 'DiagnosticSign' .. name
|
||||
vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl })
|
||||
end
|
||||
|
||||
lspSymbol('Error', '')
|
||||
lspSymbol('Warn', '')
|
||||
lspSymbol('Info', '')
|
||||
lspSymbol('Hint', '')
|
||||
|
||||
local border = {
|
||||
{ '╭', 'FloatBorder' },
|
||||
{ '─', 'FloatBorder' },
|
||||
{ '╮', 'FloatBorder' },
|
||||
{ '│', 'FloatBorder' },
|
||||
{ '╯', 'FloatBorder' },
|
||||
{ '─', 'FloatBorder' },
|
||||
{ '╰', 'FloatBorder' },
|
||||
{ '│', 'FloatBorder' },
|
||||
}
|
||||
|
||||
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = opts.border or border
|
||||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
|
||||
-- vim.o.updatetime = 100
|
||||
-- vim.cmd([[autocmd CursorHold,CursorHoldI,CmdlineEnter * lua vim.diagnostic.open_float(nil, {focus=false})]])
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
})
|
@ -237,9 +237,6 @@ return packer.startup({
|
||||
-- LSP, LSP Installer
|
||||
use({
|
||||
'neovim/nvim-lspconfig',
|
||||
config = function()
|
||||
require('plugins.configs.lspconfig')
|
||||
end,
|
||||
requires = {
|
||||
'folke/lua-dev.nvim',
|
||||
'Decodetalkers/csharpls-extended-lsp.nvim',
|
||||
|
Loading…
Reference in New Issue
Block a user