Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"CopilotChat.nvim": { "branch": "main", "commit": "181a523f5bf6b8f277e6a994907c23f9e84d2445" },
"CopilotChat.nvim": { "branch": "main", "commit": "2f3e07398ba81ccc0cf3d1fca9805aaca126264e" },
"ReplaceWithRegister": { "branch": "master", "commit": "832efc23111d19591d495dc72286de2fb0b09345" },
"avante.nvim": { "branch": "main", "commit": "44db8eba870f6c123da5efa70384b2889f3e3495" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "f19cab18ec4dc86d415512c7a572863b2adbcc18" },
"catppuccin": { "branch": "main", "commit": "5af9374957a65be8770696da295dc9016b96f241" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
"copilot.lua": { "branch": "master", "commit": "af3114aeb915beb14fcbc46849c7b08a5e3e2c1a" },
"conform.nvim": { "branch": "master", "commit": "3bad87250ed85246fe8c5bc10005ab5a6289ae4c" },
"copilot.lua": { "branch": "master", "commit": "36c220b816d07989186731ca771c15e2df419d68" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"emmet-vim": { "branch": "master", "commit": "e98397144982d1e75b20d94d55a82de3ec8f648d" },
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
"gitsigns.nvim": { "branch": "main", "commit": "23ae90a2a52fdc9b8c50dc61d6c30ebb18521343" },
"glance.nvim": { "branch": "master", "commit": "bf86d8b79dce808e65fdb6e9269d0b4ed6d2eefc" },
"grug-far.nvim": { "branch": "main", "commit": "50d9ee2b5a19634670441948e7e4afaa042f1059" },
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
Expand All @@ -26,40 +26,41 @@
"lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f760507df8c49a4bf46a4d12e1fc616797508979" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
"mcphub.nvim": { "branch": "main", "commit": "5e39057c4405bc7b83ef9fd38a37d18c9330e403" },
"mini.nvim": { "branch": "main", "commit": "80a11490e44a7fe8c911a3b4a827c56df3894058" },
"mason.nvim": { "branch": "main", "commit": "b3689a41dd77e5294498dba9757fb22cc80cbebd" },
"mcphub.nvim": { "branch": "main", "commit": "8ff40b5edc649959bb7e89d25ae18e055554859a" },
"mini.nvim": { "branch": "main", "commit": "228a8c34fae1d778e895ad06e4158f65e85828bc" },
"neovim-ayu": { "branch": "master", "commit": "cc78e880cce5dfc1187d144ed7251c746feff259" },
"nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"none-ls.nvim": { "branch": "main", "commit": "78111a97cebed3dfda8157af8141bf1915cfc327" },
"none-ls.nvim": { "branch": "main", "commit": "88e2508bd1754e2643e54e9f181e64bbda118ab9" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-dap": { "branch": "master", "commit": "7367cec8e8f7a0b1e4566af9a7ef5959d11206a7" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" },
"nvim-lspconfig": { "branch": "master", "commit": "107c2458cdc780c4ed2c2b5e1b7800cd019010bd" },
"nvim-lspconfig": { "branch": "master", "commit": "336b388c272555d2ae94627a50df4c2f89a5e257" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
"nvim-web-devicons": { "branch": "master", "commit": "f6b0920f452bfd7595ee9a9efe5e1ae78e0e2997" },
"opencode.nvim": { "branch": "main", "commit": "3a2303ab671a43ca0d766b98e754c4af2f3201ec" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"quick-scope": { "branch": "master", "commit": "6cee1d9e0b9ac0fbffeb538d4a5ba9f5628fabbc" },
"render-markdown.nvim": { "branch": "main", "commit": "67f2c7c8850bb11eefa6b22054a6f4cef1146de2" },
"snacks.nvim": { "branch": "main", "commit": "d67a47739dfc652cfcf66c59e929c704a854b37a" },
"render-markdown.nvim": { "branch": "main", "commit": "9ab9dade85d8c7d411cc89b592028da3d1b7955a" },
"snacks.nvim": { "branch": "main", "commit": "5e0e8698526f350f1280ad1ef7a8670f857c9445" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "f64efd33a51ea89bdb847fb3aaf716e96b83ba1a" },
"tokyonight.nvim": { "branch": "main", "commit": "14fd5ff7f84027064724ec3157fe903199e77ded" },
"tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "29315861711f11daf75e1cf0953ab92ec1a3e69f" },
"tokyonight.nvim": { "branch": "main", "commit": "4d159616aee17796c2c94d2f5f87d2ee1a3f67c7" },
"vim-highlightedyank": { "branch": "master", "commit": "285a61425e79742997bbde76a91be6189bc988fb" },
"vim-peekaboo": { "branch": "master", "commit": "2a8a3187ba6b15201b2563a3f0331fcdf49da36c" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vscode-js-debug": { "branch": "main", "commit": "1032e9280164bb2e14472aab8bf71dfdabf1f254" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }
"vscode-js-debug": { "branch": "main", "commit": "e48cf24bf2d7ca773270bad01716a68fa3a8518a" },
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" },
"zen-mode.nvim": { "branch": "main", "commit": "dfcb72a2dfeedc5342b2ee3a68c83243d682ba3c" }
}
2 changes: 0 additions & 2 deletions nvim/lua/nairovim/core/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
local opt = vim.opt
local g = vim.g

vim.o.winborder = "rounded"

g.mapleader = ","
g.maplocalleader = " "

Expand Down
9 changes: 5 additions & 4 deletions nvim/lua/nairovim/plugins/ai/avante.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,14 @@ return {
end

local workspace = require("nairovim.utils.workspace")
local github_workspace_dir = workspace.find_closest_dir_by_name(".github")
if not github_workspace_dir then
print("No .github directory found in the workspace")
local copilot_instructions_path =
workspace.find_file_in_closest_dir(".github", "copilot-instructions.md")
if not copilot_instructions_path then
print("No copilot-instructions.md found in the .github directory")
return
end

avante.get().file_selector:add_selected_file(github_workspace_dir)
avante.get().file_selector:add_selected_file(copilot_instructions_path)
M.SELECTED_FILES_INITIALIZED = true
end,
})
Expand Down
55 changes: 55 additions & 0 deletions nvim/lua/nairovim/plugins/ai/opencode.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
-- return {
-- "sudo-tee/opencode.nvim",
-- config = function()
-- require("opencode").setup({})
-- end,
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- {
-- "MeanderingProgrammer/render-markdown.nvim",
-- opts = {
-- anti_conceal = { enabled = false },
-- file_types = { "markdown", "opencode_output" },
-- },
-- ft = { "markdown", "Avante", "copilot-chat", "opencode_output" },
-- },
-- -- Optional, for file mentions and commands completion, pick only one
-- "saghen/blink.cmp",
-- -- 'hrsh7th/nvim-cmp',
--
-- -- Optional, for file mentions picker, pick only one
-- "folke/snacks.nvim",
-- -- 'nvim-telescope/telescope.nvim',
-- -- 'ibhagwan/fzf-lua',
-- -- 'nvim_mini/mini.nvim',
-- },
-- }
-- OpenCode.nvim configuration for AI-powered coding assistance
-- Provides interactive AI chat and code generation capabilities within Neovim
return {
"NickvanDyke/opencode.nvim",
dependencies = {
-- Recommended for better prompt input, and required to use `opencode.nvim`'s embedded terminal — otherwise optional
{ "folke/snacks.nvim", opts = { input = { enabled = true } } },
},
config = function()
-- Global configuration options for opencode.nvim
-- Can be customized with various settings (see lua/opencode/config.lua for available options)
vim.g.opencode_opts = {
-- Your configuration, if any — see `lua/opencode/config.lua`
}

-- Enable automatic file reloading when files are changed externally
-- Required for opencode's auto_reload functionality to work properly
vim.opt.autoread = true

----------------------------------------------------------------------
-- Keymaps
----------------------------------------------------------------------
-- Load custom keybinding configurations for opencode functionality
local mappings = require("nairovim.plugins.customizations.keymaps.opencode").mappings
local common_utils = require("nairovim.utils.common")
-- Apply the keymaps using the common utility function
common_utils.map(mappings)
end,
}
118 changes: 118 additions & 0 deletions nvim/lua/nairovim/plugins/customizations/keymaps/opencode.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
----------------------------------------------------------------------
-- 1. OpenCode AI Keymaps (nairovim.KeymapDef[])
----------------------------------------------------------------------
local M = {}

---@type nairovim.KeymapDef[]
M.mappings = {
-- OpenCode AI - Toggle
{
mode = "n",
key_sequence = "<leader>ot",
handler = function()
require("opencode").toggle()
end,
opts = { desc = "Toggle" },
},
-- OpenCode AI - Ask (general)
{
mode = "n",
key_sequence = "<leader>oA",
handler = function()
require("opencode").ask()
end,
opts = { desc = "Ask" },
},
-- OpenCode AI - Ask about cursor
{
mode = "n",
key_sequence = "<leader>oa",
handler = function()
require("opencode").ask("@cursor: ")
end,
opts = { desc = "Ask about this" },
},
-- OpenCode AI - Ask about selection
{
mode = "v",
key_sequence = "<leader>oa",
handler = function()
require("opencode").ask("@selection: ")
end,
opts = { desc = "Ask about selection" },
},
-- OpenCode AI - Add buffer to prompt
{
mode = "n",
key_sequence = "<leader>o+",
handler = function()
require("opencode").append_prompt("@buffer")
end,
opts = { desc = "Add buffer to prompt" },
},
-- OpenCode AI - Add selection to prompt
{
mode = "v",
key_sequence = "<leader>o+",
handler = function()
require("opencode").append_prompt("@selection")
end,
opts = { desc = "Add selection to prompt" },
},
-- OpenCode AI - New session
{
mode = "n",
key_sequence = "<leader>on",
handler = function()
require("opencode").command("session_new")
end,
opts = { desc = "New session" },
},
-- OpenCode AI - Copy last response
{
mode = "n",
key_sequence = "<leader>oy",
handler = function()
require("opencode").command("messages_copy")
end,
opts = { desc = "Copy last response" },
},
-- OpenCode AI - Messages half page up
{
mode = "n",
key_sequence = "<S-C-u>",
handler = function()
require("opencode").command("messages_half_page_up")
end,
opts = { desc = "Messages half page up" },
},
-- OpenCode AI - Messages half page down
{
mode = "n",
key_sequence = "<S-C-d>",
handler = function()
require("opencode").command("messages_half_page_down")
end,
opts = { desc = "Messages half page down" },
},
-- OpenCode AI - Select prompt
{
mode = { "n", "v" },
key_sequence = "<leader>os",
handler = function()
require("opencode").select()
end,
opts = { desc = "Select prompt" },
},
-- OpenCode AI - Explain code (custom prompt)
{
mode = "n",
key_sequence = "<leader>oe",
handler = function()
require("opencode").prompt("Explain @cursor and its context")
end,
opts = { desc = "Explain this code" },
},
}

return M
1 change: 1 addition & 0 deletions nvim/lua/nairovim/plugins/lsp/mason.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ return {
----------------------------------------------------------------------
mason_lspconfig.setup({
ensure_installed = ensure_lsp,
automatic_enablement = true,
})

----------------------------------------------------------------------
Expand Down