not quite sure what I've done here

This commit is contained in:
Squibid 2025-11-22 17:22:23 -05:00
parent b22873f45f
commit 83aaa5aef3
Signed by: squibid
GPG key ID: BECE5684D3C4005D
18 changed files with 392 additions and 392 deletions

View file

@ -31,10 +31,10 @@ auto("BufWritePre", {
})
auto({ "BufEnter", "CursorMoved", "CursorMovedI" }, {
group = bufcheck,
callback = function()
core.todo.todo_comments()
end
group = bufcheck,
callback = function()
core.todo.todo_comments()
end
})
core.color.setup_termbg_sync()

View file

@ -3,9 +3,9 @@ local map, lz = core.misc.map, core.misc.lz
--- feed keys as userinput
---@param keys string keys
local function feedkeys(keys)
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(keys, true, false, true),
"n", true)
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(keys, true, false, true),
"n", true)
end
-- vim binds
@ -27,27 +27,27 @@ map("n", "<C-i>", lz "<C-i>zz")
-- trigger completion menu
-- (stolen from https://gist.github.com/MariaSolOs/2e44a86f569323c478e5a078d0cf98cc)
map("i", "<C-n>", function()
-- if the completion menu is already visible just go to the next item
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-n>")
else
if #vim.lsp.get_clients({ bufnr = 0 }) > 0 then
vim.lsp.completion.get()
else
if vim.bo.omnifunc == "" then
feedkeys("<C-x><C-n>")
else
feedkeys("<C-x><C-o>")
end
end
end
-- if the completion menu is already visible just go to the next item
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-n>")
else
if #vim.lsp.get_clients({ bufnr = 0 }) > 0 then
vim.lsp.completion.get()
else
if vim.bo.omnifunc == "" then
feedkeys("<C-x><C-n>")
else
feedkeys("<C-x><C-o>")
end
end
end
end, { desc = "Trigger/select next completion" })
map("i", "<CR>", function()
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-e><CR>")
else
feedkeys("<CR>")
end
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-e><CR>")
else
feedkeys("<CR>")
end
end, { desc = "prevent omnifunc from completing on <CR>" })
map("i", "<C-s>", "<C-x><C-s>", { desc = "Trigger spell completion" })
map("n", "<C-s>", lz "<cmd>se spell<CR>ea<C-x><C-s><cmd>se nospell<CR>", { desc = "Trigger spell completion" })
@ -57,9 +57,9 @@ map("n", "<M-j>", lz "<cmd>cnext<CR>zz", { desc = "qf next" })
map("n", "<M-k>", lz "<cmd>cprev<CR>zz", { desc = "qf prev" })
map("n", "<M-c>", "<cmd>cclose<CR>", { desc = "qf close" })
map("n", "<M-x>", lz(function()
local win = vim.api.nvim_get_current_win()
vim.cmd.cope()
vim.api.nvim_set_current_win(win)
local win = vim.api.nvim_get_current_win()
vim.cmd.cope()
vim.api.nvim_set_current_win(win)
end), { desc = "qf open" })
-- man pages

View file

@ -24,7 +24,7 @@ return {
load = function()
require("mason").setup {
ui = {
-- not sure why these are nerdfont icons by default
-- not sure why these are nerdfont icons by default
icons = {
package_installed = "+",
package_pending = "?",

View file

@ -1,49 +1,49 @@
local map = core.misc.map
return { "L3MON4D3/LuaSnip",
branch = "v2.*",
config = function()
vim.cmd("make install_jsregexp")
end,
lazy = function(load)
load:keymap({"i", "s"}, "<c-a>")
load:keymap({"i", "s"}, "<c-e>")
load:keymap({"i", "s"}, "<c-j>")
load:keymap({"i", "s"}, "<c-k>")
load:auto("InsertEnter")
end,
load = function()
local ls = require("luasnip")
branch = "v2.*",
config = function()
vim.cmd("make install_jsregexp")
end,
lazy = function(load)
load:keymap({"i", "s"}, "<c-a>")
load:keymap({"i", "s"}, "<c-e>")
load:keymap({"i", "s"}, "<c-j>")
load:keymap({"i", "s"}, "<c-k>")
load:auto("InsertEnter")
end,
load = function()
local ls = require("luasnip")
-- replace the builtin snippet handler with luasnip so I get all my fancy
-- stuff
vim.snippet.expand = ls.lsp_expand
-- replace the builtin snippet handler with luasnip so I get all my fancy
-- stuff
vim.snippet.expand = ls.lsp_expand
ls.config.setup {
keep_roots = true,
link_roots = true,
link_children = true,
exit_roots = not true
}
ls.config.setup {
keep_roots = true,
link_roots = true,
link_children = true,
exit_roots = not true
}
map({"i", "s"}, "<C-e>", ls.expand)
map({"i", "s"}, "<C-j>", function() ls.jump(1) end)
map({"i", "s"}, "<C-k>", function() ls.jump(-1) end)
map({"i", "s"}, "<C-a>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end)
map({"i", "s"}, "<C-e>", ls.expand)
map({"i", "s"}, "<C-j>", function() ls.jump(1) end)
map({"i", "s"}, "<C-k>", function() ls.jump(-1) end)
map({"i", "s"}, "<C-a>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end)
-- collect all snippets and add them
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
true)) do
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
-- collect all snippets and add them
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
true)) do
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
local ret = require("snippets."..fn)
if type(ret) ~= "boolean" then
ls.add_snippets(fn, ret, { key = fn })
end
end
end
local ret = require("snippets."..fn)
if type(ret) ~= "boolean" then
ls.add_snippets(fn, ret, { key = fn })
end
end
end
}

View file

@ -20,14 +20,14 @@ return { "mellow-theme/mellow.nvim",
["NormalFloat"] = { fg = c.fg, bg = "#111111" },
["FloatBorder"] = { bg = "#111111" },
-- Make pmenu look good
["Pmenu"] = { link = "NormalFloat" },
["PmenuSel"] = { link = "Normal" },
["PmenuKind"] = { link = "@constant" },
["PmenuKindSel"] = {
fg = core.color.copyhl("Comment").fg,
bold = true
},
-- Make pmenu look good
["Pmenu"] = { link = "NormalFloat" },
["PmenuSel"] = { link = "Normal" },
["PmenuKind"] = { link = "@constant" },
["PmenuKindSel"] = {
fg = core.color.copyhl("Comment").fg,
bold = true
},
-- make diagnostics have an undercurl
["DiagnosticUnderlineError"] = { fg = c.red, undercurl = true },
@ -43,19 +43,19 @@ return { "mellow-theme/mellow.nvim",
["TelescopePreviewNormal"] = { link = "NormalFloat" },
["TelescopePreviewBorder"] = { link = "TelescopePreviewNormal" },
-- add highlight groups for my todo highlighting
["TodoTODO"] = { link = "DiagnosticHint" },
["TodoTODOBG"] = { fg = c.bg, bg = c.cyan, bold = true },
["TodoTODOSIGN"] = { fg = c.cyan, bg = c.cyan, bold = true },
["TodoBUG"] = { link = "DiagnosticError" },
["TodoBUGBG"] = { fg = c.bg, bg = c.red, bold = true },
["TodoBUGSIGN"] = { fg = c.red, bg = c.red, bold = true },
["TodoTEST"] = { link = "DiagnosticInfo" },
["TodoTESTBG"] = { fg = c.bg, bg = c.blue, bold = true },
["TodoTESTSIGN"] = { fg = c.blue, bg = c.blue, bold = true },
["TodoWARN"] = { link = "DiagnosticWarn" },
["TodoWARNBG"] = { fg = c.bg, bg = c.yellow, bold = true },
["TodoWARNSIGN"] = { fg = c.yellow, bg = c.yellow, bold = true },
-- add highlight groups for my todo highlighting
["TodoTODO"] = { link = "DiagnosticHint" },
["TodoTODOBG"] = { fg = c.bg, bg = c.cyan, bold = true },
["TodoTODOSIGN"] = { fg = c.cyan, bg = c.cyan, bold = true },
["TodoBUG"] = { link = "DiagnosticError" },
["TodoBUGBG"] = { fg = c.bg, bg = c.red, bold = true },
["TodoBUGSIGN"] = { fg = c.red, bg = c.red, bold = true },
["TodoTEST"] = { link = "DiagnosticInfo" },
["TodoTESTBG"] = { fg = c.bg, bg = c.blue, bold = true },
["TodoTESTSIGN"] = { fg = c.blue, bg = c.blue, bold = true },
["TodoWARN"] = { link = "DiagnosticWarn" },
["TodoWARNBG"] = { fg = c.bg, bg = c.yellow, bold = true },
["TodoWARNSIGN"] = { fg = c.yellow, bg = c.yellow, bold = true },
}
end
end

View file

@ -14,11 +14,11 @@ return { "stevearc/oil.nvim",
for i = 1, #permission_str do
local char = permission_str:sub(i, i)
table.insert(hls, { ({
["-"] = "NonText",
["r"] = "DiagnosticSignWarn",
["w"] = "DiagnosticSignHint",
["x"] = "DiagnosticSignOk"
})[char], i - 1, i })
["-"] = "NonText",
["r"] = "DiagnosticSignWarn",
["w"] = "DiagnosticSignHint",
["x"] = "DiagnosticSignOk"
})[char], i - 1, i })
end
return hls
end,
@ -26,12 +26,12 @@ return { "stevearc/oil.nvim",
{ "size", highlight = "@number" }
},
-- fix the damn border
confirmation = { winborder = vim.o.winborder },
progress = { winborder = vim.o.winborder },
ssh = { winborder = vim.o.winborder },
keymaps_help = { winborder = vim.o.winborder }
}
-- fix the damn border
confirmation = { winborder = vim.o.winborder },
progress = { winborder = vim.o.winborder },
ssh = { winborder = vim.o.winborder },
keymaps_help = { winborder = vim.o.winborder }
}
map("n", "-", "<cmd>Oil<CR>")
end

View file

@ -1,10 +1,10 @@
return { "NickvanDyke/opencode.nvim",
load = function()
core.misc.map("n", "<leader>oa", function()
require("opencode").ask()
end, { desc = "Ask opencode" })
core.misc.map("v", "<leader>oa", function()
require("opencode").ask("@selection: ")
end, { desc = "Ask opencode about selection" })
end
load = function()
core.misc.map("n", "<leader>oa", function()
require("opencode").ask()
end, { desc = "Ask opencode" })
core.misc.map("v", "<leader>oa", function()
require("opencode").ask("@selection: ")
end, { desc = "Ask opencode about selection" })
end
}

View file

@ -44,72 +44,72 @@ return { "nvim-telescope/telescope.nvim",
load = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local action_state = require("telescope.actions.state")
local function send_limited_to_qflist_and_open(prompt_bufnr)
local picker = action_state.get_current_picker(prompt_bufnr)
local entries = {}
local max_items = 100
local count = 0
local function send_limited_to_qflist_and_open(prompt_bufnr)
local picker = action_state.get_current_picker(prompt_bufnr)
local entries = {}
local max_items = 100
local count = 0
for entry in picker.manager:iter() do
if count >= max_items then
break
end
for entry in picker.manager:iter() do
if count >= max_items then
break
end
local filename = entry.path or entry.filename or entry.value
local text = entry.text or entry.value
if not text then
if type(entry.value) == "table" then
text = entry.value.text
else
text = entry.value
end
end
local filename = entry.path or entry.filename or entry.value
local text = entry.text or entry.value
if not text then
if type(entry.value) == "table" then
text = entry.value.text
else
text = entry.value
end
end
local pattern
if not entry.lnum then
if type(entry.display) == "string" then
pattern = entry.display
elseif type(entry.ordinal) == "string" then
pattern = entry.ordinal
elseif type(text) == "string" then
pattern = text
else
entry.lnum = 1
end
end
local pattern
if not entry.lnum then
if type(entry.display) == "string" then
pattern = entry.display
elseif type(entry.ordinal) == "string" then
pattern = entry.ordinal
elseif type(text) == "string" then
pattern = text
else
entry.lnum = 1
end
end
if filename then
table.insert(entries, {
filename = filename,
text = text,
lnum = entry.lnum,
col = entry.col,
if filename then
table.insert(entries, {
filename = filename,
text = text,
lnum = entry.lnum,
col = entry.col,
-- we try and put a pattern in based on the info we receive from
-- telescope so that the qf list takes us to the correct place
pattern = pattern
})
count = count + 1
end
end
-- we try and put a pattern in based on the info we receive from
-- telescope so that the qf list takes us to the correct place
pattern = pattern
})
count = count + 1
end
end
if #entries > 0 then
-- make sure errors get suppressed. I don't care
pcall(vim.fn.setqflist, {}, " ", {
title = "Telescope Limited Results",
items = entries
})
end
if #entries > 0 then
-- make sure errors get suppressed. I don't care
pcall(vim.fn.setqflist, {}, " ", {
title = "Telescope Limited Results",
items = entries
})
end
actions.select_default(prompt_bufnr)
end
actions.select_default(prompt_bufnr)
end
telescope.setup {
defaults = {
layout_strategy = "bottom_pane",
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
layout_strategy = "bottom_pane",
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
mappings = {
i = {
["<esc>"] = actions.close,
@ -119,11 +119,11 @@ return { "nvim-telescope/telescope.nvim",
}
}
},
pickers = {
colorscheme = {
enable_preview = true
}
},
pickers = {
colorscheme = {
enable_preview = true
}
},
extensions = {
fzf = {}
}
@ -154,6 +154,6 @@ return { "nvim-telescope/telescope.nvim",
}
end, { desc = "find files in plugin directory" })
map("n", "<leader>tt", "<cmd>Telescope<CR>")
map("n", "<leader>tt", "<cmd>Telescope<CR>")
end
}

View file

@ -49,11 +49,11 @@ return {
}
}
core.misc.map("n", "<leader><leader>t", function()
pcall(vim.cmd.TSInstall, vim.api.nvim_get_option_value("ft", {
buf = vim.api.nvim_get_current_buf()
}))
end)
core.misc.map("n", "<leader><leader>t", function()
pcall(vim.cmd.TSInstall, vim.api.nvim_get_option_value("ft", {
buf = vim.api.nvim_get_current_buf()
}))
end)
end
},
@ -77,7 +77,7 @@ return {
{ "windwp/nvim-ts-autotag",
reqs = "nvim-treesitter/nvim-treesitter",
disable = true,
disable = true,
-- lazy = dep_short.auto({ "BufReadPre", "BufNewFile" }),
load = function()
require("nvim-ts-autotag").setup {}