nvim: Cleanup config
This commit is contained in:
parent
980c12606f
commit
25b234ff8a
5 changed files with 20 additions and 36 deletions
13
config/nvim/lua/nifoc/config/diagnostic.lua
Normal file
13
config/nvim/lua/nifoc/config/diagnostic.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
virtual_text = {
|
||||
source = 'if_many',
|
||||
},
|
||||
signs = false,
|
||||
update_in_insert = false,
|
||||
})
|
||||
|
||||
vim.cmd('sign define DiagnosticSignError text= texthl=DiagnosticSignError linehl= numhl=')
|
||||
vim.cmd('sign define DiagnosticSignWarn text= texthl=DiagnosticSignWarn linehl= numhl=')
|
||||
vim.cmd('sign define DiagnosticSignInfo text= texthl=DiagnosticSignInfo linehl= numhl=')
|
||||
vim.cmd('sign define DiagnosticSignHint text= texthl=DiagnosticSignHint linehl= numhl=')
|
|
@ -21,19 +21,10 @@ local function custom_attach_no_format(client, bufnr)
|
|||
end
|
||||
|
||||
-- Setup
|
||||
|
||||
vim.cmd('sign define DiagnosticSignError text= texthl=DiagnosticSignError linehl= numhl=')
|
||||
vim.cmd('sign define DiagnosticSignWarn text= texthl=DiagnosticSignWarn linehl= numhl=')
|
||||
vim.cmd('sign define DiagnosticSignInfo text= texthl=DiagnosticSignInfo linehl= numhl=')
|
||||
vim.cmd('sign define DiagnosticSignHint text= texthl=DiagnosticSignHint linehl= numhl=')
|
||||
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
virtual_text = {
|
||||
source = 'if_many',
|
||||
},
|
||||
signs = false,
|
||||
update_in_insert = false,
|
||||
lsp_status.config({
|
||||
current_function = true,
|
||||
show_filename = false,
|
||||
diagnostics = false,
|
||||
})
|
||||
|
||||
lsp_status.register_progress()
|
||||
|
|
|
@ -3,6 +3,8 @@ local builtins = null_ls.builtins
|
|||
local diagnostic_utils = require('nifoc.utils.diagnostic')
|
||||
|
||||
null_ls.setup({
|
||||
debounce = 700,
|
||||
|
||||
sources = {
|
||||
builtins.formatting.fish_indent,
|
||||
builtins.formatting.shfmt.with({extra_args = { '-i', '2' }}),
|
||||
|
|
|
@ -38,6 +38,7 @@ require('nifoc.config.project')
|
|||
require('nifoc.config.todo_comments')
|
||||
|
||||
-- LSP
|
||||
require('nifoc.config.diagnostic')
|
||||
require('nifoc.config.lsp')
|
||||
require('nifoc.config.null_ls')
|
||||
require('nifoc.config.lsp_trouble')
|
||||
|
|
|
@ -48,29 +48,6 @@ function M.filetype()
|
|||
end
|
||||
end
|
||||
|
||||
function M.diagnostics_status()
|
||||
if buffer_has_lsp() then
|
||||
local status = require('lsp-status').diagnostics()
|
||||
local errors, warnings, info, hints = status.errors, status.warnings, status.info, status.hints
|
||||
local status_txt = {}
|
||||
|
||||
if errors > 0 then table.insert(status_txt, ' ' .. errors) end
|
||||
if warnings > 0 then table.insert(status_txt, ' ' .. warnings) end
|
||||
if info > 0 then table.insert(status_txt, ' ' .. info) end
|
||||
if hints > 0 then table.insert(status_txt, ' ' .. hints) end
|
||||
|
||||
local formatted_status = table.concat(status_txt, ' ')
|
||||
|
||||
if formatted_status:len() > 0 then
|
||||
return formatted_status
|
||||
else
|
||||
return ''
|
||||
end
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
|
||||
function M.gitsigns_formatter(status)
|
||||
local added, changed, removed = status.added, status.changed, status.removed
|
||||
local result = {}
|
||||
|
|
Loading…
Reference in a new issue