diff options
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/buffer_manager.lua | 24 | ||||
| -rw-r--r-- | lua/plugins/colorscheme.lua | 47 | ||||
| -rw-r--r-- | lua/plugins/completition.lua | 16 | ||||
| -rw-r--r-- | lua/plugins/elixir.lua | 34 | ||||
| -rw-r--r-- | lua/plugins/indent-o-matic.lua | 5 | ||||
| -rw-r--r-- | lua/plugins/lualine.lua | 148 | ||||
| -rw-r--r-- | lua/plugins/luarocks.lua | 5 | ||||
| -rw-r--r-- | lua/plugins/nvim-bqf.lua | 10 | ||||
| -rw-r--r-- | lua/plugins/smart-splits.lua | 8 | ||||
| -rw-r--r-- | lua/plugins/smooth-cursor.lua.n (renamed from lua/plugins/smooth-cursor.lua) | 0 | ||||
| -rw-r--r-- | lua/plugins/telescope.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/treesitter-context.lua | 13 | ||||
| -rw-r--r-- | lua/plugins/treesitter.lua | 40 | ||||
| -rw-r--r-- | lua/plugins/treesj.lua | 11 | ||||
| -rw-r--r-- | lua/plugins/undotree.lua | 11 | ||||
| -rw-r--r-- | lua/plugins/vim-illuminate.lua | 21 | ||||
| -rw-r--r-- | lua/plugins/vim-lastplace.lua | 4 | ||||
| -rw-r--r-- | lua/plugins/which-key.lua | 14 |
18 files changed, 355 insertions, 58 deletions
diff --git a/lua/plugins/buffer_manager.lua b/lua/plugins/buffer_manager.lua new file mode 100644 index 0000000..794e178 --- /dev/null +++ b/lua/plugins/buffer_manager.lua @@ -0,0 +1,24 @@ +return { + 'j-morano/buffer_manager.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, + keys = { + { + desc = 'Buffer Manager', + '<leader>o', + function() require('buffer_manager.ui').toggle_quick_menu() end, + }, + { + desc = 'Next buffer', + ']b', + function() require('buffer_manager.ui').nav_next() end, + }, + { + desc = 'Previous buffer', + '[b', + function() require('buffer_manager.ui').nav_prev() end, + }, + }, + opts = { + width = 0.9, + }, + } diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 0b90faf..b72b76f 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,11 +1,40 @@ return { - "wuelnerdotexe/vim-enfocado", - lazy = false, - priority = 1000, - init = function() - vim.g.enfocado_style = "neon" - end, - config = function() - vim.cmd.colorscheme "enfocado" - end, + { + 'catppuccin/nvim', + name = 'catppuccin', + lazy = false, + priority = 1000, + opts = { + flavour = 'frappe', + transparent_background = true, + integrations = { + mason = true, + mini = true, + native_lsp = { + underlines = { + errors = { 'undercurl' }, + hints = { 'undercurl' }, + warnings = { 'undercurl' }, + information = { 'undercurl' }, + }, + }, + treesitter_context = true, + which_key = true, + }, + }, + config = function(_, opts) + require('catppuccin').setup(opts) + vim.cmd.colorscheme 'catppuccin' + end, + }, + { + 'stevearc/dressing.nvim', + event = 'VeryLazy', + opts = { + input = { + insert_only = false, + start_in_insert = false, + }, + }, + }, } diff --git a/lua/plugins/completition.lua b/lua/plugins/completition.lua index b659fb7..0037c40 100644 --- a/lua/plugins/completition.lua +++ b/lua/plugins/completition.lua @@ -31,21 +31,21 @@ return { dict.setup({ -- The following are default values. - exact = 2, + exact_length = 2, first_case_insensitive = false, document = false, document_command = "wn %s -over", sqlite = false, - max_items = -1, - capacity = 5, + max_number_items = -1, + -- capacity = 5, debug = false, }) - dict.switcher({ - spelllang = { - es = "./../../spell/dic_es.dict", - }, - }) + -- dict.switcher({ + -- spelllang = { + -- es = "./../../spell/dic_es.dict", + -- }, + -- }) end, }, diff --git a/lua/plugins/elixir.lua b/lua/plugins/elixir.lua new file mode 100644 index 0000000..6aabb08 --- /dev/null +++ b/lua/plugins/elixir.lua @@ -0,0 +1,34 @@ +return { + "elixir-tools/elixir-tools.nvim", + version = "*", + event = { "BufReadPre", "BufNewFile" }, + filetypes = { "elixir" }, + config = function() + local elixir = require("elixir") + local elixirls = require("elixir.elixirls") + + elixir.setup { + nextls = {enable = false}, + credo = {enable = false}, + elixirls = { + enable = true, + cmd = "elixir-ls", + settings = elixirls.settings { + incrementalDialyzer = true, + dialyzerEnabled = true, + fetchDeps = true, + enableTestLenses = true, + suggestSpecs = true, + }, + on_attach = function(client, bufnr) + vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true }) + vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true }) + vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true }) + end, + } + } + end, + dependencies = { + "nvim-lua/plenary.nvim", + }, +} diff --git a/lua/plugins/indent-o-matic.lua b/lua/plugins/indent-o-matic.lua new file mode 100644 index 0000000..39b53d3 --- /dev/null +++ b/lua/plugins/indent-o-matic.lua @@ -0,0 +1,5 @@ +return { + 'Darazaki/indent-o-matic', + event = 'BufReadPre', + opts = {}, + } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index e4c3b4a..8406d42 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,19 +1,40 @@ return { - "nvim-lualine/lualine.nvim", - dependencies = { "kyazdani42/nvim-web-devicons" }, - config = function() - require("lualine").setup { - options = { - theme = "auto", - icons_enabled = true, - globalstatus = true, - }, - extensions = { "quickfix", "fugitive" }, - sections = { - lualine_a = { { "mode", upper = true } }, - lualine_b = { { "branch", icon = "" }, "db_ui#statusline" }, - lualine_c = { { "filename", file_status = true, path = 1 } }, - lualine_x = { + { + 'nvim-lualine/lualine.nvim', + dependencies = { + 'kyazdani42/nvim-web-devicons', + 'arkav/lualine-lsp-progress', + }, + opts = function() + local function winnr() return ' ' .. vim.fn.winnr() end + local function bufnr() return ' ' .. vim.fn.bufnr() end + + local function lualine_c(filename_opts) + filename_opts = filename_opts or {} + + return { + { + 'filetype', + icon_only = true, + separator = '', + padding = { left = 1, right = 0 }, + }, + { + 'filename', + file_status = filename_opts.file_status, + padding = 0, + path = filename_opts.fullpath and 1, + separator = '', + }, + } + end + + local sections = { + lualine_a = { winnr }, + lualine_b = { bufnr }, + lualine_d = lualine_c { fullpath = true }, + lualine_x = { 'searchcount' }, + lualine_y = { "diagnostics", "diff", { @@ -27,25 +48,80 @@ return { color = { fg = "ff9e64" }, }, }, - lualine_y = { "filetype" }, - lualine_z = { "location" }, - }, - winbar = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - inactive_winbar = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { {"filename", file_status = true, path = 1} }, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - } - end, + lualine_z = { 'progress' }, + } + + return { + options = { + disabled_filetypes = { 'alpha', 'dbui', 'fugitiveblame' }, + theme = 'catppuccin', + }, + tabline = { + lualine_a = { + 'mode', + 'selectioncount', + function() return vim.fn.fnamemodify(vim.fn.getcwd(), ':p:~:h') end, + }, + lualine_b = { + function() + local dap_status = require('dap').status() + + return dap_status ~= '' and ' ' .. dap_status or '' + end, + }, + lualine_x = { 'lsp_progress' }, + lualine_y = { { "branch", icon = "" }, "db_ui#statusline" }, + lualine_z = { + { + 'tabs', + show_modified_status = false, + use_mode_colors = true, + }, + }, + }, + sections = sections, + inactive_sections = sections, + extensions = { + { + filetypes = { 'fugitive', 'git' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = { { 'FugitiveHead', icon = '' } }, + }), + }, + { + filetypes = { 'help', 'man' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = lualine_c { file_status = false }, + }), + }, + { + filetypes = { 'oil' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = { + { + function() + local dir = require('oil').get_current_dir() + + return dir and vim.fn.fnamemodify(dir, ':p:~:.') + end, + icon = { + '', + color = { + fg = require('catppuccin.palettes').get_palette('frappe').maroon, + }, + }, + }, + }, + }), + }, + { + filetypes = { 'qf' }, + sections = vim.tbl_extend('force', sections, { + lualine_c = { 'w:quickfix_title' }, + }), + }, + }, + } + end, + }, } diff --git a/lua/plugins/luarocks.lua b/lua/plugins/luarocks.lua new file mode 100644 index 0000000..c8dfe6c --- /dev/null +++ b/lua/plugins/luarocks.lua @@ -0,0 +1,5 @@ +return { + "vhyrro/luarocks.nvim", + priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config. + config = true, +} diff --git a/lua/plugins/nvim-bqf.lua b/lua/plugins/nvim-bqf.lua new file mode 100644 index 0000000..5de7214 --- /dev/null +++ b/lua/plugins/nvim-bqf.lua @@ -0,0 +1,10 @@ +return { + 'kevinhwang91/nvim-bqf', + ft = 'qf', + opts = { + auto_resize_height = true, + preview = { + wrap = true, + }, + }, + } diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua index 57faedb..29cccb7 100644 --- a/lua/plugins/smart-splits.lua +++ b/lua/plugins/smart-splits.lua @@ -3,28 +3,28 @@ return { config = true, keys = { { - "<A-h>", + "<leader><A-h>", function() require("smart-splits").resize_left() end, desc = "Resize window left +10", }, { - "<A-j>", + "<leader><A-j>", function() require("smart-splits").resize_down() end, desc = "Resize window down +10", }, { - "<A-k>", + "<leader><A-k>", function() require("smart-splits").resize_up() end, desc = "Resize window up +10", }, { - "<A-l>", + "<leader><A-l>", function() require("smart-splits").resize_right() end, diff --git a/lua/plugins/smooth-cursor.lua b/lua/plugins/smooth-cursor.lua.n index 71fe431..71fe431 100644 --- a/lua/plugins/smooth-cursor.lua +++ b/lua/plugins/smooth-cursor.lua.n diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 4f5b59d..291f777 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -7,6 +7,7 @@ return { { "kyazdani42/nvim-web-devicons" }, { "nvim-telescope/telescope-file-browser.nvim" }, { "nvim-telescope/telescope-ui-select.nvim" }, + { "nvim-telescope/telescope-live-grep-args.nvim" }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make", @@ -29,5 +30,6 @@ return { config = function() require "alpha.telescope.setup" require "alpha.telescope.mappings" + require("telescope").load_extension("live_grep_args") end, } diff --git a/lua/plugins/treesitter-context.lua b/lua/plugins/treesitter-context.lua new file mode 100644 index 0000000..0f68d08 --- /dev/null +++ b/lua/plugins/treesitter-context.lua @@ -0,0 +1,13 @@ +return { + 'nvim-treesitter/nvim-treesitter-context', + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + event = { 'BufReadPre', 'BufNew', 'BufNewFile' }, + cmd = { + 'TSContextDisable', + 'TSContextEnable', + 'TSContextToggle', + }, + opts = { + max_lines = 8, + }, + } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 9bbcde2..363f081 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -2,11 +2,35 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", dependencies = { + 'RRethy/nvim-treesitter-endwise', "nvim-treesitter/nvim-treesitter-textobjects", + 'nvim-treesitter/playground', }, - event = "VeryLazy", + event = { 'BufReadPre', 'BufNew', 'BufNewFile' }, main = "nvim-treesitter.configs", + cmd = { + 'TSBufDisable', + 'TSBufEnable', + 'TSBufToggle', + 'TSConfigInfo', + 'TSDisable', + 'TSEditQuery', + 'TSEditQueryUserAfter', + 'TSEnable', + 'TSInstall', + 'TSInstallFromGrammar', + 'TSInstallInfo', + 'TSInstallSync', + 'TSModuleInfo', + 'TSToggle', + 'TSUninstall', + 'TSUpdate', + 'TSUpdateSync', + 'TSPlaygroundToggle', + }, opts = { + endwise = { enable = true }, + auto_install = true, ensure_installed = { "bash", "blade", @@ -23,6 +47,7 @@ return { "nix", "org", "php", + "php_only", "phpdoc", "query", "rust", @@ -37,11 +62,24 @@ return { "python", "dockerfile", "cpp", + "elixir", + "erlang", }, highlight = { enable = true, additional_vim_regex_highlighting = { "org" }, }, + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Tiempo de actualización en milisegundos para la consulta del árbol. + persist_queries = false, -- Si se debe persistir las consultas entre sesiones. + }, + query_linter = { + enable = true, + use_virtual_text = true, + lint_events = {"BufWrite", "CursorHold"}, + }, indent = { enable = true, }, diff --git a/lua/plugins/treesj.lua b/lua/plugins/treesj.lua new file mode 100644 index 0000000..c6b3e4a --- /dev/null +++ b/lua/plugins/treesj.lua @@ -0,0 +1,11 @@ +return { + 'Wansmer/treesj', + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + keys = { + { desc = 'Split/Join', '<leader>j', '<Cmd>TSJToggle<CR>' }, + }, + opts = { + max_join_length = 500, + use_default_keymaps = false, + }, + } diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua new file mode 100644 index 0000000..3f96d83 --- /dev/null +++ b/lua/plugins/undotree.lua @@ -0,0 +1,11 @@ +return { + "mbbill/undotree", + lazy = false, -- needs to be explicitly set, because of the keys property + keys = { + { + "<leader>u", + vim.cmd.UndotreeToggle, + desc = "Toggle undotree", + }, + }, +} diff --git a/lua/plugins/vim-illuminate.lua b/lua/plugins/vim-illuminate.lua new file mode 100644 index 0000000..9ed467e --- /dev/null +++ b/lua/plugins/vim-illuminate.lua @@ -0,0 +1,21 @@ +return + { + 'RRethy/vim-illuminate', + event = 'LspAttach', + keys = { + { + desc = 'Next Reference', + ']r', + function() require('illuminate').goto_next_reference() end, + }, + { + desc = 'Previous Reference', + '[r', + function() require('illuminate').goto_prev_reference() end, + }, + }, + opts = { + providers = { 'lsp' }, + }, + config = function(_, opts) require('illuminate').configure(opts) end, + } diff --git a/lua/plugins/vim-lastplace.lua b/lua/plugins/vim-lastplace.lua new file mode 100644 index 0000000..3de39ec --- /dev/null +++ b/lua/plugins/vim-lastplace.lua @@ -0,0 +1,4 @@ +return { + 'farmergreg/vim-lastplace', + event = 'BufReadPre', + } diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..50cd483 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,14 @@ +return { + 'folke/which-key.nvim', + event = 'VeryLazy', + keys = { + { + -- See: https://github.com/folke/which-key.nvim/issues/476 + desc = 'Workaround for which-key not showing up on <localleader>', + '<localleader>', + function() require('which-key').show(vim.g.maplocalleader) end, + }, + }, + opts = {}, + init = function() vim.opt.timeoutlen = 300 end, + } |