diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 7388724a..2562ac33 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -16,20 +16,24 @@ require("lazy").setup({ spec = { { "LazyVim/LazyVim", import = "lazyvim.plugins" }, { import = "lazyvim.plugins.extras.coding.copilot" }, + { import = "lazyvim.plugins.extras.coding.copilot-chat" }, { import = "lazyvim.plugins.extras.coding.mini-surround" }, { import = "lazyvim.plugins.extras.dap.core" }, { import = "lazyvim.plugins.extras.editor.aerial" }, + { import = "lazyvim.plugins.extras.editor.illuminate" }, { import = "lazyvim.plugins.extras.editor.leap" }, { import = "lazyvim.plugins.extras.test.core" }, { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, { import = "lazyvim.plugins.extras.lang.ansible" }, { import = "lazyvim.plugins.extras.lang.docker" }, { import = "lazyvim.plugins.extras.lang.helm" }, + { import = "lazyvim.plugins.extras.lang.json" }, { import = "lazyvim.plugins.extras.lang.markdown" }, { import = "lazyvim.plugins.extras.lang.python" }, { import = "lazyvim.plugins.extras.lang.rust" }, { import = "lazyvim.plugins.extras.lang.terraform" }, { import = "lazyvim.plugins.extras.lang.toml" }, + { import = "lazyvim.plugins.extras.lang.yaml" }, { import = "plugins" }, }, defaults = { diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua index cd556d18..953914a9 100644 --- a/.config/nvim/lua/plugins/editor.lua +++ b/.config/nvim/lua/plugins/editor.lua @@ -41,230 +41,6 @@ return { opts = { user_default_options = { names = false } }, keys = { { "<leader>uH", "<cmd>ColorizerToggle<cr>", desc = "Toggle Colorizer" } }, }, - { - "CopilotC-Nvim/CopilotChat.nvim", - dependencies = { - { "zbirenbaum/copilot.lua" }, - { "nvim-lua/plenary.nvim" }, - { - "folke/which-key.nvim", - optional = true, - opts = { defaults = { ["<leader>a"] = { name = "+ai" }, ["<leader>ac"] = { name = "+copilot" } } }, - }, - }, - keys = { - { "<leader>acc", "<cmd>CopilotChatToggle<cr>", desc = "Toggle Chat", mode = { "n", "v" } }, - { "<leader>acx", "<cmd>CopilotChatReset<cr>", desc = "Reset Chat", mode = { "n", "v" } }, - { "<leader>acf", "<cmd>CopilotChatFix<cr>", desc = "Fix Selection", mode = { "v" } }, - { "<leader>ace", "<cmd>CopilotChatExplain<cr>", desc = "Explain Selection", mode = { "v" } }, - { "<leader>acr", "<cmd>CopilotChatExplain<cr>", desc = "Review Selection", mode = { "v" } }, - { "<leader>aco", "<cmd>CopilotChatOptimize<cr>", desc = "Optimize Selection", mode = { "v" } }, - { "<leader>acd", "<cmd>CopilotChatDocs<cr>", desc = "Document Selection", mode = { "v" } }, - { "<leader>act", "<cmd>CopilotChatTests<cr>", desc = "Unittest Selection", mode = { "v" } }, - }, - opts = { - window = { - layout = "float", - width = 0.9, - height = 0.8, - }, - mappings = { - complete = { - detail = "Use @<Tab> or /<Tab> for options.", - insert = "<Tab>", - }, - close = { - normal = "q", - insert = "<C-c>", - }, - reset = { - normal = "<C-l>", - insert = "<C-l>", - }, - submit_prompt = { - normal = "<CR>", - insert = "<C-CR>", - }, - accept_diff = { - normal = "<C-y>", - insert = "<C-y>", - }, - yank_diff = { - normal = "gy", - }, - show_diff = { - normal = "gd", - }, - show_system_prompt = { - normal = "gp", - }, - show_user_selection = { - normal = "gs", - }, - }, - }, - }, - { - "jackMort/ChatGPT.nvim", - cmd = { "ChatGPT", "ChatGPTActAs", "ChatGPTEditWithInstructions", "ChatGPTRun" }, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "folke/trouble.nvim", - "nvim-telescope/telescope.nvim", - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["<leader>a"] = { name = "+ai" }, - ["<leader>ag"] = { name = "+chatgpt" }, - ["<leader>agt"] = { name = "+translate" }, - }, - }, - }, - }, - config = function(_, opts) - local key = require("lib").get_secret("openai") - if key then - require("chatgpt.api").OPENAI_API_KEY = key - require("chatgpt.api").AUTHORIZATION_HEADER = "Authorization: Bearer " .. key - require("chatgpt").setup(opts) - end - end, - --stylua: ignore - keys = { - { "<leader>agc", function() require("chatgpt").openChat() end, desc = "Toggle Chat" }, - { "<leader>age", function() require("chatgpt").edit_with_instructions() end, desc = "Edit with instruction", mode = { "n", "v" } }, - { "<leader>agg", function() require("chatgpt").run_action("grammar_correction") end, desc = "Grammar Correction", mode = { "n", "v" } }, - { "<leader>agtg", function() require("chatgpt").run_action({ fargs = { "translate", "german" } }) end, desc = "German", mode = { "n", "v" } }, - { "<leader>agte", function() require("chatgpt").run_action({ fargs = { "translate", "english" } }) end, desc = "English", mode = { "n", "v" } }, - { "<leader>agtf", function() require("chatgpt").run_action({ fargs = { "translate", "french" } }) end, desc = "French", mode = { "n", "v" } }, - { "<leader>agtr", function() require("chatgpt").run_action({ fargs = { "translate", "russian" } }) end, desc = "Russian", mode = { "n", "v" } }, - { "<leader>agk", function() require("chatgpt").run_action({ fargs = { "keywords" } }) end, desc = "Keywords", mode = { "n", "v" } }, - { "<leader>agd", function() require("chatgpt").run_action({ fargs = { "docstring" } }) end, desc = "Docstring", mode = { "n", "v" } }, - { "<leader>aga", function() require("chatgpt").run_action({ fargs = { "add_tests" } }) end, desc = "Add Tests", mode = { "n", "v" } }, - { "<leader>ago", function() require("chatgpt").run_action({ fargs = { "optimize_code" } }) end, desc = "Optimize Code", mode = { "n", "v" } }, - { "<leader>ags", function() require("chatgpt").run_action({ fargs = { "summarize" } }) end, desc = "Summarize", mode = { "n", "v" } }, - { "<leader>agf", function() require("chatgpt").run_action({ fargs = { "fix_bugs" } }) end, desc = "Fix Bugs", mode = { "n", "v" } }, - { "<leader>agx", function() require("chatgpt").run_action({ fargs = { "explain_code" } }) end, desc = "Explain Code", mode = { "n", "v" } }, - { "<leader>agr", function() require("chatgpt").run_action({ fargs = { "roxygen_edit" } }) end, desc = "Roxygen Edit", mode = { "n", "v" } }, - { "<leader>agl", function() require("chatgpt").run_action({ fargs = { "code_readability_analysis" } }) end, desc = "Code Readability Analysis", mode = { "n", "v" } }, - }, - opts = { - edit_with_instructions = { - keymaps = { - close = "<C-c>", - accept = "<C-y>", - toggle_diff = "<C-d>", - toggle_settings = "<C-o>", - toggle_help = "<C-.>", - cycle_windows = "<Tab>", - use_output_as_input = "<C-,>", - }, - }, - chat = { - question_sign = "", - answer_sign = "", - sessions_window = { - active_sign = " ", - inactive_sign = " ", - current_line_sign = "", - border = { - style = "single", - }, - win_options = { - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", - }, - }, - keymaps = { - close = "<C-c>", - yank_last = "<C-y>", - yank_last_code = "<C-p>", - scroll_up = "<C-u>", - scroll_down = "<C-d>", - new_session = "<C-g>", - cycle_windows = "<Tab>", - cycle_modes = "<C-f>", - next_message = "<C-n>", - prev_message = "<C-p>", - select_session = "<Space>", - rename_session = "r", - delete_session = "d", - draft_message = "<C-r>", - edit_message = "e", - delete_message = "d", - toggle_settings = "<C-o>", - toggle_sessions = "<C-s>", - toggle_help = "<C-.>", - toggle_message_role = "<C-,>", - toggle_system_role_open = "<C-'>", - stop_generating = "<C-x>", - }, - }, - popup_layout = { - default = "center", - center = { - width = "90%", - height = "80%", - }, - right = { - width = "30%", - width_settings_open = "50%", - }, - }, - popup_window = { - border = { - style = "single", - }, - win_options = { - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", - }, - }, - system_window = { - border = { - style = "single", - }, - win_options = { - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", - }, - }, - popup_input = { - border = { - style = "single", - }, - win_options = { - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", - }, - submit = "<C-Enter>", - submit_n = "<Enter>", - }, - settings_window = { - border = { - style = "single", - }, - win_options = { - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", - }, - }, - help_window = { - border = { - style = "single", - }, - win_options = { - winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder", - }, - }, - openai_params = { - -- model = "gpt-3.5-turbo", - model = "gpt-4-turbo", - }, - openai_edit_params = { - -- model = "gpt-3.5-turbo", - model = "gpt-4-turbo", - }, - }, - }, { "nvim-neo-tree/neo-tree.nvim", opts = { diff --git a/.config/nvim/lua/plugins/language.lua b/.config/nvim/lua/plugins/language.lua index 487237f0..55783e71 100644 --- a/.config/nvim/lua/plugins/language.lua +++ b/.config/nvim/lua/plugins/language.lua @@ -1,5 +1,9 @@ ---@type LazySpec return { + { + "lukas-reineke/headlines.nvim", + enabled = false, + }, { "stevearc/conform.nvim", opts = { @@ -8,6 +12,14 @@ return { }, }, }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "bash-language-server", + }, + }, + }, { "neovim/nvim-lspconfig", opts = {