diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2024-12-09 10:44:18 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2024-12-09 10:44:18 -0300 |
| commit | e00fc002a6441fa3741d1f705337efbbd8850744 (patch) | |
| tree | f6891a9119ee065db574aae73395af973100a008 /lua | |
| parent | 546d06a2314d0b4b5360346243bcfc0bda3fff30 (diff) | |
| download | nvim-conf-e00fc002a6441fa3741d1f705337efbbd8850744.tar.gz nvim-conf-e00fc002a6441fa3741d1f705337efbbd8850744.zip | |
Cambios varios.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/config/autocmds.lua | 55 | ||||
| -rw-r--r-- | lua/config/composer.lua | 104 | ||||
| -rw-r--r-- | lua/config/init.lua | 1 | ||||
| -rw-r--r-- | lua/config/lazy.lua | 6 | ||||
| -rw-r--r-- | lua/pi/dap/init.lua | 10 | ||||
| -rw-r--r-- | lua/pi/lsp/servers/phpactor.lua | 6 | ||||
| -rw-r--r-- | lua/plugins/CodeGPT.lua | 10 | ||||
| -rw-r--r-- | lua/plugins/aerial.lua | 54 | ||||
| -rw-r--r-- | lua/plugins/close-buffer.lua | 12 | ||||
| -rw-r--r-- | lua/plugins/code-annotation.lua | 35 | ||||
| -rw-r--r-- | lua/plugins/codecompanion.lua | 15 | ||||
| -rw-r--r-- | lua/plugins/copilot-chat.lua | 219 | ||||
| -rw-r--r-- | lua/plugins/flutter.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/hurl.lua | 39 | ||||
| -rw-r--r-- | lua/plugins/icon-picker.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/lsp.lua | 3 | ||||
| -rw-r--r-- | lua/plugins/navigator.lua | 43 | ||||
| -rw-r--r-- | lua/plugins/neotest.lua | 6 | ||||
| -rw-r--r-- | lua/plugins/note.lua | 29 | ||||
| -rw-r--r-- | lua/plugins/nvim-ts-autotag.lua | 7 | ||||
| -rw-r--r-- | lua/plugins/rayso.lua | 10 | ||||
| -rw-r--r-- | lua/plugins/spectre.lua | 70 | ||||
| -rw-r--r-- | lua/plugins/undotree.lua | 40 | ||||
| -rw-r--r-- | lua/plugins/which-key.lua | 12 | ||||
| -rw-r--r-- | lua/plugins/zenmode.lua | 44 |
25 files changed, 779 insertions, 55 deletions
diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 86d3e1d..24ff236 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -38,17 +38,6 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { end, }) -if vim.fn.has "persistent_undo" then - local target_path = vim.fn.expand "~/.cache/undodir" - -- crear el directorio y cualquier directorio padre - -- si la ubicación no existe. - if not vim.fn.isdirectory(target_path) then - vim.fn.mkdir(target_path, "p", 0700) - end - - vim.o.undodir = target_path - vim.o.undofile = true -end -- Función para alternar el ajuste de línea function ToggleWrap() local wrap = vim.wo.wrap @@ -84,3 +73,47 @@ vim.api.nvim_create_autocmd("BufEnter", { end end, }) + +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here +-- +local function augroup(name) + return vim.api.nvim_create_augroup("my_lazyvim_" .. name, { clear = true }) +end + +-- Set filetype for .env and .env.* files +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + group = augroup("env_filetype"), + pattern = { "*.env", ".env.*" }, + callback = function() + vim.opt_local.filetype = "sh" + end, +}) + +-- Set filetype for .hurl files +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + group = augroup("hurl_filetype"), + pattern = { "*.hurl" }, + callback = function() + vim.opt_local.filetype = "hurl" + end, +}) + +-- Set filetype for .toml files +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + group = augroup("toml_filetype"), + pattern = { "*.tomg-config*" }, + callback = function() + vim.opt_local.filetype = "toml" + end, +}) + +-- Set filetype for .ejs files +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + group = augroup("ejs_filetype"), + pattern = { "*.ejs", "*.ejs.t" }, + callback = function() + vim.opt_local.filetype = "embedded_template" + end, +}) diff --git a/lua/config/composer.lua b/lua/config/composer.lua new file mode 100644 index 0000000..2405416 --- /dev/null +++ b/lua/config/composer.lua @@ -0,0 +1,104 @@ +vim.treesitter.query.set( + "json", + "composer_dependencies", + [[ + (pair + key: (string + (string_content) @key (#match? @key "require|require-dev") + ) + value: (object + (pair + key: (string (string_content) @depen) + ) + ) + ) + ]] +) +local group = vim.api.nvim_create_augroup("composer-info", {}) +vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, { + pattern = "composer.json", + group = group, + callback = function(event) + local parser = vim.treesitter.get_parser(event.buf, "json") + local tree = parser:parse()[1] + if tree == nil then + return + end + local query = vim.treesitter.query.get("json", "composer_dependencies") + if not query then + return + end + + local dependencies = {} + + for id, node in query:iter_captures(tree:root(), event.buf) do + if query.captures[id] == "depen" then + table.insert(dependencies, { + name = vim.treesitter.get_node_text(node, event.buf), + line = node:start(), + }) + end + end + + if #dependencies == 0 then + return + end + + local ns = vim.api.nvim_create_namespace("composer-deps") + vim.api.nvim_buf_clear_namespace(event.buf, ns, 0, -1) + + vim.system( + { "composer", "info", "-f", "json" }, + {}, + vim.schedule_wrap(function(out) + if out.code ~= 0 then + return + end + + local data = vim.json.decode(out.stdout, {}) + if type(data.installed) ~= "table" then + return + end + + for _, dep in ipairs(dependencies) do + local info = vim.iter(data.installed):find(function(inst) + return dep.name == inst.name + end) + if info then + vim.api.nvim_buf_set_extmark(event.buf, ns, dep.line, 0, { + virt_text = { { string.format('<- %s', info.version), "comment" } }, + virt_text_pos = "eol", + }) + end + end + end) + ) + vim.system( + { "composer", "outdated", "-f", "json" }, + {}, + vim.schedule_wrap(function(out) + if out.code ~= 0 then + return + end + + local data = vim.json.decode(out.stdout, {}) + if type(data.installed) ~= "table" then + return + end + + for _, dep in ipairs(dependencies) do + local info = vim.iter(data.installed):find(function(inst) + return dep.name == inst.name + end) + if info then + vim.api.nvim_buf_set_extmark(event.buf, ns, dep.line - 1, 0, { + virt_text = { { string.format('^ %s (new version)', info.latest), "error" } }, + virt_text_pos = "eol", + }) + end + end + end) + ) + end, +}) + diff --git a/lua/config/init.lua b/lua/config/init.lua index 008ebf5..74e9c00 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -8,6 +8,7 @@ vim.api.nvim_create_autocmd("User", { require "config.usercmds" require "config.keymaps" require "config.diagnostic" + require "config.composer" end, }) require "config.lazy" diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 70aaec7..34e034f 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -13,7 +13,7 @@ vim.opt.rtp:prepend(lazypath) require("lazy").setup { -- leave nil when passing the spec as the first argument to setup() - spec = { { import = "plugins" } }, + spec = { { "LazyVim/LazyVim", import = "plugins" } }, local_spec = true, -- load project specific .lazy.lua spec files. They will be added at the end of the spec. defaults = { -- Set this to `true` to have all your plugins lazy-loaded by default. @@ -200,7 +200,3 @@ require("lazy").setup { }, } - - - - diff --git a/lua/pi/dap/init.lua b/lua/pi/dap/init.lua index 97084fd..13b6954 100644 --- a/lua/pi/dap/init.lua +++ b/lua/pi/dap/init.lua @@ -10,11 +10,11 @@ for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/pi/dap/configs/*.lua end -- Signs -vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapStopped", { text = "▶", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapLogPoint", { text = "", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpoint", { text = " ", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapStopped", { text = " ", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpointRejected", { text = " ", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpointCondition", { text = " ", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapLogPoint", { text = " ", texthl = "", linehl = "", numhl = "" }) -- UI structure dapui.setup { diff --git a/lua/pi/lsp/servers/phpactor.lua b/lua/pi/lsp/servers/phpactor.lua index e5a92ed..6196cdb 100644 --- a/lua/pi/lsp/servers/phpactor.lua +++ b/lua/pi/lsp/servers/phpactor.lua @@ -28,8 +28,8 @@ local function phpactor_attach(_, bufnr) }, position = "50%", size = { - width = "80%", - height = "60%", + width = "60%", + height = "40%", }, } @@ -65,7 +65,7 @@ return function(ops) ["language_server_configuration.auto_config"] = false, ["code_transform.import_globals"] = true, ["language_server_phpstan.enabled"] = true, - ["language_server_phpstan.level"] = 7, + ["language_server_phpstan.level"] = "7", ["language_server_phpstan.bin"] = "phpstan", }, handlers = { diff --git a/lua/plugins/CodeGPT.lua b/lua/plugins/CodeGPT.lua deleted file mode 100644 index ee3579b..0000000 --- a/lua/plugins/CodeGPT.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "dpayne/CodeGPT.nvim", - dependencies = { - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - }, - config = function() - require("codegpt.config") - end -} diff --git a/lua/plugins/aerial.lua b/lua/plugins/aerial.lua new file mode 100644 index 0000000..f8bc139 --- /dev/null +++ b/lua/plugins/aerial.lua @@ -0,0 +1,54 @@ +-- Silent keymap option +local opts = { silent = true } + +return { + { + "folke/edgy.nvim", + optional = true, + opts = function(_, opts) + opts.right = opts.right or {} + table.insert(opts.right, "aerial") + table.insert(opts.right, { + title = "hurl.nvim", + ft = "hurl-nvim", + size = { width = 0.5 }, + }) + + end, + }, + { + "stevearc/aerial.nvim", + keys = { + { "<leader>ta", "<cmd>AerialToggle<cr>", desc = "AerialToggle" }, + }, + config = function() + local status_ok, aerial = pcall(require, "aerial") + if not status_ok then + return + end + + aerial.setup({ + -- optionally use on_attach to set keymaps when aerial has attached to a buffer + on_attach = function(bufnr) + -- Jump forwards/backwards with '{' and '}' + vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr }) + vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr }) + + vim.keymap.set("n", "<leader>fi", "<cmd>Telescope aerial<CR>", opts) + end, + }) + + local tele_status_ok, telescope = pcall(require, "telescope") + if not tele_status_ok then + return + end + + -- Define a custom command to open aerial with telescope + vim.keymap.set("n", "<leader>fi", "<cmd>Telescope aerial<CR>", { + desc = "Telescope Aerial", + }) + + telescope.load_extension("aerial") + end, + }, +} diff --git a/lua/plugins/close-buffer.lua b/lua/plugins/close-buffer.lua new file mode 100644 index 0000000..947f31a --- /dev/null +++ b/lua/plugins/close-buffer.lua @@ -0,0 +1,12 @@ +return { + -- Send buffers into early retirement by automatically closing them after x minutes of inactivity. + { + "chrisgrieser/nvim-early-retirement", + config = true, + event = "VeryLazy", + opts = { + -- if a buffer has been inactive for this many minutes, close it + retirementAgeMins = 30, + }, + }, +} diff --git a/lua/plugins/code-annotation.lua b/lua/plugins/code-annotation.lua new file mode 100644 index 0000000..eae61d0 --- /dev/null +++ b/lua/plugins/code-annotation.lua @@ -0,0 +1,35 @@ +local neogeo_opts = {} + +if not vim.g.vscode then + neogeo_opts = { + enabled = true, + -- Only use luasnip as snippet engine if that is not vscode + snippet_engine = "luasnip", + } +end + +return { + -- JsDoc generator + { + "heavenshell/vim-jsdoc", + ft = "javascript,typescript,typescriptreact,svelte", + cmd = "JsDoc", + keys = { + { "<leader>jd", "<cmd>JsDoc<cr>", desc = "JsDoc" }, + }, + -- make sure that you will have lehre install locally on plugin folder, refer https://github.com/heavenshell/vim-jsdoc#manual-installation + build = "make install", + }, + { + -- A better annotation generator. Supports multiple languages and annotation conventions. + -- <C-n> to jump to next annotation, <C-p> to jump to previous annotation + "danymat/neogen", + vscode = true, + dependencies = "nvim-treesitter/nvim-treesitter", + opts = neogeo_opts, + cmd = "Neogen", + keys = { + { "<leader>ci", "<cmd>Neogen<cr>", desc = "Neogen - Annotation generator" }, + }, + }, +} diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..a98a7af --- /dev/null +++ b/lua/plugins/codecompanion.lua @@ -0,0 +1,15 @@ +return { + "olimorris/codecompanion.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "hrsh7th/nvim-cmp", -- Optional: For using slash commands and variables in the chat buffer + "nvim-telescope/telescope.nvim", -- Optional: For using slash commands + { + "MeanderingProgrammer/render-markdown.nvim", + ft = { "markdown", "codecompanion" }, + }, -- Optional: For prettier markdown rendering + { "stevearc/dressing.nvim", opts = {} }, -- Optional: Improves `vim.ui.select` + }, + config = true, +} diff --git a/lua/plugins/copilot-chat.lua b/lua/plugins/copilot-chat.lua index 63ec0b2..0ae500d 100644 --- a/lua/plugins/copilot-chat.lua +++ b/lua/plugins/copilot-chat.lua @@ -1,15 +1,224 @@ +local IS_DEV = false + +local prompts = { + -- Code related prompts + Explain = "Please explain how the following code works.", + Review = "Please review the following code and provide suggestions for improvement.", + Tests = "Please explain how the selected code works, then generate unit tests for it.", + Refactor = "Please refactor the following code to improve its clarity and readability.", + FixCode = "Please fix the following code to make it work as intended.", + FixError = "Please explain the error in the following text and provide a solution.", + BetterNamings = "Please provide better names for the following variables and functions.", + Documentation = "Please provide documentation for the following code.", + SwaggerApiDocs = "Please provide documentation for the following API using Swagger.", + SwaggerJsDocs = "Please write JSDoc for the following API using Swagger.", + -- Text related prompts + Summarize = "Please summarize the following text.", + Spelling = "Please correct any grammar and spelling errors in the following text.", + Wording = "Please improve the grammar and wording of the following text.", + Concise = "Please rewrite the following text to make it more concise.", +} + return { + -- { import = "plugins.extras.copilot-vim" }, -- Or use { import = "lazyvim.plugins.extras.coding.copilot" }, + { + "folke/which-key.nvim", + optional = true, + opts = { + spec = { + { "<leader>a", group = "ai" }, + { "gm", group = "+Copilot chat" }, + { "gmh", desc = "Show help" }, + { "gmd", desc = "Show diff" }, + { "gmp", desc = "Show system prompt" }, + { "gms", desc = "Show selection" }, + { "gmy", desc = "Yank diff" }, + }, + }, + }, { + dir = IS_DEV and "~/Projects/research/CopilotChat.nvim" or nil, "CopilotC-Nvim/CopilotChat.nvim", - branch = "canary", + -- version = "v3.3.0", -- Use a specific version to prevent breaking changes dependencies = { + { "nvim-telescope/telescope.nvim" }, -- Use telescope for help actions + { "nvim-lua/plenary.nvim" }, { "zbirenbaum/copilot.lua" }, -- or github/copilot.vim - { "nvim-lua/plenary.nvim" }, -- for curl, log wrapper }, opts = { - debug = true, -- Enable debugging - -- See Configuration section for rest + question_header = "## User ", + answer_header = "## Copilot ", + error_header = "## Error ", + prompts = prompts, + auto_follow_cursor = false, -- Don't follow the cursor after getting response + mappings = { + -- Use tab for completion + complete = { + detail = "Use @<Tab> or /<Tab> for options.", + insert = "<Tab>", + }, + -- Close the chat + close = { + normal = "q", + insert = "<C-c>", + }, + -- Reset the chat buffer + reset = { + normal = "<C-x>", + insert = "<C-x>", + }, + -- Submit the prompt to Copilot + submit_prompt = { + normal = "<CR>", + insert = "<C-CR>", + }, + -- Accept the diff + accept_diff = { + normal = "<C-y>", + insert = "<C-y>", + }, + -- Yank the diff in the response to register + yank_diff = { + normal = "gmy", + }, + -- Show the diff + show_diff = { + normal = "gmd", + }, + -- Show the info + show_info = { + normal = "gmi", + }, + -- Show the context + show_context = { + normal = "gmc", + }, + -- Show help + show_help = { + normal = "gmh", + }, + }, + }, + config = function(_, opts) + local chat = require("CopilotChat") + local select = require("CopilotChat.select") + -- Use unnamed register for the selection + opts.selection = select.unnamed + + chat.setup(opts) + + vim.api.nvim_create_user_command("CopilotChatVisual", function(args) + chat.ask(args.args, { selection = select.visual }) + end, { nargs = "*", range = true }) + + -- Inline chat with Copilot + vim.api.nvim_create_user_command("CopilotChatInline", function(args) + chat.ask(args.args, { + selection = select.visual, + window = { + layout = "float", + relative = "cursor", + width = 1, + height = 0.4, + row = 1, + }, + }) + end, { nargs = "*", range = true }) + + -- Restore CopilotChatBuffer + vim.api.nvim_create_user_command("CopilotChatBuffer", function(args) + chat.ask(args.args, { selection = select.buffer }) + end, { nargs = "*", range = true }) + + -- Custom buffer for CopilotChat + vim.api.nvim_create_autocmd("BufEnter", { + pattern = "copilot-*", + callback = function() + vim.opt_local.relativenumber = true + vim.opt_local.number = true + + -- Get current filetype and set it to markdown if the current filetype is copilot-chat + local ft = vim.bo.filetype + if ft == "copilot-chat" then + vim.bo.filetype = "markdown" + end + end, + }) + end, + event = "VeryLazy", + keys = { + -- Show prompts actions with telescope + { + "<leader>ap", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + { + "<leader>ap", + ":lua require('CopilotChat.integrations.telescope').pick(require('CopilotChat.actions').prompt_actions({selection = require('CopilotChat.select').visual}))<CR>", + mode = "x", + desc = "CopilotChat - Prompt actions", + }, + -- Code related commands + { "<leader>ae", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" }, + { "<leader>at", "<cmd>CopilotChatTests<cr>", desc = "CopilotChat - Generate tests" }, + { "<leader>ar", "<cmd>CopilotChatReview<cr>", desc = "CopilotChat - Review code" }, + { "<leader>aR", "<cmd>CopilotChatRefactor<cr>", desc = "CopilotChat - Refactor code" }, + { "<leader>an", "<cmd>CopilotChatBetterNamings<cr>", desc = "CopilotChat - Better Naming" }, + -- Chat with Copilot in visual mode + { + "<leader>av", + ":CopilotChatVisual", + mode = "x", + desc = "CopilotChat - Open in vertical split", + }, + { + "<leader>ax", + ":CopilotChatInline<cr>", + mode = "x", + desc = "CopilotChat - Inline chat", + }, + -- Custom input for CopilotChat + { + "<leader>ai", + function() + local input = vim.fn.input("Ask Copilot: ") + if input ~= "" then + vim.cmd("CopilotChat " .. input) + end + end, + desc = "CopilotChat - Ask input", + }, + -- Generate commit message based on the git diff + { + "<leader>am", + "<cmd>CopilotChatCommit<cr>", + desc = "CopilotChat - Generate commit message for all changes", + }, + -- Quick chat with Copilot + { + "<leader>aq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + vim.cmd("CopilotChatBuffer " .. input) + end + end, + desc = "CopilotChat - Quick chat", + }, + -- Debug + { "<leader>ad", "<cmd>CopilotChatDebugInfo<cr>", desc = "CopilotChat - Debug Info" }, + -- Fix the issue with diagnostic + { "<leader>af", "<cmd>CopilotChatFixDiagnostic<cr>", desc = "CopilotChat - Fix Diagnostic" }, + -- Clear buffer and chat history + { "<leader>al", "<cmd>CopilotChatReset<cr>", desc = "CopilotChat - Clear buffer and chat history" }, + -- Toggle Copilot Chat Vsplit + { "<leader>av", "<cmd>CopilotChatToggle<cr>", desc = "CopilotChat - Toggle" }, + -- Copilot Chat Models + { "<leader>a?", "<cmd>CopilotChatModels<cr>", desc = "CopilotChat - Select Models" }, }, - -- See Commands section for default commands if you want to lazy load on them }, } diff --git a/lua/plugins/flutter.lua b/lua/plugins/flutter.lua index 91cabad..9d83940 100644 --- a/lua/plugins/flutter.lua +++ b/lua/plugins/flutter.lua @@ -1,7 +1,7 @@ return { 'akinsho/flutter-tools.nvim', - lazy = true, + lazy = false, filetype = 'dart', dependencies = { 'nvim-lua/plenary.nvim', diff --git a/lua/plugins/hurl.lua b/lua/plugins/hurl.lua new file mode 100644 index 0000000..cd949ee --- /dev/null +++ b/lua/plugins/hurl.lua @@ -0,0 +1,39 @@ +local IS_DEV = false + +return { + { + "jellydn/hurl.nvim", + dir = IS_DEV and "~/Projects/research/hurl.nvim" or nil, + ft = "hurl", + dependencies = { "MunifTanjim/nui.nvim", "nvim-treesitter/nvim-treesitter" }, + opts = { + mode = "split", + auto_close = false, + debug = false, + show_notification = false, + formatters = { + json = { "jq" }, + html = { + "prettier", + "--parser", + "html", + }, + }, + }, + keys = { + -- Run API request + { "<leader>rA", "<cmd>HurlRunner<CR>", desc = "Hurl - Run All requests" }, + { "<leader>ra", "<cmd>HurlRunnerAt<CR>", desc = "Hurl - Run Api request" }, + { "<leader>re", "<cmd>HurlRunnerToEntry<CR>", desc = "Hurl -Run Api request to entry" }, + { "<leader>th", "<cmd>HurlToggleMode<CR>", desc = "Hurl - Toggle Mode" }, + { "<leader>rv", "<cmd>HurlVerbose<CR>", desc = "Hurl - Run Api in verbose mode" }, + -- Run Hurl request in visual mode + { "<leader>rh", ":HurlRunner<CR>", desc = "Hurl Runner", mode = "v" }, + -- Show last response + { "<leader>rh", "<cmd>HurlShowLastResponse<CR>", desc = "Hurl History", mode = "n" }, + -- Manage variable + { "<leader>hg", ":HurlSetVariable", desc = "Hurl - Set global variable" }, + { "<leader>hG", "<cmd>HurlManageVariable<CR>", desc = "Hurl - Manage global variable" }, + }, + }, +} diff --git a/lua/plugins/icon-picker.lua b/lua/plugins/icon-picker.lua index a466b6a..adb1bb4 100644 --- a/lua/plugins/icon-picker.lua +++ b/lua/plugins/icon-picker.lua @@ -3,7 +3,7 @@ return { keys = { { "<Leader><Leader>i", "<cmd>IconPickerNormal nerd_font<cr>", mode = "n", desc = "IconPicker NerdFont Insert" }, { "<Leader><Leader>y", "<cmd>IconPickerYank nerd_font<cr>", mode = "n", desc = "IconPicker NerdFont Yank" }, - { "<C-o>", "<cmd>IconPickerInsert nerd_font<cr>", mode = "i", desc = "IconPicker NerdFont Insert mode" }, + { "<C-o>", "<cmd>IconPickerInsert nerd_font emoji alt_font nerd_font_v3 symbols <cr>", mode = "i", desc = "IconPicker NerdFont Insert mode" }, }, opts = { disable_legacy_commands = true }, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 0799874..eae804e 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -21,8 +21,5 @@ return { enable = true, auto_install = false, }, - servers = { - phpactor = { enable = true }, - }, }, } diff --git a/lua/plugins/navigator.lua b/lua/plugins/navigator.lua new file mode 100644 index 0000000..53a7735 --- /dev/null +++ b/lua/plugins/navigator.lua @@ -0,0 +1,43 @@ +-- [[ +-- Use <c-e> or :q! to kill the floating window +-- <up/down> (or <c-n>, <c-p>) to move +-- <c-o> or <CR> to open location or apply code actions. Note: <CR> might be bound in insert mode by other plugins +-- ]] +return { + { + "ray-x/navigator.lua", + event = "LspAttach", + dependencies = { + { "ray-x/guihua.lua", build = "cd lua/fzy && make" }, + { + "neovim/nvim-lspconfig", + }, + }, + opts = { + default_mapping = false, + lsp = { + disable_lsp = "all", + hover = { + enable = false, + }, + }, + }, + -- Refer more usage on https://raw.githubusercontent.com/ray-x/navigator.lua/master/lua/navigator/lspclient/mapping.lua + keys = { + { "<leader>gr", ":lua require'navigator.reference'.async_ref()<cr>", desc = "Navigator - Async reference" }, + { "<leader>gS", ":lua require'navigator.symbols'.document_symbols()<cr>", desc = "Navigator - Document symbols" }, + { + "<leader>gw", + ":lua require'navigator.workspace'.workspace_symbol_live()<cr>", + desc = "Navigator - workspace symbols live", + }, + { "<leader>gd", ":lua require'navigator.definition'.definition()<cr>", desc = "Navigator - Definition" }, + { + "<leader>gp", + ":lua require'navigator.definition'.definition_preview()<cr>", + desc = "Navigator - Definition preview", + }, + { "<leader>ga", ":lua require'navigator.codeAction'.code_action()<cr>", desc = "Navigator - Code Action" }, + }, + }, +} diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index 2afc490..c00f12e 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -10,11 +10,17 @@ return { "nvim-neotest/neotest-plenary", "nvim-neotest/neotest-vim-test", "anuvyklack/hydra.nvim", + "nvim-neotest/neotest-python", }, config = function() local neotest = require "neotest" neotest.setup { adapters = { + ["neotest-python"] = { + -- Here you can specify the settings for the adapter, i.e. + -- runner = "pytest", + -- python = ".venv/bin/python", + }, require "neotest-go", require('rustaceanvim.neotest'), require "neotest-plenary", diff --git a/lua/plugins/note.lua b/lua/plugins/note.lua new file mode 100644 index 0000000..2728bde --- /dev/null +++ b/lua/plugins/note.lua @@ -0,0 +1,29 @@ +return { + { + "jellydn/my-note.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + keys = { + { + "<leader>mn", + "<cmd>MyNote<cr>", + desc = "Open MyNote", + }, + { + "<leader>mg", + "<cmd>MyNote global<cr>", + desc = "Open MyNote Global", + }, + }, + opts = { + files = { + -- Using the parent .git folder as the cwd + cwd = function() + local bufPath = vim.api.nvim_buf_get_name(0) + local cwd = require("lspconfig").util.root_pattern(".git")(bufPath) + + return cwd + end, + }, + }, + }, +} diff --git a/lua/plugins/nvim-ts-autotag.lua b/lua/plugins/nvim-ts-autotag.lua new file mode 100644 index 0000000..59473b2 --- /dev/null +++ b/lua/plugins/nvim-ts-autotag.lua @@ -0,0 +1, |