Got Null-LS working with markdown and python.

This commit is contained in:
Norm Rasmussen
2022-11-30 17:21:29 -05:00
parent c8bcff39f5
commit 8d46ae585e
9 changed files with 234 additions and 67 deletions

View File

@ -1,15 +1,21 @@
local null_ls = require("null-ls")
null_ls.setup({
on_attach = function(client, bufnr)
--[[ on_attach = function(client, bufnr)
if client.resolved_capabilities.document_formatting then
vim.cmd("nnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.formatting()<CR>")
-- format on save
vim.cmd("autocmd BufWritePost <buffer> lua vim.lsp.buf.formatting()")
end
if client.resolved_capabilities.document_range_formatting then
vim.cmd("xnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.range_formatting({})<CR>")
end
end,
end
end,--]]
sources = {
null_ls.builtins.completion.spell,
null_ls.builtins.diagnostics.codespell,
null_ls.builtins.diagnostics.markdownlint.with({ extra_args = { "--disable MD013" }}),
null_ls.builtins.diagnostics.pycodestyle,
null_ls.builtins.formatting.black.with({ extra_args = { "--fast" }}),
},
})

View File

@ -57,8 +57,15 @@ return require'packer'.startup(function()
}
-- Null-LS
use'jose-elias-alvarez/null-ls.nvim'
use({
"jose-elias-alvarez/null-ls.nvim",
config = function()
require("null-ls").setup({
debug = true,
})
end,
requires = { "nvim-lua/plenary.nvim" },
})
------------------------------------------------------------
-- General Functionality
------------------------------------------------------------
@ -171,29 +178,36 @@ use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = fun
use {
'folke/todo-comments.nvim',
requires = "nvim-lua/plenary.nvim",
config = function()
require('todo-comments').setup({
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
DONE = { icon = "", color = "info" },
FEAT = { icon = "", color = "warning", alt = { "NEED", "REQUEST" } },
WARN = { icon = "", color = "warning", alt = { "WARNING", "ERROR" } },
TASK = { icon = "", color = "hint", alt = { "TODO", "TBD" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
SENG = { icon = "", color = "test", alt = { "SOLUTIONS", "SE", "WORKAROUND" } },
},
highlight = {
comments_only = false,
},
})
end
config = function()
require("todo-comments").setup {
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
DONE = { icon = "", color = "info" },
FEAT = { icon = "", color = "warning", alt = { "NEED", "REQUEST" } },
WARN = { icon = "", color = "error", alt = { "WARNING", "ERROR" } },
TASK = { icon = "", color = "hint", alt = { "TODO", "TBD" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
SENG = { icon = "", color = "test", alt = { "SOLUTIONS", "SE", "WORKAROUND" } },
},
highlight = {
comments_only = false,
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarning", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
},
}
end
}
-- The all famous telescope
use {
'nvim-telescope/telescope.nvim', tag = '0.1.0',
@ -203,7 +217,6 @@ use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = fun
})
end
}
use {
"nvim-telescope/telescope-file-browser.nvim"
}
@ -229,6 +242,8 @@ use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = fun
require('gitsigns').setup()
end
}
-- Plugin that causes your code to crumble >:)
use 'eandrju/cellular-automaton.nvim'
-- The Dashboard
use {

View File

@ -0,0 +1,29 @@
local g = vim.g
require('todo-comments').setup {
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
DONE = { icon = "", color = "info" },
FEAT = { icon = "", color = "warning", alt = { "NEED", "REQUEST" } },
WARN = { icon = "", color = "error", alt = { "WARNING", "ERROR" } },
TASK = { icon = "", color = "hint", alt = { "TODO", "TBD" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
SENG = { icon = "", color = "test", alt = { "SOLUTIONS", "SE", "WORKAROUND" } },
},
highlight = {
comments_only = false,
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarning", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
},
}