From a04f9cd914055244f29e9ff17aa7a723f5db2405 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Tue, 17 Jan 2023 23:53:34 +0100 Subject: feat: migration to lazy --- after/plugin/dressing.lua | 161 -------------------- after/plugin/gitsigns.lua | 16 -- after/plugin/luasnip.lua | 129 ---------------- after/plugin/neotest.lua | 52 ------- after/plugin/refactoring.lua | 6 - after/plugin/transparent.lua | 20 --- after/plugin/treesitter.lua | 64 -------- init.lua | 7 - lazy-lock.json | 70 +++++---- lua/alpha/database.lua | 1 - lua/alpha/lazy.lua | 2 +- lua/alpha/lazy_plugins.lua | 222 ---------------------------- lua/alpha/plugins.lua | 295 ------------------------------------- lua/alpha/plugins/colorscheme.lua | 9 ++ lua/alpha/plugins/completition.lua | 19 +++ lua/alpha/plugins/dap.lua | 14 ++ lua/alpha/plugins/database.lua | 11 ++ lua/alpha/plugins/dressing.lua | 161 ++++++++++++++++++++ lua/alpha/plugins/gitsigns.lua | 20 +++ lua/alpha/plugins/harpoon.lua | 10 ++ lua/alpha/plugins/init.lua | 54 +++++++ lua/alpha/plugins/lsp.lua | 19 +++ lua/alpha/plugins/lualine.lua | 38 +++++ lua/alpha/plugins/neotest.lua | 63 ++++++++ lua/alpha/plugins/refactoring.lua | 10 ++ lua/alpha/plugins/rest.lua | 41 ++++++ lua/alpha/plugins/snippets.lua | 135 +++++++++++++++++ lua/alpha/plugins/telescope.lua | 17 +++ lua/alpha/plugins/transparent.lua | 20 +++ lua/alpha/plugins/treesitter.lua | 71 +++++++++ lua/alpha/rest.lua | 35 ----- lua/alpha/status_line.lua | 34 ----- 32 files changed, 747 insertions(+), 1079 deletions(-) delete mode 100644 after/plugin/dressing.lua delete mode 100644 after/plugin/gitsigns.lua delete mode 100644 after/plugin/luasnip.lua delete mode 100644 after/plugin/neotest.lua delete mode 100644 after/plugin/refactoring.lua delete mode 100644 after/plugin/transparent.lua delete mode 100644 after/plugin/treesitter.lua delete mode 100644 lua/alpha/lazy_plugins.lua delete mode 100644 lua/alpha/plugins.lua create mode 100644 lua/alpha/plugins/colorscheme.lua create mode 100644 lua/alpha/plugins/completition.lua create mode 100644 lua/alpha/plugins/dap.lua create mode 100644 lua/alpha/plugins/database.lua create mode 100644 lua/alpha/plugins/dressing.lua create mode 100644 lua/alpha/plugins/gitsigns.lua create mode 100644 lua/alpha/plugins/harpoon.lua create mode 100644 lua/alpha/plugins/init.lua create mode 100644 lua/alpha/plugins/lsp.lua create mode 100644 lua/alpha/plugins/lualine.lua create mode 100644 lua/alpha/plugins/neotest.lua create mode 100644 lua/alpha/plugins/refactoring.lua create mode 100644 lua/alpha/plugins/rest.lua create mode 100644 lua/alpha/plugins/snippets.lua create mode 100644 lua/alpha/plugins/telescope.lua create mode 100644 lua/alpha/plugins/transparent.lua create mode 100644 lua/alpha/plugins/treesitter.lua delete mode 100644 lua/alpha/rest.lua delete mode 100644 lua/alpha/status_line.lua diff --git a/after/plugin/dressing.lua b/after/plugin/dressing.lua deleted file mode 100644 index d41a8d1..0000000 --- a/after/plugin/dressing.lua +++ /dev/null @@ -1,161 +0,0 @@ -local ok, dressing = pcall(require, "dressing") -if not ok then - return -end - -dressing.setup({ - input = { - -- Set to false to disable the vim.ui.input implementation - enabled = true, - - -- Default prompt string - default_prompt = "Input:", - - -- Can be 'left', 'right', or 'center' - prompt_align = "left", - - -- When true, will close the modal - insert_only = true, - - -- When true, input will start in insert mode. - start_in_insert = true, - - -- These are passed to nvim_open_win - anchor = "SW", - border = "rounded", - -- 'editor' and 'win' will default to being centered - relative = "cursor", - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - prefer_width = 40, - width = nil, - -- min_width and max_width can be a list of mixed types. - -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" - max_width = { 140, 0.9 }, - min_width = { 20, 0.2 }, - win_options = { - -- Window transparency (0-100) - winblend = 10, - -- Disable line wrapping - wrap = false, - }, - - -- Set to `false` to disable - mappings = { - n = { - [""] = "Close", - [""] = "Confirm", - }, - i = { - [""] = "Close", - [""] = "Confirm", - [""] = "HistoryPrev", - [""] = "HistoryNext", - }, - }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - - -- see :help dressing_get_config - get_config = nil, - }, - select = { - -- Set to false to disable the vim.ui.select implementation - enabled = true, - - -- Priority list of preferred vim.select implementations - backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, - - -- Trim trailing `:` from prompt - trim_prompt = true, - - -- Options for telescope selector - -- These are passed into the telescope picker directly. Can be used like: - -- telescope = require('telescope.themes').get_ivy({...}) - telescope = nil, - - -- Options for fzf selector - fzf = { - window = { - width = 0.5, - height = 0.4, - }, - }, - - -- Options for fzf_lua selector - fzf_lua = { - winopts = { - width = 0.5, - height = 0.4, - }, - }, - - -- Options for nui Menu - nui = { - position = "50%", - size = nil, - relative = "editor", - border = { - style = "rounded", - }, - buf_options = { - swapfile = false, - filetype = "DressingSelect", - }, - win_options = { - winblend = 10, - }, - max_width = 80, - max_height = 40, - min_width = 40, - min_height = 10, - }, - - -- Options for built-in selector - builtin = { - -- These are passed to nvim_open_win - anchor = "NW", - border = "rounded", - -- 'editor' and 'win' will default to being centered - relative = "editor", - - win_options = { - -- Window transparency (0-100) - winblend = 10, - }, - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- the min_ and max_ options can be a list of mixed types. - -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" - width = nil, - max_width = { 140, 0.8 }, - min_width = { 40, 0.2 }, - height = nil, - max_height = 0.9, - min_height = { 10, 0.2 }, - - -- Set to `false` to disable - mappings = { - [""] = "Close", - [""] = "Close", - [""] = "Confirm", - }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - }, - - -- Used to override format_item. See :help dressing-format - format_item_override = {}, - - -- see :help dressing_get_config - get_config = nil, - }, -}) diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua deleted file mode 100644 index 268267b..0000000 --- a/after/plugin/gitsigns.lua +++ /dev/null @@ -1,16 +0,0 @@ -local ok, gitsigns = pcall(require, "gitsigns") -if not ok then - return -end - -gitsigns.setup({ - on_attach = function (bufnr) - vim.keymap.set('n', 'hs', gitsigns.stage_hunk, {buffer = bufnr} ) - vim.keymap.set('n', 'hu', gitsigns.undo_stage_hunk, {buffer = bufnr} ) - vim.keymap.set('n', 'hr', gitsigns.reset_hunk, {buffer = bufnr} ) - vim.keymap.set('n', 'hp', gitsigns.preview_hunk, {buffer = bufnr} ) - vim.keymap.set('n', 'hj', gitsigns.next_hunk, {buffer = bufnr} ) - vim.keymap.set('n', 'hk', gitsigns.prev_hunk, {buffer = bufnr} ) - end, - max_file_length = 10000, -}) diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua deleted file mode 100644 index 8538b8e..0000000 --- a/after/plugin/luasnip.lua +++ /dev/null @@ -1,129 +0,0 @@ -if vim.g.snippets ~= "luasnip" then - return -end - -local ls = require("luasnip") -local types = require("luasnip.util.types") - -ls.config.set_config({ - -- This tells LuaSnip to remember to keep around the last snippet. - -- You can jump back into even if you move outside of the selection - history = true, - - -- This one is cool cause if you have dynamic snippets, it updatesas you type! - updateevents = "TextChanged,TextChangedI", - - -- Autosnippets: - enable_autosnippets = true, - - ext_opts = { - [types.choiceNode] = { - active = { - virt_text = { { "<- Choice", "Error" } }, - }, - }, - }, -}) - --- create snippet --- s(context, nodes, condition, ...) -local snippet = ls.s - --- TODO: Write about this. --- Useful for dynamic nodes and choice nodes --- local snippet_from_nodes = ls.sn - --- This is the simplest node. --- Creates a new text node. Places cursor after node by default. --- t { "this will be inserted" } --- --- Multiple lines are by passing a table of strings. --- t { "line 1", "line 2" } -local t = ls.text_node - --- Insert Node --- Creates a location for the cursor to jump to. --- Possible options to jump to are 1 - N --- If you use 0, that's the final place to jump to. --- --- To create placeholder text, pass it as the second argument --- i(2, "this is placeholder text") -local i = ls.insert_node - --- Function Node --- Takes a function that returns text --- local f = ls.function_node - --- This a choice snippet. You can move through with (in my config) --- c(1, { t {"hello"}, t {"world"}, }), --- --- The first argument is the jump position --- The second argument is a table of possible nodes. --- Note, one thing that's nice is you don't have to include --- the jump position for nodes that normally require one (can be nil) --- local c = ls.choice_node - --- local d = ls.dynamic_node - --- TODO: Document what I've learned about lambda --- local l = require("luasnip.extras").lambda - --- local events = require("luasnip.util.events") - -local shortcut = function(val) - if type(val) == "string" then - return { t({ val }), i(0) } - end - - if type(val) == "table" then - for k, v in ipairs(val) do - if type(v) == "string" then - val[k] = t({ v }) - end - end - end - - return val -end - -local make = function(tbl) - local result = {} - for k, v in pairs(tbl) do - table.insert(result, (snippet({ trig = k, desc = v.desc }, shortcut(v)))) - end - - return result -end - -ls.cleanup() -for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/snips/ft/*.lua", true)) do - local ft = vim.fn.fnamemodify(ft_path, ":t:r") - ls.add_snippets(ft, make(loadfile(ft_path)())) -end - --- is my expansion key --- this will expand the current item or jump to the next item within the snippet. -vim.keymap.set({ "i", "s" }, "", function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end -end, { silent = true }) - --- is my jump backwards key. --- this always moves to the previous item within the snippet -vim.keymap.set({ "i", "s" }, "", function() - if ls.jumpable(-1) then - ls.jump(-1) - end -end, { silent = true }) - --- is selecting within a list of options. --- This is useful for choice nodes (introduced in the forthcoming episode 2) -vim.keymap.set("i", "", function() - if ls.choice_active() then - ls.change_choice(1) - end -end) - --- shorcut to source my luasnips file again, which will reload my snippets -vim.keymap.set("n", "s", "source ~/.config/nvim/after/plugin/luasnip.lua") diff --git a/after/plugin/neotest.lua b/after/plugin/neotest.lua deleted file mode 100644 index a18016e..0000000 --- a/after/plugin/neotest.lua +++ /dev/null @@ -1,52 +0,0 @@ -local ok, neotest = pcall(require, "neotest") -if not ok then - return -end - -neotest.setup({ - adapters = { - require("neotest-go"), - require("neotest-rust"), - require("neotest-plenary"), - require("neotest-vim-test")({ - ignore_file_types = { "go", "lua", "rust", "php" }, - }), - require("laravel.neotest"), - }, -}) - -local hydra = require("hydra") - -local hint = [[ - NeoTest - _n_: Near test _f_: Current file _l_: Last Test _m_: Run Marked _s_: Toggle Summary ^ - ^ ^ __ -]] - -hydra({ - name = "neotest", - hint = hint, - mode = "n", - config = { - color = "teal", - invoke_on_body = true, - hint = { - border = "rounded", - position = "bottom", - }, - }, - body = "", - heads = { - { "n", neotest.run.run }, - { - "f", - function() - neotest.run.run(vim.fn.expand("%")) - end, - }, - { "l", neotest.run.run_last }, - { "m", neotest.summary.run_marked }, - { "s", neotest.summary.toggle }, - { "", nil, { exit = true } }, - }, -}) diff --git a/after/plugin/refactoring.lua b/after/plugin/refactoring.lua deleted file mode 100644 index ff45c89..0000000 --- a/after/plugin/refactoring.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, refactoring = pcall(require, "refactoring") -if not ok then - return -end - -refactoring.setup({}) diff --git a/after/plugin/transparent.lua b/after/plugin/transparent.lua deleted file mode 100644 index 1548dd2..0000000 --- a/after/plugin/transparent.lua +++ /dev/null @@ -1,20 +0,0 @@ -local ok, transparent = pcall(require, "transparent") -if not ok then - return -end - -transparent.setup({ - enable = true, -- boolean: enable transparent - extra_groups = { -- table/string: additional groups that should be cleared - -- In particular, when you set it to 'all', that means all available groups - - -- example of akinsho/nvim-bufferline.lua - "BufferLineTabClose", - "BufferlineBufferSelected", - "BufferLineFill", - "BufferLineBackground", - "BufferLineSeparator", - "BufferLineIndicatorSelected", - }, - exclude = {}, -- table: groups you don't want to clear -}) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua deleted file mode 100644 index 69791bd..0000000 --- a/after/plugin/treesitter.lua +++ /dev/null @@ -1,64 +0,0 @@ -if not pcall(require, "nvim-treesitter") then - return -end - -require "nvim-treesitter.configs".setup { - ensure_installed = {"php", "phpdoc", "vim", "go", "gomod", "css", "html", "javascript", "lua", "typescript"}, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - refactor = { - highlight_definitions = { enable = true }, - smart_rename = { - enable = true, - keymaps = { - smart_rename = "trr", - }, - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@conditional.outer", - ["ic"] = "@conditional.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - } - } - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '', - show_help = '?', - }, - } -} diff --git a/init.lua b/init.lua index a8ce930..dea3bb6 100644 --- a/init.lua +++ b/init.lua @@ -5,12 +5,5 @@ require("alpha.keybindings") require("alpha.globals") require("alpha.disable_builtin") -require("alpha.telescope.setup") -require("alpha.telescope.mappings") -require("alpha.lsp") -require("alpha.completition") -require("alpha.dap") -require("alpha.colors") -require("alpha.status_line") require("alpha.diagnostic") diff --git a/lazy-lock.json b/lazy-lock.json index 658091d..f0eb44a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,5 @@ { - "Comment.nvim": { "branch": "master", "commit": "7bb563ff2d811a63b207e9de63e3e9c0877cb6d5" }, + "Comment.nvim": { "branch": "master", "commit": "e89df176e8b38e931b7e71a470f923a317976d86" }, "FixCursorHold.nvim": { "branch": "master", "commit": "70a9516a64668cbfe59f31b66d0a21678c5e9b12" }, "LuaSnip": { "branch": "master", "commit": "563827f00bb4fe43269e3be653deabc0005f1302" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -8,74 +8,72 @@ "cmp-git": { "branch": "main", "commit": "169202582f900b0e189eed5153b291383bfbba47" }, "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "d2768cb1b83de649d57d967085fe73c5e01f8fd7" }, - "cmp-nvim-lua": { "branch": "main", "commit": "d276254e7198ab7d00f117e88e223b4bd8c02d21" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "composer.nvim": { "branch": "main", "commit": "e62eaaef7c978d96a2abfeb2ca570650a4f21528" }, "delimitMate": { "branch": "master", "commit": "537a1da0fa5eeb88640425c37e545af933c56e1b" }, "dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" }, "fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" }, - "fzf": { "branch": "master", "commit": "ee5cdb9713715883ac6d2cd87bc8a091ff7c8361" }, - "fzf.vim": { "branch": "master", "commit": "0f03107bc94b31a9c7adcee6da8e5de7492e4b0b" }, + "fzf": { "branch": "master", "commit": "20230117636c9dfa3ed6f6428c5bc4c51b02f60a" }, + "fzf.vim": { "branch": "master", "commit": "bdf48c282ad2174c25c059b3cdb7956427b07a99" }, "git-worktree.nvim": { "branch": "master", "commit": "d7f4e2584e81670154f07ca9fa5dd791d9c1b458" }, - "gitsigns.nvim": { "branch": "main", "commit": "03639e6fc0ffd8d149c1834b52836af9b70ed560" }, + "gitsigns.nvim": { "branch": "main", "commit": "addd6e174a85fc1c4007ab0b65d77e6555b417bf" }, "harpoon": { "branch": "master", "commit": "21d0d1bfa3000e4384740bfaefa0ebc51c773786" }, - "hydra.nvim": { "branch": "master", "commit": "7e2aa29f88d534371c6b0263d3abbfac7c2376ce" }, + "hydra.nvim": { "branch": "master", "commit": "d00274f05363c13f29ed1fa571026a066a634cce" }, "indent-blankline.nvim": { "branch": "master", "commit": "c4c203c3e8a595bc333abaf168fcb10c13ed5fb7" }, - "keymap-layer.nvim": { "branch": "master", "commit": "e46840f9f377766e856964a49d7f351de3188a38" }, "laravel.nvim": { "branch": "main", "commit": "d87c06ecdafc9e1c2b13938f8485b3915fe89d36" }, - "lazy.nvim": { "branch": "main", "commit": "dea43afc4adff21a6d5864a378459a140a702c0c" }, + "lazy.nvim": { "branch": "main", "commit": "27ca918bc3d02ea20b3fd901c8919e9925555444" }, "lspkind-nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lualine.nvim": { "branch": "master", "commit": "32a7382a75a52e8ad05f4cec7eeb8bbfbe80d461" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" }, + "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "610f5919fe633ac872239a0ab786572059f0d91d" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "27f61f75a71bb3c2504a17e02b571f79cae43676" }, - "mason.nvim": { "branch": "main", "commit": "dac1093be4f833da1696767c5badac9a3665c1df" }, + "mason.nvim": { "branch": "main", "commit": "5e78970539d937b7aef7a4e10b219d60da0b1425" }, "mind.nvim": { "branch": "v2.2", "commit": "79e0ca131d5e37dfa65f3f0e725d99742e4ff783" }, - "neotest": { "branch": "master", "commit": "414b43f99da0a827c3ce897161fc67c3bb6a5d83" }, + "neotest": { "branch": "master", "commit": "fee5ce9bdc3dff4706a29b012e75025ab376becb" }, "neotest-go": { "branch": "main", "commit": "981406c12bd3c77eb434211a1b85b964ab5bbdd5" }, "neotest-plenary": { "branch": "master", "commit": "d49bfd9470f791e7c29149e75d56b6f925bb391b" }, - "neotest-rust": { "branch": "main", "commit": "3270504691595a317361dcd04798b5d0ff852e52" }, + "neotest-rust": { "branch": "main", "commit": "53db2f682e337c2188d81e8ecdf779bff869fb74" }, "neotest-vim-test": { "branch": "master", "commit": "07f25ab7ba4e7646b38c84e10002b195a53b0096" }, - "null-ls.nvim": { "branch": "main", "commit": "d09d7d82cc26d63673cef85cb62895dd68aab6d8" }, - "nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" }, - "nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-dap": { "branch": "master", "commit": "0f482cad01e31b67cb4e41e6cb66b346d5742408" }, - "nvim-dap-go": { "branch": "main", "commit": "8f10f347b3332d1f783a209813bf9b61f517256f" }, - "nvim-dap-ui": { "branch": "master", "commit": "f2206de65ea39093e3f13992507fc985c17aa763" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "2971ce3e89b1711cc26e27f73d3f854b559a77d4" }, + "null-ls.nvim": { "branch": "main", "commit": "7bd74a821d991057ca1c0ca569d8252c4f89f860" }, + "nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" }, + "nvim-cmp": { "branch": "main", "commit": "11a95792a5be0f5a40bab5fc5b670e5b1399a939" }, + "nvim-dap": { "branch": "master", "commit": "5a1479c5d633daa0db06988ed44663f07f10f5dd" }, + "nvim-dap-go": { "branch": "main", "commit": "6f045a72a05a78e4071dd0880f08214a2bb1461b" }, + "nvim-dap-ui": { "branch": "master", "commit": "b80227ea56a48177786904f6322abc8b2dc0bc36" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "191345947a92a5188d791e9786a5b4f205dcaca3" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "e7c05495934a658c8aa10afd995dacd796f76091" }, - "nvim-lspconfig": { "branch": "master", "commit": "e69978a39e4d3262b09ce6a316beff384f443e3b" }, - "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, + "nvim-lspconfig": { "branch": "master", "commit": "8ebe6894dddaeb1459e1397c865f54fa5ecaac80" }, + "nvim-notify": { "branch": "master", "commit": "72e77098a145d7b805353a0d94a367739f81214f" }, "nvim-projectconfig": { "branch": "master", "commit": "05fd34831e170db269d1b84597615bcdcdde930e" }, "nvim-transparent": { "branch": "main", "commit": "6816751e3d595b3209aa475a83b6fbaa3a5ccc98" }, - "nvim-treesitter": { "branch": "master", "commit": "b1569394614804aaad4e994731161f253ff61bcc" }, + "nvim-treesitter": { "branch": "master", "commit": "fb11ba487caa012b83957e8dd2f8ba45e40da8fd" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "75f5895cc662d61eb919da8050b7a0124400d589" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" }, - "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "2fb97bd6c53d78517d2022a0b84422c18ce5686e" }, + "nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" }, "php-code-actions.nvim": { "branch": "main", "commit": "a85a695c58f9c5e8033d824ffae366e9797e0b28" }, - "playground": { "branch": "master", "commit": "8a887bcf66017bd775a0fb19c9d8b7a4d6759c48" }, - "plenary.nvim": { "branch": "master", "commit": "bb444796dc5746d969f0718913a31c8075741e36" }, + "playground": { "branch": "master", "commit": "01c27f37a1f067200680cacfb7b96f5ad2fa5cd6" }, + "plenary.nvim": { "branch": "master", "commit": "1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "refactoring.nvim": { "branch": "master", "commit": "2d5c7a646e9d0a0f8843a76bae70307eafd3c794" }, - "rest.nvim": { "branch": "main", "commit": "f94c795321b4ee77834db0300cf42f33d6605000" }, + "refactoring.nvim": { "branch": "master", "commit": "b253bcee0488209875fafceda0d0832a121fa3c7" }, + "rest.nvim": { "branch": "main", "commit": "090e253c114b6d5448bac5869a28a6623c195e3a" }, "telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "304508fb7bea78e3c0eeddd88c4837501e403ae8" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "fab3e2212e206f4f8b3bbaa656e129443c9b802e" }, "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, - "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" }, - "tokyonight.nvim": { "branch": "main", "commit": "d785bffce2b5f5a8e8ff9b4f2e4fb3ce7d469b3e" }, - "trouble.nvim": { "branch": "main", "commit": "897542f90050c3230856bc6e45de58b94c700bbf" }, + "telescope.nvim": { "branch": "master", "commit": "2f32775405f6706348b71d0bb8a15a22852a61e4" }, + "tokyonight.nvim": { "branch": "main", "commit": "73671f5dd48a577e753def35b410ef1157d6560b" }, + "trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" }, "vim-blade": { "branch": "master", "commit": "9534101808cc320eef003129a40cab04b026a20c" }, "vim-dadbod": { "branch": "master", "commit": "a09e40664e9cd30cd2b3f8866b796598302070f6" }, "vim-dadbod-completion": { "branch": "master", "commit": "e71eb6140556c5ced80de6299a1fdfe22bd3c1b1" }, - "vim-dadbod-ui": { "branch": "master", "commit": "ecf07480687a13fe1bd3899270a6c9c99de51f4b" }, + "vim-dadbod-ui": { "branch": "master", "commit": "f4ead480930a37dd2b0cf917a8c387ed36c2d86a" }, "vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" }, "vim-eunuch": { "branch": "master", "commit": "291ef1f8c8996ca7715df1032a35a27b12d7b5cf" }, - "vim-fugitive": { "branch": "master", "commit": "99cdb88bc64063dc4656ae53496f06fb2a394cd4" }, + "vim-fugitive": { "branch": "master", "commit": "2febbe1f00be04f16daa6464cb39214a8566ec4b" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-rhubarb": { "branch": "master", "commit": "cad60fe382f3f501bbb28e113dfe8c0de6e77c75" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "vim-test": { "branch": "master", "commit": "aff3607e7698ab5a94a58fdda7ecb5ec567ac293" } + "vim-test": { "branch": "master", "commit": "ca2502545a8c563e15f556d0eb8a59e0f74d2864" } } \ No newline at end of file diff --git a/lua/alpha/database.lua b/lua/alpha/database.lua index df1586b..7715875 100644 --- a/lua/alpha/database.lua +++ b/lua/alpha/database.lua @@ -1,4 +1,3 @@ -P("loading this") vim.g.db_ui_use_nerd_fonts = 1 vim.g.db_ui_show_database_icon = 1 vim.g.db_ui_force_echo_notifications = 1 diff --git a/lua/alpha/lazy.lua b/lua/alpha/lazy.lua index 13754d4..b878978 100644 --- a/lua/alpha/lazy.lua +++ b/lua/alpha/lazy.lua @@ -11,4 +11,4 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -require("lazy").setup("alpha.lazy_plugins") +require("lazy").setup("alpha.plugins") diff --git a/lua/alpha/lazy_plugins.lua b/lua/alpha/lazy_plugins.lua deleted file mode 100644 index 9c6db15..0000000 --- a/lua/alpha/lazy_plugins.lua +++ /dev/null @@ -1,222 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-telescope/telescope-fzy-native.nvim" }, - { "kyazdani42/nvim-web-devicons" }, - { "nvim-telescope/telescope-file-browser.nvim" }, - { "nvim-telescope/telescope-dap.nvim" }, - { "nvim-telescope/telescope-ui-select.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - } - }, - { - "folke/tokyonight.nvim" - }, - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-treesitter/nvim-treesitter" }, - }, - }, - - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - dependencies = { - "nvim-treesitter/playground", - "nvim-treesitter/nvim-treesitter-refactor", - "nvim-treesitter/nvim-treesitter-textobjects", - }, - }, - { "junegunn/fzf.vim" }, - { - "junegunn/fzf", - build = function() - vim.fn["fzf#install"]() - end, - }, - - { - "ThePrimeagen/harpoon", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-lua/popup.nvim", - }, - }, - - { - "windwp/nvim-projectconfig", - config = function() - require("nvim-projectconfig").setup() - end, - }, - - -- Completion - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-git", - "rcarriga/cmp-dap", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind-nvim", - { "L3MON4D3/LuaSnip", version = "v1.*" }, - "windwp/nvim-autopairs", - }, - }, - - -- LSP - { - "neovim/nvim-lspconfig", - "hrsh7th/cmp-nvim-lsp-signature-help", - "jose-elias-alvarez/null-ls.nvim", - }, - - -- Installation of LSP/Debuggers/Other - { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - - { - "nvim-telescope/telescope.nvim", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-telescope/telescope-fzy-native.nvim" }, - { "kyazdani42/nvim-web-devicons" }, - { "nvim-telescope/telescope-file-browser.nvim" }, - { "nvim-telescope/telescope-dap.nvim" }, - { "nvim-telescope/telescope-ui-select.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - }, - }, - - { - "ThePrimeagen/git-worktree.nvim", - config = function() - require("git-worktree").setup({}) - end, - }, - - { - "norcalli/nvim-colorizer.lua", - config = function() - require("colorizer").setup({}) - end, - }, - - { - "nvim-lualine/lualine.nvim", - dependencies = { "kyazdani42/nvim-web-devicons" }, - }, - - { - "mfussenegger/nvim-dap", - dependencies = { - "theHamsta/nvim-dap-virtual-text", - "rcarriga/nvim-dap-ui", - "leoluz/nvim-dap-go", - "mxsdev/nvim-dap-vscode-js", - }, - }, - - { - "folke/trouble.nvim", - dependencies = "kyazdani42/nvim-web-devicons", - }, - - { - "vim-test/vim-test" - }, - { - "nvim-neotest/neotest", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - "antoinemadec/FixCursorHold.nvim", - "nvim-neotest/neotest-go", - "rouge8/neotest-rust", - "nvim-neotest/neotest-plenary", - "nvim-neotest/neotest-vim-test", - -- "olimorris/neotest-phpunit", - }, - }, - - { - "j-hui/fidget.nvim", - config = function() - require("fidget").setup() - end, - }, - - "stevearc/dressing.nvim", - "rcarriga/nvim-notify", - "xiyaowong/nvim-transparent", - - "Raimondi/delimitMate", - "lukas-reineke/indent-blankline.nvim", - - "tpope/vim-surround", - "tpope/vim-repeat", - "tpope/vim-fugitive", - "tpope/vim-rhubarb", - "tpope/vim-dotenv", - "tpope/vim-eunuch", - - { - "numToStr/Comment.nvim", - config = function() - require("Comment").setup() - end, - }, - - { - "lewis6991/gitsigns.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - }, - }, - - -- Database client - { - "kristijanhusak/vim-dadbod-ui", - dependencies = { - "tpope/vim-dadbod", - "kristijanhusak/vim-dadbod-completion", - "tpope/vim-dotenv", - }, - }, - - -- Rest client - { - "NTBBloodbath/rest.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - - { - "anuvyklack/hydra.nvim", - dependencies = "anuvyklack/keymap-layer.nvim", -- needed only for pink hydras - }, - - { - "phaazon/mind.nvim", - branch = "v2.2", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - - { "adalessa/laravel.nvim", dev = false }, - - "adalessa/composer.nvim", - "adalessa/php-code-actions.nvim", - "jwalton512/vim-blade", -} diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua deleted file mode 100644 index ed80c71..0000000 --- a/lua/alpha/plugins.lua +++ /dev/null @@ -1,295 +0,0 @@ -if require("alpha.packer_install")() then - return -end - -vim.cmd.packadd("packer.nvim") -vim.cmd([[autocmd BufWritePost plugins.lua source | PackerCompile]]) - -return require("packer").startup(function(use) - local local_use = function(first, second, opts) - opts = opts or {} - - local plug_path, home - if second == nil then - plug_path = first - home = "adalessa" - else - plug_path = second - home = first - end - - if vim.fn.isdirectory(vim.fn.expand("~/code/plugins/" .. plug_path)) == 1 then - opts[1] = "~/code/plugins/" .. plug_path - else - opts[1] = string.format("%s/%s", home, plug_path) - end - - use(opts) - end - - use("wbthomason/packer.nvim") - use("lewis6991/impatient.nvim") - - use("jwalton512/vim-blade") - - use({ - "ThePrimeagen/refactoring.nvim", - requires = { - { "nvim-lua/plenary.nvim" }, - { "nvim-treesitter/nvim-treesitter" }, - }, - }) - - use({ - "nvim-treesitter/nvim-treesitter", - run = ":TSUpdate", - requires = { - "nvim-treesitter/playground", - "nvim-treesitter/nvim-treesitter-refactor", - "nvim-treesitter/nvim-treesitter-textobjects", - }, - }) - - -- optional - use({ "junegunn/fzf.vim" }) - use({ - "junegunn/fzf", - run = function() - vim.fn["fzf#install"]() - end, - }) - - use({ - "ThePrimeagen/harpoon", - requires = { - "nvim-lua/plenary.nvim", - "nvim-lua/popup.nvim", - }, - keys = require('alpha.harpoon').keymaps, - config = function () - require('alpha.harpoon').setup() - end - }) - - use({ - "windwp/nvim-projectconfig", - config = function() - require("nvim-projectconfig").setup() - end, - }) - - -- Completion - use({ - "hrsh7th/nvim-cmp", - requires = { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-git", - "rcarriga/cmp-dap", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind-nvim", - "hrsh7th/cmp-nvim-lsp-signature-help", - { "L3MON4D3/LuaSnip", tag = "v1.*" }, - "windwp/nvim-autopairs", - }, - }) - - -- Installation of LSP/Debuggers/Other - use({ - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "neovim/nvim-lspconfig", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }) - - -- Null ls - use({ - "jose-elias-alvarez/null-ls.nvim", - }) - - use({ - "nvim-telescope/telescope.nvim", - requires = { - { "nvim-lua/plenary.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-telescope/telescope-fzy-native.nvim" }, - { "kyazdani42/nvim-web-devicons" }, - { "nvim-telescope/telescope-file-browser.nvim" }, - { "nvim-telescope/telescope-dap.nvim" }, - { "nvim-telescope/telescope-ui-select.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", run = "make" }, - }, - }) - - use({ - "ThePrimeagen/git-worktree.nvim", - config = function() - require("git-worktree").setup({}) - end, - }) - - use({ - "nvim-lualine/lualine.nvim", - requires = { "kyazdani42/nvim-web-devicons", opt = true }, - }) - - use({ - "mfussenegger/nvim-dap", - requires = { - "theHamsta/nvim-dap-virtual-text", - "rcarriga/nvim-dap-ui", - "leoluz/nvim-dap-go", - "mxsdev/nvim-dap-vscode-js", - }, - }) - - use({ - "folke/trouble.nvim", - requires = "kyazdani42/nvim-web-devicons", - config = function () - require('trouble').setup({mode = "document_diagnostics"}) - vim.keymap.set('n', 'oo', ':TroubleToggle') - end, - cmd = {"Trouble", "TroubleToggle"}, - keys = "oo", - }) - - use("vim-test/vim-test") - use({ - "nvim-neotest/neotest", - requires = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - "antoinemadec/FixCursorHold.nvim", - "nvim-neotest/neotest-go", - "rouge8/neotest-rust", - "nvim-neotest/neotest-plenary", - "nvim-neotest/neotest-vim-test", - -- "olimorris/neotest-phpunit", - }, - }) - - use({ - "j-hui/fidget.nvim", - config = function() - require("fidget").setup() - end, - }) - - -- Themes - use("EdenEast/nightfox.nvim") - use("folke/tokyonight.nvim") - use("wuelnerdotexe/vim-enfocado") - - -- use("voldikss/vim-floaterm") - - -- Style - use("stevearc/dressing.nvim") - use({ - "rcarriga/nvim-notify", - config = function () - require('notify').setup({background_colour = "#000000"}) - end - }) - use("xiyaowong/nvim-transparent") - - use("Raimondi/delimitMate") - use("lukas-reineke/indent-blankline.nvim") - - use("tpope/vim-surround") - use("tpope/vim-repeat") - use("tpope/vim-fugitive") - use("tpope/vim-rhubarb") - use("tpope/vim-dotenv") - use("tpope/vim-eunuch") - - use({ - "numToStr/Comment.nvim", - config = function() - require("Comment").setup() - end, - }) - use("tpope/vim-sleuth") - - use("junegunn/vim-easy-align") - - - use("jghauser/mkdir.nvim") - - use({ - "lewis6991/gitsigns.nvim", - requires = { - "nvim-lua/plenary.nvim", - }, - }) - - -- Database client - use({ - "kristijanhusak/vim-dadbod-ui", - requires = { - "tpope/vim-dadbod", - "kristijanhusak/vim-dadbod-completion", - "tpope/vim-dotenv", - }, - cmd = "DBUI", - keys = "db", - config = function () - require('alpha.database') - end - }) - - -- Rest client - use({ - "NTBBloodbath/rest.nvim", - requires = { "nvim-lua/plenary.nvim" }, - ft = "http", - config = function() - require("alpha.rest") - end, - }) - - use({ - "anuvyklack/hydra.nvim", - requires = "anuvyklack/keymap-layer.nvim", -- needed only for pink hydras - }) - - use({ - "phaazon/mind.nvim", - branch = "v2.2", - requires = { "nvim-lua/plenary.nvim" }, - cmd = { "MindOpenMain", "MindOpenProject" }, - config = function () - local dirs = {} - if vim.fn.isdirectory("/mnt/nas/alpha/mind/data") == 1 then - dirs = { - state_path = "/mnt/nas/alpha/mind/mind.json", - data_dir = "/mnt/nas/alpha/mind/data", - } - end - require('mind').setup({ persistence = dirs}) - end - }) - - use { - "danymat/neogen", - config = function() - require('neogen').setup({ snippet_engine = "luasnip" }) - end, - cmd = "Neogen", - requires = "nvim-treesitter/nvim-treesitter", - } - - -- Local plugins can be included - local_use("telescope-projectionist.nvim") - local_use("php-code-actions.nvim") - local_use("laravel.nvim", nil, { - config = function () - require('alpha.laravel') - end, - }) - local_use("composer.nvim") - local_use("neotest-phpunit") -end) diff --git a/lua/alpha/plugins/colorscheme.lua b/lua/alpha/plugins/colorscheme.lua new file mode 100644 index 0000000..8b9bbbd --- /dev/null +++ b/lua/alpha/plugins/colorscheme.lua @@ -0,0 +1,9 @@ +return { + "folke/tokyonight.nvim", + config = function() + require("tokyonight").setup({ + style = "night" + }) + vim.cmd.colorscheme("tokyonight") + end +} diff --git a/lua/alpha/plugins/completition.lua b/lua/alpha/plugins/completition.lua new file mode 100644 index 0000000..0ab9b89 --- /dev/null +++ b/lua/alpha/plugins/completition.lua @@ -0,0 +1,19 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-git", + "rcarriga/cmp-dap", + "saadparwaiz1/cmp_luasnip", + "onsails/lspkind-nvim", + { "L3MON4D3/LuaSnip", version = "v1.*" }, + "windwp/nvim-autopairs", + }, + config = function () + require("alpha.completition") + end +} diff --git a/lua/alpha/plugins/dap.lua b/lua/alpha/plugins/dap.lua new file mode 100644 index 0000000..6f33484 --- /dev/null +++ b/lua/alpha/plugins/dap.lua @@ -0,0 +1,14 @@ +return { + "mfussenegger/nvim-dap", + dependencies = { + "theHamsta/nvim-dap-virtual-text", + "rcarriga/nvim-dap-ui", + "leoluz/nvim-dap-go", + "mxsdev/nvim-dap-vscode-js", + "anuvyklack/hydra.nvim", + }, + keys = { { "d" } }, + config = function() + require("alpha.dap") + end +} diff --git a/lua/alpha/plugins/database.lua b/lua/alpha/plugins/database.lua new file mode 100644 index 0000000..39e42a5 --- /dev/null +++ b/lua/alpha/plugins/database.lua @@ -0,0 +1,11 @@ +return { + "kristijanhusak/vim-dadbod-ui", + dependencies = { + "tpope/vim-dadbod", + "kristijanhusak/vim-dadbod-completion", + "tpope/vim-dotenv", + }, + config = function () + require("alpha.database") + end +} diff --git a/lua/alpha/plugins/dressing.lua b/lua/alpha/plugins/dressing.lua new file mode 100644 index 0000000..7d7e056 --- /dev/null +++ b/lua/alpha/plugins/dressing.lua @@ -0,0 +1,161 @@ +return { + "stevearc/dressing.nvim", + config = function() + require("dressing").setup({ + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "Input:", + + -- Can be 'left', 'right', or 'center' + prompt_align = "left", + + -- When true, will close the modal + insert_only = true, + + -- When true, input will start in insert mode. + start_in_insert = true, + + -- These are passed to nvim_open_win + anchor = "SW", + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 40, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + win_options = { + -- Window transparency (0-100) + winblend = 10, + -- Disable line wrapping + wrap = false, + }, + + -- Set to `false` to disable + mappings = { + n = { + [""] = "Close", + [""] = "Confirm", + }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext", + }, + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil, + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + telescope = nil, + + -- Options for fzf selector + fzf = { + window = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for fzf_lua selector + fzf_lua = { + winopts = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { + style = "rounded", + }, + buf_options = { + swapfile = false, + filetype = "DressingSelect", + }, + win_options = { + winblend = 10, + }, + max_width = 80, + max_height = 40, + min_width = 40, + min_height = 10, + }, + + -- Options for built-in selector + builtin = { + -- These are passed to nvim_open_win + anchor = "NW", + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + win_options = { + -- Window transparency (0-100) + winblend = 10, + }, + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + -- Set to `false` to disable + mappings = { + [""] = "Close", + [""] = "Close", + [""] = "Confirm", + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil, + }, + }) + end +} diff --git a/lua/alpha/plugins/gitsigns.lua b/lua/alpha/plugins/gitsigns.lua new file mode 100644 index 0000000..12a1840 --- /dev/null +++ b/lua/alpha/plugins/gitsigns.lua @@ -0,0 +1,20 @@ +return { + "lewis6991/gitsigns.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + local gitsigns = require("gitsigns") + gitsigns.setup({ + on_attach = function(bufnr) + vim.keymap.set('n', 'hs', gitsigns.stage_hunk, { buffer = bufnr }) + vim.keymap.set('n', 'hu', gitsigns.undo_stage_hunk, { buffer = bufnr }) + vim.keymap.set('n', 'hr', gitsigns.reset_hunk, { buffer = bufnr }) + vim.keymap.set('n', 'hp', gitsigns.preview_hunk, { buffer = bufnr }) + vim.keymap.set('n', 'hj', gitsigns.next_hunk, { buffer = bufnr }) + vim.keymap.set('n', 'hk', gitsigns.prev_hunk, { buffer = bufnr }) + end, + max_file_length = 10000, + }) + end +} diff --git a/lua/alpha/plugins/harpoon.lua b/lua/alpha/plugins/harpoon.lua new file mode 100644 index 0000000..8a4ecc6 --- /dev/null +++ b/lua/alpha/plugins/harpoon.lua @@ -0,0 +1,10 @@ +return { + "ThePrimeagen/harpoon", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-lua/popup.nvim", + }, + config = function () + require("alpha.harpoon").setup() + end +} diff --git a/lua/alpha/plugins/init.lua b/lua/alpha/plugins/init.lua new file mode 100644 index 0000000..334cb01 --- /dev/null +++ b/lua/alpha/plugins/init.lua @@ -0,0 +1,54 @@ +return { + "jwalton512/vim-blade", + { "junegunn/fzf.vim" }, + { + "junegunn/fzf", + build = function() + vim.fn["fzf#install"]() + end, + }, + { + "windwp/nvim-projectconfig", + config = function() + require("nvim-projectconfig").setup() + end, + }, + { + "ThePrimeagen/git-worktree.nvim", + config = function() + require("git-worktree").setup({}) + end, + }, + { + "folke/trouble.nvim", + dependencies = "kyazdani42/nvim-web-devicons", + }, + "vim-test/vim-test", + "rcarriga/nvim-notify", + + "Raimondi/delimitMate", + "lukas-reineke/indent-blankline.nvim", + + "tpope/vim-surround", + "tpope/vim-repeat", + "tpope/vim-fugitive", + "tpope/vim-rhubarb", + "tpope/vim-dotenv", + "tpope/vim-eunuch", + { + "numToStr/Comment.nvim", + config = function() + require("Comment").setup() + end, + }, + { + "phaazon/mind.nvim", + branch = "v2.2", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + + { "adalessa/laravel.nvim", dev = false }, + + "adalessa/composer.nvim", + "adalessa/php-code-actions.nvim", +} diff --git a/lua/alpha/plugins/lsp.lua b/lua/alpha/plugins/lsp.lua new file mode 100644 index 0000000..ac07faf --- /dev/null +++ b/lua/alpha/plugins/lsp.lua @@ -0,0 +1,19 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + "hrsh7th/cmp-nvim-lsp-signature-help", + "jose-elias-alvarez/null-ls.nvim", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + { + "j-hui/fidget.nvim", + config = function() + require("fidget").setup() + end, + }, + }, + config = function () + require("alpha.lsp") + end +} diff --git a/lua/alpha/plugins/lualine.lua b/lua/alpha/plugins/lualine.lua new file mode 100644 index 0000000..e2ace98 --- /dev/null +++ b/lua/alpha/plugins/lualine.lua @@ -0,0 +1,38 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "kyazdani42/nvim-web-devicons" }, + config = function() + require("lualine").setup({ + options = { + theme = vim.g.alpha_lualine_color, + 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 = { "diagnostics", "diff" }, + lualine_y = { "filetype" }, + lualine_z = { "location" }, + }, + winbar = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + inactive_winbar = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + }) + end +} diff --git a/lua/alpha/plugins/neotest.lua b/lua/alpha/plugins/neotest.lua new file mode 100644 index 0000000..2cecb60 --- /dev/null +++ b/lua/alpha/plugins/neotest.lua @@ -0,0 +1,63 @@ +return { + "nvim-neotest/neotest", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim", + "nvim-neotest/neotest-go", + "rouge8/neotest-rust", + "nvim-neotest/neotest-plenary", + "nvim-neotest/neotest-vim-test", + "anuvyklack/hydra.nvim", + }, + config = function() + local neotest = require("neotest") + neotest.setup({ + adapters = { + require("neotest-go"), + require("neotest-rust"), + require("neotest-plenary"), + require("neotest-vim-test")({ + ignore_file_types = { "go", "lua", "rust", "php" }, + }), + -- require("laravel.neotest"), + }, + }) + + local hydra = require("hydra") + + local hint = [[ + NeoTest + _n_: Near test _f_: Current file _l_: Last Test _m_: Run Marked _s_: Toggle Summary ^ + ^ ^ __ + ]] + + hydra({ + name = "neotest", + hint = hint, + mode = "n", + config = { + color = "teal", + invoke_on_body = true, + hint = { + border = "rounded", + position = "bottom", + }, + }, + body = "", + heads = { + { "n", neotest.run.run }, + { + "f", + function() + neotest.run.run(vim.fn.expand("%")) + end, + }, + { "l", neotest.run.run_last }, + { "m", neotest.summary.run_marked }, + { "s", neotest.summary.toggle }, + { "", nil, { exit = true } }, + }, + }) + end +} diff --git a/lua/alpha/plugins/refactoring.lua b/lua/alpha/plugins/refactoring.lua new file mode 100644 index 0000000..c8bf7fc --- /dev/null +++ b/lua/alpha/plugins/refactoring.lua @@ -0,0 +1,10 @@ +return { + "ThePrimeagen/refactoring.nvim", + dependencies = { + { "nvim-lua/plenary.nvim" }, + { "nvim-treesitter/nvim-treesitter" }, + }, + config = function() + require("refactoring").setup({}) + end +} diff --git a/lua/alpha/plugins/rest.lua b/lua/alpha/plugins/rest.lua new file mode 100644 index 0000000..a0ec729 --- /dev/null +++ b/lua/alpha/plugins/rest.lua @@ -0,0 +1,41 @@ +return { + "NTBBloodbath/rest.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local rest_nvim = require("rest-nvim") + + rest_nvim.setup({ + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + show_http_info = true, + show_headers = true, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = ".env", + custom_dynamic_variables = {}, + yank_dry_run = true, + }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = "http", + callback = function() + local buff = tonumber(vim.fn.expand(""), 10) + vim.keymap.set("n", "rn", rest_nvim.run, { noremap = true, buffer = buff }) + vim.keymap.set("n", "rl", rest_nvim.last, { noremap = true, buffer = buff }) + vim.keymap.set("n", "rp", function() rest_nvim.run(true) end, { noremap = true, buffer = buff }) + end + }) + + end +} diff --git a/lua/alpha/plugins/snippets.lua b/lua/alpha/plugins/snippets.lua new file mode 100644 index 0000000..dee004e --- /dev/null +++ b/lua/alpha/plugins/snippets.lua @@ -0,0 +1,135 @@ +return { + "L3MON4D3/LuaSnip", + version = "v1.*", + config = function() + if vim.g.snippets ~= "luasnip" then + return + end + + local ls = require("luasnip") + local types = require("luasnip.util.types") + + ls.config.set_config({ + -- This tells LuaSnip to remember to keep around the last snippet. + -- You can jump back into even if you move outside of the selection + history = true, + + -- This one is cool cause if you have dynamic snippets, it updatesas you type! + updateevents = "TextChanged,TextChangedI", + + -- Autosnippets: + enable_autosnippets = true, + + ext_opts = { + [types.choiceNode] = { + active = { + virt_text = { { "<- Choice", "Error" } }, + }, + }, + }, + }) + + -- create snippet + -- s(context, nodes, condition, ...) + local snippet = ls.s + + -- TODO: Write about this. + -- Useful for dynamic nodes and choice nodes + -- local snippet_from_nodes = ls.sn + + -- This is the simplest node. + -- Creates a new text node. Places cursor after node by default. + -- t { "this will be inserted" } + -- + -- Multiple lines are by passing a table of strings. + -- t { "line 1", "line 2" } + local t = ls.text_node + + -- Insert Node + -- Creates a location for the cursor to jump to. + -- Possible options to jump to are 1 - N + -- If you use 0, that's the final place to jump to. + -- + -- To create placeholder text, pass it as the second argument + -- i(2, "this is placeholder text") + local i = ls.insert_node + + -- Function Node + -- Takes a function that returns text + -- local f = ls.function_node + + -- This a choice snippet. You can move through with (in my config) + -- c(1, { t {"hello"}, t {"world"}, }), + -- + -- The first argument is the jump position + -- The second argument is a table of possible nodes. + -- Note, one thing that's nice is you don't have to include + -- the jump position for nodes that normally require one (can be nil) + -- local c = ls.choice_node + + -- local d = ls.dynamic_node + + -- TODO: Document what I've learned about lambda + -- local l = require("luasnip.extras").lambda + + -- local events = require("luasnip.util.events") + + local shortcut = function(val) + if type(val) == "string" then + return { t({ val }), i(0) } + end + + if type(val) == "table" then + for k, v in ipairs(val) do + if type(v) == "string" then + val[k] = t({ v }) + end + end + end + + return val + end + + local make = function(tbl) + local result = {} + for k, v in pairs(tbl) do + table.insert(result, (snippet({ trig = k, desc = v.desc }, shortcut(v)))) + end + + return result + end + + ls.cleanup() + for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/snips/ft/*.lua", true)) do + local ft = vim.fn.fnamemodify(ft_path, ":t:r") + ls.add_snippets(ft, make(loadfile(ft_path)())) + end + + -- is my expansion key + -- this will expand the current item or jump to the next item within the snippet. + vim.keymap.set({ "i", "s" }, "", function() + if ls.expand_or_jumpable() then + ls.expand_or_jump() + end + end, { silent = true }) + + -- is my jump backwards key. + -- this always moves to the previous item within the snippet + vim.keymap.set({ "i", "s" }, "", function() + if ls.jumpable(-1) then + ls.jump(-1) + end + end, { silent = true }) + + -- is selecting within a list of options. + -- This is useful for choice nodes (introduced in the forthcoming episode 2) + vim.keymap.set("i", "", function() + if ls.choice_active() then + ls.change_choice(1) + end + end) + + -- shorcut to source my luasnips file again, which will reload my snippets + vim.keymap.set("n", "s", "source ~/.config/nvim/after/plugin/luasnip.lua") + end +} diff --git a/lua/alpha/plugins/telescope.lua b/lua/alpha/plugins/telescope.lua new file mode 100644 index 0000000..ba6ae58 --- /dev/null +++ b/lua/alpha/plugins/telescope.lua @@ -0,0 +1,17 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + { "nvim-lua/plenary.nvim" }, + { "nvim-lua/popup.nvim" }, + { "nvim-telescope/telescope-fzy-native.nvim" }, + { "kyazdani42/nvim-web-devicons" }, + { "nvim-telescope/telescope-file-browser.nvim" }, + { "nvim-telescope/telescope-dap.nvim" }, + { "nvim-telescope/telescope-ui-select.nvim" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + }, + config = function () + require("alpha.telescope.setup") + require("alpha.telescope.mappings") + end +} diff --git a/lua/alpha/plugins/transparent.lua b/lua/alpha/plugins/transparent.lua new file mode 100644 index 0000000..fa0b480 --- /dev/null +++ b/lua/alpha/plugins/transparent.lua @@ -0,0 +1,20 @@ +return { + "xiyaowong/nvim-transparent", + config = function() + require("transparent").setup({ + enable = true, -- boolean: enable transparent + extra_groups = { -- table/string: additional groups that should be cleared + -- In particular, when you set it to 'all', that means all available groups + + -- example of akinsho/nvim-bufferline.lua + "BufferLineTabClose", + "BufferlineBufferSelected", + "BufferLineFill", + "BufferLineBackground", + "BufferLineSeparator", + "BufferLineIndicatorSelected", + }, + exclude = {}, -- table: groups you don't want to clear + }) + end +} diff --git a/lua/alpha/plugins/treesitter.lua b/lua/alpha/plugins/treesitter.lua new file mode 100644 index 0000000..8bb6026 --- /dev/null +++ b/lua/alpha/plugins/treesitter.lua @@ -0,0 +1,71 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + dependencies = { + "nvim-treesitter/playground", + "nvim-treesitter/nvim-treesitter-refactor", + "nvim-treesitter/nvim-treesitter-textobjects", + }, + config = function() + require "nvim-treesitter.configs".setup { + ensure_installed = { "php", "phpdoc", "vim", "go", "gomod", "css", "html", "javascript", "lua", "typescript" }, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "gnn", + node_incremental = "grn", + scope_incremental = "grc", + node_decremental = "grm", +