1
0
Fork 0

nvim: Cleanup config

This commit is contained in:
Daniel Kempkens 2021-12-20 00:18:02 +01:00
parent 980c12606f
commit 25b234ff8a
5 changed files with 20 additions and 36 deletions

View 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=')

View file

@ -21,19 +21,10 @@ local function custom_attach_no_format(client, bufnr)
end end
-- Setup -- Setup
lsp_status.config({
vim.cmd('sign define DiagnosticSignError text= texthl=DiagnosticSignError linehl= numhl=') current_function = true,
vim.cmd('sign define DiagnosticSignWarn text= texthl=DiagnosticSignWarn linehl= numhl=') show_filename = false,
vim.cmd('sign define DiagnosticSignInfo text= texthl=DiagnosticSignInfo linehl= numhl=') diagnostics = false,
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.register_progress() lsp_status.register_progress()

View file

@ -3,6 +3,8 @@ local builtins = null_ls.builtins
local diagnostic_utils = require('nifoc.utils.diagnostic') local diagnostic_utils = require('nifoc.utils.diagnostic')
null_ls.setup({ null_ls.setup({
debounce = 700,
sources = { sources = {
builtins.formatting.fish_indent, builtins.formatting.fish_indent,
builtins.formatting.shfmt.with({extra_args = { '-i', '2' }}), builtins.formatting.shfmt.with({extra_args = { '-i', '2' }}),

View file

@ -38,6 +38,7 @@ require('nifoc.config.project')
require('nifoc.config.todo_comments') require('nifoc.config.todo_comments')
-- LSP -- LSP
require('nifoc.config.diagnostic')
require('nifoc.config.lsp') require('nifoc.config.lsp')
require('nifoc.config.null_ls') require('nifoc.config.null_ls')
require('nifoc.config.lsp_trouble') require('nifoc.config.lsp_trouble')

View file

@ -48,29 +48,6 @@ function M.filetype()
end end
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) function M.gitsigns_formatter(status)
local added, changed, removed = status.added, status.changed, status.removed local added, changed, removed = status.added, status.changed, status.removed
local result = {} local result = {}