diff --git a/README.md b/README.md index 7a24cfb..6cbac98 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Neovim Config ## Requirements -* Git * [ripgrep](https://github.com/BurntSushi/ripgrep) * [fd](https://github.com/sharkdp/fd) +* [sed](https://www.gnu.org/software/sed) - required for search/replace diff --git a/init.lua b/init.lua index 7632cb6..6bf9caa 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,5 @@ -- Import core configuration require("core") -require("core.neovide") -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" diff --git a/lazy-lock.json b/lazy-lock.json index 12ca193..2a93f78 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,55 +1,44 @@ { - "Comment.nvim": { "branch": "master", "commit": "176e85eeb63f1a5970d6b88f1725039d85ca0055" }, - "LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" }, - "alpha-nvim": { "branch": "main", "commit": "e4fc5e29b731bdf55d204c5c6a11dc3be70f3b65" }, - "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" }, + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, + "barbar.nvim": { "branch": "master", "commit": "283bceab39f549c5e5228212661750704fcfcd9e" }, "bigfile.nvim": { "branch": "main", "commit": "9616b73670ffeb92679677554ded88854ae42cf8" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "cosmic-ui": { "branch": "main", "commit": "c0b14531999f2bfef3d927c4dcd57a1a8fed5ee9" }, - "diffview.nvim": { "branch": "main", "commit": "e91110d2a7f8e2f667666aba6ea089ff823f8748" }, - "dressing.nvim": { "branch": "master", "commit": "713b56e13c58ad519920e0e634763345cb4fc832" }, - "flutter-tools.nvim": { "branch": "main", "commit": "561d85b16d8ca2938820a9c26b2fe74096d89c81" }, - "friendly-snippets": { "branch": "main", "commit": "4aed1a0ca605cb1c87f59799a0cc4afe00a40272" }, - "git-blame.nvim": { "branch": "master", "commit": "93d983806a0c76692bebd6f804c8eaa2a3844452" }, - "gitsigns.nvim": { "branch": "main", "commit": "adcf2c7f2f495f5df148683764bf7cba6a70f34c" }, - "glow.nvim": { "branch": "main", "commit": "bbd0473d72a45094495ee5600b5577823543eefe" }, + "diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" }, + "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, + "flutter-tools.nvim": { "branch": "main", "commit": "7350750d46fbeb4d2bb4878157b658d435935299" }, + "git-blame.nvim": { "branch": "master", "commit": "4ff5874c80f25c5aaaaad8394eedbcb9f6b286cc" }, + "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" }, + "glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" }, + "goto-preview": { "branch": "main", "commit": "b428db4d2a5b7c06e149a020e31b2121fbf57a67" }, "guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" }, - "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, - "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, - "lsp_signature.nvim": { "branch": "master", "commit": "17ff7a405fea8376b015b8ea7910d2e59958bf68" }, - "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, - "mason.nvim": { "branch": "main", "commit": "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, - "neodev.nvim": { "branch": "main", "commit": "866b6b6e687a93ba98851a03a74bf6d9211b7299" }, - "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, - "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" }, - "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, - "nvim-code-action-menu": { "branch": "main", "commit": "e4399dbaf6eabff998d3d5f1cbcd8d9933710027" }, + "indent-blankline.nvim": { "branch": "master", "commit": "9301e434dd41154ffe5c3d5b8a5c9acd075ebeff" }, + "lazy.nvim": { "branch": "main", "commit": "4c75c8eeb957a99aa44ce8e526c04340ab358c5e" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "22d2186bee730d68f6fd3bb2d19a389784c37a96" }, + "lsp_signature.nvim": { "branch": "master", "commit": "33250c84c7a552daf28ac607d9d9e82f88cd0907" }, + "lualine.nvim": { "branch": "master", "commit": "7533b0ead663d80452210c0c089e5105089697e5" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e7b64c11035aa924f87385b72145e0ccf68a7e0a" }, + "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "6f8c49956c89e9fefae6acdfe1d57c6293b0a03d" }, + "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, + "nvim-autopairs": { "branch": "master", "commit": "f6c71641f6f183427a651c0ce4ba3fb89404fa9e" }, + "nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" }, "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "d17d1bba23ec72a157bd183c57840c39e323f515" }, - "nvim-dap-go": { "branch": "main", "commit": "eab43d63cef832801a701812913e4d1d726725e5" }, - "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, - "nvim-lspconfig": { "branch": "master", "commit": "dd11ba7b3c8f82d51b6d4dd7d68fce2d78bf78a0" }, - "nvim-treesitter": { "branch": "master", "commit": "7b04e8b67eec7d92daadf9f0717dd272ddfc81a3" }, + "nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" }, + "nvim-spectre": { "branch": "master", "commit": "696cff781a4a7ecc91549736835e2acbd00fe859" }, + "nvim-treesitter": { "branch": "master", "commit": "afa103385a2b5ef060596ed822ef63276ae88016" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" }, - "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, - "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, - "smart-splits.nvim": { "branch": "master", "commit": "7aad6019dee974a01333523a5b8e122b7e7da454" }, + "nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" }, + "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, - "telescope.nvim": { "branch": "master", "commit": "1228f3b15ca3d9b95dcb92efda6a3448871030bd" }, - "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, - "toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" }, - "tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" }, - "trouble.nvim": { "branch": "main", "commit": "d572f59aaf7eef670d6ddc331032a7d5e59d634e" }, - "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, - "vim-matchup": { "branch": "master", "commit": "ca8971739e3908973c5912cb3a0ffb6cf7bd83e7" }, - "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" } + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, + "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, + "toggleterm.nvim": { "branch": "main", "commit": "faee9d60428afc7857e0927fdc18daa6c409fa64" }, + "tokyonight.nvim": { "branch": "main", "commit": "633039585dff7fd2b9b62fb190bf768702609d95" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, + "vim-matchup": { "branch": "master", "commit": "6dbe108230c7dbbf00555b7d4d9f6a891837ef07" }, + "vim-wakatime": { "branch": "master", "commit": "945a441b83e48c7bafdd227ef8e2eb826f72ab90" }, + "which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" } } \ No newline at end of file diff --git a/lua/.luarc.json b/lua/.luarc.json deleted file mode 100644 index bcbc12f..0000000 --- a/lua/.luarc.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "workspace.library": [ - "/Users/ghost/.local/share/nvim/lazy/neodev.nvim/types/stable", - "/Users/ghost/Documents/DEV/IDE/nvim-macos/share/nvim/runtime/lua", - "/Users/ghost/.local/share/nvim/lazy/glow.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/vim-illuminate/lua", - "/Users/ghost/.local/share/nvim/lazy/telescope.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/todo-comments.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/lsp_signature.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/indent-blankline.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/guess-indent.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/plenary.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/gitsigns.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/trouble.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/barbar.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-cmp/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-code-action-menu/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-lspconfig/lua", - "/Users/ghost/.local/share/nvim/lazy/cmp-nvim-lsp/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-ts-autotag/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-ts-context-commentstring/lua", - "/Users/ghost/.local/share/nvim/lazy/lazy.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/git-blame.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/tokyonight.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/cmp_luasnip/lua", - "/Users/ghost/.local/share/nvim/lazy/lualine.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/smart-splits.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/telescope-fzf-native.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/mason-lspconfig.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-treesitter/lua", - "/Users/ghost/.local/share/nvim/lazy/neo-tree.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/toggleterm.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/symbols-outline.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/mason.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-dap-ui/lua", - "/Users/ghost/.local/share/nvim/lazy/cmp-cmdline/lua", - "/Users/ghost/.local/share/nvim/lazy/cmp-path/lua", - "/Users/ghost/.local/share/nvim/lazy/cmp-buffer/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-web-devicons/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-dap/lua", - "/Users/ghost/.local/share/nvim/lazy/neodev.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/Comment.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/filetype.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/cmp-nvim-lua/lua", - "/Users/ghost/.local/share/nvim/lazy/vim-matchup/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-dap-go/lua", - "/Users/ghost/.local/share/nvim/lazy/bigfile.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/LuaSnip/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-colorizer.lua/lua", - "/Users/ghost/.local/share/nvim/lazy/diffview.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/nvim-autopairs/lua", - "/Users/ghost/.local/share/nvim/lazy/nui.nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/alpha-nvim/lua", - "/Users/ghost/.local/share/nvim/lazy/cosmic-ui/lua", - "/Users/ghost/.config/nvim/lua", - "${3rd}/luv/library" - ] -} \ No newline at end of file diff --git a/lua/core/neovide.lua b/lua/core/neovide.lua deleted file mode 100644 index 0e8c73e..0000000 --- a/lua/core/neovide.lua +++ /dev/null @@ -1,16 +0,0 @@ -local g = vim.g -local keymap = vim.keymap - -g.neovide_scale_factor = 1.0 - -local change_scale_factor = function(delta) - g.neovide_scale_factor = g.neovide_scale_factor * delta -end - -keymap.set("n", "", function() - change_scale_factor(1.25) -end) - -keymap.set("n", "", function() - change_scale_factor(1/1.25) -end) diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua index 09ee543..17a349a 100644 --- a/lua/plugins/barbar.lua +++ b/lua/plugins/barbar.lua @@ -1,6 +1,10 @@ return { "romgrk/barbar.nvim", - dependencies = "nvim-tree/nvim-web-devicons", + event = "BufEnter", + dependencies = { + "lewis6991/gitsigns.nvim", + "nvim-tree/nvim-web-devicons" + }, init = function() vim.g.barbar_auto_setup = false end, opts = { auto_hide = true, diff --git a/lua/plugins/blankline.lua b/lua/plugins/blankline.lua index 02f12b0..49d1178 100644 --- a/lua/plugins/blankline.lua +++ b/lua/plugins/blankline.lua @@ -1,42 +1,6 @@ return { "lukas-reineke/indent-blankline.nvim", - opts = { - char = "▏", - context_char = "▏", - filetype_exclude = { - "help", - "terminal", - "alpha", - "lazy", - "neo-tree", - "Trouble" - }, - buftype_exclude = { "nofile", "terminal" }, - context_patterns = { - "class", - "return", - "function", - "method", - "^if", - "^while", - "jsx_element", - "^for", - "^object", - "^table", - "block", - "arguments", - "if_statement", - "else_clause", - "jsx_element", - "jsx_self_closing_element", - "try_statement", - "catch_clause", - "import_statement", - "operation_type" - }, - show_trailing_blankline_indent = false, - show_first_indent_level = false, - use_treesitter = true, - show_current_context = true - } + event = "BufEnter", + main = "ibl", + config = true } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index dc28d04..3b48a49 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,54 +1,29 @@ return { "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-nvim-lua" - }, - event = { "InsertEnter", "CmdlineEnter" }, + event = "InsertEnter", + dependencies = "L3MON4D3/LuaSnip", config = function() + local lsp_zero = require("lsp-zero") + lsp_zero.extend_cmp() + local cmp = require("cmp") + local cmp_action = lsp_zero.cmp_action() - cmp.setup { - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end + cmp.setup({ + formatting = lsp_zero.cmp_format(), + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered() }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp_action.luasnip_jump_forward(), + [""] = cmp_action.luasnip_jump_backward(), [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.select_prev_item() - }), - - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" } - }, { - { name = "buffer" }, - { name = "path" } - }) - } - - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { name = "buffer" } - }) - - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" } - }, { - { name = "cmdline" } }) }) end diff --git a/lua/plugins/config/whichkey.lua b/lua/plugins/config/whichkey.lua deleted file mode 100644 index e6effbd..0000000 --- a/lua/plugins/config/whichkey.lua +++ /dev/null @@ -1,78 +0,0 @@ -local wk = require("which-key") - -wk.setup { - ignore_missing = true, - key_labels = { - [""] = "SPC" - } -} - -wk.register({ - [""] = { - f = { - name = "Find", - f = { "Telescope fd", "find file" }, - w = { "Telescope live_grep", "live grep" }, - s = { "Telescope spell_suggest", "spell suggest" }, - b = { "Telescope buffers", "all buffers" }, - t = { "TodoTelescope", "todos" }, - ["."] = { "Telescope keymaps", "keymaps" } - }, - - l = { - name = "LSP", - r = { "lua require('cosmic-ui').rename()", "rename" }, - d = { "Telescope diagnostics", "diagnostics" }, - f = { "lua vim.lsp.buf.format { async = true }", "format" }, - a = { "CodeActionMenu", "code action" } - }, - - b = { - name = "Buffer", - p = { "BufferPick", "pick buffer" }, - q = { "BufferMovePrevious", "move buffer left" }, - w = { "BufferMoveNext", "move buffer right" }, - x = { "BufferCloseAllButCurrent", "close all but current" } - }, - - g = { - name = "Git", - b = { "Gitsigns blame_line", "blame line" }, - B = { "DiffviewOpen", "diff view & merge tool" }, - d = { "Gitsigns diffthis", "diff" }, - s = { "Telescope git_status", "git status" }, - c = { "Telescope git_commits", "commits" }, - C = { "DiffviewClose", "close diffview & merge tool" } - }, - - x = { "BufferClose", "close buffer" }, - c = { "Telescope colorscheme", "colorscheme" }, - s = { "SymbolsOutline", "symbols outline" }, - h = { "noh", "no highlight" }, - k = { "lua vim.lsp.buf.hover()", "hover" } - }, - - t = { - name = "Trouble", - t = { "TroubleToggle", "toggle trouble" } - }, - - g = { - d = { "lua vim.lsp.buf.definition()", "definition" }, - D = { "lua vim.lsp.buf.declaration()", "declaration" }, - i = { "lua vim.lsp.buf.implementation()", "implementation" }, - t = { "lua vim.lsp.buf.type_definition()", "type definition" } - }, - - K = { "lua require('lsp_signature').toggle_float_win()", "hover" }, - - -- Nvim Tree - [""] = { "Neotree toggle", "toggle neotree" }, - - -- Switching Buffers - [""] = { "BufferNext", "next buffer" }, - [""] = { "BufferPrevious", "previous buffer" }, - - -- Find in file - [""] = { "Telescope current_buffer_fuzzy_find", "find in file" } -}) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 4238cf4..2a30e01 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,25 +1,31 @@ return { - "nvim-lua/plenary.nvim", "LunarVim/bigfile.nvim", - "f-person/git-blame.nvim", - "nvim-tree/nvim-web-devicons", + "wakatime/vim-wakatime", { - "numToStr/Comment.nvim", + "nvim-pack/nvim-spectre", + dependencies = "nvim-lua/plenary.nvim" + }, + + { + "folke/todo-comments.nvim", + event = "BufRead", + dependencies = "nvim-lua/plenary.nvim", config = true }, { - "goolord/alpha-nvim", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - require("alpha").setup(require("alpha.themes.dashboard").config) - end + "nmac427/guess-indent.nvim", + lazy = false, + config = true }, { "andymass/vim-matchup", - dependencies = "nvim-treesitter/nvim-treesitter" + event = "CursorMoved", + config = function() + vim.g.matchup_matchparen_offscreen = { method = "popup" } + end }, { @@ -28,19 +34,12 @@ return { config = true }, - { - "folke/todo-comments.nvim", - dependencies = "nvim-lua/plenary.nvim", - config = true - }, - - { - "nmac427/guess-indent.nvim", - config = true - }, + -- NOTE: Git + "f-person/git-blame.nvim", { "lewis6991/gitsigns.nvim", + event = "BufEnter", config = true }, @@ -52,58 +51,30 @@ return { }, -- NOTE: LSP - { - "neovim/nvim-lspconfig", + "VonHeikemen/lsp-zero.nvim", + branch = "v3.x", lazy = true, - dependencies = { - { "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } }, - "williamboman/mason-lspconfig.nvim" - } - }, - - { - "williamboman/mason-lspconfig.nvim", - dependencies = "williamboman/mason.nvim", - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - - local handlers = { - function (server_name) - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end - } - - require("mason-lspconfig").setup { handlers = handlers } + config = false, + init = function() + local g = vim.g + g.lsp_zero_extend_cmp = 0 + g.lsp_zero_extend_lspconfig = 0 end }, { "williamboman/mason.nvim", - build = ":MasonUpdate", + lazy = false, config = true }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end - } - }, - { "windwp/nvim-autopairs", event = "InsertEnter", config = true }, - "RRethy/vim-illuminate", - { "ray-x/lsp_signature.nvim", dependencies = "neovim/nvim-lspconfig", @@ -124,42 +95,21 @@ return { }, { - "weilbith/nvim-code-action-menu", - dependencies = "neovim/nvim-lspconfig", - cmd = "CodeActionMenu" - }, - - { - "CosmicNvim/cosmic-ui", - lazy = true, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim" - }, + "numToStr/Comment.nvim", + lazy = false, config = true }, { - "rcarriga/nvim-dap-ui", - lazy = true, - dependencies = "mfussenegger/nvim-dap", - config = true + "rmagatti/goto-preview", + opts = { + default_mappings = true + } }, - { - "leoluz/nvim-dap-go", - lazy = true, - dependencies = "mfussenegger/nvim-dap", - config = true - }, - - { - "folke/which-key.nvim", - config = function() - require("plugins.config.whichkey") - end - }, + "RRethy/vim-illuminate", + -- NOTE: Flutter { "akinsho/flutter-tools.nvim", lazy = false, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..0bdf854 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,27 @@ +return { + "neovim/nvim-lspconfig", + cmd = { "LspInfo", "LspInstall", "LspStart" }, + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "williamboman/mason-lspconfig.nvim", + }, + config = function() + local lsp_zero = require("lsp-zero") + lsp_zero.extend_lspconfig() + + lsp_zero.on_attach(function(_, bufnr) + lsp_zero.default_keymaps({ buffer = bufnr }) + end) + + require("mason-lspconfig").setup({ + handlers = { + lsp_zero.default_setup, + lua_ls = function() + local lua_opts = lsp_zero.nvim_lua_ls() + require("lspconfig").lua_ls.setup(lua_opts) + end, + } + }) + end +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 1370fc6..1dc6aaa 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,19 +1,21 @@ return { "nvim-lualine/lualine.nvim", event = "BufEnter", + dependencies = "nvim-tree/nvim-web-devicons", opts = { options = { theme = "tokyonight" }, - extensions = { "fzf", "lazy", "neo-tree", "nvim-dap-ui", + "quickfix", "symbols-outline", "toggleterm", - "trouble" + "trouble", + "mason" } } } diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index e58c228..e87a435 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -1,5 +1,6 @@ return { "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons", @@ -7,70 +8,17 @@ return { }, cmd = "Neotree", init = function() - vim.g.neo_tree_remove_legacy_commands = true - vim.fn.sign_define("DiagnosticSignError", - { text = " ", texthl = "DiagnosticSignError" }) - vim.fn.sign_define("DiagnosticSignWarn", - { text = " ", texthl = "DiagnosticSignWarn" }) - vim.fn.sign_define("DiagnosticSignInfo", - { text = " ", texthl = "DiagnosticSignInfo" }) - vim.fn.sign_define("DiagnosticSignHint", - { text = "", texthl = "DiagnosticSignHint" }) + vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" }) + vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" }) + vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" }) + vim.fn.sign_define("DiagnosticSignHint", { text = "󰌵", texthl = "DiagnosticSignHint" }) end, opts = { close_if_last_window = true, - - source_selector = { - winbar = true, - content_layout = "center", - sources = { - { source = "filesystem", display_name = " Files" }, - { source = "buffers", display_name = "󰕲 Buffers" }, - { source = "git_status", display_name = " Git" } - } - }, - - group_empty_dirs = true, - window = { width = 30 }, - + window = { width = "30" }, filesystem = { - follow_current_file = true, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true - }, - - default_component_configs = { - icon = { - folder_empty = "󰜌", - folder_empty_open = "󰜌" - }, - git_status = { - symbols = { - renamed = "󰁕", - unstaged = "󰄱" - } - } - }, - - document_symbols = { - kinds = { - File = { icon = "󰈙", hl = "Tag" }, - Namespace = { icon = "󰌗", hl = "Include" }, - Package = { icon = "󰏖", hl = "Label" }, - Class = { icon = "󰌗", hl = "Include" }, - Property = { icon = "󰆧", hl = "@property" }, - Enum = { icon = "󰒻", hl = "@number" }, - Function = { icon = "󰊕", hl = "Function" }, - String = { icon = "󰀬", hl = "String" }, - Number = { icon = "󰎠", hl = "Number" }, - Array = { icon = "󰅪", hl = "Type" }, - Object = { icon = "󰅩", hl = "Type" }, - Key = { icon = "󰌋", hl = "" }, - Struct = { icon = "󰌗", hl = "Type" }, - Operator = { icon = "󰆕", hl = "Operator" }, - TypeParameter = { icon = "󰊄", hl = "Type" }, - StaticMethod = { icon = '󰠄 ', hl = 'Function' } - } + follow_current_file = { enabled = true }, + group_empty_dirs = true } } } diff --git a/lua/plugins/smartsplits.lua b/lua/plugins/smartsplits.lua deleted file mode 100644 index da49fe1..0000000 --- a/lua/plugins/smartsplits.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "mrjones2014/smart-splits.nvim", - build = "./kitty/install-kittens.bash", - opt = { - ignored_buftypes = { "NeoTree" } - } -} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 6c5a112..aa62626 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,20 +1,18 @@ return { "nvim-telescope/telescope.nvim", + branch = "0.1.x", dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - enabled = vim.fn.executable "make" == 1, - build = "make" + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } }, - cmd = "Telescope", config = function() local telescope = require("telescope") telescope.setup { defaults = { - layout_strategy = "vertical" - }, - - file_ignore_patterns = { "node_modules" } + layout_strategy = "vertical", + file_ignore_patterns = { "node_modules" } + } } telescope.load_extension("fzf") diff --git a/lua/plugins/tokyonight.lua b/lua/plugins/tokyonight.lua index c82127f..07a2ac2 100644 --- a/lua/plugins/tokyonight.lua +++ b/lua/plugins/tokyonight.lua @@ -1,5 +1,7 @@ return { "folke/tokyonight.nvim", + lazy = false, + priority = 1000, opts = { style = "night", styles = { diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 248e217..0647446 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,20 +1,22 @@ return { "nvim-treesitter/nvim-treesitter", dependencies = { - "windwp/nvim-ts-autotag", - "JoosepAlviste/nvim-ts-context-commentstring" + { "windwp/nvim-ts-autotag", config = true } }, build = ":TSUpdate", config = function() - require("nvim-treesitter.configs").setup { + local configs = require("nvim-treesitter.configs") + + configs.setup { + ensure_installed = { "lua" }, highlight = { enable = true }, - incremental_selection = { enable = true }, + indent = { enable = true, - disable = { 'dart' } + disable = { "dart" } }, + autotag = { enable = true }, - context_commentstring = { enable = true, enable_autocmd = false }, matchup = { enable = true } } end diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua new file mode 100644 index 0000000..044c7cf --- /dev/null +++ b/lua/plugins/whichkey.lua @@ -0,0 +1,83 @@ +local function config() + local wk = require("which-key") + + wk.register({ + [""] = { + -- Finders + f = { + name = "Finders", + f = { "Telescope fd", "Find files" }, + w = { "Telescope live_grep", "Text grep" }, + s = { "Telescope spell_suggest", "Spell suggest" }, + t = { "TodoTelescope", "Todos" }, + ["."] = { "Telescope keymaps", "Keymaps" } + }, + + -- Buffers + b = { + name = "Buffers", + p = { "BufferPick", "Pick buffer" }, + q = { "BufferMovePrevious", "Move buffer left" }, + w = { "BufferMoveNext", "Move buffer right" }, + x = { "BufferCloseAllButCurrent", "Close all but current" } + }, + + -- Git + g = { + name = "Git", + b = { "Gitsigns blame_line", "Blame line" }, + d = { "Gitsigns diffthis", "Diff" }, + D = { "DiffviewOpen", "Diff view & merge tool" }, + C = { "DiffviewClose", "Close diffview & merge tool" } + }, + + -- LSP + l = { + name = "LSP", + f = { "lua vim.lsp.buf.format { async = true }", "Format" }, + a = { "lua vim.lsp.buf.code_action()", "Code Action" } + }, + + -- Misc + c = { "BufferClose", "Close buffer" }, + h = { "noh", "No highlight" }, + s = { "SymbolsOutline", "Symbols outline" }, + t = { "TroubleToggle", "Toggle trouble" } + }, + + g = { + d = { "lua vim.lsp.buf.definition()", "definition" }, + t = { "lua vim.lsp.buf.type_definition()", "type definition" } + }, + + -- Neotree + [""] = { "Neotree toggle", "Toggle neotree" }, + + -- Switching Buffers + [""] = { "BufferNext", "Next buffer" }, + [""] = { "BufferPrevious", "Previous buffer" }, + + -- Find in file + [""] = { "Telescope current_buffer_fuzzy_find", "Find in file" }, + + -- Text replacer in file + [""] = { "lua require('spectre').toggle()", "Replace in file" } + }) +end + +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + local o = vim.o + o.timeout = true + o.timeoutlen = 300 + end, + config = config, + opts = { + ignore_missing = false, + key_labels = { + [""] = "SPC" + } + } +}