fix: get configs working
This commit is contained in:
@@ -14,10 +14,10 @@ vim.opt.rtp:prepend(lazypath)
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins.nav" },
|
||||
{ import = "plugins.snacks" },
|
||||
{ import = "plugins.lsp" },
|
||||
{ import = "plugins.style" },
|
||||
{ import = "plugins.util" },
|
||||
{ import = "plugins.util.diff" },
|
||||
{ import = "plugins.testing" },
|
||||
},
|
||||
change_detection = {
|
||||
|
||||
@@ -8,21 +8,6 @@ M.on_attach = function(client, bufnr)
|
||||
opts.buffer = bufnr
|
||||
|
||||
-- set keybinds
|
||||
opts.desc = "Show LSP references"
|
||||
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts)
|
||||
|
||||
opts.desc = "Go to declaration"
|
||||
keymap.set("n", "gD", ":lua vim.lsp.buf.declaration", opts)
|
||||
|
||||
opts.desc = "Show LSP definitions"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
|
||||
|
||||
opts.desc = "Show LSP implementations"
|
||||
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
|
||||
|
||||
opts.desc = "Show LSP type definitions"
|
||||
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
|
||||
|
||||
opts.desc = "See available code actions"
|
||||
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
|
||||
@@ -32,12 +17,6 @@ M.on_attach = function(client, bufnr)
|
||||
opts.desc = "Smart rename"
|
||||
keymap.set("n", "<leader>n", vim.lsp.buf.rename, opts)
|
||||
|
||||
opts.desc = "Show buffer diagnostics"
|
||||
keymap.set("n", "ga", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
|
||||
|
||||
opts.desc = "Show line diagnostics"
|
||||
keymap.set("n", "gA", ":lua vim.diagnostic.open_float()<CR>", opts)
|
||||
|
||||
opts.desc = "Go to previous diagnostic"
|
||||
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
|
||||
|
||||
|
||||
@@ -28,5 +28,5 @@ return {
|
||||
statuscolumn = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
},
|
||||
keys = require("plugins.snacks.keys"),
|
||||
keys = require("plugins.snacks.keys.keys"),
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ return {
|
||||
Snacks.picker.icons()
|
||||
end,
|
||||
desc = "Show icons",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
-- Terminal
|
||||
{
|
||||
@@ -56,7 +56,7 @@ return {
|
||||
Snacks.explorer()
|
||||
end,
|
||||
desc = "Open File Tree",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
-- Pickers
|
||||
{
|
||||
@@ -65,7 +65,7 @@ return {
|
||||
Snacks.picker.files()
|
||||
end,
|
||||
desc = "Find file",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fg",
|
||||
@@ -73,7 +73,7 @@ return {
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = "Find file content using grep",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fb",
|
||||
@@ -81,7 +81,7 @@ return {
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = "Show all buffers",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fch",
|
||||
@@ -89,7 +89,7 @@ return {
|
||||
Snacks.picker.command_history()
|
||||
end,
|
||||
desc = "Show command history",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fd",
|
||||
@@ -97,7 +97,7 @@ return {
|
||||
Snacks.picker.diagnostics()
|
||||
end,
|
||||
desc = "Show diagnostics",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fm",
|
||||
@@ -105,7 +105,7 @@ return {
|
||||
Snacks.picker.git_diff()
|
||||
end,
|
||||
desc = "Show uncommitted diffs",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fh",
|
||||
@@ -113,7 +113,7 @@ return {
|
||||
Snacks.picker.help()
|
||||
end,
|
||||
desc = "Show nvim help pages",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fj",
|
||||
@@ -121,7 +121,7 @@ return {
|
||||
Snacks.picker.jumps()
|
||||
end,
|
||||
desc = "Show available jumps",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fk",
|
||||
@@ -129,7 +129,7 @@ return {
|
||||
Snacks.picker.keymaps()
|
||||
end,
|
||||
desc = "Show keymaps",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>flc",
|
||||
@@ -137,47 +137,68 @@ return {
|
||||
Snacks.picker.lsp_config()
|
||||
end,
|
||||
desc = "Show LSP configs",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fld",
|
||||
"gd",
|
||||
function()
|
||||
Snacks.picker.lsp_definitions()
|
||||
end,
|
||||
desc = "Show LSP definitions (alias for gd)",
|
||||
mode = "n"
|
||||
desc = "Goto definitions",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fli",
|
||||
"gi",
|
||||
function()
|
||||
Snacks.picker.lsp_implementations()
|
||||
end,
|
||||
desc = "Show LSP implementations (alias for gi)",
|
||||
mode = "n"
|
||||
desc = "Goto implementations",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>flr",
|
||||
"<leader>gR",
|
||||
function()
|
||||
Snacks.picker.lsp_references()
|
||||
end,
|
||||
desc = "Show LSP references (alias for gR)",
|
||||
mode = "n"
|
||||
desc = "Goto references",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fls",
|
||||
"<leader>gD",
|
||||
function()
|
||||
Snacks.picker.lsp_declarations()
|
||||
end,
|
||||
desc = "Goto declaration",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"gy",
|
||||
function()
|
||||
Snacks.picker.lsp_type_definitions()
|
||||
end,
|
||||
desc = "Goto T[y]pe Definition",
|
||||
},
|
||||
{
|
||||
"gai",
|
||||
function()
|
||||
Snacks.picker.lsp_incoming_calls()
|
||||
end,
|
||||
desc = "C[a]lls Incoming",
|
||||
},
|
||||
{
|
||||
"gao",
|
||||
function()
|
||||
Snacks.picker.lsp_outgoing_calls()
|
||||
end,
|
||||
desc = "C[a]lls Outgoing",
|
||||
},
|
||||
{
|
||||
"gs",
|
||||
function()
|
||||
Snacks.picker.lsp_symbols()
|
||||
end,
|
||||
desc = "Show LSP symbols",
|
||||
mode = "n"
|
||||
},
|
||||
{
|
||||
"<leader>flt",
|
||||
function()
|
||||
Snacks.picker.lsp_type_definitions()
|
||||
end,
|
||||
desc = "Show LSP type definitions",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fn",
|
||||
@@ -185,7 +206,7 @@ return {
|
||||
Snacks.picker.notifications()
|
||||
end,
|
||||
desc = "Show notifications",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fp",
|
||||
@@ -193,7 +214,7 @@ return {
|
||||
Snacks.picker.projects()
|
||||
end,
|
||||
desc = "Show recent projects",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fr",
|
||||
@@ -201,7 +222,7 @@ return {
|
||||
Snacks.picker.recent()
|
||||
end,
|
||||
desc = "Show recent files",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fs",
|
||||
@@ -209,7 +230,7 @@ return {
|
||||
Snacks.picker.spelling()
|
||||
end,
|
||||
desc = "Show spelling suggestions",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>fo",
|
||||
@@ -217,7 +238,7 @@ return {
|
||||
Snacks.picker.treesitter()
|
||||
end,
|
||||
desc = "Show treesitter details",
|
||||
mode = "n"
|
||||
mode = "n",
|
||||
},
|
||||
-- Close buffer
|
||||
{
|
||||
@@ -1,71 +1,87 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
event = "BufRead",
|
||||
opts = {
|
||||
{
|
||||
signs = true, -- show icons in the signs column
|
||||
sign_priority = 8, -- sign priority
|
||||
-- keywords recognized as todo comments
|
||||
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
|
||||
},
|
||||
TODO = { icon = " ", color = "todo" },
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
||||
},
|
||||
gui_style = {
|
||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
||||
},
|
||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
-- highlighting of the line containing the todo comment
|
||||
-- * before: highlights before the keyword (typically comment characters)
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
-- list of named colors where we try to extract the guifg from the
|
||||
-- list of highlight groups or use the hex color if hl not found as a fallback
|
||||
colors = {
|
||||
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
||||
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
|
||||
todo = { "DiagnosticInfo", "#2563EB" },
|
||||
hint = { "DiagnosticHint", "#10B981" },
|
||||
default = { "Identifier", "#7C3AED" },
|
||||
test = { "Identifier", "#FF00FF" },
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (KEYWORDS) placeholder
|
||||
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
||||
},
|
||||
},
|
||||
},
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
event = "BufRead",
|
||||
opts = {
|
||||
{
|
||||
signs = true, -- show icons in the signs column
|
||||
sign_priority = 8, -- sign priority
|
||||
-- keywords recognized as todo comments
|
||||
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
|
||||
},
|
||||
TODO = { icon = " ", color = "todo" },
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
||||
},
|
||||
gui_style = {
|
||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
||||
},
|
||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
-- highlighting of the line containing the todo comment
|
||||
-- * before: highlights before the keyword (typically comment characters)
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
-- list of named colors where we try to extract the guifg from the
|
||||
-- list of highlight groups or use the hex color if hl not found as a fallback
|
||||
colors = {
|
||||
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
||||
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
|
||||
todo = { "DiagnosticInfo", "#2563EB" },
|
||||
hint = { "DiagnosticHint", "#10B981" },
|
||||
default = { "Identifier", "#7C3AED" },
|
||||
test = { "Identifier", "#FF00FF" },
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (KEYWORDS) placeholder
|
||||
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>ft",
|
||||
function()
|
||||
Snacks.picker.todo_comments()
|
||||
end,
|
||||
desc = "Todo",
|
||||
},
|
||||
{
|
||||
"<leader>fT",
|
||||
function()
|
||||
Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } })
|
||||
end,
|
||||
desc = "Todo/Fix/Fixme",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user