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/plugins/aerial.lua | |
| parent | 546d06a2314d0b4b5360346243bcfc0bda3fff30 (diff) | |
| download | nvim-conf-e00fc002a6441fa3741d1f705337efbbd8850744.tar.gz nvim-conf-e00fc002a6441fa3741d1f705337efbbd8850744.zip | |
Cambios varios.
Diffstat (limited to 'lua/plugins/aerial.lua')
| -rw-r--r-- | lua/plugins/aerial.lua | 54 |
1 files changed, 54 insertions, 0 deletions
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, + }, +} |