feat: add NeoCodeium chat function keymap

This commit is contained in:
2024-09-13 09:18:34 -04:00
parent 07acf6cfa1
commit 1684b05f1b
+40 -21
View File
@@ -182,6 +182,13 @@ M.neocodeium = {
desc = "Cycle or complete (next)", desc = "Cycle or complete (next)",
mode = "i", mode = "i",
}, },
{ -- NeoCodeium Chat
"<leader>ch",
function()
require("neocodeium").chat()
end,
desc = "NeoCodeium Chat",
},
} }
M.foldnav = { M.foldnav = {
@@ -325,23 +332,40 @@ M.lazygit = {
}, },
} }
---@function Helper function to toggle mini.files explorer
---@param ... any Optional arguments to pass to mini.files.open
local minifiles_toggle = function(...)
if not require("mini.files").close() then
require("mini.files").open(...)
end
end
--- MiniFiles keymaps
M.minifiles = { M.minifiles = {
{ {
"<leader>fm", "<leader>fm",
function() function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true) minifiles_toggle(vim.api.nvim_buf_get_name(0), true)
end, end,
desc = "Open mini.files (Directory of Current File)", desc = "Open mini.files (Directory of Current File)",
}, },
{ {
"<leader>fM", "<leader>fM",
function() function()
require("mini.files").open(vim.uv.cwd(), true) minifiles_toggle(vim.uv.cwd(), true)
end, end,
desc = "Open mini.files (cwd)", desc = "Open mini.files (cwd)",
}, },
{ -- Mini.files
"<leader>.",
function()
minifiles_toggle(vim.api.nvim_buf_get_name(0), true)
end,
desc = "Open mini.files",
},
} }
--- Misc keymaps
M.misc = { M.misc = {
{ -- Yank line (without whitespace) { -- Yank line (without whitespace)
lhs = "yo", lhs = "yo",
@@ -384,11 +408,6 @@ M.misc = {
rhs = "<cmd>Neotree reveal toggle<cr>", rhs = "<cmd>Neotree reveal toggle<cr>",
desc = "Neotree toggle", desc = "Neotree toggle",
}, },
{ -- Mini.files
lhs = "<leader>.",
rhs = "<cmd>lua require('mini.files').open()<cr>",
desc = "Open mini.files",
},
{ -- Telescope Frecency { -- Telescope Frecency
lhs = "<leader><leader>", lhs = "<leader><leader>",
rhs = "<cmd>Telescope frecency workspace=CWD<cr>", rhs = "<cmd>Telescope frecency workspace=CWD<cr>",
@@ -485,35 +504,35 @@ M.splits = {
function() function()
require("smart-splits").resize_left() require("smart-splits").resize_left()
end, end,
"Resize split left", desc = "Resize split left",
}, },
{ -- Resize split downwards { -- Resize split downwards
"<A-j>", "<A-j>",
function() function()
require("smart-splits").resize_down() require("smart-splits").resize_down()
end, end,
"Resize split down", desc = "Resize split down",
}, },
{ -- Resize split upwards { -- Resize split upwards
"<A-k>", "<A-k>",
function() function()
require("smart-splits").resize_up() require("smart-splits").resize_up()
end, end,
"Resize split up", desc = "Resize split up",
}, },
{ -- Resize split rightwards { -- Resize split rightwards
"<A-l>", "<A-l>",
function() function()
require("smart-splits").resize_right() require("smart-splits").resize_right()
end, end,
"Resize split right", desc = "Resize split right",
}, },
{ -- Start interactive split resizing { -- Start interactive split resizing
"<A-r>", "<A-r>",
function() function()
require("smart-splits").start_resize_mode() require("smart-splits").start_resize_mode()
end, end,
"Resize split interactively", desc = "Resize split interactively",
}, },
}, },
move = { move = {
@@ -522,35 +541,35 @@ M.splits = {
function() function()
require("smart-splits").move_cursor_left() require("smart-splits").move_cursor_left()
end, end,
"Move to split left", desc = "Move to split left",
}, },
{ -- Move cursor to split below { -- Move cursor to split below
"<C-S-j>", "<C-S-j>",
function() function()
require("smart-splits").move_cursor_down() require("smart-splits").move_cursor_down()
end, end,
"Move to split below", desc = "Move to split below",
}, },
{ -- Move cursor to split above { -- Move cursor to split above
"<C-S-k>", "<C-S-k>",
function() function()
require("smart-splits").move_cursor_up() require("smart-splits").move_cursor_up()
end, end,
"Move to split above", desc = "Move to split above",
}, },
{ -- Move cursor to split right { -- Move cursor to split right
"<C-S-l>", "<C-S-l>",
function() function()
require("smart-splits").move_cursor_right() require("smart-splits").move_cursor_right()
end, end,
"Move to split right", desc = "Move to split right",
}, },
{ -- Move cursor to previous split { -- Move cursor to previous split
"<C-\\>", "<C-\\>",
function() function()
require("smart-splits").move_cursor_previous() require("smart-splits").move_cursor_previous()
end, end,
"Move to previous split", desc = "Move to previous split",
}, },
}, },
swap = { swap = {
@@ -559,28 +578,28 @@ M.splits = {
function() function()
require("smart-splits").swap_buf_left() require("smart-splits").swap_buf_left()
end, end,
"Swap buffer left", desc = "Swap buffer left",
}, },
{ -- Swap buffer with the one below { -- Swap buffer with the one below
"<A-S-j>", "<A-S-j>",
function() function()
require("smart-splits").swap_buf_down() require("smart-splits").swap_buf_down()
end, end,
"Swap buffer down", desc = "Swap buffer down",
}, },
{ -- Swap buffer with the one above { -- Swap buffer with the one above
"<A-S-k>", "<A-S-k>",
function() function()
require("smart-splits").swap_buf_up() require("smart-splits").swap_buf_up()
end, end,
"Swap buffer up", desc = "Swap buffer up",
}, },
{ -- Swap buffer with the one to the right { -- Swap buffer with the one to the right
"<A-S-l>", "<A-S-l>",
function() function()
require("smart-splits").swap_buf_right() require("smart-splits").swap_buf_right()
end, end,
"Swap buffer right", desc = "Swap buffer right",
}, },
}, },
} }