Compare commits

...

3 Commits

Author SHA1 Message Date
9bae49fa30 update 2025-02-20 19:20:58 -08:00
d3ace6bbc8 update keymaps 2025-02-20 19:20:54 -08:00
b29d79a356 fix codecompanion fidget spinner 2025-02-20 19:20:49 -08:00
5 changed files with 143 additions and 96 deletions

View File

@@ -2,14 +2,14 @@
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "d72341852556e2dfe19f779cc682c16dd58548fc" },
"catppuccin": { "branch": "main", "commit": "4bb938bbba41d306db18bf0eb0633a5f28fd7ba0" },
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"codecompanion.nvim": { "branch": "main", "commit": "f79fd321c772c18e1520a08eea2ec06a7edb162e" },
"codecompanion.nvim": { "branch": "main", "commit": "67a747eeab28456971979c8ee03c648135e8687c" },
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
"copilot-lualine": { "branch": "main", "commit": "dc4b8ed0f75bc2557b3158c526624bf04ad233ea" },
"copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" },
@@ -17,7 +17,7 @@
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "c3070fcc2e7da1798041219fde8d88f2e4bf7eb5" },
"gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" },
"goto-preview": { "branch": "main", "commit": "4751e70a6ebce4fb78327b097cb8fdff55f38f3a" },
"image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" },
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
@@ -27,7 +27,7 @@
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
"mini.diff": { "branch": "main", "commit": "bc3a7be30fd45ed4961ea90de1d9d04637cdeae6" },
"mini.nvim": { "branch": "main", "commit": "a84b7e555fe382c1859e6ca46b4983c822a1f77f" },
"mini.nvim": { "branch": "main", "commit": "dc1775613f672e6a804577945813353c5c4e6fe5" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"none-ls.nvim": { "branch": "main", "commit": "f41624ea1a73f020ddbd33438f74abb95ea17d55" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
@@ -36,11 +36,11 @@
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-html-css": { "branch": "main", "commit": "fa7e2da75edfd3d110fc8d4f8e5215b5de56ff42" },
"nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" },
"nvim-lspconfig": { "branch": "master", "commit": "1110787f1b464888c59a044c48c5119d14078044" },
"nvim-lspconfig": { "branch": "master", "commit": "7c8cb61b21727a473663054edec4b83633d9e442" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
"nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" },
"nvim-treesitter": { "branch": "master", "commit": "a15dd9280f369fef4640e64de794f69456ecdf7a" },
"nvim-treesitter": { "branch": "master", "commit": "bf18d4dc8d9a7a61e855190bc154df12d6536741" },
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"odis": { "branch": "master", "commit": "5176a07a729860d0c0cdefe96252fc7ff9e16d43" },

View File

@@ -15,6 +15,7 @@ vim.g.maplocalleader = ","
-- Custom commands
vim.api.nvim_create_user_command("Config", "edit ~/.config/nvim", {})
vim.api.nvim_create_user_command("Keymaps", "edit ~/.config/nvim/lua/core/keymaps.lua", {})
vim.api.nvim_create_user_command("Hypr", "edit ~/.config/hypr/hyprland.conf", {})
-- {{{ Basic Mappings
local basic_mappings = {
@@ -42,20 +43,20 @@ local buffer_navigation_mappings = {
--{{{ Terminal Mappings
local terminal_mappings = {
{
key = "op",
cmd = "<C-\\><C-N>:ToggleTerm name=ipython",
desc = "Open IPython",
mode = "v",
group = "Open",
},
{
key = "oP",
cmd = "<C-\\><C-N>:ToggleTerm name=ipython-full",
desc = "Open full IPython",
mode = "v",
group = "Open",
},
-- {
-- key = "op",
-- cmd = "<C-\\><C-N>:ToggleTerm name=ipython",
-- desc = "Open IPython",
-- mode = "v",
-- group = "Open",
-- },
-- {
-- key = "oP",
-- cmd = "<C-\\><C-N>:ToggleTerm name=ipython-full",
-- desc = "Open full IPython",
-- mode = "v",
-- group = "Open",
-- },
{
key = "<C-T>",
cmd = ":ToggleTerm name=toggleterm<CR>",
@@ -224,116 +225,126 @@ local code_companion_mappings = {
}
-- }}}
--{{{ Telescope mappings
-- {{{ Telescope mappings
local telescope_mappings = {
{ mode = "n", key = "//", cmd = ":Telescope current_buffer_fuzzy_find previewer=false<CR>" },
{ mode = "n", key = "??", cmd = ":Telescope lsp_document_symbols theme=dropdown layout_config={width=0.5}<CR>" },
{
mode = "n",
key = "//",
cmd = ":Telescope current_buffer_fuzzy_find previewer=false<CR>",
"Current buffer fuzzy find",
},
{
mode = "n",
key = "??",
cmd = ":Telescope lsp_document_symbols theme=dropdown layout_config={width=0.5}<CR>",
group = "Lsp document symbols",
},
{
mode = "n",
key = "<leader>fc",
cmd = ':Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical<CR>',
group = "Find",
group = "Telescope color names",
},
{
mode = "n",
key = "<leader>Tc",
cmd = ":Telescope colorscheme<CR>",
group = "Telescope",
group = "Telescope colorscheme",
},
{
mode = "n",
key = "<leader>TC",
cmd = ':Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical<CR>',
group = "Telescope",
group = "Telescope color names",
},
{
mode = "n",
key = "<leader>Tn",
cmd = ":Telescope notify theme=dropdown layout_config={width=0.75}<CR>",
group = "Telescope",
group = "Telescope notify",
},
{
mode = "n",
key = "<leader>TN",
cmd = ":Telescope noice theme=dropdown layout_config={width=0.75}<CR>",
group = "Telescope",
group = "Telescope Noice",
},
{
mode = "n",
key = "<leader>ff",
cmd = ":Telescope find_files find_command=rg,--ignore,--follow,--hidden,--files prompt_prefix=🔍<CR>",
group = "Find",
group = "Find files",
},
{ mode = "n", key = "<leader>fg", cmd = ":Telescope live_grep<CR>", group = "Find" },
{ mode = "n", key = "<leader>fg", cmd = ":Telescope live_grep<CR>", group = "Live Grep" },
{
mode = "n",
key = "<leader>Tg",
cmd = ':Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical<CR>',
group = "Telecope",
group = "Telescope Glyph",
},
{
mode = "n",
key = "<leader>fG",
cmd = ':Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical<CR>',
group = "Find",
group = "Glhph",
},
{ mode = "n", key = "<leader>fb", cmd = ":Telescope file_browser<CR>", group = "Find" },
{ mode = "n", key = "<leader>fb", cmd = ":Telescope file_browser<CR>", group = "File browser" },
{
mode = "n",
key = "<leader>fr",
cmd = ":Telescope oldfiles theme=dropdown layout_config={width=0.5}<CR>",
group = "Find",
group = "Oldfiles",
},
{
mode = "n",
key = "<leader>hc",
cmd = ":Telescope commands<CR>",
group = "Help",
group = "Commands",
},
{
mode = "n",
key = "<leader>hv",
cmd = ":Telescope vim_options<CR>",
group = "Help",
group = "Vim options",
},
{
mode = "n",
key = "<leader>hk",
cmd = ":Telescope keymaps<CR>",
group = "Help",
group = "Keymaps",
},
{
mode = "n",
key = "<leader>hs",
cmd = ":Telescope spell_suggest<CR>",
group = "Help",
group = "Spell suggest",
},
{
mode = "n",
key = "<leader>ht",
cmd = ":Telescope help_tags<CR>",
group = "Help",
group = "Help tags",
},
{
mode = "n",
key = "<leader>hm",
cmd = ":Telescope man_pages theme=dropdown layout_config={width=0.75}<CR>",
group = "Help",
group = "Man pages",
},
{
mode = "n",
key = "<leader>sf",
cmd = ":Telescope find_files find_command=rg,--ignore,--follow,--hidden,--files prompt_prefix=🔍<CR>",
group = "Search",
group = "Search files",
},
{ mode = "n", key = "<leader>sF", cmd = ":Telescope fidget<CR>", group = "Search" },
{ mode = "n", key = "<leader>sg", cmd = ":Telescope live_grep<CR>", group = "Search" },
{ mode = "n", key = "<leader>sh", cmd = ":Telescope command_history<CR>", group = "Search" },
{ mode = "n", key = "<leader>sm", cmd = ":Telescope man_pages<CR>", group = "Search" },
{ mode = "n", key = "<leader>s/", cmd = ":Telescope search_history<CR>", group = "Search" },
{ mode = "n", key = "<leader>gc", cmd = ":Telescope git_commits<CR>", group = "Git" },
{ mode = "n", key = "<leader>gf", cmd = ":Telescope git_files<CR>", group = "Git" },
{ mode = "n", key = "<leader>Tr", cmd = ":Telescope reloader<CR>", group = "Telescope" },
{ mode = "n", key = "<leader>sF", cmd = ":Telescope fidget<CR>", group = "Fidget" },
{ mode = "n", key = "<leader>sg", cmd = ":Telescope live_grep<CR>", group = "Live grep" },
{ mode = "n", key = "<leader>sh", cmd = ":Telescope command_history<CR>", group = "Command history" },
{ mode = "n", key = "<leader>sm", cmd = ":Telescope man_pages<CR>", group = "Man pages" },
{ mode = "n", key = "<leader>s/", cmd = ":Telescope search_history<CR>", group = "Search history" },
{ mode = "n", key = "<leader>gc", cmd = ":Telescope git_commits<CR>", group = "Git commits" },
{ mode = "n", key = "<leader>gf", cmd = ":Telescope git_files<CR>", group = "Git files" },
{ mode = "n", key = "<leader>Tr", cmd = ":Telescope reloader<CR>", group = "Telescope reloader" },
}
--}}}
@@ -462,12 +473,20 @@ local diffview_mappings = {
--{{{ Custom Terminals
local programs_map = {
gg = { cmd = "lazygit", display_name = "lazygit", direction = "tab", hidden = true, group = "Git" },
op = { cmd = "ipython", display_name = "ipython", direction = "vertical", hidden = true, group = "Open" },
oP = { cmd = "ipython", display_name = "ipython-full", direction = "tab", hidden = true, group = "Open" },
on = { cmd = "ncmpcpp", display_name = "ncmpcpp", direction = "tab", hidden = true, group = "Open" },
ob = { cmd = "btop", display_name = "btop", direction = "tab", hidden = true, group = "Open" },
od = { cmd = "lazydocker", display_name = "lazydocker", direction = "tab", hidden = true },
gg = { cmd = "lazygit", display_name = "lazygit", direction = "tab", hidden = true, group = "Lazygit" },
op = { cmd = "ipython", display_name = "ipython", direction = "vertical", hidden = true, group = "Ipython" },
oP = {
cmd = "ipython",
display_name = "ipython-full",
direction = "tab",
hidden = true,
group = "Ipython Fullscreen",
},
oi = { cmd = "sudo iotop", display_name = "ncmpcpp", direction = "tab", hidden = true, group = "Ncmpcpp" },
on = { cmd = "ncmpcpp", display_name = "ncmpcpp", direction = "tab", hidden = true, group = "Ncmpcpp" },
oN = { cmd = "nvtop", display_name = "nvtop", direction = "tab", hidden = true, group = "Nvtop" },
ob = { cmd = "/usr/bin/btop", display_name = "btop", direction = "tab", hidden = true, group = "Btop" },
od = { cmd = "lazydocker", display_name = "lazydocker", direction = "tab", hidden = true, group = "Lazydocker" },
}
for key, value in pairs(programs_map) do
@@ -478,24 +497,13 @@ end
local tbl = {}
for key, value in pairs(programs_map) do
local temp = {}
if key == "gg" then
temp = {
cmd = value.cmd,
key = "<leader>" .. key,
group = value.group,
mode = "n",
desc = "Open " .. value.display_name,
}
else
temp = {
cmd = value.cmd,
key = "<leader>" .. key,
group = value.group,
mode = "n",
desc = "Open " .. value.display_name,
}
end
local temp = {
cmd = value.cmd,
key = "<leader>" .. key,
group = value.group,
mode = "n",
desc = "Open " .. value.display_name,
}
table.insert(tbl, temp)
end
add_to_whichkey(tbl, { key = "<leader>o", group = "Open" })
@@ -523,7 +531,12 @@ add_to_whichkey(nil, { key = "<leader>gg", group = "Lazygit" })
add_to_whichkey(nil, { key = "<leader>h", group = "Help" })
add_to_whichkey(nil, { key = "<leader>j", group = "AnyJump" })
add_to_whichkey(nil, { key = "<leader>N", group = "Noice" })
add_to_whichkey(nil, { key = "<leader>o", group = "Open" })
-- add_to_whichkey(nil, { key = "<leader>o", group = "Open" })
add_to_whichkey(nil, { key = "<leader>ob", group = "Btop" })
add_to_whichkey(nil, { key = "<leader>on", group = "Ncmpcpp" })
add_to_whichkey(nil, { key = "<leader>od", group = "Lazydocker" })
add_to_whichkey(nil, { key = "<leader>op", group = "Ipython" })
add_to_whichkey(nil, { key = "<leader>oP", group = "Ipython Full" })
add_to_whichkey(nil, { key = "<leader>p", group = "Paste in Place" })
add_to_whichkey(nil, { key = "<leader>s", group = "Search" })
add_to_whichkey(nil, { key = "<leader>t", group = "Terminal" })

View File

@@ -10,6 +10,7 @@ return {
copilot = function()
return require("codecompanion.adapters").extend("copilot", {
schema = {
name = "copilot",
model = {
default = "claude-3.5-sonnet",
-- default = "o3-mini-2025-01-31",
@@ -22,9 +23,9 @@ return {
"gemini-2.0-flash-001",
},
},
max_tokens = {
default = 65536,
},
-- max_tokens = {
-- default = 65536,
-- },
},
})
end,
@@ -76,7 +77,7 @@ return {
show_header_separator = false, -- Show header separators in the chat buffer? Set this to false if you're using an external markdown formatting plugin
separator = "", -- The separator between the different messages in the chat buffer
show_references = true, -- Show references (from slash commands and variables) in the chat buffer?
show_settings = true, -- Show LLM settings at the top of the chat buffer?
show_settings = false, -- Show LLM settings at the top of the chat buffer?
show_token_count = true, -- Show the token count for each response?
start_in_insert_mode = false, -- Open the chat buffer in insert mode?
},

View File

@@ -1,7 +1,14 @@
local notify = require("notify")
local spinner_frames = { "", "", "", "", "", "", "", "", "", "" }
local spinner_len = #spinner_frames -- cache spinner length
local M = {}
local timeout = 3000
local timeout = 2999
-- Helper function to safely call notify
local function safe_notify(msg, level, opts)
local ok, res = pcall(notify, msg, level, opts)
return ok, res
end
function M:init()
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
@@ -41,29 +48,38 @@ function M:pop_progress_handle(id)
end
function M:create_progress_handle(request)
local title = " Requesting assistance (" .. request.data.strategy .. ")"
local title = " Requesting assistance"
.. " ("
.. request.data.strategy
.. ") from "
.. request.data.adapter.formatted_name
.. " using "
.. request.data.adapter.model
local idx = 1
local notification_id = notify(spinner_frames[idx] .. " In progress...", "info", { title = title, timeout = false })
local handle = { notification_id = notification_id, title = title }
local handle = { notification_id = notification_id, title = title, finished = false }
local timer = vim.loop.new_timer()
if timer == nil then
return
end
timer:start(
0,
100,
vim.schedule_wrap(function()
idx = idx % #spinner_frames + 1
local new_id = notify(
spinner_frames[idx] .. " In progress...",
"info",
{ replace = handle.notification_id, title = title, timeout = false }
)
handle.notification_id = new_id
if handle.finished then
return
end -- stop updating if finished
idx = idx % spinner_len + 1
local opts = { replace = handle.notification_id, title = title, timeout = false }
local ok, new_id = safe_notify(spinner_frames[idx] .. " In progress...", "info", opts)
if ok then
handle.notification_id = new_id
else
handle.notification_id =
notify(spinner_frames[idx] .. " In progress...", "info", { title = title, timeout = false })
end
end)
)
handle.timer = timer
handle.finish = function()
handle.finished = true -- mark as finished to abort future updates
if handle.timer then
handle.timer:stop()
handle.timer:close()
@@ -74,13 +90,30 @@ function M:create_progress_handle(request)
end
function M:report_exit_status(handle, request)
local title = handle.title or (" Requesting assistance (" .. request.data.strategy .. ")")
local title = handle.title
or (
" Requesting assistance"
.. " ("
.. request.data.strategy
.. ") from "
.. request.data.adapter.formatted_name
.. " using "
.. request.data.adapter.model
)
local function report(msg, level)
local opts = { replace = handle.notification_id, title = title, timeout = timeout }
local ok = safe_notify(msg, level, opts)
if not ok then
notify(msg, level, { title = title, timeout = timeout })
end
end
if request.data.status == "success" then
notify("Completed", "info", { replace = handle.notification_id, title = title, timeout = timeout })
report("Completed", "info")
elseif request.data.status == "error" then
notify(" Error", "error", { replace = handle.notification_id, title = title, timeout = timeout })
report(" Error", "error")
else
notify("󰜺 Cancelled", "warn", { replace = handle.notification_id, title = title, timeout = timeout })
report("󰜺 Cancelled", "warn")
end
end

View File

@@ -14,7 +14,7 @@ return {
minimum_width = 50,
render = "default",
stages = "fade_in_slide_out",
timeout = 5000,
timeout = 3000,
top_down = true,
},
}