diff --git a/lazy-lock.json b/lazy-lock.json index 10a2c34..136cc59 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,56 +2,55 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, - "bufferline.nvim": { "branch": "main", "commit": "261a72b90d6db4ed8014f7bda976bcdc9dd7ce76" }, - "catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" }, + "bufferline.nvim": { "branch": "main", "commit": "9f0826ae6adfd836a23bf8a4910e3c07450211f4" }, + "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8" }, - "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, + "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, + "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, + "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, - "lazy.nvim": { "branch": "main", "commit": "014d1d6d78df4e58f962158e6e00261d8632612c" }, - "lazygit.nvim": { "branch": "main", "commit": "02a7a2789fe9e660ef72bec27df342b15bcca6b7" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "9a686513eaaa13d737d0fec8956a18268ead8b29" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mdx.nvim": { "branch": "main", "commit": "ae83959b61a9fec8da228ebb5d6b045fd532d2cc" }, "mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" }, - "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, "mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" }, "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, - "mini.surround": { "branch": "main", "commit": "48a9795c9d352c771e1ab5dedab6063c0a2df037" }, + "mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "noice.nvim": { "branch": "main", "commit": "7b1960c48078a8b2fb44a89db82f4fa637b2d7c8" }, - "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "47f236c058f0511702286a21ba53bbf42abbd8a8" }, - "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, + "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, + "nvim-notify": { "branch": "master", "commit": "c3797193536711b5d8983975791c4b11dc35ab3a" }, "nvim-spectre": { "branch": "master", "commit": "08be31c104df3b4b049607694ebb2b6ced4f928b" }, "nvim-treesitter": { "branch": "master", "commit": "b6492f41c46d9c3bc3550ecfb10c3f261e73cba6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, - "nvim-web-devicons": { "branch": "master", "commit": "87c34abe5d1dc7c1c0a95aaaf888059c614c68ac" }, - "oil.nvim": { "branch": "master", "commit": "9a59256c8e88b29d2150e99b5960b2f111e51f75" }, + "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "smart-splits.nvim": { "branch": "master", "commit": "264e865589389409f1ac1da7673b1b732b1e8963" }, + "smart-splits.nvim": { "branch": "master", "commit": "d2da32b76b89126609f4142bd55279c8723cb050" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "twilight.nvim": { "branch": "main", "commit": "1584c0b0a979b71fd86b18d302ba84e9aba85b1b" }, "typescript-tools.nvim": { "branch": "master", "commit": "35e397ce467bedbbbb5bfcd0aa79727b59a08d4a" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" }, - "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }, - "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" } + "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" }, + "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } } diff --git a/lua/plugins/Comment.lua b/lua/plugins/Comment.lua new file mode 100644 index 0000000..cc0273b --- /dev/null +++ b/lua/plugins/Comment.lua @@ -0,0 +1,8 @@ +return { + + { + "numToStr/Comment.nvim", + event = "VeryLazy", + opts = {}, + }, +} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..02fbf2f --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,58 @@ +return { + { + "goolord/alpha-nvim", + event = "VimEnter", + opts = function() + local dashboard = require("alpha.themes.dashboard") + local logo = [[ + + ]] + + dashboard.section.header.val = vim.split(logo, "\n") + dashboard.section.buttons.val = { + dashboard.button("f", " " .. " Find file", ":Telescope find_files "), + dashboard.button("n", " " .. " New file", ":ene startinsert "), + dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), + dashboard.button("g", " " .. " Find text", ":Telescope live_grep "), + dashboard.button("c", " " .. " Config", ":e $MYVIMRC "), + dashboard.button("s", " " .. " Restore Session", [[:lua require("persistence").load() ]]), + dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy"), + dashboard.button("q", " " .. " Quit", ":qa"), + } + for _, button in ipairs(dashboard.section.buttons.val) do + button.opts.hl = "AlphaButtons" + button.opts.hl_shortcut = "AlphaShortcut" + end + dashboard.section.header.opts.hl = "AlphaHeader" + dashboard.section.buttons.opts.hl = "AlphaButtons" + dashboard.section.footer.opts.hl = "AlphaFooter" + dashboard.opts.layout[1].val = 8 + return dashboard + end, + config = function(_, dashboard) + local lazy = require("lazy") + -- close Lazy and re-open when the dashboard is ready + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "AlphaReady", + callback = function() + lazy.show() + end, + }) + end + + require("alpha").setup(dashboard.opts) + + vim.api.nvim_create_autocmd("User", { + pattern = "LazyVimStarted", + callback = function() + local stats = lazy.stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" + pcall(vim.cmd.AlphaRedraw) + end, + }) + end, + }, +} diff --git a/lua/plugins/autotag.lua b/lua/plugins/autotag.lua new file mode 100644 index 0000000..dac689b --- /dev/null +++ b/lua/plugins/autotag.lua @@ -0,0 +1,16 @@ +return { + { + "windwp/nvim-ts-autotag", + config = function(_, _) + local autotag = require("nvim-ts-autotag") + + autotag.setup({ + opts = { + enable_rename = true, + enable_close = true, + enable_close_on_slash = true, + }, + }) + end, + }, +} diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100644 index 0000000..1b10c60 --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1,19 @@ +return { + { + "akinsho/bufferline.nvim", + event = "VeryLazy", + keys = { + { "bp", "BufferLineTogglePin", desc = "Toggle pin" }, + { "bP", "BufferLineGroupClose ungrouped", desc = "Delete non-pinned buffers" }, + }, + opts = { + options = { + offsets = { + { + filetype = "neo-tree", + }, + }, + }, + }, + }, +} diff --git a/lua/plugins/bufremove.lua b/lua/plugins/bufremove.lua new file mode 100644 index 0000000..a167876 --- /dev/null +++ b/lua/plugins/bufremove.lua @@ -0,0 +1,10 @@ +return { + { + "echasnovski/mini.bufremove", + -- stylua: ignore + keys = { + { "bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" }, + { "bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" }, + }, + }, +} diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua deleted file mode 100644 index f81f19e..0000000 --- a/lua/plugins/coding.lua +++ /dev/null @@ -1,207 +0,0 @@ -return { - { - "L3MON4D3/LuaSnip", - version = "2.*", - build = (not jit.os:find("Windows")) - and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" - or nil, - opts = { - history = true, - delete_check_events = "TextChanged", - }, - config = function(_, opts) - local ls = require("luasnip") - ls.setup({ - history = true, - delete_check_events = "TextChanged", - }) - require("luasnip.loaders.from_lua").load({ paths = "~/snippets" }) - end, - dependencies = { - "hrsh7th/nvim-cmp", - }, - -- stylua: ignore - }, - - { - "hrsh7th/nvim-cmp", - version = false, - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lsp-signature-help", - "onsails/lspkind.nvim", - }, - opts = function() - vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) - local luasnip = require("luasnip") - local cmp = require("cmp") - local border_opts = { - border = { - { "╭", "CmpDocBorder" }, - { "─", "CmpDocBorder" }, - { "╮", "CmpDocBorder" }, - { "│", "CmpDocBorder" }, - { "╯", "CmpDocBorder" }, - { "─", "CmpDocBorder" }, - { "╰", "CmpDocBorder" }, - { "│", "CmpDocBorder" }, - }, - winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None", - } - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 - and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - return { - formatting = { - fields = { - "abbr", - "kind", - "menu", - }, - format = require("lspkind").cmp_format({ - mode = "symbol_text", - maxwidth = 150, - ellipsis_char = "...", - before = function(entry, vim_item) - vim_item.menu = ({ - nvim_lsp = "[LSP]", - buffer = "[Buffer]", - })[entry.source.name] - return vim_item - end, - }), - }, - completion = { - completeopt = "menu,menuone,noinsert", - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ behavior = cmp.SelectBehavior.Replace, select = true }), - -- [""] = cmp.mapping(function(fallback) - -- if cmp.visible() then - -- cmp.select_next_item() - -- -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- -- they way you will only jump inside the snippet region - -- elseif luasnip.expand_or_jumpable() then - -- luasnip.expand_or_jump() - -- elseif has_words_before() then - -- cmp.complete() - -- else - -- fallback() - -- end - -- end, { "i", "s" }), - -- [""] = cmp.mapping(function(fallback) - -- if cmp.visible() then - -- cmp.select_prev_item() - -- elseif luasnip.jumpable(-1) then - -- luasnip.jump(-1) - -- else - -- fallback() - -- end - -- end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "nvim_lsp_signature_help" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }), - window = { - scrollbar = false, - completion = cmp.config.window.bordered(border_opts), - documentation = cmp.config.window.bordered(border_opts), - }, - } - end, - }, - - { - "stevearc/conform.nvim", - opts = {}, - config = function() - local confrom = require("conform") - confrom.setup({ - log_level = vim.log.levels.DEBUG, - formatters_by_ft = { - lua = { "stylua" }, - javascript = { "prettierd", "eslint_d" }, - typescript = { "prettierd", "eslint_d" }, - typescriptreact = { "prettierd", "eslint_d" }, - json = { "prettierd" }, - jsonc = { "prettierd" }, - go = { "gofumpt", "goimports" }, - }, - format_on_save = { - timeout_ms = 500, - lsp_fallback = true, - }, - }) - end, - }, - - { - "echasnovski/mini.pairs", - event = "VeryLazy", - opts = {}, - }, - - { - "numToStr/Comment.nvim", - event = "VeryLazy", - opts = {}, - }, - - { - "echasnovski/mini.surround", - opts = {}, - }, - - { - "folke/zen-mode.nvim", - keys = { - { - "zm", - function() - require("zen-mode").toggle({ - window = { - width = 0.85, - }, - }) - end, - }, - }, - opts = { - plugins = { - twilight = { enabled = true }, - }, - }, - }, - - { - "folke/twilight.nvim", - opts = {}, - }, - - { - "davidmh/mdx.nvim", - config = true, - dependencies = { "nvim-treesitter/nvim-treesitter" }, - }, -} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 83b1047..4529f82 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -15,7 +15,7 @@ return { dark = "mocha", light = "latte", }, - transparent_background = true, + transparent_background = false, }) vim.cmd.colorscheme("catppuccin") end, diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..99c3eca --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,25 @@ +return { + { + "stevearc/conform.nvim", + opts = {}, + config = function() + local confrom = require("conform") + confrom.setup({ + log_level = vim.log.levels.DEBUG, + formatters_by_ft = { + lua = { "stylua" }, + javascript = { "prettierd", "eslint_d" }, + typescript = { "prettierd", "eslint_d" }, + typescriptreact = { "prettierd", "eslint_d" }, + json = { "prettierd" }, + jsonc = { "prettierd" }, + go = { "gofumpt", "goimports" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + }) + end, + }, +} diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..3b60898 --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,57 @@ +-- Copilot. +return { + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + opts = { + -- I don't find the panel useful. + panel = { enabled = false }, + suggestion = { + auto_trigger = true, + -- Use alt to interact with Copilot. + keymap = { + -- Disable the built-in mapping, we'll configure it in nvim-cmp. + accept = false, + accept_word = "", + accept_line = "", + next = "", + prev = "", + dismiss = "/", + }, + }, + filetypes = { markdown = true, lua = true, python = true, typescript = true, javascript = true }, + }, + config = function(_, opts) + local cmp = require("cmp") + local copilot = require("copilot.suggestion") + local luasnip = require("luasnip") + + require("copilot").setup(opts) + + local function set_trigger(trigger) + vim.b.copilot_suggestion_auto_trigger = trigger + vim.b.copilot_suggestion_hidden = not trigger + end + + -- Hide suggestions when the completion menu is open. + cmp.event:on("menu_opened", function() + if copilot.is_visible() then + copilot.dismiss() + end + set_trigger(false) + end) + + -- Disable suggestions when inside a snippet. + cmp.event:on("menu_closed", function() + set_trigger(not luasnip.expand_or_locally_jumpable()) + end) + vim.api.nvim_create_autocmd("User", { + pattern = { "LuasnipInsertNodeEnter", "LuasnipInsertNodeLeave" }, + callback = function() + set_trigger(not luasnip.expand_or_locally_jumpable()) + end, + }) + end, + }, +} diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua new file mode 100644 index 0000000..ebb4c88 --- /dev/null +++ b/lua/plugins/dressing.lua @@ -0,0 +1,17 @@ +return { + { + "stevearc/dressing.nvim", + opts = { + select = { + enabled = true, + backend = { + "telescope", + "fzf", + "builtin", + "nui", + }, + telescope = require("telescope.themes").get_ivy(), + }, + }, + }, +} diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua deleted file mode 100644 index 89ad7c8..0000000 --- a/lua/plugins/editor.lua +++ /dev/null @@ -1,445 +0,0 @@ -return { - { - "nvim-neo-tree/neo-tree.nvim", - cmd = "Neotree", - branch = "v2.x", - dependencies = { - "MunifTanjim/nui.nvim", - }, - opts = { - close_if_last_window = true, - sources = { - "filesystem", - "buffers", - "git_status", - }, - source_selector = { - winbar = true, - content_layout = "center", - sources = { - { source = "filesystem", display_name = require("config.icons").FolderClosed .. " File" }, - { source = "buffers", display_name = require("config.icons").DefaultFile .. " Bufs" }, - { source = "git_status", display_name = require("config.icons").Git .. " Git" }, - { source = "diagnostics", display_name = require("config.icons").Diagnostic .. " Diagnostic" }, - }, - }, - default_component_configs = { - indent = { - padding = 0, - }, - icon = { - folder_closed = require("config.icons").FolderClosed, - folder_open = require("config.icons").FolderOpen, - folder_empty = require("config.icons").FolderEmpty, - folder_empty_open = require("config.icons").FolderEmpty, - default = require("config.icons").DefaultFile, - }, - }, - filesystem = { - follow_current_file = true, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true, - }, - }, - keys = { - { - "fe", - function() - require("neo-tree.command").execute({ - toggle = true, - }) - end, - }, - }, - }, - - { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - }, - cmd = "Telescope", - keys = { - { - "ff", - function() - require("telescope.builtin").find_files() - end, - desc = "[ F ]ind files", - }, - { - "fF", - function() - require("telescope.builtin").find_files({ hidden = true, no_ignore = true }) - end, - desc = "[ F ]ind [ F ]iles", - }, - - { - "lg", - function() - require("telescope.builtin").live_grep() - end, - desc = "Live grep", - }, - { - "gf", - function() - require("telescope.builtin").git_files() - end, - desc = "Live grep", - }, - { - "gs", - function() - require("telescope.builtin").git_status() - end, - desc = "Live grep", - }, - { - "fc", - function() - require("telescope.builtin").git_commits() - end, - desc = "Git Commits", - }, - - { - "of", - function() - require("telescope.builtin").oldfiles() - end, - desc = "[ O ]ld [ F ]iles", - }, - - { - "ds", - function() - require("telescope.builtin").lsp_document_symbols() - end, - desc = "[ D ]ocument [ S ]ymbols", - }, - - { - "wss", - function() - require("telescope.builtin").lsp_dynamic_workspace_symbols() - end, - desc = "[ W ]orkspace [ S ]ymbol[ s ]", - remap = true, - }, - - { - "lr", - function() - require("telescope.builtin").lsp_references() - end, - desc = "[L]ist [R]erefrences", - }, - { - "ld", - function() - require("telescope.builtin").diagnostics() - end, - desc = "[ L ]ist [ D ]iagnostics", - }, - { - "li", - function() - require("telescope.builtin").lsp_implementations() - end, - desc = "[ L ]ist [ I ]mplementation", - }, - { - "ldi", - function() - require("telescope.builtin").lsp_definitions() - end, - desc = "[ L ]ist [ D ]ef[ i ]nitions", - }, - }, - opts = { - defaults = { - prompt_prefix = "", - selection_caret = "", - sorting_strategy = "ascending", - path_display = { - "smart", - }, - layout_config = { - horizontal = { - prompt_position = "top", - width = 0.75, - height = 0.65, - preview_width = 0.6, - }, - }, - mappings = { - i = { - [""] = function(...) - require("telescope.actions").move_selection_previous(...) - end, - [""] = function(...) - require("telescope.actions").move_selection_next(...) - end, - [""] = function(...) - require("trouble.providers.telescope").open_with_trouble(...) - end, - }, - n = { - q = function(...) - require("telescope.actions").close(...) - end, - [""] = function(...) - require("trouble.providers.telescope").open_with_trouble(...) - end, - }, - }, - }, - }, - }, - - { - "folke/flash.nvim", - event = "VeryLazy", - vscode = true, - keys = { - { - "s", - mode = { "n", "x", "o" }, - function() - require("flash").jump() - end, - desc = "Flash", - }, - { - "S", - mode = { "n", "o", "x" }, - function() - require("flash").treesitter() - end, - desc = "Flash Treesitter", - }, - { - "r", - mode = "o", - function() - require("flash").remote() - end, - desc = "Remote Flash", - }, - { - "R", - mode = { "o", "x" }, - function() - require("flash").treesitter_search() - end, - desc = "Treesitter Search", - }, - { - "", - mode = { "c" }, - function() - require("flash").toggle() - end, - desc = "Toggle Flash Search", - }, - }, - }, - - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - plugins = { - spelling = true, - }, - }, - }, - - { - "lewis6991/gitsigns.nvim", - event = { - "BufReadPre", - "BufNewFile", - }, - opts = { - signs = { - add = { text = "▎" }, - change = { text = "▎" }, - delete = { text = "" }, - topdelete = { text = "" }, - changedelete = { text = "▎" }, - untracked = { text = "▎" }, - }, - }, - }, - - { - "RRethy/vim-illuminate", - event = { - "BufReadPost", - "BufNewFile", - }, - opts = { - delay = 200, - }, - config = function(_, opts) - require("illuminate").configure(opts) - end, - keys = { - { "]]", desc = "Next Reference" }, - { "[[", desc = "Prev Reference" }, - }, - }, - - { - "echasnovski/mini.bufremove", - -- stylua: ignore - keys = { - { "bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" }, - { "bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" }, - }, - }, - - { - "folke/trouble.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xb", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "cl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, - opts = {}, - }, - - { - "kdheepak/lazygit.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - "nvim-lua/plenary.nvim", - }, - keys = { - { - "gg", - function() - require("lazygit").lazygit() - end, - desc = "Lazygit", - }, - }, - config = function() - require("telescope").load_extension("lazygit") - end, - }, - - { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - }, - opts = { - -- you can enable a preset for easier configuration - presets = { - bottom_search = true, -- use a classic bottom cmdline for search - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = true, -- add a border to hover docs and signature help - }, - routes = { - { - filter = { - event = "msg_show", - kind = "", - find = "written", - }, - opts = { skip = true }, - }, - }, - views = { - cmdline_popup = { - position = { - row = 5, - col = "50%", - }, - size = { - width = 60, - height = "auto", - }, - }, - popupmenu = { - relative = "editor", - position = { - row = 8, - col = "50%", - }, - size = { - width = 60, - height = 10, - }, - border = { - style = "rounded", - padding = { 0, 1 }, - }, - win_options = { - winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, - }, - }, - }, - lsp = { - -- override markdown rendering so that **cmp** and other plugins use **Treesitter** - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - }, - }, - - { - "psliwka/vim-smoothie", - }, - - { - "mrjones2014/smart-splits.nvim", - opts = {}, - }, - - { - "nvim-pack/nvim-spectre", - opts = {}, - }, -} diff --git a/lua/plugins/flash.lua b/lua/plugins/flash.lua new file mode 100644 index 0000000..0fbbc07 --- /dev/null +++ b/lua/plugins/flash.lua @@ -0,0 +1,49 @@ +return { + { + "folke/flash.nvim", + event = "VeryLazy", + vscode = true, + keys = { + { + "s", + mode = { "n", "x", "o" }, + function() + require("flash").jump() + end, + desc = "Flash", + }, + { + "S", + mode = { "n", "o", "x" }, + function() + require("flash").treesitter() + end, + desc = "Flash Treesitter", + }, + { + "r", + mode = "o", + function() + require("flash").remote() + end, + desc = "Remote Flash", + }, + { + "R", + mode = { "o", "x" }, + function() + require("flash").treesitter_search() + end, + desc = "Treesitter Search", + }, + { + "", + mode = { "c" }, + function() + require("flash").toggle() + end, + desc = "Toggle Flash Search", + }, + }, + }, +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..e95852a --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,19 @@ +return { + { + "lewis6991/gitsigns.nvim", + event = { + "BufReadPre", + "BufNewFile", + }, + opts = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + }, + }, +} diff --git a/lua/plugins/illuminate.lua b/lua/plugins/illuminate.lua new file mode 100644 index 0000000..0e17145 --- /dev/null +++ b/lua/plugins/illuminate.lua @@ -0,0 +1,19 @@ +return { + { + "RRethy/vim-illuminate", + event = { + "BufReadPost", + "BufNewFile", + }, + opts = { + delay = 200, + }, + config = function(_, opts) + require("illuminate").configure(opts) + end, + keys = { + { "]]", desc = "Next Reference" }, + { "[[", desc = "Prev Reference" }, + }, + }, +} diff --git a/lua/plugins/indent-blanklike.lua b/lua/plugins/indent-blanklike.lua new file mode 100644 index 0000000..35033ab --- /dev/null +++ b/lua/plugins/indent-blanklike.lua @@ -0,0 +1,32 @@ +return { + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPost", "BufNewFile" }, + main = "ibl", + opts = { + indent = { + char = "┊", + }, + whitespace = { + highlight = { + "CursorColumn", + "Whitespace", + }, + }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + }, + }, +} diff --git a/lua/plugins/indentscope.lua b/lua/plugins/indentscope.lua new file mode 100644 index 0000000..5ce4b79 --- /dev/null +++ b/lua/plugins/indentscope.lua @@ -0,0 +1,32 @@ +return { + -- active indent guide and indent text objects + { + "echasnovski/mini.indentscope", + version = false, -- wait till new 0.7.0 release to put it back on semver + event = { "BufReadPre", "BufNewFile" }, + opts = { + -- symbol = "▏", + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, +} diff --git a/lua/plugins/lazygit.lua b/lua/plugins/lazygit.lua new file mode 100644 index 0000000..3704893 --- /dev/null +++ b/lua/plugins/lazygit.lua @@ -0,0 +1,21 @@ +return { + { + "kdheepak/lazygit.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + }, + keys = { + { + "gg", + function() + require("lazygit").lazygit() + end, + desc = "Lazygit", + }, + }, + config = function() + require("telescope").load_extension("lazygit") + end, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lspconfig.lua similarity index 70% rename from lua/plugins/lsp.lua rename to lua/plugins/lspconfig.lua index 659810e..cbb1e51 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lspconfig.lua @@ -1,12 +1,4 @@ return { - { - "VonHeikemen/lsp-zero.nvim", - branch = "v2.x", - lazy = true, - config = function() - require("lsp-zero.settings").preset({}) - end, - }, { "neovim/nvim-lspconfig", @@ -46,7 +38,7 @@ return { "lua_ls", "gopls", "yamlls", - "ruby-lsp", + "ruby_lsp", }) local lspconfig = require("lspconfig") @@ -68,28 +60,4 @@ return { lsp.setup() end, }, - - { - "pmizio/typescript-tools.nvim", - dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, - config = function() - require("typescript-tools").setup({ - single_file_support = true, - settings = { - single_file_support = true, - }, - }) - vim.keymap.set( - "n", - "toi", - "TSToolsOrganizeImports", - { desc = "[T]ypescript [O]rganize [I]mports" } - ) - end, - }, - - { - "folke/neodev.nvim", - opts = {}, - }, } diff --git a/lua/plugins/lspzero.lua b/lua/plugins/lspzero.lua new file mode 100644 index 0000000..a555e18 --- /dev/null +++ b/lua/plugins/lspzero.lua @@ -0,0 +1,10 @@ +return { + { + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + lazy = true, + config = function() + require("lsp-zero.settings").preset({}) + end, + }, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..2a47d05 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,35 @@ +return { + { + "nvim-lualine/lualine.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + opts = { + options = { + theme = "catppuccin", + globalstatus = true, + disabled_filetypes = { + statusline = { + "dashboard", + "alpha", + }, + }, + section_separators = "", + component_separators = "", + }, + sections = { + lualine_a = { + { "mode", icons_enabled = true }, + }, + lualine_b = { + "branch", + "diff", + "diagnostics", + }, + lualine_c = { + { "filename", path = 1 }, + }, + }, + }, + }, +} diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua new file mode 100644 index 0000000..bced5cc --- /dev/null +++ b/lua/plugins/luasnip.lua @@ -0,0 +1,26 @@ +return { + + { + "L3MON4D3/LuaSnip", + version = "2.*", + build = (not jit.os:find("Windows")) + and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" + or nil, + opts = { + history = true, + delete_check_events = "TextChanged", + }, + config = function(_, opts) + local ls = require("luasnip") + ls.setup({ + history = true, + delete_check_events = "TextChanged", + }) + require("luasnip.loaders.from_lua").load({ paths = "~/snippets" }) + end, + dependencies = { + "hrsh7th/nvim-cmp", + }, + -- stylua: ignore + }, +} diff --git a/lua/plugins/mdx.lua b/lua/plugins/mdx.lua new file mode 100644 index 0000000..6b56c53 --- /dev/null +++ b/lua/plugins/mdx.lua @@ -0,0 +1,7 @@ +return { + { + "davidmh/mdx.nvim", + config = true, + dependencies = { "nvim-treesitter/nvim-treesitter" }, + }, +} diff --git a/lua/plugins/mini-pairs.lua b/lua/plugins/mini-pairs.lua new file mode 100644 index 0000000..9c10a3f --- /dev/null +++ b/lua/plugins/mini-pairs.lua @@ -0,0 +1,8 @@ +return { + + { + "echasnovski/mini.pairs", + event = "VeryLazy", + opts = {}, + }, +} diff --git a/lua/plugins/mini-surround.lua b/lua/plugins/mini-surround.lua new file mode 100644 index 0000000..c4a8f24 --- /dev/null +++ b/lua/plugins/mini-surround.lua @@ -0,0 +1,7 @@ +return { + + { + "echasnovski/mini.surround", + opts = {}, + }, +} diff --git a/lua/plugins/neodev.lua b/lua/plugins/neodev.lua new file mode 100644 index 0000000..2926a1f --- /dev/null +++ b/lua/plugins/neodev.lua @@ -0,0 +1,7 @@ +return { + + { + "folke/neodev.nvim", + opts = {}, + }, +} diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua new file mode 100644 index 0000000..be1a625 --- /dev/null +++ b/lua/plugins/neotree.lua @@ -0,0 +1,56 @@ +return { + + { + "nvim-neo-tree/neo-tree.nvim", + cmd = "Neotree", + branch = "v2.x", + dependencies = { + "MunifTanjim/nui.nvim", + }, + opts = { + close_if_last_window = true, + sources = { + "filesystem", + "buffers", + "git_status", + }, + source_selector = { + winbar = true, + content_layout = "center", + sources = { + { source = "filesystem", display_name = require("config.icons").FolderClosed .. " File" }, + { source = "buffers", display_name = require("config.icons").DefaultFile .. " Bufs" }, + { source = "git_status", display_name = require("config.icons").Git .. " Git" }, + { source = "diagnostics", display_name = require("config.icons").Diagnostic .. " Diagnostic" }, + }, + }, + default_component_configs = { + indent = { + padding = 0, + }, + icon = { + folder_closed = require("config.icons").FolderClosed, + folder_open = require("config.icons").FolderOpen, + folder_empty = require("config.icons").FolderEmpty, + folder_empty_open = require("config.icons").FolderEmpty, + default = require("config.icons").DefaultFile, + }, + }, + filesystem = { + follow_current_file = true, + hijack_netrw_behavior = "open_current", + use_libuv_file_watcher = true, + }, + }, + keys = { + { + "fe", + function() + require("neo-tree.command").execute({ + toggle = true, + }) + end, + }, + }, + }, +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..2750172 --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,68 @@ +return { + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + opts = { + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + routes = { + { + filter = { + event = "msg_show", + kind = "", + find = "written", + }, + opts = { skip = true }, + }, + }, + views = { + cmdline_popup = { + position = { + row = 5, + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + }, + popupmenu = { + relative = "editor", + position = { + row = 8, + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + }, + }, +} diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua new file mode 100644 index 0000000..b0e234f --- /dev/null +++ b/lua/plugins/notify.lua @@ -0,0 +1,11 @@ +return { + { + "rcarriga/nvim-notify", + config = function(_, opts) + local notify = require("notify") + notify.setup(vim.tbl_extend("keep", { + background_colour = "#000000", + }, opts)) + end, + }, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..c20d8a3 --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,120 @@ +return { + + { + "hrsh7th/nvim-cmp", + version = false, + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lsp-signature-help", + "onsails/lspkind.nvim", + }, + config = function() + vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) + local luasnip = require("luasnip") + local cmp = require("cmp") + + local border_opts = { + border = { + { "╭", "CmpDocBorder" }, + { "─", "CmpDocBorder" }, + { "╮", "CmpDocBorder" }, + { "│", "CmpDocBorder" }, + { "╯", "CmpDocBorder" }, + { "─", "CmpDocBorder" }, + { "╰", "CmpDocBorder" }, + { "│", "CmpDocBorder" }, + }, + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None", + } + ---@diagnostic disable: missing-fields + cmp.setup({ + formatting = { + preselect = cmp.PreselectMode.None, + fields = { + "abbr", + "kind", + "menu", + }, + format = require("lspkind").cmp_format({ + mode = "symbol_text", + maxwidth = 150, + ellipsis_char = "...", + before = function(entry, vim_item) + vim_item.menu = ({ + nvim_lsp = "[LSP]", + buffer = "[Buffer]", + })[entry.source.name] + return vim_item + end, + }), + }, + completion = { + completeopt = "menu,menuone,noinsert", + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + view = { + docs = { + auto_open = false, + }, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ behavior = cmp.SelectBehavior.Replace, select = true }), + [""] = cmp.mapping(function(fallback) + local copilot = require("copilot.suggestion") + if copilot.is_visible() then + copilot.accept_line() + elseif cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.expand_or_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + [""] = function() + if cmp.visible_docs() then + cmp.close_docs() + else + cmp.open_docs() + end + end, + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "nvim_lsp_signature_help" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }), + window = { + scrollbar = false, + completion = cmp.config.window.bordered(border_opts), + documentation = cmp.config.window.bordered(border_opts), + }, + }) + ---@diagnostic enable: missing-fields + end, + }, +} diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua new file mode 100644 index 0000000..d2602b6 --- /dev/null +++ b/lua/plugins/smart-splits.lua @@ -0,0 +1,6 @@ +return { + { + "mrjones2014/smart-splits.nvim", + opts = {}, + }, +} diff --git a/lua/plugins/smoothie.lua b/lua/plugins/smoothie.lua new file mode 100644 index 0000000..031891a --- /dev/null +++ b/lua/plugins/smoothie.lua @@ -0,0 +1,5 @@ +return { + { + "psliwka/vim-smoothie", + }, +} diff --git a/lua/plugins/spectre.lua b/lua/plugins/spectre.lua new file mode 100644 index 0000000..ad1a563 --- /dev/null +++ b/lua/plugins/spectre.lua @@ -0,0 +1,6 @@ +return { + { + "nvim-pack/nvim-spectre", + opts = {}, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..6420e22 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,147 @@ +return { + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + cmd = "Telescope", + keys = { + { + "ff", + function() + require("telescope.builtin").find_files() + end, + desc = "[ F ]ind files", + }, + { + "fF", + function() + require("telescope.builtin").find_files({ hidden = true, no_ignore = true }) + end, + desc = "[ F ]ind [ F ]iles", + }, + + { + "lg", + function() + require("telescope.builtin").live_grep() + end, + desc = "Live grep", + }, + { + "gf", + function() + require("telescope.builtin").git_files() + end, + desc = "Live grep", + }, + { + "gs", + function() + require("telescope.builtin").git_status() + end, + desc = "Live grep", + }, + { + "fc", + function() + require("telescope.builtin").git_commits() + end, + desc = "Git Commits", + }, + + { + "of", + function() + require("telescope.builtin").oldfiles() + end, + desc = "[ O ]ld [ F ]iles", + }, + + { + "ds", + function() + require("telescope.builtin").lsp_document_symbols() + end, + desc = "[ D ]ocument [ S ]ymbols", + }, + + { + "wss", + function() + require("telescope.builtin").lsp_dynamic_workspace_symbols() + end, + desc = "[ W ]orkspace [ S ]ymbol[ s ]", + remap = true, + }, + + { + "lr", + function() + require("telescope.builtin").lsp_references() + end, + desc = "[L]ist [R]erefrences", + }, + { + "ld", + function() + require("telescope.builtin").diagnostics() + end, + desc = "[ L ]ist [ D ]iagnostics", + }, + { + "li", + function() + require("telescope.builtin").lsp_implementations() + end, + desc = "[ L ]ist [ I ]mplementation", + }, + { + "ldi", + function() + require("telescope.builtin").lsp_definitions() + end, + desc = "[ L ]ist [ D ]ef[ i ]nitions", + }, + }, + opts = { + defaults = { + prompt_prefix = "", + selection_caret = "", + sorting_strategy = "ascending", + path_display = { + "smart", + }, + layout_config = { + horizontal = { + prompt_position = "top", + width = 0.75, + height = 0.65, + preview_width = 0.6, + }, + }, + mappings = { + i = { + [""] = function(...) + require("telescope.actions").move_selection_previous(...) + end, + [""] = function(...) + require("telescope.actions").move_selection_next(...) + end, + [""] = function(...) + require("trouble.providers.telescope").open_with_trouble(...) + end, + }, + n = { + q = function(...) + require("telescope.actions").close(...) + end, + [""] = function(...) + require("trouble.providers.telescope").open_with_trouble(...) + end, + }, + }, + }, + }, + }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 1c72687..4fbe1cc 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -64,13 +64,4 @@ return { { "nvim-treesitter/playground", }, - - { - "windwp/nvim-ts-autotag", - opts = { - enable_rename = true, - enable_close = true, - enable_close_on_slash = true, - }, - }, } diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua new file mode 100644 index 0000000..fd0df5a --- /dev/null +++ b/lua/plugins/trouble.lua @@ -0,0 +1,41 @@ +return { + { + "folke/trouble.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xb", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, + opts = {}, + }, +} diff --git a/lua/plugins/twilight.lua b/lua/plugins/twilight.lua new file mode 100644 index 0000000..0fb0dff --- /dev/null +++ b/lua/plugins/twilight.lua @@ -0,0 +1,7 @@ +return { + + { + "folke/twilight.nvim", + opts = {}, + }, +} diff --git a/lua/plugins/typescript-tools.lua b/lua/plugins/typescript-tools.lua new file mode 100644 index 0000000..e71e880 --- /dev/null +++ b/lua/plugins/typescript-tools.lua @@ -0,0 +1,21 @@ +return { + + { + "pmizio/typescript-tools.nvim", + dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, + config = function() + require("typescript-tools").setup({ + single_file_support = true, + settings = { + single_file_support = true, + }, + }) + vim.keymap.set( + "n", + "toi", + "TSToolsOrganizeImports", + { desc = "[T]ypescript [O]rganize [I]mports" } + ) + end, + }, +} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua deleted file mode 100644 index bcdbeff..0000000 --- a/lua/plugins/ui.lua +++ /dev/null @@ -1,198 +0,0 @@ -return { - { - "nvim-lualine/lualine.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - opts = { - options = { - theme = "catppuccin", - globalstatus = true, - disabled_filetypes = { - statusline = { - "dashboard", - "alpha", - }, - }, - section_separators = "", - component_separators = "", - }, - sections = { - lualine_a = { - { "mode", icons_enabled = true }, - }, - lualine_b = { - "branch", - "diff", - "diagnostics", - }, - lualine_c = { - { "filename", path = 1 }, - }, - }, - }, - }, - - { - "akinsho/bufferline.nvim", - event = "VeryLazy", - keys = { - { "bp", "BufferLineTogglePin", desc = "Toggle pin" }, - { "bP", "BufferLineGroupClose ungrouped", desc = "Delete non-pinned buffers" }, - }, - opts = { - options = { - offsets = { - { - filetype = "neo-tree", - }, - }, - }, - }, - }, - - { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPost", "BufNewFile" }, - main = "ibl", - opts = { - indent = { - char = "┊", - }, - whitespace = { - highlight = { - "CursorColumn", - "Whitespace", - }, - }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - }, - }, - }, - - -- active indent guide and indent text objects - { - "echasnovski/mini.indentscope", - version = false, -- wait till new 0.7.0 release to put it back on semver - event = { "BufReadPre", "BufNewFile" }, - opts = { - -- symbol = "▏", - symbol = "│", - options = { try_as_border = true }, - }, - init = function() - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - end, - }, - - { - "stevearc/dressing.nvim", - opts = { - select = { - enabled = true, - backend = { - "telescope", - "fzf", - "builtin", - "nui", - }, - telescope = require("telescope.themes").get_ivy(), - }, - }, - }, - - { - "rcarriga/nvim-notify", - config = function(_, opts) - local notify = require("notify") - notify.setup(vim.tbl_extend("keep", { - background_colour = "#000000", - }, opts)) - end, - }, - - { - "goolord/alpha-nvim", - event = "VimEnter", - opts = function() - local dashboard = require("alpha.themes.dashboard") - local logo = [[ - - ]] - - dashboard.section.header.val = vim.split(logo, "\n") - dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", ":Telescope find_files "), - dashboard.button("n", " " .. " New file", ":ene startinsert "), - dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), - dashboard.button("g", " " .. " Find text", ":Telescope live_grep "), - dashboard.button("c", " " .. " Config", ":e $MYVIMRC "), - dashboard.button("s", " " .. " Restore Session", [[:lua require("persistence").load() ]]), - dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy"), - dashboard.button("q", " " .. " Quit", ":qa"), - } - for _, button in ipairs(dashboard.section.buttons.val) do - button.opts.hl = "AlphaButtons" - button.opts.hl_shortcut = "AlphaShortcut" - end - dashboard.section.header.opts.hl = "AlphaHeader" - dashboard.section.buttons.opts.hl = "AlphaButtons" - dashboard.section.footer.opts.hl = "AlphaFooter" - dashboard.opts.layout[1].val = 8 - return dashboard - end, - config = function(_, dashboard) - local lazy = require("lazy") - -- close Lazy and re-open when the dashboard is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "AlphaReady", - callback = function() - lazy.show() - end, - }) - end - - require("alpha").setup(dashboard.opts) - - vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimStarted", - callback = function() - local stats = lazy.stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - pcall(vim.cmd.AlphaRedraw) - end, - }) - end, - }, -} diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua new file mode 100644 index 0000000..403894f --- /dev/null +++ b/lua/plugins/whichkey.lua @@ -0,0 +1,11 @@ +return { + { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + plugins = { + spelling = true, + }, + }, + }, +} diff --git a/lua/plugins/zenmode.lua b/lua/plugins/zenmode.lua new file mode 100644 index 0000000..f5f0694 --- /dev/null +++ b/lua/plugins/zenmode.lua @@ -0,0 +1,23 @@ +return { + + { + "folke/zen-mode.nvim", + keys = { + { + "zm", + function() + require("zen-mode").toggle({ + window = { + width = 0.85, + }, + }) + end, + }, + }, + opts = { + plugins = { + twilight = { enabled = true }, + }, + }, + }, +}