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

@ -48,10 +48,82 @@ map('n', '<leader>fe', ':Telescope file_browser<CR>', default_opts)
Mapper = require("nvim-mapper")
local M = Mapper.map
-- For Neovim >= 0.7.0
M('n', '<leader>P', ":MarkdownPreview<CR>", {silent = true, noremap = true}, "Markdown", "md_preview", "Display Markdown preview in Qutebrowser")
M('n', '<leader>fe', ":Telescope file_browser<CR>", {silent=true, noremap=true}, "Telescope", "telescope-file-browser", "Find files and directories in telescope")
M('n', '<C-t>', "@t<CR>",{silent=true, noremap=true}, "Todo Comments", "todo_todo", "Add To-do/Task to the beginning of the line")
M('n', '<C-s>', "@s<CR>", {silent=true, noremap=true}, "Todo Comments", "todo_seng", "Add Solutions Engineering to the beginning of the line")
M('n', '<C-f>', "@f<CR>", {silent=true, noremap=true}, "Todo Comments", "todo_feat", "Add Feature Request tag to the beginning of the line. ")
M('n', '<C-cx>', "@c<CR>", {silent=true, noremap=true}, "Todo Comments", "todo_complete", "Replace tag with Complete tag at beginning of the line.")
M('n', '<C-w>', "@w<CR>", {silent=true, noremap=true}, "Todo Comments", "todo_error", "Add Warning/Error tag at the beginning of the line.")
M(
'n', '<leader>P', ":MarkdownPreview<CR>",
{silent = true, noremap = true},
"Markdown",
"md_preview",
"Display Markdown preview in Qutebrowser"
)
M(
'n', '<leader>fe', ":Telescope file_browser<CR>",
{silent=true, noremap=true},
"Telescope",
"telescope-file-browser",
"Find files and directories in telescope"
)
M(
'n', '<C-t>', "@t<CR>",
{silent=true, noremap=true},
"Todo Comments",
"todo_todo",
"Add To-do/Task to the beginning of the line"
)
M(
'n', '<C-s>', "@s<CR>",
{silent=true, noremap=true},
"Todo Comments",
"todo_seng",
"Add Solutions Engineering to the beginning of the line"
)
M(
'n', '<C-f>', "@f<CR>",
{silent=true, noremap=true},
"Todo Comments",
"todo_feat",
"Add Feature Request tag to the beginning of the line. "
)
M(
'n', '<C-cx>', "@c<CR>",
{silent=true, noremap=true},
"Todo Comments",
"todo_complete",
"Replace tag with Complete tag at beginning of the line."
)
M(
'n', '<C-w>', "@w<CR>",
{silent=true, noremap=true},
"Todo Comments",
"todo_error",
"Add Warning/Error tag at the beginning of the line."
)
M(
'n', '<leader>ce', ":TodoTrouble keywords=TODO<CR> | resize +10<CR>",
{silent=true, noremap=true},
"Show Todos",
"todo_trouble_todo",
"Show Todos from Folke's Todo Comments Plugin."
)
M(
'n', '<leader>cf', ":TodoTrouble keywords=FEAT<CR>",
{silent=true, noremap=true},
"Show Todos",
"todo_trouble_todo",
"Show Feature Requests from Folke's Todo Comments Plugin."
)
M(
'n', '<leader>cq', ":TodoTrouble keywords=ERROR, WARN<CR>",
{silent=true, noremap=true},
"Show Todos",
"todo_trouble_todo",
"Show Errors from Folke's Todo Comments Plugin."
)

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" }
},
}

View File

@ -23,6 +23,8 @@ opt.shell = "/bin/zsh"
opt.updatetime = 200
opt.cursorline = true
g.markdown_folding = 1
opt.spell=true
opt.spelllang = 'en_us'
-----------------------------------------------------------
-- Neovim UI
-----------------------------------------------------------
@ -30,9 +32,9 @@ opt.number = true -- Show line number
opt.relativenumber = true -- Show Current Line with Relative numbers above and below cursor.
opt.showmatch = true -- Highlight matching parenthesis
opt.foldmethod = 'syntax' -- Enable folding (default 'foldmarker')
opt.colorcolumn = '150' -- Line lenght marker at 80 columns
opt.colorcolumn = '150' -- Line length marker at 80 columns
opt.splitright = true -- Vertical split to the right
opt.splitbelow = true -- Orizontal split to the bottom
opt.splitbelow = true -- Horizontal split to the bottom
opt.ignorecase = true -- Ignore case letters when search
opt.smartcase = true -- Ignore lowercase for the whole pattern
opt.linebreak = true -- Wrap on word boundary