feat(nvim): updated config to use vim.pack instead of lazy

This commit is contained in:
2026-04-16 19:42:48 -04:00
parent 086c3ee5a3
commit c07bd3924b
77 changed files with 3511 additions and 169 deletions
+8
View File
@@ -0,0 +1,8 @@
" Override cargo compiler defaults
setlocal makeprg=cargo\ build\ --message-format=short
setlocal errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %m,
\%f:%l:\ %t%*[^:]:\ %m,
\%f:%l:\ %m
+2
View File
@@ -0,0 +1,2 @@
let current_compiler = "cmake"
CompilerSet makeprg=cmake
+2
View File
@@ -0,0 +1,2 @@
let current_compiler = "npm"
CompilerSet makeprg=npm\ run
+30
View File
@@ -0,0 +1,30 @@
vim.api.nvim_buf_set_keymap(
0,
"n",
"<CR>",
"<cmd>lua require('kulala').run()<cr>",
{ noremap = true, silent = true, desc = "Execute the request" }
)
vim.api.nvim_buf_set_keymap(
0,
"n",
"[",
"<cmd>lua require('kulala').jump_prev()<cr>",
{ noremap = true, silent = true, desc = "Jump to the previous request" }
)
vim.api.nvim_buf_set_keymap(
0,
"n",
"]",
"<cmd>lua require('kulala').jump_next()<cr>",
{ noremap = true, silent = true, desc = "Jump to the next request" }
)
vim.api.nvim_buf_set_keymap(
0,
"n",
"<leader>i",
"<cmd>lua require('kulala').inspect()<cr>",
{ noremap = true, silent = true, desc = "Inspect the current request" }
)
+163
View File
@@ -0,0 +1,163 @@
-- Steve Beaulac nvim configuration using kickstart git: 2ba39c6 --
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.have_nerd_fonts = true
-- set <space> as my leader key
vim.g.autoformat = true
-- vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
vim.g.editorconfig = true
vim.wo.number = true
vim.opt.background = "dark"
vim.opt.backup = false
vim.opt.clipboard:append("unnamedplus")
vim.opt.modifiable = true
vim.opt.cmdheight = 1
vim.opt.completeopt = { 'menuone', 'noinsert', 'noselect', 'fuzzy', 'popup' }
vim.opt.conceallevel = 0
-- vim.opt.concealcursor = ""
vim.opt.encoding = "UTF-8"
vim.opt.lazyredraw = true
vim.opt.redrawtime = 10000
vim.opt.maxmempattern = 20000
vim.opt.synmaxcol = 300
vim.opt.pumheight = 10
vim.opt.pumblend = 10
vim.opt.winblend = 0
vim.opt.hlsearch = true
vim.opt.breakindent = true
vim.opt.ignorecase = true
vim.opt.backspace = "indent,eol,start"
vim.opt.formatoptions = "jcroqlnt"
vim.opt.grepformat = "%f:%l:%c:%m"
vim.opt.grepprg = "rg --vimgrep"
vim.opt.ignorecase = true
vim.opt.inccommand = "split"
vim.opt.list = true
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
vim.opt.mouse = "a"
vim.opt.pumblend = 10
vim.opt.pumheight = 10
vim.opt.showmode = false
vim.opt.showmatch = true
vim.opt.showtabline = 0
vim.opt.smartcase = true
vim.opt.smartindent = true
vim.opt.splitbelow = true
vim.opt.splitright = true
-- vim.opt.splitkeep = "screen"
vim.opt.swapfile = false
vim.opt.termguicolors = true
vim.opt.undofile = true
vim.opt.undolevels = 10000
vim.opt.updatetime = 250 -- default 250
vim.opt.timeoutlen = 500 -- default 1000
vim.opt.ttimeoutlen = 0
-- vim.opt.timeout = false
vim.opt.autoread = true
vim.opt.autowrite = false
vim.opt.autochdir = false
vim.opt.writebackup = false
vim.opt.expandtab = true
vim.opt.shiftround = true
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.tabstop = 4
vim.opt.hidden = true
vim.opt.shortmess:append({ W = true, I = true, c = true, C = true })
vim.opt.spelllang = { "en" }
vim.opt.selection = "inclusive"
vim.opt.cursorline = true
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.laststatus = 3
vim.opt.showcmd = false
vim.opt.ruler = false
vim.opt.numberwidth = 4
vim.opt.signcolumn = "yes"
vim.opt.wrap = false
vim.opt.scrolloff = 8
vim.opt.sidescrolloff = 8
vim.opt.shell = "/bin/bash"
vim.opt.sessionoptions = { "blank", "buffers", "curdir", "tabpages", "winsize", "winpos", "terminal", "localoptions", "help", "skiprtp", "folds" }
vim.opt.virtualedit = "block"
vim.opt.wildmode = "longest:full,full"
vim.opt.diffopt:append("linematch:60")
vim.opt.winminwidth = 5
-- vim.opt.hidden = false
-- vim.opt.cindent = true
-- vim.opt.autoindent = true
if vim.fn.has("nvim-0.10") == 1 then
vim.opt.smoothscroll = true
end
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldlevel = 99
vim.opt.errorbells = false
vim.opt.belloff = "all"
vim.opt.undodir = vim.fn.stdpath('data') .. "/undodir"
vim.opt.incsearch = true
vim.opt.fillchars = { eob = " " }
vim.opt.iskeyword:append("-")
vim.opt.path:append("**")
vim.opt.colorcolumn = "100"
vim.diagnostic.config({
virtual_text = { current_line = true }
})
-- Lazy plugin manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', lazyrepo, '--branch=stable', lazypath }
if vim.v.shell_error ~= 0 then
error('Error cloning lazy.nvim:\n' .. out)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins" }
},
rocks = {
enabled = false,
hererocks = false,
},
checker = {
enabled = true,
notify = false,
},
change_detection = {
notify = false,
},
})
vim.g.lazyvim_check_order = false
require("config.keymaps")
require("config.scripts")
-- When Nvim is idle or you switch focus/buffers, check if files changed
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
pattern = "*",
command = "checktime",
})
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
require("config.autocmds")
end,
})
@@ -0,0 +1,10 @@
{
"gCopyright": {
"prefix": "copy",
"description": "Generic Copyright",
"body": [
"Copyright (c) ${CURRENT_YEAR} ${1:Author} <${2:email}>. All Rights Reserved.",
"$0"
]
}
}
+49
View File
@@ -0,0 +1,49 @@
{
"Starter Template": {
"prefix": "vsTaskHeader",
"body": [
"{",
"\t\"version\": \"2.0.0\",",
"\t\"tasks\": [",
"\t\t$0",
"\t]",
"}"
],
"scope": "json"
},
"Tasks": {
"prefix": "vsTasks",
"body": [
"{",
"\t\"label\": \"$1\",",
"\t\"type\": \"shell\",",
"\t\"command\": \"$2\",",
"\t\"args\": [ $3 ],",
"\t\"group\": {",
"\t\t\"kind\": \"build\",",
"\t\t\"isDefault\": true",
"\t}$0",
"}"
],
"scope": "json"
},
"Presentation": {
"prefix": "presentation",
"body": [
"\"presentation\": {",
"\t\"reveal\": \"always\",",
"\t\"panel\": \"new\",",
"}"
],
"scope": "json"
},
"ProblemMatcher": {
"prefix": "problemMatcher",
"body": [
"\"problemMatcher\": [",
"\t$0",
"]"
],
"scope": "json"
}
}
@@ -0,0 +1,21 @@
{
"name": "sjb_snippets",
"contributes": {
"snippets": [
{
"language": [
"json"
],
"path": "./json.json"
},
{
"language": [
"rust",
"global",
"all"
],
"path": "./copyright.json"
}
]
}
}
+143
View File
@@ -0,0 +1,143 @@
vim.filetype.add({
extension = {
['http'] = 'http',
},
})
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
desc = 'Check time',
group = vim.api.nvim_create_augroup("sjb-checktime", { clear = true}),
callback = function()
if vim.o.buftype ~= 'nofile' then
vim.cmd('checktime')
end
end,
})
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('sjb-highlight-yank', { clear = true }),
callback = function()
vim.hl.on_yank()
end,
})
-- windows to close
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"OverseerForm",
"OverseerList",
"floggraph",
"fugitive",
"git",
"help",
"lspinfo",
"man",
"neotest-output",
"neotest-summary",
"qf",
"query",
"spectre_panel",
"startuptime",
"toggleterm",
"tsplayground",
"vim",
},
group = vim.api.nvim_create_augroup('sjb-quick-close', { clear = true }),
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
end,
})
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("sjb-wrap-spell", { clear = true }),
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = vim.api.nvim_create_augroup("sjb-auto-create-dir", { clear = true}),
callback = function(event)
if event.match:match("^%w%w+://") then
return
end
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*",
callback = function()
if vim.fn.isdirectory(".jj") == 1 then
vim.fn.jobstart({"jj", "status"}, {
on_exit = function(_, exit_code)
if exit_code ~= 0 then
vim.notify("jj command failed", vim.log.levels.WARN)
end
end,
})
end
end,
})
local gpgGroup = vim.api.nvim_create_augroup("customGpg", { clear = true })
vim.api.nvim_create_autocmd({ "BufReadPre", "FileReadPre" }, {
pattern = "*.gpg",
group = gpgGroup,
callback = function()
-- Make sure nothing is written to shada file while editing an encrypted file.
vim.opt_local.shada = nil
-- We don't want a swap file, as it writes unencrypted data to disk
vim.opt_local.swapfile = false
-- Switch to binary mode to read the encrypted file
vim.opt_local.bin = true
-- Save the current 'ch' value to a buffer-local variable
vim.b.ch_save = vim.opt_local.ch:get()
vim.cmd "set ch=2"
end,
})
vim.api.nvim_create_autocmd({ "BufReadPost", "FileReadPost" }, {
pattern = "*.gpg",
group = gpgGroup,
callback = function()
vim.cmd "'[,']!gpg --decrypt 2> /dev/null"
-- Switch to normal mode for editing
vim.opt_local.bin = false
-- Restore the 'ch' value from the buffer-local variable
vim.opt_local.ch = vim.b.ch_save
vim.cmd "unlet b:ch_save"
vim.cmd(":doautocmd BufReadPost " .. vim.fn.expand "%:r")
end,
})
-- Convert all text to encrypted text before writing
vim.api.nvim_create_autocmd({ "BufWritePre", "FileWritePre" }, {
pattern = "*.gpg",
group = gpgGroup,
callback = function()
-- Switch to binary mode to write the encrypted file
vim.opt_local.bin = true
-- So we can avoid the armor option
vim.cmd("'[,']!gpg --default-recipient-self -e 2>/dev/null")
end,
})
-- Undo the encryption so we are back in the normal text, directly after the file has been written.
vim.api.nvim_create_autocmd({ "BufWritePost", "FileWritePost" }, {
pattern = "*.gpg",
group = gpgGroup,
callback = function()
vim.cmd("u")
-- Switch to normal mode for editing
vim.opt_local.bin = false
end,
})
+78
View File
@@ -0,0 +1,78 @@
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
--vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- save file
-- vim.keymap.set({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
-- vim.keymap.set({ "i", "x", "n", "s" }, "<C-x><C-s>", "<cmd>:qall<cr>", { desc = "Save file" })
-- better indenting
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
-- better jumps
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "<C-f>", "<C-f>zz")
vim.keymap.set("n", "<C-b>", "<C-b>zz")
vim.keymap.set("i", "<C-f>", "<C-x><C-f>", { noremap = true, silent = true })
vim.keymap.set("i", "<C-b>", "<C-x><C-b>", { noremap = true, silent = true })
vim.keymap.set("i", "<C-l>", "<C-x><C-l>", { noremap = true, silent = true })
-- Paste over currently selected text without yanking it
vim.keymap.set("v", "p", '"_dP')
vim.keymap.set("n", "<leader>p", [["_dP]], { desc = "Paste over currently selected text without yanking it" })
vim.keymap.set("n", "<leader>Y", [["+Y]], { noremap = true, silent = true })
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]], { noremap = true, silent = true })
vim.keymap.set({"n", "v"}, "<leader>d", [["_d]], { noremap = true, silent = true })
-- new file
vim.keymap.set("n", "<leader>bn", "<cmd>enew<cr>", { desc = "New File" })
-- vim.keymap.set("n", "<leader>bd", "<cmd>bdelete<cr>", { desc = "Unload Buffer" })
vim.keymap.set("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
vim.keymap.set("n", "<leader>bc", "<cmd>tabclose<cr>", { desc = "Close Tab" })
-- Clear search with <esc>
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<cr>', { desc = "clear hlsearch" })
-- vim.keymap.set("n", "<leader><esc>", "<cmd>nohlsearch<cr>", { desc = "clear hlsearch" })
-- Diagnostic keymaps
vim.keymap.set('n', '<leader>cl', vim.diagnostic.setloclist, { desc = 'Send diagnostic to location list' })
vim.keymap.set("n", "<leader>cq", vim.diagnostic.setqflist, { desc = "Send diagnostic to Quickfix" })
-- vim.keymap.set("n", "<leader>gq", "<cmd>copen<cr>", { desc = "Quickfix List" })
-- vim.keymap.set("n", "<leader>gl", "<cmd>lopen<cr>", { desc = "Location List" })
vim.keymap.set('n', '<leader>eb', "<cmd>.w !bash -e<cr>", { desc = "Send line to bash" })
vim.keymap.set('n', '<leader>eB', "<cmd>%w !bash -e<cr>", { desc = "Send buffer to bash" })
vim.keymap.set('n', '<leader>e.', "<cmd>.!bash -e<cr>", { desc = "Execute current line" })
vim.keymap.set('n', '<leader>e%', "<cmd>% !bash -e<cr>", { desc = "Execute current buffer" })
vim.keymap.set('n', '<leader>ex', "<cmd>!chmod +x %<cr>", { desc = "Make file executable" })
vim.keymap.set('n', "<leader>eL", "<cmd>source %<cr>", { desc = "Source current buffer" })
vim.keymap.set('n', "<leader>el", "<cmd>.lua<cr>", { desc = "Source current line" })
vim.keymap.set('v', "<leader>el", "<cmd>lua<cr>", { desc = "Source current line" })
vim.keymap.set('n', '<leader>xu', '<cmd>Lazy sync<cr>', { desc = 'Lazy sync' })
vim.keymap.set("n", "<leader>cx", function()
local file = vim.fn.expand "%"
local line = vim.fn.line "."
vim.fn.setreg("+", string.format("%s:%d", file, line))
vim.notify "Copied line reference to clipboard"
end, { desc = "Copy line reference to clipboard" })
vim.keymap.set("n", "<leader>ktn", require('tasks').create_new_task, { desc = "create new task" } )
vim.keymap.set("n", "<leader>kts", require('tasks').start_task, { desc = "start task" } )
vim.keymap.set("n", "<leader>kte", require('tasks').stop_task, { desc = "stop task" } )
+33
View File
@@ -0,0 +1,33 @@
function R(name)
require("plenary.reload").reload_module(name)
end
function websearch(url, o)
-- Get visual selection or prompt for search
local search_term
-- Check if there's a visual selection
if vim.fn.mode() == 'v' or vim.fn.mode() == 'V' then
-- Get the visual selection
local start_pos = vim.fn.getpos("'<")
local end_pos = vim.fn.getpos("'>")
local lines = vim.fn.getline(start_pos[2], end_pos[2])
local selected_text = table.concat(lines, " ")
search_term = selected_text
else
search_term = (o and o.args) or vim.fn.input("Search: ")
end
-- Encode the search term for URLs
local escaped = vim.uri_encode(search_term)
-- Construct and execute the search URL
local search_url = (url):format(escaped)
vim.ui.open(search_url)
end
-- Command to call the search function
vim.api.nvim_create_user_command('DuckDuckGo', function(o) websearch('https://duckduckgo.com/?q=%s', o) end, { nargs = 1 })
vim.api.nvim_create_user_command('Docsrs', function(o) websearch('https://docs.rs/%s', o) end, { nargs = 1})
vim.api.nvim_create_user_command('RustStd', function(o) websearch('https://doc.rust-lang.org/std/?search=%s', o) end, { nargs = 1})
vim.keymap.set({ 'n', 'v'}, '<leader>sW', function() websearch('https://duckduckgo.com/?q=%s', null) end, { desc = "Search on DuckDuckGo" })
@@ -0,0 +1,17 @@
return {
name = "CMake Build",
builder = function()
return {
cmd = { "cmake" },
args = { "--build", "build", "--target", "all" },
components = {
{ "on_output_quickfix", set_diagnostics = true },
"on_result_diagnostics",
"default",
},
}
end,
condition = {
filetype = { "cpp", "c" },
},
}
@@ -0,0 +1,17 @@
return {
name = "CMake Create",
builder = function()
return {
cmd = { "cmake" },
args = { "-B", "build", "-S", "." },
components = {
{ "on_output_quickfix", set_diagnostics = true },
"on_result_diagnostics",
"default",
},
}
end,
condition = {
filetype = { "cpp", "c" },
},
}
@@ -0,0 +1 @@
return { "user.cmake_create", "user.cmake_build" }
@@ -0,0 +1,34 @@
local M = {}
M.problem_patterns = {
["$rustc"] = {
{
regexp = "^(error|warning)(\\[E\\d+\\])*:(.*)$",
message = 3
},
{
regexp = "^\\s+-+>\\s*([^:]*):(\\d+):(\\d+)$",
kind = "location",
file = 1,
line = 2,
column = 3
},
{
regexp = "^(\\s|\\d)+(\\||=).*$"
},
{
regexp = "^$"
}
}
}
M.problem_matchers = {
["$rustc"] = {
fileLocation = { "relative", "${cwd}" },
pattern = "$rustc",
}
}
return M
+864
View File
@@ -0,0 +1,864 @@
return {
{
"Davidyz/VectorCode",
version = "*",
build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date
-- build = "pipx upgrade vectorcode", -- If you used pipx to install the CLI
dependencies = { "nvim-lua/plenary.nvim" },
},
{
"olimorris/codecompanion.nvim",
version = "^18.0.0",
opts = {},
dependencies = {
"nvim-lua/plenary.nvim",
"franco-ruggeri/codecompanion-spinner.nvim",
"ravitemer/codecompanion-history.nvim",
"cairijun/codecompanion-agentskills.nvim",
"ttgrules/cc-adapter-copilot-cli-acp",
},
event = "VeryLazy",
keys = {
{ "<leader>rct", "<cmd>CodeCompanionChat Toggle<cr>", mode = {'n', 'v'}, { noremap = true, silent = true }, desc = "CC Toggle" },
{ "<leader>rca", "<cmd>CodeCompanionActions<cr>", mode = { 'n', 'v' }, { noremap = true, silent = true }, desc = "CC Action" },
{ "<leader>rce", "<cmd>CodeCompanion Explain<cr>", mode = { 'n' }, desc = "CC Explain" },
{ "<leader>rcf", "<cmd>CodeCompanion Fix code<cr>", mode = { 'n' }, desc = "CC fix" },
{ "<leader>rcc", "<cmd>CodeCompanionChat Add<cr>", mode = { 'v' }, { noremap = true, silent = true }, desc = "CC Add" },
{ '<leader>rcr', '<cmd>CodeCompanion Code Review<cr>', mode = { 'v' }, desc = 'Code Review' },
{ '<leader>rco', '<cmd>CodeCompanion Optimize Performance<cr>', mode = { 'v' }, desc = 'Optimize Code' },
{ '<leader>rce', '<cmd>CodeCompanion Explain Code<cr>', mode = { 'v' }, desc = 'Explain Code' },
{ '<leader>rcg', '<cmd>CodeCompanion Generate Tests<cr>', mode = { 'v' }, desc = 'Generate Tests' },
{ '<leader>rcd', '<cmd>CodeCompanion Debug Analysis<cr>', mode = { 'v' }, desc = 'Debug Analysis' },
},
config = function()
local function get_abacus_key()
local handle = io.popen("pass show abacus.ai-api")
if not handle then return "" end
local result = handle:read("*a")
handle:close()
-- Remove trailing newline that 'pass' often adds
return result:gsub("%s+", "")
end
local codecompanion = require("codecompanion")
codecompanion.setup({
adapters = {
http = {
opts = {
show_presets = true,
show_model_choices = true,
},
-- openai = function()
-- return require("codecompanion.adapters").extend("openai", {
-- env = { api_key = "cmd:pass show api.openai.com" }
-- })
-- end,
openrouter = function()
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "https://openrouter.ai/api",
api_key = "OPENROUTER_API_KEY",
chat_url = "/v1/chat/completions",
},
schema = {
model = {
default = "anthropic/claude-3.7-sonnet",
},
},
})
end,
abacus = function()
return require("codecompanion.adapters").extend("openai_compatible", {
name = "abacus",
formatted_name = "Abacus.AI",
env = {
url = "https://routellm.abacus.ai/v1",
-- IMPORTANT: include /v1 in the base url
api_key = get_abacus_key(),
chat_url = "/chat/completions"
},
headers = {
["Content-Type"] = "application/json",
["Authorization"] = "Bearer ${api_key}",
},
schema = {
model = {
order = 1,
mapping = "parameters",
type = "enum",
desc = "The model to use for chat completions.",
default = "route-llm",
choices = {
-- Routing Model
["route-llm"] = { opts = { desc = "Intelligent routing to best model" } },
-- OpenAI Models
["gpt-5.2"] = { opts = { has_vision = true } },
["gpt-5.1"] = { opts = { has_vision = true } },
["gpt-5.1-chat-latest"] = { opts = { has_vision = true } },
["gpt-5"] = { opts = { has_vision = true } },
["gpt-5-mini"] = { opts = { has_vision = true } },
["gpt-5-nano"] = { opts = { has_vision = true } },
["gpt-4o"] = { opts = { has_vision = true } },
["gpt-4o-mini"] = { opts = { has_vision = true } },
["o4-mini"] = { opts = { can_reason = true } },
["o3"] = { opts = { can_reason = true } },
["o3-pro"] = { opts = { can_reason = true } },
-- Anthropic Models
["claude-4-5-sonnet"] = { opts = { has_vision = true } },
["claude-4-5-haiku"] = { opts = { has_vision = true } },
["claude-4-5-opus"] = { opts = { has_vision = true } },
["claude-3-opus"] = { opts = { has_vision = true } },
-- Google Models
["gemini-3-pro"] = { opts = { has_vision = true } },
["gemini-3-flash"] = { opts = { has_vision = true } },
["gemini-2.5-pro"] = { opts = { has_vision = true } },
["gemini-2.5-flash"] = { opts = { has_vision = true } },
-- xAI Models
["grok-4-1-fast"] = {},
["grok-4"] = {},
["grok-code-fast-1"] = {},
-- Meta Models
["llama-4-Maverick-17B"] = {},
["llama-3.1-405B"] = {},
["llama-3.1-70B"] = {},
-- DeepSeek Models
["deepseek-v3.2"] = {},
["deepseek-v3.1-Terminus"] = {},
["deepseek-R1"] = { opts = { can_reason = true } },
-- Qwen Models
["qwen-3-Max"] = {},
["qwen3-coder-480b-a35b-instruct"] = {},
["qwen-3-32B"] = {},
["qwq-32B"] = { opts = { can_reason = true } },
},
},
temperature = {
order = 2,
mapping = "parameters",
type = "number",
optional = true,
default = 1.0,
desc = "Controls randomness of output (0-2).",
validate = function(n)
return n >= 0 and n <= 2, "Must be between 0 and 2"
end,
},
max_tokens = {
order = 3,
mapping = "parameters",
type = "integer",
optional = true,
default = nil,
desc = "Maximum tokens to generate.",
validate = function(n)
return n > 0, "Must be greater than 0"
end,
},
top_p = {
order = 4,
mapping = "parameters",
type = "number",
optional = true,
default = 1.0,
desc = "Nucleus sampling parameter (0-1).",
validate = function(n)
return n >= 0 and n <= 1, "Must be between 0 and 1"
end,
},
},
})
end,
ollama = function()
return require("codecompanion.adapters").extend("ollama", {
env = {
url = "http://129.100.33.66:11434",
},
schema = {
model = {
default = "qwen3.5", -- change to whatever you pulled
},
},
})
end,
copilot = function()
return require("codecompanion.adapters").extend("copilot", {
schema = {
model = {
default = "gpt-5-mini", -- Consistent model choice
},
max_tokens = {
default = 16284,
}
}
})
end,
},
acp = {
opts = {
show_presets = true,
},
copilot_cli = function()
return require("codecompanion.adapters").extend("copilot_cli", {})
end,
codex = function()
return require("codecompanion.adapters").extend("codex", {
commands = {
default = { "codex-acp" },
},
schema = {
model = {
default = "github-copilot/gpt-5.2-codex",
},
},
defaults = {
timeout = 20000,
auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
},
})
end,
opencode = function()
return require("codecompanion.adapters").extend("codex", {
commands = {
default = { "opencode", "acp" },
},
schema = {
model = {
default = "github-copilot/gpt-5.2-codex",
},
},
defaults = {
timeout = 20000,
auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt"
},
})
end,
},
},
rules = {
opts = {
chat = {
enabled = true,
autoload = { "default" }
},
},
},
opts = {
send_code = true,
log_level = "WARN", -- Change to DEBUG for troubleshooting
language = "English",
-- NEW: Performance improvements
job_start_delay = 500, -- Reduced from default 1500ms
submit_delay = 1000, -- Reduced from default 2000ms
},
extensions = {
spinner = {},
-- ddgr_search = {
-- opts = {
-- require_approval_before = false,
-- },
-- },
agentskills = {
opts = {
{ "~/Documents/ai-skills", recursive = true },
},
},
-- vectorcode = { lazy = true },
history = {
lazy = true,
enabled = true,
opts = {
keymap = "ghf",
save_chat_keymap = "ghs",
picker = "snacks",
dir_to_save = vim.env.HOME .. "/Documents/ai-history",
title_generation_opts = {
adapter = "copilot",
model = "gpt-5-mini",
},
summary = {
create_summary_keymap = "ghc",
browse_summaries_keymap = "ghb",
},
},
},
-- mcphub = {
-- callback = "mcphub.extensions.codecompanion",
-- opts = {
-- make_vars = true,
-- make_slash_commands = true,
-- show_result_in_chat = true,
-- },
-- },
},
interactions = {
chat = {
variables = {
project = {
callback = function()
-- Get project files structure
local files = vim.fn.systemlist("fd . -type f")
return table.concat(files, "\n")
end,
description = "Share project structure"
}
},
tools = {
opts = {
auto_submit_errors = true, -- Send any errors to the LLM automatically?
auto_submit_success = true, -- Send any successful output to the LLM automatically?
system_prompt = {
enabled = true,
replace_main_system_prompt = false,
},
default_tools = {
"file_search",
"read_file",
"cmd_runner",
-- "ddgr_search",
},
},
["fetch_enhanced"] = {
callback = function(url, options)
options = options or {}
local max_length = options.max_length or 200000 -- 200KB default
local timeout = options.timeout or 60
-- Use curl for better control
local cmd = string.format(
'curl -L -s --max-time %d --user-agent "CodeCompanion-Neovim" "%s"',
timeout,
url
)
local handle = io.popen(cmd)
if not handle then
return nil, "Failed to execute curl"
end
local result = handle:read("*a")
local success = handle:close()
if not success then
return nil, "Curl command failed"
end
-- Truncate if too long
if #result > max_length then
result = result:sub(1, max_length) .. "\n[... truncated at " .. max_length .. " characters ...]"
end
return result
end,
opts = {
requires_approval = false,
}
},
["fetch_unlimited"] = {
description = "Fetch a data from the web",
callback = function(url, options)
options = options or {}
-- Use a local proxy service or direct system calls
local temp_file = vim.fn.tempname()
local cmd = string.format(
'wget --timeout=60 --tries=3 --output-document="%s" "%s" 2>/dev/null && cat "%s" && rm "%s"',
temp_file, url, temp_file, temp_file
)
local handle = io.popen(cmd)
if not handle then
return nil, "Failed to fetch URL"
end
local result = handle:read("*a")
handle:close()
-- Optional: Process and clean the content
-- Remove excessive whitespace, clean HTML if needed
-- result = result:gsub("%s+", " "):gsub("^\s+", ""):gsub("%s+$", "")
return result
end,
opts = {
requires_approval = false,
description = "Fetch web content with unlimited size"
}
},
["fetch"] = {
description = "Fetch a webpage in a markdown format",
callback = function(url, options)
local cmd = string.format(
'reader -o -i none %s 2>/dev/null',
url
)
local handle = io.popen(cmd)
if not handle then
return nil, "Failed to fetch URL"
end
local result = handle:read("*a")
handle:close()
return result
end,
},
-- ["mcp"] = { -- Name this tool whatever you like
-- -- Callback provides the necessary functions to CodeCompanion
-- callback = function()
-- return require("mcphub.extensions.codecompanion")
-- end,
-- opts = {
-- -- If true, CodeCompanion will ask for approval before executing the MCP tool call
-- requires_approval = true,
-- -- Optional: Pass parameters like temperature to the underlying LLM if the chat strategy supports it
-- temperature = 0.7
-- }
-- },
groups = {
['plan'] = {
description = "Planning my project and codes with enhanced web access",
prompt = "Using all the ${tools} at your disposal including enhanced web fetching. Analyze the codes and use it to help me with my query. You have access to unlimited web content fetching.",
tools = {
"fetch", -- Backup unlimited fetch
"file_search",
"grep_search",
"list_code_usages",
"next_edit_suggestion",
"read_file",
"cmd_runner",
},
opts = {
collapse_tools = true,
-- Override default fetch behavior for this group
tool_config = {
fetch_enhanced = {
max_length = 500000, -- 500KB for planning tasks
chunk_processing = true,
},
},
},
},
['research'] = {
description = "Deep research with unlimited web access",
prompt = "You are a research assistant with unlimited web access. Using the ${tools} fetch and analyze large documents, research papers, and comprehensive web content.",
tools = {
"fetch",
"fetch_enhanced",
"file_search",
"read_file",
},
opts = {
collapse_tools = false,
},
},
-- NEW: Add development group for coding tasks
['dev'] = {
description = "Full-stack development with all necessary tools",
prompt = "You are an expert full-stack developer. Use ${tools} to understand, modify, and test code. Always gather context before making changes.",
tools = {
"file_search",
"grep_search",
"fetch",
"list_code_usages",
"read_file",
"insert_edit_into_file",
"cmd_runner",
"next_edit_suggestion",
},
opts = {
collapse_tools = true,
},
},
},
},
slash_commands = {
["buffer"] = { opts = { provider = "snacks" } }, -- snacks
["file"] = { opts = { provider = "snacks" } }, -- snackes
['git_files'] = {
description = 'List git files',
---@param chat CodeCompanion.Chat
callback = function(chat)
local handle = io.popen 'git ls-files'
if handle ~= nil then
local result = handle:read '*a'
handle:close()
chat:add_reference({ content = result }, 'git', '<git_files>')
return vim.notify('Git files added to the chat.')
else
return vim.notify('No git files available', vim.log.levels.INFO, { title = 'CodeCompanion' })
end
end,
opts = {
contains_code = false,
},
},
-- NEW: Add helpful workspace command
["workspace"] = {
description = "Add workspace context",
callback = function(chat)
local cwd = vim.fn.getcwd()
local workspace_info = string.format("Working directory: %s", cwd)
-- Get project type
local files = vim.fn.glob(cwd .. "/*", false, true)
for _, file in ipairs(files) do
local basename = vim.fn.fnamemodify(file, ":t")
if basename == "package.json" then
workspace_info = workspace_info .. "\nProject type: Node.js/JavaScript"
break
elseif basename == "Cargo.toml" then
workspace_info = workspace_info .. "\nProject type: Rust"
break
elseif basename == "go.mod" then
workspace_info = workspace_info .. "\nProject type: Go"
break
end
end
chat:add_reference({ content = workspace_info }, 'workspace', '<workspace>')
return vim.notify('Workspace context added.')
end,
opts = {
contains_code = false,
},
},
},
-- adapter = { name = "abacus", model = "route-llm" },
-- adapter = { name = "opencode", model = "github-copilot/gpt-5.2-codex" },
adapter = { name = "copilot", model = "gpt-5-mini" },
},
inline = {
-- adapter = { name = "abacus", model = "route-llm" },
adapter = { name = "copilot", model = "gpt-5.1-codex-mini" },
},
cmd = {
adapter = { name = "copilot", model = "gpt-5-mini" },
},
background = {
adapter = { name = "copilot", model = "gpt-5-mini" },
},
},
prompt_library = {
markdown = {
dirs = {
vim.fn.getcwd() .. "/.prompts",
"~/.agents/prompts",
},
},
["Code Review"] = {
interaction = "chat",
description = "Review the selected code for improvements",
opts = {
mapping = "<LocalLeader>rpc",
modes = { "v" },
adapter = {
name = "copilot",
model = "chatgpt-5.1-codex",
},
},
prompts = {
{
role = "system",
content = "You are an expert code reviewer. Analyze the code for: 1) Logic errors 2) Performance issues 3) Security vulnerabilities 4) Best practices 5) Code clarity and maintainability. Provide specific, actionable feedback.",
},
{
role = "user",
content = function(context)
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
return "Please review this code:\n\n```" .. context.filetype .. "\n" .. code .. "\n```"
end,
},
},
cc_keywords = { "review", "critique", "smell", "security", "vulnerability", "best practice", "maintainab" },
cc_threshold = 2,
},
["Optimize Performance"] = {
interaction = "chat",
description = "Get performance optimization suggestions",
opts = {
mapping = "<LocalLeader>rpo",
modes = { "v" },
adapter = {
name = "copilot",
model = "chatgpt-5.2-codex",
},
},
prompts = {
{
role = "system",
content = "You are a performance optimization expert. Focus on: 1) Time complexity improvements 2) Space efficiency 3) Algorithm optimization 4) Framework-specific optimizations 5) Caching strategies.",
},
{
role = "user",
content = function(context)
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
return "How can I optimize the performance of this code?\n\n```" .. context.filetype .. "\n" .. code .. "\n```"
end,
},
},
cc_keywords = { "optimize", "performance", "slow", "latency", "throughput", "memory", "alloc" },
},
["Debug Analysis"] = {
interaction = "chat",
description = "Analyze and debug problematic code",
opts = {
mapping = "<LocalLeader>rpd",
modes = { "v" },
adapter = {
name = "copilot",
model = "chatgpt-5.2-codex",
},
},
prompts = {
{
role = "system",
content = [[You are a debugging expert. Analyze code for:
1. Potential bugs and issues
2. Logic errors
3. Runtime errors
4. Common pitfalls
5. Debugging strategies.
6. Provide specific solutions.]],
},
{
role = "user",
content = function(context)
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
return fmt(
[[Help me debug this code from buffer %d and identify potential issues:
```%s
%s
```]],
context.bufnr,
context.filetype,
code
)
end,
opts = {
contains_code = true,
}
},
},
cc_keyword = { "bug", "debug", "error", "exception", "crash", "stacktrace", "broken", "issue" },
},
["Architecture Review"] = {
interaction = "chat",
description = "Review architectural patterns and design",
opts = {
mapping = "<LocalLeader>rpa",
modes = { "v" },
adapter = {
name = "copilot",
model = "chatgpt-5.2-codex",
},
},
prompts = {
{
role = "system",
content = "You are a software architect. Review code for: 1) Design patterns usage 2) SOLID principles 3) Separation of concerns 4) Scalability considerations 5) Maintainability. Suggest architectural improvements.",
},
{
role = "user",
content = function(context)
local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line)
return fmt(
[[Please review the architecture and design of this code from buffer %d:
```%s
%s
```]],
context.bufnr,
context.filetype,
code
)
end,
opts = {
contains_code = true,
}
},
},
cc_keywords = { "architecture", "design", "pattern", "solid", "scalab", "maintainab", "refactor" },
},
},
display = {
action_palette = {
provider = "snacks",
opts = {
show_default_actions = true,
show_default_prompt_library = true,
}
},
chat = {
show_settings = false,
render_headers = false,
icons = {
chat_context = "📎️",
},
fold_context = true,
-- NEW: Better chat window configuration
window = {
layout = "vertical",
width = 0.45,
height = 0.8,
border = "rounded", -- Better visual
},
auto_scroll = false,
start_in_insert_mode = false, -- More convenient
}
}
})
end
},
{
"carlos-algms/agentic.nvim",
opts = {
-- Available by default: "claude-agent-acp" | "gemini-acp" | "codex-acp" | "opencode-acp" | "cursor-acp" | "auggie-acp" | "mistral-vibe-acp"
provider = "opencode-acp", -- setting the name here is all you need to get started
keymaps = {
-- Keybindings for ALL buffers in the widget (chat, prompt, code, files)
widget = {
close = "q", -- String for a single keybinding
change_mode = {
{
"<S-Tab>",
mode = { "i", "n", "v" }, -- Specify modes for this keybinding
},
},
switch_provider = "<localLeader>ras", -- Switch ACP provider
switch_model = "<localLeader>ram", -- Switch model
},
-- Keybindings for the prompt buffer only
prompt = {
submit = {
"<CR>", -- Normal mode, just Enter
{
"<C-s>",
mode = { "n", "v", "i" },
},
},
paste_image = {
{
"<localLeader>p",
mode = { "n" },
},
{
"<C-v>", -- Same as Claude-code in insert mode
mode = { "i" },
}
},
},
-- Keybindings for diff preview navigation
diff_preview = {
next_hunk = "]c",
prev_hunk = "[c",
},
},
},
-- these are just suggested keymaps; customize as desired
keys = {
{
"<leader>rat",
function() require("agentic").toggle() end,
mode = { "n", "v", "i" },
desc = "Toggle Agentic Chat"
},
{
"<C-'>",
function() require("agentic").add_selection_or_file_to_context() end,
mode = { "n", "v" },
desc = "Add file or selection to Agentic to Context"
},
{
"<leader>ran",
function() require("agentic").new_session() end,
mode = { "n", "v", "i" },
desc = "New Agentic Session"
},
{
"<A-i>r", -- ai Restore
function()
require("agentic").restore_session()
end,
desc = "Agentic Restore session",
silent = true,
mode = { "n", "v", "i" },
},
{
"<leader>rad", -- ai Diagnostics
function()
require("agentic").add_current_line_diagnostics()
end,
desc = "Add current line diagnostic to Agentic",
mode = { "n" },
},
{
"<leader>raD", -- ai all Diagnostics
function()
require("agentic").add_buffer_diagnostics()
end,
desc = "Add all buffer diagnostics to Agentic",
mode = { "n" },
},
},
},
{
"zbirenbaum/copilot.lua",
dependencies = {
"copilotlsp-nvim/copilot-lsp",
config = function()
vim.g.copilot_nes_debounce = 500
end,
},
cmd = "Copilot",
event = "InsertEnter",
config = function()
require('copilot').setup({
nes = {
enabled = false,
keymap = {
accept_and_goto = "<a-y>",
accept = false,
dismiss = "<Esc>",
},
},
panel = {
enabled = false,
},
})
end,
},
{
"PhantomYdn/fabric-ai.nvim",
cmd = { "Fabric" },
opts = {
-- Default configuration (all optional)
fabric_path = "fabric-ai", -- Path to Fabric CLI
patterns_path = nil, -- Custom patterns dir (auto-detect if nil)
timeout = 300000, -- Command timeout in ms (5 minutes)
window = {
width = 0.8, -- 80% of editor width
height = 0.8, -- 80% of editor height
border = "rounded",
},
},
keys = {
-- fabric-ai.nvim doesn't have default keymappings
{ "<leader>fa", ":'<,'>Fabric<CR>", mode = "v", desc = "Fabric AI" },
{ "<leader>fa", ":Fabric<CR>", mode = "n", desc = "Fabric AI" },
{ "<leader>fu", ":Fabric url<CR>", mode = "n", desc = "Fabric URL" },
},
},
}
+283
View File
@@ -0,0 +1,283 @@
return {
{
"mfussenegger/nvim-ansible",
lazy = true,
keys = function()
vim.keymap.set('v', '<leader>te', function() require('ansible').run() end, { buffer = true, silent = true })
vim.keymap.set('n', '<leader>te', ":w<CR> :lua require('ansible').run()<CR>", { buffer = true, silent = true })
end,
},
{
"hat0uma/csvview.nvim",
opts = {
parser = { comments = { "#", "//" } },
keymaps = {
textobject_field_inner = { "if", mode = { "o", "x" } },
textobject_field_outer = { "af", mode = { "o", "x" } },
jump_next_field_end = { "<Tab>", mode = { "n", "v" } },
jump_prev_field_end = { "<S-Tab>", mode = { "n", "v" } },
jump_next_row = { "<Enter>", mode = { "n", "v" } },
jump_prev_row = { "<S-Enter>", mode = { "n", "v" } },
},
},
cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" },
},
{
"obsidian-nvim/obsidian.nvim",
lazy = false,
ft = "markdown",
keys = {
{ "<leader>kx", "<cmd>Obsidian extract_note<cr>", desc = "Extract Note", mode = "v" },
{ "<leader>knn", "<cmd>Obsidian new<cr>", desc = "New Obsidian note", mode = "n" },
{ "<leader>knt", "<cmd>Obsidian new_from_template<cr>", desc = "New from template", mode = "n" },
{ "<leader>ksq", "<cmd>Obsidian quick_switch<cr>", desc = "Quick Switch", mode = "n" },
{ "<leader>kss", "<cmd>Obsidian search<cr>", desc = "Search Obsidian notes", mode = "n" },
{ "<leader>kdt", "<cmd>Obsidian today<cr>", desc = "Daily Today", mode = "n" },
{ "<leader>kdy", "<cmd>Obsidian yesterday<cr>", desc = "Daily Yesterday", mode = "n" },
{ "<leader>kdw", "<cmd>Obsidian tomorrow<cr>", desc = "Daily Tomorrow", mode = "n" },
{ "<leader>kdd", "<cmd>Obsidian dailies<cr>", desc = "Dailies", mode = "n" },
{ "<leader>kw", "<cmd>Obsidian workspace<cr>", desc = "Change Workspace", mode = "n" },
},
config = function()
require("obsidian").setup({
legacy_commands = false,
picker = {
name = "snacks.pick",
},
ui = {
enable = true,
},
workspaces = {
{
name = "NCA notes",
path = vim.fn.expand "~" .. "/Documents/nca-notes/",
},
},
notes_subdir = "Inbox",
daily_notes = {
folder = "Dailies",
date_format = "%Y-%m-%d-%a",
alias_fomat = "%B %-d, %Y",
default_tags = { "daily-notes" },
},
new_notes_location = "notes_subdir",
templates = {
subdir = "Templates",
date_format = "%Y-%m-%d-%a",
time_format = "%H:%M",
tags = "",
},
completion = {
nvim_cmp = false,
blink = true,
min_chars = 2,
},
link = {
style = "wiki",
},
note_id_func = function(title)
local suffix = ""
if title ~= nil then
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
for _ = 1, 4 do
suffix = suffix .. string.char(math.random(65, 90))
suffix = tostring(os.time()) .. "-" .. suffix
end
end
return suffix
end,
callbacks = {
enter_note = function(note)
vim.keymap.set('n', '<leader>k.', '<CMD>Obsidian toggle_checkbox<CR>', { desc = 'toggle checkbox', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>kp', '<CMD>Obsidian paste_img<CR>', { desc = 'paste img', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>kt', '<CMD>Obsidian tags<CR>', { desc = 'tags', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>k`', '<CMD>Obsidian backlinks<CR>', { desc = 'backlinks', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>kx', '<CMD>Obsidian follow_link<CR>', { desc = 'follow link', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>ksl', '<CMD>Obsidian links<CR>', { desc = 'links', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>kr', '<CMD>Obsidian rename<CR>', { desc = 'rename', buffer = note.bufnr, silent = true })
vim.keymap.set('n', '<leader>ksc', '<CMD>Obsidian toc<CR>', { desc = 'toc', buffer = note.bufnr, silent = true })
vim.keymap.set('v', '<leader>kx', '<CMD>Obsidian link<CR>', { desc = 'links', buffer = note.bufnr, silent = true })
vim.keymap.set('v', '<leader>kl', '<CMD>Obsidian link_new<CR>', { desc = 'links', buffer = note.bufnr, silent = true })
end,
},
})
end,
},
{
"salkin-mada/openscad.nvim",
lazy = true,
config = function()
vim.g.openscad_load_snippets = true
require("openscad").setup({})
end,
dependencies = { "L3MON4D3/LuaSnip", "junegunn/fzf.vim" },
},
{
-- 'nvim-orgmode/orgmode',
'SjB/orgmode',
branch = 'sjb-wip',
event = 'VeryLazy',
ft = { 'org' },
config = function()
-- Setup orgmode
local org = require('orgmode')
-- org.setup_ts_grammar()
org.setup({
ui = {
input = {
use_vim_ui = true
}
},
org_agenda_files = {'~/Documents/notes/*project*org', '~/Documents/notes/Inbox*org', '~/Documents/journals/*.org'},
org_default_notes_file = "~/Documents/notes/Inbox.org",
org_todo_keywords = { 'TODO(t)', 'NEXT(n)', '|', 'DONE(d)', 'DELEGATED(a)' },
mappings = {
capture = {
org_capture_refile = 'R',
}
},
hyperlinks = {
sources = {
-- require("denote.extensions.orgmode"):new({
-- files = _G.denote.config.directory,
-- }),
},
},
org_capture_templates = {
t = {
description = "Todo item",
template = "* TODO %?\n SCHEDULED: %t\n DEADLINE: %T\n", -- Template content
headline = "Tasks",
},
j = {
description = "Journal entry",
target = "~/Documents/notes/journals/%<%Y-%m-%d>.org",
template = "* %<%Y-%m-%d %H:%M> %?\n",
},
},
})
end,
},
{
"akinsho/org-bullets.nvim",
config = function()
require("org-bullets").setup {
concealcursor = false, -- If false then when the cursor is on a line underlying characters are visible
symbols = {
-- list symbol
list = "•",
-- headlines can be a list
headlines = { "◉", "○", "✸", "✿" },
-- or a function that receives the defaults and returns a list
headlines = function(default_list)
table.insert(default_list, "♥")
return default_list
end,
-- or false to disable the symbol. Works for all symbols
headlines = false,
-- or a table of tables that provide a name
-- and (optional) highlight group for each headline level
headlines = {
{ "◉", "MyBulletL1" },
{ "○", "MyBulletL2" },
{ "✸", "MyBulletL3" },
{ "✿", "MyBulletL4" },
},
checkboxes = {
half = { "", "@org.checkbox.halfchecked" },
done = { "✓", "@org.keyword.done" },
todo = { "˟", "@org.keyword.todo" },
},
}
}
end
},
{
"chipsenkbeil/org-roam.nvim",
lazy = true,
ft = { 'org' },
opts = {
bindings = {
prefix = "<LocalLeader>oO",
},
directory = "~/Documents/notes",
extensions = {
dailies = {
directory = "journals"
},
},
},
},
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
keys = function()
vim.keymap.set("n", "<leader>xmp", "<cmd>MarkdownPreview<CR>", { desc ="Markdown Preview" })
vim.keymap.set("n", "<leader>xms", "<cmd>MarkdownPreviewStop<CR>", { desc ="Markdown Preview Stop" })
end,
build = function() vim.fn["mkdp#util#install"]() end,
--build = "cd app && npm install",
},
{
"lervag/vimtex",
ft = "tex", -- Load only for .tex files
config = function()
vim.g.tex_flavor = "latex"
vim.g.vimtex_view_method = "zathura" -- Change to your preferred PDF viewer
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix window
-- vim.opt.conceallevel = 2 -- Enable concealment for nicer inline math display
vim.g.tex_conceal = "abdmg" -- Conceal accents, bold, delimiters, math, Greek
end,
},
{
'MeanderingProgrammer/render-markdown.nvim',
after = { 'nvim-treesitter' },
requires = { 'nvim-tree/nvim-web-devicons', opt = true },
ft = { 'markdown', 'codecompanion', 'copilot-chat' },
config = function()
require('render-markdown').setup({
completions = { lsp = { enabled = true } },
-- render_modes = { 'n', 'v' },
render_modes = true,
enabled = true,
anti_conceal = {
enabled = false,
},
quote = { repeat_linebreak = true },
checkbox = {
-- unchecked = { icon = '✘ ' },
checked = { icon = '✔ ', scope_highlight = '@markup.strikethrough' },
custom = {
todo = { raw = '[-]', rendered = '󰥔 ', highlight = 'RenderMarkdownTodo', scope_highlight = nil },
important = { raw = '[~]', rendered = '󰓎 ', highlight = 'DiagnosticWarn', },
},
},
latex = {
enabled = false,
converter = "latex2text",
},
win_options = {
conceallevel = {
default = 0,
rendered = 2, -- Conceal level 2: hide LaTeX code fully
},
concealcursor = {
default = "",
rendered = "n", -- Conceal only in normal mode
},
}
})
end,
},
}
File diff suppressed because it is too large Load Diff
+134
View File
@@ -0,0 +1,134 @@
return {
{ "nvim-lua/plenary.nvim", lazy = true },
{ "nvim-tree/nvim-web-devicons", lazy = true, opts = {} },
{
'nvim-mini/mini.extra',
lazy = true,
},
{
'nvim-mini/mini.ai',
lazy = false,
version = '*',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
config = function()
local MiniExtra = require('mini.extra')
local ai = require('mini.ai')
local spec_treesitter = ai.gen_spec.treesitter
ai.setup({
custom_textobjects = {
F = spec_treesitter({ a = '@function.outer', i = '@function.inner' }),
C = spec_treesitter({ a = '@comment.outer', i = '@comment.inner' }),
P = spec_treesitter({ a = '@parameter.outer', i = '@parameter.inner' }),
O = spec_treesitter({ a = '@block.outter', i = '@block.inner' }),
k = spec_treesitter({ a = '@class.outer', i = '@class.inner' }),
o = spec_treesitter({
a = { '@conditional.outer', '@loop.outer' },
i = { '@conditional.inner', '@loop.inner' },
})
}
})
end
},
{
'nvim-mini/mini.move',
lazy = false,
version = '*',
opts = {}
},
{ 'nvim-mini/mini.align', lazy = false, version = '*', opts = {} },
{ 'nvim-mini/mini.bracketed', lazy = false, version = '*', opts = {} },
{
'nvim-mini/mini.operators',
lazy = false,
version = '*',
opts = {
evaluate = { prefix = 'g|', func = nil, },
exchange = { prefix = 'g.', reindent_linewise = true, },
multiply = { prefix = 'gm', func = nil, },
replace = { prefix = 'gk', reindent_linewise = true, },
sort = { prefix = 'gs', func = nil, }
}
},
{
'nvim-mini/mini.surround',
lazy = false,
version = '*',
opts = {
-- Add custom surroundings to be used on top of builtin ones. For more
-- information with examples, see `:h MiniSurround.config`.
-- custom_surroundings = {
-- s = { input = { '%[%[().-()%]%]' }, output = { left = '[[', right = ']]' } },
-- },
mappings = {
add = 'sa', -- Add surrounding in Normal and Visual modes
delete = 'sd', -- Delete surrounding
find = 'sf', -- Find surrounding (to the right)
find_left = 'sF', -- Find surrounding (to the left)
highlight = 'sh', -- Highlight surrounding
replace = 'sr', -- Replace surrounding
update_n_lines = 'sn', -- Update `n_lines`
suffix_last = 'l', -- Suffix to search with "prev" method
suffix_next = 'n', -- Suffix to search with "next" method
},
}
},
{
'nvim-mini/mini.splitjoin',
lazy = false,
version = false,
config = function()
require('mini.splitjoin').setup()
end,
},
{
"nvim-mini/mini.hipatterns",
lazy = false,
event = "BufReadPre",
config = function()
local MiniExtra = require("mini.extra")
local hi_words = MiniExtra.gen_highlighter.words
require('mini.hipatterns').setup({
highlighters = {
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
fixme = hi_words({ 'FIXME', 'Fixme', 'fixme' }, "MiniHipatternsFixme"),
hack = hi_words({ 'HACK', 'Hack', 'hack' }, "MiniHipatternsHack"),
todo = hi_words({ 'TODO', 'Todo', 'todo' }, "MiniHipatternsTodo"),
note = hi_words({ 'NOTE', 'Note', 'note' }, "MiniHipatternsNote"),
done = hi_words({ 'DONE', 'Done', 'done' }, "MiniHipatternsFixme"),
-- Highlight hex color strings (`#rrggbb`) using that color
-- hex_color = hipatterns.gen_highlighter.hex_color(),
},
})
end,
},
{
'nvim-mini/mini.files',
event = 'VeryLazy',
version = '*',
keys = {
{ "-", function() require("mini.files").open(vim.api.nvim_buf_get_name(0)) end, desc = "Open parent directory", mode = "n" },
{ "<leader>-", function() require("mini.files").open() end, desc = "File Explore", mode = "n" },
},
opts = {
mappings = {
go_in = "<CR>", -- Map both Enter and L to enter directories or open files
go_in_plus = "L",
go_out = "-",
go_out_plus = "H",
close = "<Esc>",
},
}
},
{
'nvim-mini/mini.sessions',
version = '*',
lazy = false,
config = function()
require('mini.sessions').setup()
end,
},
}
+89
View File
@@ -0,0 +1,89 @@
return {
{
"al1-ce/just.nvim",
dependencies = {
'nvim-lua/plenary.nvim', -- async jobs
'j-hui/fidget.nvim', -- task progress (optional)
},
config = true
},
{
'mistweaverco/kulala.nvim',
ft = {"http", "rest"},
},
{
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- add options here
-- or leave it empty to use the default settings
},
keys = {
-- suggested keymap
{ "<leader>kp", "<cmd>PasteImage<cr>", desc = "Paste image from system clipboard" },
},
},
{
"uhs-robert/sshfs.nvim",
opts = {
mounts = {
base_dir = vim.fn.expand("$HOME") .. "/Public", -- where remote mounts are created
},
-- Refer to the configuration section below
-- or leave empty for defaults
},
},
{
"esmuellert/codediff.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
cmd = "CodeDiff",
},
{
"https://plugins.ejri.dev/mise.nvim",
keys = {
{ "<leader>xm", "<cmd>Lazy reload mise.nvim<cr>", desc = "Reload mise environment" }
},
opts = {
unset_vars = true,
load_on_setup = true,
force_run = true,
}
},
{
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim', -- required
'sindrets/diffview.nvim',
},
lazy = true,
keys = {
{ '<leader>gn', "<cmd>Neogit kind=auto<cr>", desc = 'Neogit'},
{ '<leader>gN', "<cmd>Neogit kind=floating<cr>", desc = 'Neogit'}
},
opts = {
-- disable_context_highlighting = true,
disable_commit_confirmation = true,
disable_insert_on_commit = false,
disable_signs = true,
integrations = { diffview = true, fz_lua = false },
auto_refresh = false,
console_timeout = 5000,
auto_show_console = false,
sections = {
stashes = {
folded = false,
},
recent = { folded = false },
},
}
},
{
"thunder-coding/zincoxide",
opts = {
zincoxide_cmd = "zoxide",
complete = true,
behaviour = "tabs",
},
cmd = { "Z", "Zg", "Zt", "Zw" },
},
}
+308
View File
@@ -0,0 +1,308 @@
return {
{ 'j-hui/fidget.nvim', lazy = true },
{
"utilyre/barbecue.nvim",
dependencies = {
{ 'SmiteshP/nvim-navic', lazy = true },
},
event = "VeryLazy",
opts = {},
},
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
modes = {
char = {
jump_labels = true,
search = { wrap = true },
highlight = { backdrop = false },
},
search = {
-- when `true`, flash will be activated during regular search by default.
-- You can always toggle when searching with `require("flash").toggle()`
enabled = true,
highlight = { backdrop = false },
jump = { history = true, register = true, nohlsearch = true, autojump = true },
search = {
wrap = true,
-- `forward` will be automatically set to the search direction
-- `mode` is always set to `search`
-- `incremental` is set to `true` when `incsearch` is enabled
},
},
treesitter = {
search = { wrap = true },
}
},
},
-- stylua: ignore
keys = {
{ "<leader>/", mode = { "n" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "s", mode = { "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
{
"folke/snacks.nvim",
opts = {
notifier = {
timeout = 4000,
},
picker = {
win = {
input = {
keys = {
["<a-s>"] = { "flash", mode = { "n", "i" } },
["s"] = { "flash" },
},
},
},
actions = {
flash = function(picker)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "snacks_picker_list"
end,
},
},
action = function(match)
local idx = picker.list:row2idx(match.pos[1])
picker.list:_move(idx, true, true)
end,
})
end,
},
},
},
},
{
'nvim-lualine/lualine.nvim',
event = "VeryLazy",
config = function()
local function truncate_branch_name(branch)
if not branch or branch == "" then
return ""
end
-- Match the branch name to the specified format
local _, _, ticket_number = string.find(branch, "skdillon/sko%-(%d+)%-")
-- If the branch name matches the format, display sko-{ticket_number}, otherwise display the full branch name
if ticket_number then
return "sko-" .. ticket_number
else
return branch
end
end
require("lualine").setup({
options = {
-- theme = "rose-pine",
globalstatus = true,
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "█", right = "█" },
icons_enabled = true,
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
tabline = {
lualine_a = {},
lualine_b = {'branch'},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
},
sections = {
lualine_b = {
{ "branch", icon = "", fmt = truncate_branch_name },
"diff",
"diagnostics",
},
lualine_c = {
{ 'lsp_progress' },
{
'buffers',
show_filename_only = true, -- Shows shortened relative path when set to false.
hide_filename_extension = false, -- Hide filename extension when set to true.
show_modified_status = true, -- Shows indicator when the buffer is modified.
mode = 0,
max_length = vim.o.columns * 2 / 3,
filetype_names = {
TelescopePrompt = '',
},
-- it can also be a function that returns
-- the value of `max_length` dynamically.
use_mode_colors = false,
symbols = {
modified = ' ●', -- Text to show when the buffer is modified
alternate_file = '#', -- Text to show to identify the alternate file
directory = '', -- Text to show when the buffer is a directory
},
},
},
lualine_x = {
"windows",
"fileformat",
"filetype",
},
},
})
end,
},
{
"hedyhli/outline.nvim",
lazy = true,
cmd = { "Outline", "OutlineOpen" },
keys = { -- Example mapping to toggle outline
{ "<leader>so", "<cmd>Outline<CR>", desc = "Toggle outline" },
},
opts = {
symbol_folding = {
-- Unfold entire symbol tree by default with false, otherwise enter a
-- number starting from 1
autofold_depth = false,
-- autofold_depth = 1,
},
},
},
{
'stevearc/quicker.nvim',
ft = "qf",
opts = {},
},
{
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
-- { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
},
{
'akinsho/toggleterm.nvim',
lazy = false,
config = function()
require("toggleterm").setup({
-- highlights = require("rose-pine.plugins.toggleterm"),
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persiste_size = true,
direction = 'horizontal',
close_on_exit = true,
float_opts = {
border = "curved",
}
})
end,
keys = {
{ "<Esc><Esc>", "<c-\\><c-n>", desc = "Escape input", mode = { "t" } }
},
},
{
'ten3roberts/window-picker.nvim',
opts = {
-- Default keys to annotate, keys will be used in order. The default uses the
-- most accessible keys from the home row and then top row.
keys = 'alskdjfhgwoeiruty',
-- Swap windows by holding shift + letter
swap_shift = true,
-- Windows containing filetype to exclude
exclude = { qf = true, NvimTree = true, aerial = true },
-- Flash the cursor line of the newly focused window for 300ms.
-- Set to 0 or false to disable.
flash_duration = 300,
},
keys = {
{ "<leader>a", "<cmd>WindowPick<cr>", desc = "Windows Pick"},
{ "<C-w>a", "<cmd>WindowPick<cr>", desc = "Windows Pick"},
{ "<C-w>D", "<cmd>WindowZap<cr>", desc = "Windows Delete"},
{ "<C-w>S", "<cmd>WindowSwap<cr>", desc = "Windows Swap"},
},
},
{
"folke/which-key.nvim",
event = "VimEnter",
opts = {
icons = {
-- set icon mappings to true if you have a Nerd Font
mappings = vim.g.have_nerd_font,
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
keys = vim.g.have_nerd_font and {} or {
Up = '<Up> ',
Down = '<Down> ',
Left = '<Left> ',
Right = '<Right> ',
C = '<C-…> ',
M = '<M-…> ',
D = '<D-…> ',
S = '<S-…> ',
CR = '<CR> ',
Esc = '<Esc> ',
ScrollWheelDown = '<ScrollWheelDown> ',
ScrollWheelUp = '<ScrollWheelUp> ',
NL = '<NL> ',
BS = '<BS> ',
Space = '<Space> ',
Tab = '<Tab> ',
F1 = '<F1>',
F2 = '<F2>',
F3 = '<F3>',
F4 = '<F4>',
F5 = '<F5>',
F6 = '<F6>',
F7 = '<F7>',
F8 = '<F8>',
F9 = '<F9>',
F10 = '<F10>',
F11 = '<F11>',
F12 = '<F12>',
},
},
spec = {
{ "g", group = "+goto" },
{ "]", group = "+next" },
{ "[", group = "+prev" },
{ "<leader>c", group = "+code", mode = { 'n', 'x' } },
{ "<leader>b", group = "+buffer" },
{ "<leader>f", group = "+find" },
{ "<leader>g", group = "+goto" },
{ "<leader>k", group = "+obsidian" },
{ "<leader>l", group = "+lsp" },
{ "<leader>m", group = "+bookmark" },
{ "<leader>o", group = "+notes" },
{ "<leader>r", group = "+ai" },
{ "<leader>s", group = "+search" },
{ "<leader>t", group = "+trouble" },
{ "<leader>v", group = "+vcs", mode = { 'n', 'v' } },
{ "<leader>w", group = "+workspace" },
{ "<leader>x", group = "+extra" },
{ "<leader>u", group = "+toggle" },
},
},
},
}
+16
View File
@@ -0,0 +1,16 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
-- local f = ls.function_node
return {
s({ trig = "fn", name = "Function", dscr = "Function" }, {
t("fn "),
i(1),
t("() "),
t("{\n"),
t("\t"),
i(0),
t("\n}\n"),
})
}
+92
View File
@@ -0,0 +1,92 @@
local M = {}
local function get_current_time()
return os.date("%H:%M")
end
local function get_active_task_line()
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
local active_lines = {}
for i, line in ipairs(lines) do
if line:match("#status/in%-progress") then
table.insert(active_lines, {line = line, lnum = i})
end
end
if #active_lines == 0 then
print("No active task found (#status/in-progress).")
return nil, "no_active"
elseif #active_lines > 1 then
print("Multiple active tasks found. Please ensure only one task is #status/in-progress.")
return nil, "multiple_active"
else
return active_lines[1].line, active_lines[1].lnum
end
end
function M.create_new_task()
local desc = vim.fn.input("Task Description: ")
if desc == '' then return end
local project = vim.fn.input("Project (leave empty if none, e.g., '[[Project Name]]'): ")
local priority_options = {"high", "medium", "low"}
local priority_idx = vim.fn.inputlist("Priority:", priority_options)
local priority = priority_options[tonumber(priority_idx)] or "medium"
local category_options = {"work", "meeting", "learning", "journal", "focused-work", "break"}
local category_idx = vim.fn.inputlist("Category:", category_options)
local category = category_options[tonumber(category_idx)] or "work"
local new_task_line = string.format("- [ ] %s %s #status/todo #priority/%s #%s",
desc, project, priority, category)
vim.api.nvim_put({new_task_line}, "l", true, true)
print("New task created: " .. new_task_line)
end
function M.start_task()
local current_line, lnum = get_active_task_line()
if not current_line then return end
local new_line = current_line
local current_time = get_current_time()
if new_line:match("start:: %d%d:%d%d") then
print("Task already has a start time. Updating to current time.")
new_line = new_line:gsub("start:: %d%d:%d%d", "start:: " .. current_time)
else
new_line = new_line .. " start:: " .. current_time
end
-- Clear end time if present when starting a task again
new_line = new_line:gsub(" end:: %d%d:%d%d", "")
vim.api.nvim_buf_set_lines(0, lnum - 1, lnum, false, {new_line})
print("Task started/resumed: " .. current_time)
end
function M.stop_task()
local current_line, lnum = get_active_task_line()
if not current_line then return end
local new_line = current_line
local current_time = get_current_time()
if new_line:match("end:: %d%d:%d%d") then
print("Task already has an end time. Updating to current time.")
new_line = new_line:gsub("end:: %d%d:%d%d", "end:: " .. current_time)
else
new_line = new_line .. " end:: " .. current_time
end
-- Option to change status to done
local change_status = vim.fn.confirm("Change status to #status/done?", "&Yes\n&No", 2)
if change_status == 1 then -- Yes
new_line = new_line:gsub("#status/in%-progress", "#status/done")
end
vim.api.nvim_buf_set_lines(0, lnum - 1, lnum, false, {new_line})
print("Task stopped: " .. current_time)
end
return M