From f425edc6a6c6aee87861363a37d995e8798ac72f Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 15 Apr 2023 19:24:20 +0200 Subject: [PATCH] =?UTF-8?q?=CE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/nvim/init.lua | 2 +- configs/nvim/lazy-lock.json | 54 +- configs/nvim/lua/max/configs/autocomplete.lua | 111 ---- configs/nvim/lua/max/configs/dap.lua | 96 ---- configs/nvim/lua/max/configs/dashboard.lua | 82 --- configs/nvim/lua/max/configs/litee.lua | 15 - configs/nvim/lua/max/configs/lsp.lua | 221 -------- configs/nvim/lua/max/configs/lualine.lua | 236 -------- configs/nvim/lua/max/configs/neotest.lua | 5 - configs/nvim/lua/max/configs/notify.lua | 17 - configs/nvim/lua/max/configs/nvimtree.lua | 159 ------ configs/nvim/lua/max/configs/scrollbar.lua | 16 - configs/nvim/lua/max/configs/session.lua | 3 - configs/nvim/lua/max/configs/sniprun.lua | 4 - configs/nvim/lua/max/configs/telescope.lua | 70 --- configs/nvim/lua/max/configs/toggleterm.lua | 38 -- .../nvim/lua/max/configs/translate/init.lua | 60 -- configs/nvim/lua/max/configs/tree.lua | 39 -- configs/nvim/lua/max/configs/treesitter.lua | 65 --- configs/nvim/lua/max/configs/ufo.lua | 41 -- configs/nvim/lua/max/core/keymappings.lua | 2 +- configs/nvim/lua/max/core/plugins.lua | 512 ++++-------------- .../nvim/lua/max/functions/translate/init.lua | 60 ++ .../translate/languages.lua | 0 configs/nvim/lua/max/plugins/autocomplete.lua | 129 +++++ .../autocomplete}/snippets.lua | 0 configs/nvim/lua/max/plugins/dadbod.lua | 8 + configs/nvim/lua/max/plugins/dap.lua | 107 ++++ configs/nvim/lua/max/plugins/dashboard.lua | 88 +++ configs/nvim/lua/max/plugins/git-conflict.lua | 6 + configs/nvim/lua/max/plugins/git-signs.lua | 5 + configs/nvim/lua/max/plugins/jump.lua | 8 + configs/nvim/lua/max/plugins/lsp.lua | 213 ++++++++ .../lsp-glsl.lua => plugins/lsp/glsl.lua} | 0 configs/nvim/lua/max/plugins/lualine.lua | 245 +++++++++ configs/nvim/lua/max/plugins/mini.lua | 21 + configs/nvim/lua/max/plugins/neotest.lua | 16 + .../lua/max/{configs => plugins}/neotree.lua | 0 configs/nvim/lua/max/plugins/noice.lua | 45 ++ configs/nvim/lua/max/plugins/notify.lua | 23 + configs/nvim/lua/max/plugins/recorder.lua | 7 + configs/nvim/lua/max/plugins/scrollbar.lua | 22 + configs/nvim/lua/max/plugins/session.lua | 7 + configs/nvim/lua/max/plugins/sniprun.lua | 9 + configs/nvim/lua/max/plugins/tabs.lua | 13 + configs/nvim/lua/max/plugins/telescope.lua | 82 +++ configs/nvim/lua/max/plugins/theme.lua | 2 + .../nvim/lua/max/{ => plugins}/theme/ayu.lua | 0 .../lua/max/{ => plugins}/theme/catpuccin.lua | 0 .../lua/max/{ => plugins}/theme/everblush.lua | 0 configs/nvim/lua/max/plugins/theme/init.lua | 0 .../max/{ => plugins}/theme/statuscolumn.lua | 0 .../lua/max/{ => plugins}/theme/tokyo.lua | 0 .../lua/max/{ => plugins}/theme/tundra.lua | 0 configs/nvim/lua/max/plugins/toggleterm.lua | 44 ++ configs/nvim/lua/max/plugins/translate.lua | 7 + configs/nvim/lua/max/plugins/treesitter.lua | 75 +++ configs/nvim/lua/max/plugins/undotree.lua | 4 + configs/nvim/lua/max/plugins/which-key.lua | 7 + configs/nvim/lua/max/theme/init.lua | 2 - 60 files changed, 1395 insertions(+), 1708 deletions(-) delete mode 100644 configs/nvim/lua/max/configs/autocomplete.lua delete mode 100644 configs/nvim/lua/max/configs/dap.lua delete mode 100644 configs/nvim/lua/max/configs/dashboard.lua delete mode 100644 configs/nvim/lua/max/configs/litee.lua delete mode 100644 configs/nvim/lua/max/configs/lsp.lua delete mode 100644 configs/nvim/lua/max/configs/lualine.lua delete mode 100644 configs/nvim/lua/max/configs/neotest.lua delete mode 100644 configs/nvim/lua/max/configs/notify.lua delete mode 100644 configs/nvim/lua/max/configs/nvimtree.lua delete mode 100644 configs/nvim/lua/max/configs/scrollbar.lua delete mode 100644 configs/nvim/lua/max/configs/session.lua delete mode 100644 configs/nvim/lua/max/configs/sniprun.lua delete mode 100644 configs/nvim/lua/max/configs/telescope.lua delete mode 100644 configs/nvim/lua/max/configs/toggleterm.lua delete mode 100644 configs/nvim/lua/max/configs/translate/init.lua delete mode 100644 configs/nvim/lua/max/configs/tree.lua delete mode 100644 configs/nvim/lua/max/configs/treesitter.lua delete mode 100644 configs/nvim/lua/max/configs/ufo.lua create mode 100644 configs/nvim/lua/max/functions/translate/init.lua rename configs/nvim/lua/max/{configs => functions}/translate/languages.lua (100%) create mode 100644 configs/nvim/lua/max/plugins/autocomplete.lua rename configs/nvim/lua/max/{configs => plugins/autocomplete}/snippets.lua (100%) create mode 100644 configs/nvim/lua/max/plugins/dadbod.lua create mode 100644 configs/nvim/lua/max/plugins/dap.lua create mode 100644 configs/nvim/lua/max/plugins/dashboard.lua create mode 100644 configs/nvim/lua/max/plugins/git-conflict.lua create mode 100644 configs/nvim/lua/max/plugins/git-signs.lua create mode 100644 configs/nvim/lua/max/plugins/jump.lua create mode 100644 configs/nvim/lua/max/plugins/lsp.lua rename configs/nvim/lua/max/{configs/lsp-glsl.lua => plugins/lsp/glsl.lua} (100%) create mode 100644 configs/nvim/lua/max/plugins/lualine.lua create mode 100644 configs/nvim/lua/max/plugins/mini.lua create mode 100644 configs/nvim/lua/max/plugins/neotest.lua rename configs/nvim/lua/max/{configs => plugins}/neotree.lua (100%) create mode 100644 configs/nvim/lua/max/plugins/noice.lua create mode 100644 configs/nvim/lua/max/plugins/notify.lua create mode 100644 configs/nvim/lua/max/plugins/recorder.lua create mode 100644 configs/nvim/lua/max/plugins/scrollbar.lua create mode 100644 configs/nvim/lua/max/plugins/session.lua create mode 100644 configs/nvim/lua/max/plugins/sniprun.lua create mode 100644 configs/nvim/lua/max/plugins/tabs.lua create mode 100644 configs/nvim/lua/max/plugins/telescope.lua create mode 100644 configs/nvim/lua/max/plugins/theme.lua rename configs/nvim/lua/max/{ => plugins}/theme/ayu.lua (100%) rename configs/nvim/lua/max/{ => plugins}/theme/catpuccin.lua (100%) rename configs/nvim/lua/max/{ => plugins}/theme/everblush.lua (100%) create mode 100644 configs/nvim/lua/max/plugins/theme/init.lua rename configs/nvim/lua/max/{ => plugins}/theme/statuscolumn.lua (100%) rename configs/nvim/lua/max/{ => plugins}/theme/tokyo.lua (100%) rename configs/nvim/lua/max/{ => plugins}/theme/tundra.lua (100%) create mode 100644 configs/nvim/lua/max/plugins/toggleterm.lua create mode 100644 configs/nvim/lua/max/plugins/translate.lua create mode 100644 configs/nvim/lua/max/plugins/treesitter.lua create mode 100644 configs/nvim/lua/max/plugins/undotree.lua create mode 100644 configs/nvim/lua/max/plugins/which-key.lua delete mode 100644 configs/nvim/lua/max/theme/init.lua diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 97bcf07..db5c241 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -8,4 +8,4 @@ require("max.core.autocommands") require("max.core.keymappings") -vim.cmd("colorscheme " .. require("max.theme").name); +vim.cmd("colorscheme " .. require("max.plugins.theme").name); diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index 5327a71..b8a0faa 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -1,68 +1,58 @@ { - "ChatGPT.nvim": { "branch": "main", "commit": "3ea19ba666e226ac33c8e00c7bf99e81931d7c86" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "8fdb06d4601c019a9ee880473646364bdbed3206" }, + "LuaSnip": { "branch": "master", "commit": "a6355b12a3b7da0aef71f02560e17ff480182b97" }, "alpha-nvim": { "branch": "main", "commit": "dafa11a6218c2296df044e00f88d9187222ba6b0" }, - "autolist.nvim": { "branch": "main", "commit": "6fc6e376d7f3e2a69a3c364294a14d3c620075e2" }, - "barbar.nvim": { "branch": "master", "commit": "f37cbed0320bea7cdc756fde4e54fd2e36991cbc" }, - "boole.nvim": { "branch": "main", "commit": "f4f9996f91159e54b8f1893b20e2e599c91bc1bd" }, - "catppuccin": { "branch": "main", "commit": "73587f9c454da81679202f1668c30fea6cdafd5e" }, + "barbar.nvim": { "branch": "master", "commit": "8edf23fe94a2486a8bc74cb64efb9211810f7e83" }, + "catppuccin": { "branch": "main", "commit": "fa9a4465672fa81c06b23634c0f04f6a5d622211" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "copilot-cmp": { "branch": "master", "commit": "99467081478aabe4f1183a19a8ba585e511adc20" }, - "copilot.lua": { "branch": "master", "commit": "f0b41fb89ef2ed7ab4e8cd5208a30755aa638fc4" }, + "copilot.lua": { "branch": "master", "commit": "a4a37dda9e48986e5d2a90d6a3cbc88fca241dbb" }, "flit.nvim": { "branch": "main", "commit": "f60e4b3d49bb5a5e97cfffe66f2e671eb422078e" }, - "friendly-snippets": { "branch": "main", "commit": "8d91ba2dc2421a54981115f61b914974f938fa77" }, + "friendly-snippets": { "branch": "main", "commit": "8f26df063f0fdabc27845c7aed56db9102d385e8" }, "git-conflict.nvim": { "branch": "main", "commit": "80bc8931d4ed8c8c4d289a08e1838fcf4741408d" }, "gitsigns.nvim": { "branch": "main", "commit": "372d5cb485f2062ac74abc5b33054abac21d8b58" }, "lazy.nvim": { "branch": "main", "commit": "57cce98dfdb2f2dd05a0567d89811e6d0505e13b" }, - "leap.nvim": { "branch": "main", "commit": "f74473d23ebf60957e0db3ff8172349a82e5a442" }, + "leap.nvim": { "branch": "main", "commit": "98a72ad93c629c49bd7127d342960cc1b159b620" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lspsaga.nvim": { "branch": "main", "commit": "1fbb3e4721354d0d0a20a28bb77b3f83fe68538b" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine.nvim": { "branch": "master", "commit": "84ffb80e452d95e2c46fa29a98ea11a240f7843e" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "a8d5db8f227b9b236d1c54a9c6234bc033825ce7" }, - "mason.nvim": { "branch": "main", "commit": "2311d9d883eb709ad9979a726a38c5ce1343b63c" }, - "mini.nvim": { "branch": "main", "commit": "a7c375312edba618d7abc7c6129c53c512cca9d7" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b81c50c4baae7d80b1723b3fa86e814d7754d15b" }, + "mason.nvim": { "branch": "main", "commit": "7caf4f7143b4b2e17fe0e893bdd05c622c508207" }, + "mini.nvim": { "branch": "main", "commit": "10d3903189418af95d5852d7b93d4e22f6a1e46f" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "2b2f74828eeb02cf29d6b21aa32eedadadc94ca7" }, - "neotest": { "branch": "master", "commit": "734efe8a2682b6415712933efd19c484c2f8d942" }, + "neotest": { "branch": "master", "commit": "3dbac1ebda49861956e3c53f37a9d14de6dffb9b" }, "neotest-jest": { "branch": "main", "commit": "821bb227e31259307db30c88671a1c3724f78637" }, "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, - "no-neck-pain.nvim": { "branch": "main", "commit": "e22c01b148b37dcb74c40faf801f7ee9de727dfc" }, "noice.nvim": { "branch": "main", "commit": "1da4edfba3e9278e98fc9723d7235d9ab3889744" }, - "nui.nvim": { "branch": "main", "commit": "1f43b13d133eb4b4f53a4485379d9afa58808389" }, - "null-ls.nvim": { "branch": "main", "commit": "5855128178fa78293acdfb5b4e41ef046779240b" }, + "nui.nvim": { "branch": "main", "commit": "ecd9def93891b9260b15b5fcef542eaabf4145c9" }, + "null-ls.nvim": { "branch": "main", "commit": "f8ffcd7cb8fb3325c711d459152ef132b5b65aed" }, "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, "nvim-dap": { "branch": "master", "commit": "debd7c2f80eaf20c5f5df25db8d8c1b9b18f4421" }, "nvim-dap-ui": { "branch": "master", "commit": "286f682f366fbc652b38dff893569374e9433dd3" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-lspconfig": { "branch": "master", "commit": "27e9e1d2638ffd133b06f314a49ac55825cb1017" }, + "nvim-lspconfig": { "branch": "master", "commit": "e52efca5d4f5536533d447ec0d97e4d525b37ace" }, "nvim-notify": { "branch": "master", "commit": "50d037041ada0895aeba4c0215cde6d11b7729c4" }, "nvim-recorder": { "branch": "main", "commit": "0f6dec901a530c41095cff8def0c723877374cb4" }, "nvim-scrollbar": { "branch": "main", "commit": "f85b29805cf917f9b1d5ff0c9a52c5b1bdca5943" }, - "nvim-toggleterm.lua": { "branch": "main", "commit": "b86982429325112d2b20c6d0cc7a5c4b182ab705" }, - "nvim-treesitter": { "branch": "master", "commit": "a57d2a599b57a619f58a5c91c89d9bf12f8977b2" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "b55fe6175f0001347a433c9df358c8cbf8a4e90f" }, - "nvim-ts-autotag": { "branch": "main", "commit": "7a1c677985b8fc4cdfdb87dd55fbc16dadd86bbe" }, + "nvim-toggleterm.lua": { "branch": "main", "commit": "1c5996ee3c30b54751093fe68d40676859e7778f" }, + "nvim-treesitter": { "branch": "master", "commit": "dad0864fa324d1df88242a978e9d7de383c5be68" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "8673926519ea61069f9c1366d1ad1949316d250e" }, + "nvim-ts-autotag": { "branch": "main", "commit": "cac97f3b47bcb927db6d1d784c0c323056506ef3" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" }, - "nvim-web-devicons": { "branch": "master", "commit": "f16ec8f6e5d23e4349501dae46e0a661918e086e" }, - "persisted.nvim": { "branch": "main", "commit": "e053ff33488431dc5bf9239b08650e650ec67292" }, - "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, + "nvim-web-devicons": { "branch": "master", "commit": "4ec26d67d419c12a4abaea02f1b6c57b40c08d7e" }, + "persisted.nvim": { "branch": "main", "commit": "dbdd6af1847105f5cc7f7c51a648b32a78598eec" }, + "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rest.nvim": { "branch": "main", "commit": "0fdb69f328529b34a2279c14be63b3325dc52740" }, "sniprun": { "branch": "master", "commit": "52ecf6ad06304e46722118af2aaea5647b157ab8" }, - "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, - "telescope.nvim": { "branch": "master", "commit": "2ea61f1952f0ad10e4fcc282468a06d3e69674c2" }, - "todo-comments.nvim": { "branch": "main", "commit": "8febc60a76feefd8203077ef78b6a262ea1a41f9" }, + "telescope.nvim": { "branch": "master", "commit": "6258d50b09f9ae087317e392efe7c05a7323492d" }, "translate.nvim": { "branch": "main", "commit": "7b2fd50c21ecfe536d572d62dcd3fa83acad3743" }, - "trouble.nvim": { "branch": "main", "commit": "2ae7237c2917d661f458443c9a88680f8ca2d7b2" }, "undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" }, "vim-dadbod": { "branch": "master", "commit": "3f57c0cd41523423fd781422dfc833820095a3e8" }, "vim-dadbod-completion": { "branch": "master", "commit": "e71eb6140556c5ced80de6299a1fdfe22bd3c1b1" }, diff --git a/configs/nvim/lua/max/configs/autocomplete.lua b/configs/nvim/lua/max/configs/autocomplete.lua deleted file mode 100644 index 50539f6..0000000 --- a/configs/nvim/lua/max/configs/autocomplete.lua +++ /dev/null @@ -1,111 +0,0 @@ -local luasnip = require("luasnip") -require("max.configs.snippets") - -local lspkind = require("lspkind") -local cmp = require("cmp") - -local capabilities = require("cmp_nvim_lsp").default_capabilities() -require("lspconfig").html.setup({ - capabilities = capabilities, -}) - -require("copilot").setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, -}) -require("copilot_cmp").setup { - method = "getCompletionsCycling", -} - -local check_backspace = function() - local col = vim.fn.col(".") - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") -end - -cmp.setup({ - window = { - documentation = cmp.config.window.bordered(), - }, - experimental = { - ghost_text = true, - }, - completion = { - completeopt = "menuone,noselect", - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = { - [""] = cmp.mapping.complete({}), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - 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", - }), - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - }, - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", - max_width = 50, - symbol_map = { Copilot = "" }, - }), - }, - sources = { - { name = "copilot" }, - { name = "vim-dadbod-completion", filetype = "sql" }, - { name = "nvim_lua" }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "emoji" }, - { name = "path" }, - { name = "buffer" }, - { name = "calc" }, - }, -}) - - --- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline("/", { - sources = { - { name = "buffer" }, - }, -}) - --- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(":", { - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), -}) diff --git a/configs/nvim/lua/max/configs/dap.lua b/configs/nvim/lua/max/configs/dap.lua deleted file mode 100644 index ac79f3f..0000000 --- a/configs/nvim/lua/max/configs/dap.lua +++ /dev/null @@ -1,96 +0,0 @@ -local dap, dapui = require("dap"), require("dapui") - -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open({}) -end -dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close({}) -end -dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close({}) -end - -require("dap-vscode-js").setup({ - -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" - -- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation. - -- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`. - adapters = { 'pwa-node', 'pwa-chrome' }, -- which adapters to register in nvim-dap -}) - -dap.adapters.node2 = { - type = 'executable'; - command = 'node', - args = { vim.fn.stdpath "data" .. '/mason/packages/node-debug2-adapter/out/src/nodeDebug.js' }; -} - -dap.adapters.firefox = { - type = "executable", - command = "node", - options = { - initialize_timeout_sec = 10, - disconnect_timeout_sec = 10, - max_retries = 30, - }, - args = { vim.fn.stdpath("data") .. "/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js" }, -} - -dap.configurations.typescript = { - { - name = "Debug with Firefox", - type = "firefox", - request = "launch", - reAttach = true, - webRoot = "${workspaceFolder}", - url = "http://localhost:8080", - firefoxExecutable = "/sbin/firefox-developer-edition", - }, - { - name = 'Launch', - type = 'node2', - request = 'launch', - program = '${file}', - cwd = vim.fn.getcwd(), - sourceMaps = true, - protocol = 'inspector', - console = 'integratedTerminal', - }, - { - -- For this to work you need to make sure the node process is started with the `--inspect` flag. - name = 'Attach to process', - type = 'node2', - request = 'attach', - sourceMaps = true, - cwd = "${workspaceFolder}", - processId = require 'dap.utils'.pick_process, - }, - { - type = "pwa-node", - request = "attach", - name = "Attach", - processId = require 'dap.utils'.pick_process, - cwd = "${workspaceFolder}", - } -} - -dap.configurations.typescriptreact = { - { - name = 'debug with firefox', - type = 'firefox', - request = 'launch', - reattach = true, - url = 'http://localhost:4200', - webRoot = '/home/max/Projects/ruumio/main/apps/events-standalone/', - firefoxExecutable = '/home/max/Downloads/firefox/firefox' - }, - { - name = 'debug with chrome', - type = 'pwa-chrome', - request = 'launch', - reattach = true, - url = 'http://localhost:4200', - webroot = '${workspacefolder}', - runtimeExecutable = '/mnt/c/Program Files/Google/Chrome/Application/chrome.exe' - }, -} - -dap.configurations.javascript = dap.configurations.typescript; diff --git a/configs/nvim/lua/max/configs/dashboard.lua b/configs/nvim/lua/max/configs/dashboard.lua deleted file mode 100644 index 1d94825..0000000 --- a/configs/nvim/lua/max/configs/dashboard.lua +++ /dev/null @@ -1,82 +0,0 @@ ------------------------------------ --- Welcome Screen Configuration -- ------------------------------------ - --- Call Alpha With A pcall -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - --- Enable Alpha Dashboard -local dashboard = require("alpha.themes.dashboard") - --- Remove These ~ ~ ~ -vim.opt.fillchars:append({ eob = " " }) - --- Disable Status Line so that alpha dashboard look nice --- vim.cmd [[ au User AlphaReady if winnr('$') == 1 | set laststatus=1 ]] - --- Custom Footer -dashboard.section.footer.val = { - "Write Programs That Do One Thing And Do It Well.", -} - --- Custom Section -dashboard.section.buttons.val = { - dashboard.button("n", " Create New file", ":set laststatus=3 | :ene startinsert "), - dashboard.button("e", " Open File Manager", ":set laststatus=3 | :Neotree toggle "), - dashboard.button("s", "Δ Search Sessions", ":Telescope persisted"), - dashboard.button("v", " Neovim Settings ", ":set laststatus=3 | e ~/.config/nvim/init.lua "), - dashboard.button("b", "⟳ Recent Files", ":Telescope oldfiles"), - -- dashboard.button("s", " Shell Configuration", ":set laststatus=3 | e ~/.config/zsh/.zshrc "), - dashboard.button("u", " Update Nvim Plugins", ":Lazy update "), - dashboard.button("q", " Quit Neovim", ":qa"), -} - --- LuaVim Ascii Art -dashboard.section.header.val = { - [[███╗ ███╗ █████╗ ██╗ ██╗ ███╗ ██╗ ██╗ ██╗██╗███╗ ███╗]], - [[████╗ ████║██╔══██╗╚██╗██╔╝ ████╗ ██║ ██║ ██║██║████╗ ████║]], - [[██╔████╔██║███████║ ╚███╔╝ ██╔██╗ ██║ ██║ ██║██║██╔████╔██║]], - [[██║╚██╔╝██║██╔══██║ ██╔██╗ ██║╚██╗██║ ╚██╗ ██╔╝██║██║╚██╔╝██║]], - [[██║ ╚═╝ ██║██║ ██║██╔╝ ██╗ ██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║]], - [[╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]], -} - -dashboard.section.header.val = { - [[ __ ]], - [[ /\ \ ]], - [[ / /\ \ ]], - [[/ /__\ \ ]], - [[\/____\/ ]], -} - --- dashboard.section.header.val = { --- [[ ____]], --- [[ /\ \]], --- [[ / \ \]], --- [[ / \ \]], --- [[ / \ \]], --- [[ / /\ \ \]], --- [[ / / \ \ \]], --- [[ / / \ \ \]], --- [[ / / / \ \ \]], --- [[ / / / \ \ \]], --- [[ / / /---------' \]], --- [[/ / /_______________\]], --- [[\ / /]], --- [[ \/_____________________/ ]], --- } - --- Layout For Luavim ascii art -dashboard.config.layout = { - { type = "padding", val = 5 }, - dashboard.section.header, - { type = "padding", val = 2 }, - dashboard.section.buttons, - { type = "padding", val = 1 }, - dashboard.section.footer, -} - -alpha.setup(dashboard.opts) diff --git a/configs/nvim/lua/max/configs/litee.lua b/configs/nvim/lua/max/configs/litee.lua deleted file mode 100644 index 55b6263..0000000 --- a/configs/nvim/lua/max/configs/litee.lua +++ /dev/null @@ -1,15 +0,0 @@ -require("litee.lib").setup({ - tree = { - icon_set = "codicons", - }, - panel = { - orientation = "right", - panel_size = 30, - }, -}) -require("litee.symboltree").setup({ - icon_set = "codicons", -}) -require("litee.calltree").setup({ - icon_set = "codicons", -}) diff --git a/configs/nvim/lua/max/configs/lsp.lua b/configs/nvim/lua/max/configs/lsp.lua deleted file mode 100644 index 18d456b..0000000 --- a/configs/nvim/lua/max/configs/lsp.lua +++ /dev/null @@ -1,221 +0,0 @@ -local mason = require("mason") -local mason_lsp = require("mason-lspconfig") -local lsp = require("lspconfig") - -vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( - vim.lsp.handlers.hover, - { border = 'single' } -) -vim.diagnostic.config({ - float = { - border = 'single', - }, -}) - -local null_ls = require("null-ls") -null_ls.setup({ - sources = { - null_ls.builtins.diagnostics.eslint_d, - }, -}) - -mason.setup() -mason_lsp.setup({ - ensure_installed = { "lua_ls", "jsonls", "tsserver", "svelte", "cssls", "prismals" }, -}) - -local function on_attach(client, bufnr) - if client.supports_method("textDocument/formatting") then - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = bufnr, - callback = function() - vim.lsp.buf.format() - - if client.name == "tsserver" or client.name == "svelte" then - -- params for the request - local params = { - command = "_typescript.organizeImports", - arguments = { vim.api.nvim_buf_get_name(bufnr) }, - title = "", - } - - -- perform a syncronous request - -- 500ms timeout depending on the size of file a bigger timeout may be needed - vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500) - end - end, - }) - else - print("Lsp (" .. client.name .. ") doesnt support format") - end -end - -local capabilities = require("cmp_nvim_lsp").default_capabilities() -capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true, -} -capabilities.textDocument.completion.completionItem.snippetSupport = true - -local custom_lsp = {} - -custom_lsp.tsserver = { - root_dir = lsp.util.root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git"), -} - -local runtime_path = vim.split(package.path, ";") -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") -custom_lsp.lua_ls = { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - -- Setup your lua path - path = runtime_path, - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim" }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - checkThirdParty = false - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} - -custom_lsp.jsonls = { - settings = { - provideFormatter = false, - json = { - schemas = { - { - description = "TypeScript compiler configuration file", - fileMatch = { "tsconfig.json", "tsconfig.*.json" }, - url = "http://json.schemastore.org/tsconfig", - }, - { - description = "ESLint config", - fileMatch = { ".eslintrc.json", ".eslintrc" }, - url = "http://json.schemastore.org/eslintrc", - }, - { - description = "Prettier config", - fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" }, - url = "http://json.schemastore.org/prettierrc", - }, - { - description = "JSON schema for Import Maps files", - fileMatch = { "importmap.json", "import_map.json", "import-map.json" }, - name = "importmap.json", - url = "https://json.schemastore.org/importmap.json", - }, - { - description = "NPM configuration file", - fileMatch = { "package.json" }, - name = "package.json", - url = "https://json.schemastore.org/package.json", - }, - }, - }, - }, -} - -custom_lsp.intelephense = { - settings = { - intelephense = { - stubs = { - "wordpress", - "woocommerce", - "wordpress-globals", - "wp-cli", - }, - environment = { - includePaths = "/home/max/.composer/vendor/php-stubs/", -- this line forces the composer path for the stubs in case inteliphense don't find it... - }, - files = { - maxSize = 5000000, - }, - }, - }, -} - -custom_lsp.rust_analyzer = { - settings = { - ["rust-analyzer"] = { - imports = { - granularity = { - group = "module", - }, - prefix = "self", - }, - cargo = { - buildScripts = { - enable = true, - }, - }, - procMacro = { - enable = true, - }, - }, - }, -} - -custom_lsp.yamlls = { - settings = { - yaml = { - schemas = { - ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*", - ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", - ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml", - ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml", - }, - }, - }, -} - --- local glslls_config = require("max.configs.lsp-glsl") --- glslls_config.on_attach = on_attach; --- lsp.glslls.setup(glslls_config) - -custom_lsp.ltex = { - settings = { - ltex = { - language = "de", - disabledRules = { ["en-US"] = { "PROFANITY" } }, - dictionary = { - ["en-US"] = { "perf", "ci", "neovim" }, - }, - hiddenFalsePositives = { - "neovim", - "Neovim", - "waybar", - }, - }, - }, -} - -mason_lsp.setup_handlers({ - function(server_name) - local config = { - on_attach = on_attach, - capabilities = capabilities, - } - - if custom_lsp[server_name] ~= nil then - for k, v in pairs(custom_lsp[server_name]) do - config[k] = v - end - end - - lsp[server_name].setup(config) - end, -}) diff --git a/configs/nvim/lua/max/configs/lualine.lua b/configs/nvim/lua/max/configs/lualine.lua deleted file mode 100644 index 4c399ed..0000000 --- a/configs/nvim/lua/max/configs/lualine.lua +++ /dev/null @@ -1,236 +0,0 @@ ------------------ --- Status Line -- ------------------ - --- Eviline / Vimline config for lualine --- Author: shadmansaleh --- Credit: glepnir --- Credit: Elai - -local lualine = require("lualine") - --- Color table for highlights --- stylua: ignore -local colors = { - bg = '#00000000', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#B7BD82', - orange = '#8d6141', - violet = '#B294BB', - magenta = '#AE84BB', - blue = '#81A2BE', - red = '#CC8282', -} - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand("%:p:h") - local gitdir = vim.fn.finddir(".git", filepath .. ";") - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, -} - --- Config -local config = { - options = { - -- Disable sections and component separators - component_separators = "", - section_separators = "", - globalstatus = true, - theme = require("max.theme").name, - }, - -- These are to remove the defaults - sections = { - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, -} - --- Inserts a component in lualine_c at left section -local function ins_left(component) - table.insert(config.sections.lualine_c, component) -end - --- Inserts a component in lualine_x ot right section -local function ins_right(component) - table.insert(config.sections.lualine_x, component) -end - --- Icon Of Diffrent Mode: -- normal -- | -- insert -- | -- visual -- -ins_left({ - -- mode component - function() - return "◬" - end, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [""] = colors.blue, - V = colors.blue, - c = colors.red, - no = colors.red, - s = colors.orange, - S = colors.orange, - [""] = colors.orange, - ic = colors.yellow, - R = colors.violet, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ["r?"] = colors.cyan, - ["!"] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, -}) - --- File Name -ins_left({ - "filename", - file_status = true, -- Displays file status (readonly status, modified status) - path = 2, -- 0: Just the filename - -- 1: Relative path - -- 2: Absolute path - shorting_target = 100, -- Shortens path to leave 40 spaces in the window - -- for other components. (terrible name, any suggestions?) - symbols = { - modified = "  ", -- Text to show when the file is modified. - readonly = " ", -- Text to show when the file is non-modifiable or readonly. - unnamed = "[No Name]", -- Text to show for unnamed buffers. - }, -}) - -ins_left { - require("recorder").recordingStatus -} - -ins_left { - 'lsp_progress', - display_components = { 'lsp_client_name', { 'title', 'percentage', 'message' } }, - -- With spinner - -- display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' }}, - colors = { - percentage = colors.cyan, - title = colors.cyan, - message = colors.cyan, - spinner = colors.cyan, - lsp_client_name = colors.magenta, - use = true, - }, - separators = { - component = ' ', - progress = ' | ', - message = { pre = '(', post = ')' }, - percentage = { pre = '', post = '%% ' }, - title = { pre = '', post = ': ' }, - lsp_client_name = { pre = '[', post = ']' }, - spinner = { pre = '', post = '' }, - }, - timer = { progress_enddelay = 500, spinner = 1000, lsp_client_name_enddelay = 1000 }, - spinner_symbols = { '🌑 ', '🌒 ', '🌓 ', '🌔 ', '🌕 ', '🌖 ', '🌗 ', '🌘 ' }, -} - --- Git Diff -local function diff_source() - local gitsigns = vim.b.gitsigns_status_dict - if gitsigns then - return { - added = gitsigns.added, - modified = gitsigns.changed, - removed = gitsigns.removed, - } - end -end - -ins_right({ "diff", source = diff_source }) - --- Git Branch -ins_right({ - "branch", - icon = "", - -- icon = '', - -- color = { fg = colors.green }, - -- padding = { right = 1 }, - -- padding = { left = 1 }, -}) - --- File Type -ins_right({ - "filetype", - icon_only = true, - padding = { right = 2, left = 1 }, -}) - --- File Encoding -ins_right({ - "o:encoding", -- option component same as &encoding in viml - fmt = string.upper, -- I'm not sure why it's upper case either ;) - cond = conditions.hide_in_width, - padding = { right = 2 }, - -- color = { fg = colors.green, gui = 'bold' }, - -- Add components to right sections -}) - --- File Size -ins_right({ - -- filesize component - "filesize", - padding = { right = 2 }, - cond = conditions.buffer_not_empty, -}) - --- File Location -ins_right({ - "location", - padding = { right = 0 }, -}) - --- Insert mid section. You can make any number of sections in neovim :) --- for lualine it's any number greater then 2 -ins_left({ - function() - return "%=" - end, -}) - --- End Of The Status Bar -ins_right { - function() - return '' - end, - color = { fg = colors.blue }, -- Sets highlighting of component - padding = { left = 1, right = 0 }, -- We don't need space before this -} - --- Now don't forget to initialize lualine -lualine.setup(config) diff --git a/configs/nvim/lua/max/configs/neotest.lua b/configs/nvim/lua/max/configs/neotest.lua deleted file mode 100644 index bf26089..0000000 --- a/configs/nvim/lua/max/configs/neotest.lua +++ /dev/null @@ -1,5 +0,0 @@ -require("neotest").setup({ - adapters = { - require("neotest-vitest")({}), - }, -}) diff --git a/configs/nvim/lua/max/configs/notify.lua b/configs/nvim/lua/max/configs/notify.lua deleted file mode 100644 index 65b2fb3..0000000 --- a/configs/nvim/lua/max/configs/notify.lua +++ /dev/null @@ -1,17 +0,0 @@ -local notify = require("notify") -notify.setup( - { - stages = "fade_in_slide_out", - max_width = 50, - render = "minimal", - background_colour = "#000000", - icons = { - ERROR = "", - WARN = "", - INFO = "", - DEBUG = "", - TRACE = "✎" - } - } -) -vim.notify = notify; diff --git a/configs/nvim/lua/max/configs/nvimtree.lua b/configs/nvim/lua/max/configs/nvimtree.lua deleted file mode 100644 index 91cf3ca..0000000 --- a/configs/nvim/lua/max/configs/nvimtree.lua +++ /dev/null @@ -1,159 +0,0 @@ -return { - "nvim-tree/nvim-tree.lua", - cmd = "NvimTreeToggle", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - opts = { - auto_reload_on_write = true, - create_in_closed_folder = false, - disable_netrw = false, - hijack_cursor = false, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = false, - ignore_buffer_on_setup = false, - open_on_setup = false, - open_on_setup_file = false, - open_on_tab = false, - sort_by = "name", - update_cwd = true, - reload_on_bufenter = true, - respect_buf_cwd = false, - view = { - adaptive_size = false, - width = 35, - hide_root_folder = true, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - mappings = { - list = { - { key = "d", action = "trash" }, - { key = "D", action = "remove" }, - }, - }, - }, - renderer = { - add_trailing = false, - group_empty = true, - highlight_git = true, - highlight_opened_files = "none", - indent_markers = { - enable = true, - icons = { - corner = "└", - edge = "│", - none = "", - }, - }, - icons = { - webdev_colors = true, - git_placement = "signcolumn", - padding = " ", - symlink_arrow = "  ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = false, - }, - glyphs = { - default = "", - symlink = "", - folder = { - default = "", - empty = "", - empty_open = "", - open = "", - symlink = "", - symlink_open = "", - arrow_open = "", - arrow_closed = "", - }, - git = { - unstaged = "", - staged = "ﰶ", - unmerged = "", - renamed = "➜", - untracked = "●", - deleted = "﯀", - ignored = "", - }, - }, - }, - special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md", "package.json" }, - }, - hijack_directories = { - enable = true, - auto_open = true, - }, - update_focused_file = { - enable = true, - update_cwd = true, - ignore_list = {}, - }, - ignore_ft_on_setup = {}, - system_open = { - cmd = "", - args = {}, - }, - diagnostics = { - enable = false, - show_on_dirs = false, - }, - filters = { - dotfiles = false, - custom = { - "^.git$", - }, - exclude = {}, - }, - git = { - enable = true, - ignore = false, - timeout = 400, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - open_file = { - quit_on_open = true, - resize_window = true, - window_picker = { - enable = true, - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - }, - trash = { - cmd = "trash", - require_confirm = true, - }, - live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - diagnostics = false, - git = false, - profile = false, - }, - }, - }, -} diff --git a/configs/nvim/lua/max/configs/scrollbar.lua b/configs/nvim/lua/max/configs/scrollbar.lua deleted file mode 100644 index 0bac2dd..0000000 --- a/configs/nvim/lua/max/configs/scrollbar.lua +++ /dev/null @@ -1,16 +0,0 @@ -require("scrollbar").setup({ - handlers = { - cursor = true, - diagnostic = true, - gitsigns = true, -- Requires gitsigns - handle = true, - search = false, -- Requires hlslens - }, - excluded_filetypes = { - "prompt", - "TelescopePrompt", - "noice", - "NvimTree", - "neo-tree" - }, -}) diff --git a/configs/nvim/lua/max/configs/session.lua b/configs/nvim/lua/max/configs/session.lua deleted file mode 100644 index 603e58a..0000000 --- a/configs/nvim/lua/max/configs/session.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("persisted").setup({ - autoload = true, -}) diff --git a/configs/nvim/lua/max/configs/sniprun.lua b/configs/nvim/lua/max/configs/sniprun.lua deleted file mode 100644 index 001dc3e..0000000 --- a/configs/nvim/lua/max/configs/sniprun.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('sniprun').setup({ - selected_interpreters = { "JS_TS_deno" }, - repl_enable = { "JS_TS_deno" } -}) diff --git a/configs/nvim/lua/max/configs/telescope.lua b/configs/nvim/lua/max/configs/telescope.lua deleted file mode 100644 index 56d3713..0000000 --- a/configs/nvim/lua/max/configs/telescope.lua +++ /dev/null @@ -1,70 +0,0 @@ -local telescope = require("telescope") -telescope.setup({ - defaults = {}, -}) - -local function open_with_trouble() - require("trouble.providers.telescope").open_with_trouble() -end - -local default = { - extensions = { - sessions_picker = { - sessions_dir = vim.fn.stdpath("data") .. "/sessions/", - }, - }, - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--ignore-file", - ".gitignore", - }, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - file_ignore_patterns = { "node_modules", "*pnpm-lock*" }, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - mappings = { - i = { [""] = open_with_trouble }, - n = { [""] = open_with_trouble }, - }, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - use_less = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - }, -} - -telescope.setup(default) -telescope.load_extension("notify") --- telescope.load_extension("persisted") -- To load the telescope extension diff --git a/configs/nvim/lua/max/configs/toggleterm.lua b/configs/nvim/lua/max/configs/toggleterm.lua deleted file mode 100644 index 81e9f1c..0000000 --- a/configs/nvim/lua/max/configs/toggleterm.lua +++ /dev/null @@ -1,38 +0,0 @@ -local Terminal = require("toggleterm.terminal").Terminal -local lazygit = Terminal:new({ - cmd = "lazygit", - dir = "git_dir", - direction = "float", - float_opts = { - winblend = 0, - border = "shadow", - }, - on_close = function() - Terminal:close() - end, -}) - -function _Lazygit_toggle() - lazygit:toggle() -end - -vim.api.nvim_set_keymap("n", "", "lua _Lazygit_toggle()", { noremap = true, silent = true }) - -local pnpm = Terminal:new({ - dir = "git_dir", - direction = "float", - float_opts = { - winblend = 0, - padding = 10, - border = "single", - }, - on_close = function() - Terminal:close() - end, -}) - -function _Pnpm_toggle() - pnpm:toggle() -end - -vim.api.nvim_set_keymap("n", "", "lua _Pnpm_toggle()", { noremap = true, silent = true }) diff --git a/configs/nvim/lua/max/configs/translate/init.lua b/configs/nvim/lua/max/configs/translate/init.lua deleted file mode 100644 index 18fe875..0000000 --- a/configs/nvim/lua/max/configs/translate/init.lua +++ /dev/null @@ -1,60 +0,0 @@ -local languages = require("max.configs.translate.languages") -local pickers = require("telescope.pickers") -local finders = require("telescope.finders") -local actions = require("telescope.actions") -local action_state = require("telescope.actions.state") -local conf = require("telescope.config").values - -return function() - -- This active_buf and active selection because telescope clears everything (i think) - local active_buf = vim.api.nvim_get_current_buf() - local mode = vim.api.nvim_get_mode().mode - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "x!", true) - local start_mark = vim.api.nvim_buf_get_mark(active_buf, "<") - local end_mark = vim.api.nvim_buf_get_mark(active_buf, ">") - - pickers - .new({}, { - prompt_title = "Translate", - finder = finders.new_table({ - results = languages, - entry_maker = function(entry) - return { - value = entry[2], - ordinal = entry[1] .. " " .. entry[2], - display = entry[3] .. entry[1], - } - end, - }), - sorter = conf.generic_sorter({}), - attach_mappings = function(prompt_bufnr) - actions.select_default:replace(function() - actions.close(prompt_bufnr) - - local selection = action_state.get_selected_entry() - - vim.api.nvim_set_current_buf(active_buf) - - vim.api.nvim_win_set_cursor(0, start_mark) - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(mode, true, false, true), "x!", true) - vim.api.nvim_win_set_cursor(0, end_mark) - - local timer = vim.loop.new_timer() - timer:start( - 500, - 0, - vim.schedule_wrap(function() - if mode == "v" or mode == "V" then - vim.cmd("'<,'>Translate " .. selection.value) - else - vim.cmd("Translate " .. selection.value) - end - end) - ) - end) - return true - end, - previewer = nil, - }) - :find() -end diff --git a/configs/nvim/lua/max/configs/tree.lua b/configs/nvim/lua/max/configs/tree.lua deleted file mode 100644 index 6c3e649..0000000 --- a/configs/nvim/lua/max/configs/tree.lua +++ /dev/null @@ -1,39 +0,0 @@ --- Configure nvim-tree -require("nvim-tree").setup({ - hijack_cursor = true, - update_cwd = false, - trash = { - cmd = "trash", - require_confirm = true, - }, - diagnostics = { - enable = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - view = { - hide_root_folder = true, - signcolumn = "no", - }, - renderer = { - group_empty = true, - highlight_opened_files = "all", - icons = { - glyphs = { - git = { - untracked = "*", - }, - }, - show = { - folder_arrow = false, - folder = true, - file = true, - git = true, - }, - }, - }, -}) diff --git a/configs/nvim/lua/max/configs/treesitter.lua b/configs/nvim/lua/max/configs/treesitter.lua deleted file mode 100644 index 09119e7..0000000 --- a/configs/nvim/lua/max/configs/treesitter.lua +++ /dev/null @@ -1,65 +0,0 @@ -require("nvim-treesitter.configs").setup({ - context_commentstring = { - enable = true - }, - autotag = { - enable = true, - }, - indent = { - enable = true, - }, - ensure_installed = { - "bash", - "yaml", - "http", - "svelte", - "css", - "svelte", - "typescript", - "javascript", - "tsx", - "go", - "lua", - "json", - "yaml", - "prisma", - }, - highlight = { enable = true }, - textobjects = { - select = { - enable = true, - - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - -- You can choose the select mode (default is charwise 'v') - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * method: eg 'v' or 'o' - -- and should return the mode ('v', 'V', or '') or a table - -- mapping query_strings to modes. - selection_modes = { - ["@parameter.outer"] = "v", -- charwise - ["@function.outer"] = "V", -- linewise - ["@class.outer"] = "", -- blockwise - }, - -- If you set this to `true` (default is `false`) then any textobject is - -- extended to include preceding or succeeding whitespace. Succeeding - -- whitespace has priority in order to act similarly to eg the built-in - -- `ap`. - -- - -- Can also be a function which gets passed a table with the keys - -- * query_string: eg '@function.inner' - -- * selection_mode: eg 'v' - -- and should return true of false - include_surrounding_whitespace = true, - }, - }, -}) diff --git a/configs/nvim/lua/max/configs/ufo.lua b/configs/nvim/lua/max/configs/ufo.lua deleted file mode 100644 index a3d63dc..0000000 --- a/configs/nvim/lua/max/configs/ufo.lua +++ /dev/null @@ -1,41 +0,0 @@ -return function() - local handler = function(virtText, lnum, endLnum, width, truncate) - local newVirtText = {} - local suffix = ('  %d '):format(endLnum - lnum) - local sufWidth = vim.fn.strdisplaywidth(suffix) - local targetWidth = width - sufWidth - local curWidth = 0 - for _, chunk in ipairs(virtText) do - local chunkText = chunk[1] - local chunkWidth = vim.fn.strdisplaywidth(chunkText) - if targetWidth > curWidth + chunkWidth then - table.insert(newVirtText, chunk) - else - chunkText = truncate(chunkText, targetWidth - curWidth) - local hlGroup = chunk[2] - table.insert(newVirtText, { chunkText, hlGroup }) - chunkWidth = vim.fn.strdisplaywidth(chunkText) - -- str width returned from truncate() may less than 2nd argument, need padding - if curWidth + chunkWidth < targetWidth then - suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth) - end - break - end - curWidth = curWidth + chunkWidth - end - table.insert(newVirtText, { suffix, 'MoreMsg' }) - return newVirtText - end - - require("ufo").setup({ - fold_virt_text_handler = handler, - provider_selector = function(bufnr, filetype, buftype) - return { 'treesitter', 'indent' } - end - }) - - vim.o.foldcolumn = '1' - vim.o.foldlevel = 99 - vim.o.foldlevelstart = 99 - vim.o.foldenable = true -end diff --git a/configs/nvim/lua/max/core/keymappings.lua b/configs/nvim/lua/max/core/keymappings.lua index fce2cc3..b8a1268 100644 --- a/configs/nvim/lua/max/core/keymappings.lua +++ b/configs/nvim/lua/max/core/keymappings.lua @@ -61,7 +61,7 @@ map("n", "ip", ":TroubleToggle", opts) -- [i]nspect [p]rob map("n", "ii", ":Lspsaga incomming_calls", opts) -- [i]nspect [i]ncomming_calls map("n", "io", ":Lspsaga outgoing_calls", opts) -- [i]nspect [o]utgoing_calls -map({ "n", "v" }, "t", require("max.configs.translate"), opts) +map({ "n", "v" }, "t", require("max.functions.translate"), opts) -- DAP Functionality map("n", "b", ":lua require('dap').toggle_breakpoint()", opts) diff --git a/configs/nvim/lua/max/core/plugins.lua b/configs/nvim/lua/max/core/plugins.lua index 6048953..a672f00 100644 --- a/configs/nvim/lua/max/core/plugins.lua +++ b/configs/nvim/lua/max/core/plugins.lua @@ -1,399 +1,123 @@ -local plugins = { - - { - dir = "~/Projects/sudoku.nvim", - cmd = "Sudoku", - config = function() - require("sudoku").setup({ - custom_highlights = { - square = { fg = "red" } - } - }) - vim.cmd("hi SudokuSquare guibg=red") - end - }, - - "nvim-lua/plenary.nvim", - - --------------------- - -- Theming Section -- - --------------------- - - require("max.theme"), - - -------------------- - -- Layout Plugins -- - -------------------- - "nvim-lua/popup.nvim", - require("max.configs.neotree"), - { - "nvim-lualine/lualine.nvim", - lazy = false, - config = function() - require("max.configs.lualine") - end, - }, - { - 'echasnovski/mini.nvim', - version = false, - event = "VeryLazy", - config = function() - -- require("mini.sessions").setup({ - -- autoread = true, - -- directory = "session", - -- file = "", - -- verbose = { read = true, write = true, delete = true }, - -- }) - - require("mini.comment").setup({ - }) - - require("mini.pairs").setup({ - }) - - require("mini.surround").setup({ - }) - - require("mini.animate").setup({ - cursor = { - enable = false, - } - }) - end - }, - { - "shortcuts/no-neck-pain.nvim", - cmd = "NoNeckPain", - config = true - }, - { - "folke/noice.nvim", - event = "VeryLazy", - enabled = true, - opts = { - lsp = { - progress = { - enabled = false - }, - hover = { - enabled = false - } - }, - views = { - cmdline_popup = { - border = { - style = "single", - padding = { 0, 1 }, - }, - filter_options = {}, - win_options = { - winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder", - }, - }, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - lsp_doc_border = true - }, - }, - keys = { - { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, - { "snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, - { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, - { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, - }, - }, - { - "romgrk/barbar.nvim", - dependencies = 'nvim-tree/nvim-web-devicons', - event = "VeryLazy", - config = function() - require("bufferline").setup({ - auto_hide = true, - icons = { - seperator = { left = "│", right = "" } - } - }) - end, - }, - { - "stevearc/dressing.nvim", - enabled = false, - lazy = true, - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - config = function() - require("which-key").setup({}) - end, - }, - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - config = true, - }, - { "mbbill/undotree", cmd = { "Undotree", "UndotreeToggle" } }, - { - "petertriho/nvim-scrollbar", - event = "VeryLazy", - config = function() - require("max.configs.scrollbar") - end, - }, - { - "lewis6991/gitsigns.nvim", - event = "BufReadPost", - config = function() - require("gitsigns").setup() - end, - }, - { - "akinsho/nvim-toggleterm.lua", - event = "VeryLazy", - config = function() - require("max.configs.toggleterm"); - end, - }, - { - "akinsho/git-conflict.nvim", - version = "*", - event = "BufReadPost", - config = function() - require("git-conflict").setup() - end, - }, - { - "rcarriga/nvim-notify", - config = function() - require("max.configs.notify") - end, - event = "VimEnter", - }, - { - "goolord/alpha-nvim", - lazy = false, - config = function() - require("max.configs.dashboard") - end, - }, -- startup screen - --------------------- - -- Code Navigation -- - --------------------- - { - "ggandor/flit.nvim", - dependencies = { - "ggandor/leap.nvim", - }, - event = "VeryLazy", - config = true, - }, - { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/popup.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope-fzf-native.nvim", - }, - event = "VeryLazy", - config = function() - require("max.configs.telescope") - end, - }, - --------------- - -- Lsp Setup -- - --------------- - { - "glepnir/lspsaga.nvim", - event = "BufRead", - config = function() - require("lspsaga").setup({ - symbol_in_winbar = { - enable = false, - }, - }) - end, - }, - { - "neovim/nvim-lspconfig", - dependencies = { - "arkav/lualine-lsp-progress", - "williamboman/mason.nvim", - "jose-elias-alvarez/null-ls.nvim", - "williamboman/mason-lspconfig.nvim", - "onsails/lspkind.nvim", - { "lukas-reineke/lsp-format.nvim", config = true }, - }, - event = "BufReadPost", - config = function() - require("max.configs.lsp") - end, - }, - { - "folke/trouble.nvim", - cmd = "TroubleToggle", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - require("trouble").setup({}) - end, - }, - ------------------- - -- Autocomplete -- - ------------------- - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-emoji", - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-nvim-lua", - "zbirenbaum/copilot.lua", - "zbirenbaum/copilot-cmp", - "L3MON4D3/LuaSnip", - "rafamadriz/friendly-snippets", - }, - config = function() - require("max.configs.autocomplete") - end, - }, - { - "nat-418/boole.nvim", - event = "InsertEnter", - config = function() - require("boole").setup({ - mappings = { - increment = '+', - decrement = '-' - }, - additions = { - { "const", "let", "var" }, - { "absolute", "relative", "fixed", "sticky" } - } - }) - end, - }, - { - "gaoDean/autolist.nvim", - event = "InsertEnter", - config = true, - }, - ------------------------- - -- Syntax Highlighting -- - ------------------------- - { - "norcalli/nvim-colorizer.lua", - config = true, - event = "BufReadPost", - }, - { - "folke/todo-comments.nvim", - config = true, - event = "VeryLazy", - }, - { - "nvim-treesitter/nvim-treesitter", - event = "VeryLazy", - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - "JoosepAlviste/nvim-ts-context-commentstring", - "windwp/nvim-ts-autotag", - }, - config = function() - require("max.configs.treesitter") - end, - build = ":TSUpdate", - }, - -------------------- - -- IDE Type Stuff -- - -------------------- - { - "rest-nvim/rest.nvim", - lazy = false, - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("rest-nvim").setup({}) - end, - }, - { - "chrisgrieser/nvim-recorder", - event = "VeryLazy", - config = function() - require("recorder").setup({ - logLevel = vim.log.levels.OFF, - }) - end, - }, - { - "jackMort/ChatGPT.nvim", - cmd = "ChatGPT", - config = true, - dependencies = { - "MunifTanjim/nui.nvim", - }, - }, - { - "olimorris/persisted.nvim", - lazy = false, - config = function() - require("max.configs.session") - end, - }, - --Dap Debugger -- Have not yet been able to set this up - { - "mfussenegger/nvim-dap", - dependencies = { - "rcarriga/nvim-dap-ui", - "mxsdev/nvim-dap-vscode-js", - }, - config = function() - require("max.configs.dap") - end, - }, - { - "michaelb/sniprun", - event = "BufRead", - config = function() - require("max.configs.sniprun") - end, - build = "bash ./install.sh", - }, - { - "uga-rosa/translate.nvim", - event = "InsertEnter", - config = function() - require("translate").setup({ default = { output = "replace" } }) - end, - }, - { - "nvim-neotest/neotest", - cmd = "NeoTest", - config = function() - require("max.configs.neotest") - end, - dependencies = { - "haydenmeade/neotest-jest", - "KaiSpencer/neotest-vitest", - "antoinemadec/FixCursorHold.nvim", - }, - }, - { - "tpope/vim-dadbod", - dependencies = { - "kristijanhusak/vim-dadbod-completion", - "kristijanhusak/vim-dadbod-ui", - }, - cmd = "DBUI" - }, -} +-- local plugins = { +-- +-- { +-- dir = "~/Projects/sudoku.nvim", +-- cmd = "Sudoku", +-- config = function() +-- require("sudoku").setup({ +-- custom_highlights = { +-- square = { fg = "red" } +-- } +-- }) +-- vim.cmd("hi SudokuSquare guibg=red") +-- end +-- }, +-- +-- +-- +-- { +-- "shortcuts/no-neck-pain.nvim", +-- cmd = "NoNeckPain", +-- config = true +-- }, +-- , +-- { +-- "stevearc/dressing.nvim", +-- enabled = false, +-- lazy = true, +-- }, +-- { +-- "simrat39/symbols-outline.nvim", +-- cmd = "SymbolsOutline", +-- config = true, +-- }, +-- --------------------- +-- -- Code Navigation -- +-- --------------------- +-- --------------- +-- -- Lsp Setup -- +-- --------------- +-- { +-- "glepnir/lspsaga.nvim", +-- event = "BufRead", +-- config = function() +-- require("lspsaga").setup({ +-- symbol_in_winbar = { +-- enable = false, +-- }, +-- }) +-- end, +-- }, +-- { +-- "folke/trouble.nvim", +-- cmd = "TroubleToggle", +-- dependencies = "nvim-tree/nvim-web-devicons", +-- config = function() +-- require("trouble").setup({}) +-- end, +-- }, +-- ------------------- +-- -- Autocomplete -- +-- ------------------- +-- { +-- "nat-418/boole.nvim", +-- event = "InsertEnter", +-- config = function() +-- require("boole").setup({ +-- mappings = { +-- increment = '+', +-- decrement = '-' +-- }, +-- additions = { +-- { "const", "let", "var" }, +-- { "absolute", "relative", "fixed", "sticky" } +-- } +-- }) +-- end, +-- }, +-- { +-- "gaoDean/autolist.nvim", +-- event = "InsertEnter", +-- config = true, +-- }, +-- ------------------------- +-- -- Syntax Highlighting -- +-- ------------------------- +-- { +-- "norcalli/nvim-colorizer.lua", +-- config = true, +-- event = "BufReadPost", +-- }, +-- { +-- "folke/todo-comments.nvim", +-- config = true, +-- event = "VeryLazy", +-- }, +-- -------------------- +-- -- IDE Type Stuff -- +-- -------------------- +-- { +-- "rest-nvim/rest.nvim", +-- lazy = false, +-- dependencies = { "nvim-lua/plenary.nvim" }, +-- config = function() +-- require("rest-nvim").setup({}) +-- end, +-- }, +-- { +-- "jackMort/ChatGPT.nvim", +-- cmd = "ChatGPT", +-- config = true, +-- dependencies = { +-- "MunifTanjim/nui.nvim", +-- }, +-- }, +-- --Dap Debugger -- Have not yet been able to set this up +-- } local opts = { defaults = { lazy = true }, - install = { colorscheme = { require("max.theme").name } }, + install = { colorscheme = { require("max.plugins.theme").name } }, change_detection = { enabled = true, -- automatically check for config file changes and reload the ui notify = true, -- get a notification when changes are found @@ -426,4 +150,4 @@ local opts = { } } -require("lazy").setup(plugins, opts) +require("lazy").setup("max.plugins", opts) diff --git a/configs/nvim/lua/max/functions/translate/init.lua b/configs/nvim/lua/max/functions/translate/init.lua new file mode 100644 index 0000000..9ab6c78 --- /dev/null +++ b/configs/nvim/lua/max/functions/translate/init.lua @@ -0,0 +1,60 @@ +local languages = require("max.functions.translate.languages") +local pickers = require("telescope.pickers") +local finders = require("telescope.finders") +local actions = require("telescope.actions") +local action_state = require("telescope.actions.state") +local conf = require("telescope.config").values + +return function() + -- This active_buf and active selection because telescope clears everything (i think) + local active_buf = vim.api.nvim_get_current_buf() + local mode = vim.api.nvim_get_mode().mode + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "x!", true) + local start_mark = vim.api.nvim_buf_get_mark(active_buf, "<") + local end_mark = vim.api.nvim_buf_get_mark(active_buf, ">") + + pickers + .new({}, { + prompt_title = "Translate", + finder = finders.new_table({ + results = languages, + entry_maker = function(entry) + return { + value = entry[2], + ordinal = entry[1] .. " " .. entry[2], + display = entry[3] .. entry[1], + } + end, + }), + sorter = conf.generic_sorter({}), + attach_mappings = function(prompt_bufnr) + actions.select_default:replace(function() + actions.close(prompt_bufnr) + + local selection = action_state.get_selected_entry() + + vim.api.nvim_set_current_buf(active_buf) + + vim.api.nvim_win_set_cursor(0, start_mark) + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(mode, true, false, true), "x!", true) + vim.api.nvim_win_set_cursor(0, end_mark) + + local timer = vim.loop.new_timer() + timer:start( + 500, + 0, + vim.schedule_wrap(function() + if mode == "v" or mode == "V" then + vim.cmd("'<,'>Translate " .. selection.value) + else + vim.cmd("Translate " .. selection.value) + end + end) + ) + end) + return true + end, + previewer = nil, + }) + :find() +end diff --git a/configs/nvim/lua/max/configs/translate/languages.lua b/configs/nvim/lua/max/functions/translate/languages.lua similarity index 100% rename from configs/nvim/lua/max/configs/translate/languages.lua rename to configs/nvim/lua/max/functions/translate/languages.lua diff --git a/configs/nvim/lua/max/plugins/autocomplete.lua b/configs/nvim/lua/max/plugins/autocomplete.lua new file mode 100644 index 0000000..7c2a376 --- /dev/null +++ b/configs/nvim/lua/max/plugins/autocomplete.lua @@ -0,0 +1,129 @@ +return { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-emoji", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "zbirenbaum/copilot.lua", + "zbirenbaum/copilot-cmp", + "L3MON4D3/LuaSnip", + "rafamadriz/friendly-snippets", + }, + config = function() + local luasnip = require("luasnip") + require("max.plugins.autocomplete.snippets") + + local lspkind = require("lspkind") + local cmp = require("cmp") + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + require("lspconfig").html.setup({ + capabilities = capabilities, + }) + + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + }) + require("copilot_cmp").setup { + method = "getCompletionsCycling", + } + + local check_backspace = function() + local col = vim.fn.col(".") - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") + end + + cmp.setup({ + window = { + documentation = cmp.config.window.bordered(), + }, + experimental = { + ghost_text = true, + }, + completion = { + completeopt = "menuone,noselect", + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping.complete({}), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + 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", + }), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + }, + formatting = { + format = lspkind.cmp_format({ + mode = "symbol_text", + max_width = 50, + symbol_map = { Copilot = "" }, + }), + }, + sources = { + { name = "copilot" }, + { name = "vim-dadbod-completion", filetype = "sql" }, + { name = "nvim_lua" }, + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "emoji" }, + { name = "path" }, + { name = "buffer" }, + { name = "calc" }, + }, + }) + + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline("/", { + sources = { + { name = "buffer" }, + }, + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(":", { + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }) + end, +} diff --git a/configs/nvim/lua/max/configs/snippets.lua b/configs/nvim/lua/max/plugins/autocomplete/snippets.lua similarity index 100% rename from configs/nvim/lua/max/configs/snippets.lua rename to configs/nvim/lua/max/plugins/autocomplete/snippets.lua diff --git a/configs/nvim/lua/max/plugins/dadbod.lua b/configs/nvim/lua/max/plugins/dadbod.lua new file mode 100644 index 0000000..4ea4a39 --- /dev/null +++ b/configs/nvim/lua/max/plugins/dadbod.lua @@ -0,0 +1,8 @@ +return { + "tpope/vim-dadbod", + dependencies = { + "kristijanhusak/vim-dadbod-completion", + "kristijanhusak/vim-dadbod-ui", + }, + cmd = "DBUI" +} diff --git a/configs/nvim/lua/max/plugins/dap.lua b/configs/nvim/lua/max/plugins/dap.lua new file mode 100644 index 0000000..89dfbfc --- /dev/null +++ b/configs/nvim/lua/max/plugins/dap.lua @@ -0,0 +1,107 @@ +return { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + "mxsdev/nvim-dap-vscode-js", + }, + config = function() + require("max.configs.dap") + + local dap, dapui = require("dap"), require("dapui") + + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open({}) + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close({}) + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close({}) + end + + require("dap-vscode-js").setup({ + -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" + -- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation. + -- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`. + adapters = { 'pwa-node', 'pwa-chrome' }, -- which adapters to register in nvim-dap + }) + + dap.adapters.node2 = { + type = 'executable', + command = 'node', + args = { vim.fn.stdpath "data" .. '/mason/packages/node-debug2-adapter/out/src/nodeDebug.js' }, + } + + dap.adapters.firefox = { + type = "executable", + command = "node", + options = { + initialize_timeout_sec = 10, + disconnect_timeout_sec = 10, + max_retries = 30, + }, + args = { vim.fn.stdpath("data") .. "/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js" }, + } + + dap.configurations.typescript = { + { + name = "Debug with Firefox", + type = "firefox", + request = "launch", + reAttach = true, + webRoot = "${workspaceFolder}", + url = "http://localhost:8080", + firefoxExecutable = "/sbin/firefox-developer-edition", + }, + { + name = 'Launch', + type = 'node2', + request = 'launch', + program = '${file}', + cwd = vim.fn.getcwd(), + sourceMaps = true, + protocol = 'inspector', + console = 'integratedTerminal', + }, + { + -- For this to work you need to make sure the node process is started with the `--inspect` flag. + name = 'Attach to process', + type = 'node2', + request = 'attach', + sourceMaps = true, + cwd = "${workspaceFolder}", + processId = require 'dap.utils'.pick_process, + }, + { + type = "pwa-node", + request = "attach", + name = "Attach", + processId = require 'dap.utils'.pick_process, + cwd = "${workspaceFolder}", + } + } + + dap.configurations.typescriptreact = { + { + name = 'debug with firefox', + type = 'firefox', + request = 'launch', + reattach = true, + url = 'http://localhost:4200', + webRoot = '/home/max/Projects/ruumio/main/apps/events-standalone/', + firefoxExecutable = '/home/max/Downloads/firefox/firefox' + }, + { + name = 'debug with chrome', + type = 'pwa-chrome', + request = 'launch', + reattach = true, + url = 'http://localhost:4200', + webroot = '${workspacefolder}', + runtimeExecutable = '/mnt/c/Program Files/Google/Chrome/Application/chrome.exe' + }, + } + + dap.configurations.javascript = dap.configurations.typescript; + end, +} diff --git a/configs/nvim/lua/max/plugins/dashboard.lua b/configs/nvim/lua/max/plugins/dashboard.lua new file mode 100644 index 0000000..c3219ad --- /dev/null +++ b/configs/nvim/lua/max/plugins/dashboard.lua @@ -0,0 +1,88 @@ +return { + "goolord/alpha-nvim", + lazy = false, + config = function() + ----------------------------------- + -- Welcome Screen Configuration -- + ----------------------------------- + + -- Call Alpha With A pcall + local status_ok, alpha = pcall(require, "alpha") + if not status_ok then + return + end + + -- Enable Alpha Dashboard + local dashboard = require("alpha.themes.dashboard") + + -- Remove These ~ ~ ~ + vim.opt.fillchars:append({ eob = " " }) + + -- Disable Status Line so that alpha dashboard look nice + -- vim.cmd [[ au User AlphaReady if winnr('$') == 1 | set laststatus=1 ]] + + -- Custom Footer + dashboard.section.footer.val = { + "Write Programs That Do One Thing And Do It Well.", + } + + -- Custom Section + dashboard.section.buttons.val = { + dashboard.button("n", " Create New file", ":set laststatus=3 | :ene startinsert "), + dashboard.button("e", " Open File Manager", ":set laststatus=3 | :Neotree toggle "), + dashboard.button("s", "Δ Search Sessions", ":Telescope persisted"), + dashboard.button("v", " Neovim Settings ", ":set laststatus=3 | e ~/.config/nvim/init.lua "), + dashboard.button("b", "⟳ Recent Files", ":Telescope oldfiles"), + -- dashboard.button("s", " Shell Configuration", ":set laststatus=3 | e ~/.config/zsh/.zshrc "), + dashboard.button("u", " Update Nvim Plugins", ":Lazy update "), + dashboard.button("q", " Quit Neovim", ":qa"), + } + + -- LuaVim Ascii Art + dashboard.section.header.val = { + [[███╗ ███╗ █████╗ ██╗ ██╗ ███╗ ██╗ ██╗ ██╗██╗███╗ ███╗]], + [[████╗ ████║██╔══██╗╚██╗██╔╝ ████╗ ██║ ██║ ██║██║████╗ ████║]], + [[██╔████╔██║███████║ ╚███╔╝ ██╔██╗ ██║ ██║ ██║██║██╔████╔██║]], + [[██║╚██╔╝██║██╔══██║ ██╔██╗ ██║╚██╗██║ ╚██╗ ██╔╝██║██║╚██╔╝██║]], + [[██║ ╚═╝ ██║██║ ██║██╔╝ ██╗ ██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║]], + [[╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]], + } + + dashboard.section.header.val = { + [[ __ ]], + [[ /\ \ ]], + [[ / /\ \ ]], + [[/ /__\ \ ]], + [[\/____\/ ]], + } + + -- dashboard.section.header.val = { + -- [[ ____]], + -- [[ /\ \]], + -- [[ / \ \]], + -- [[ / \ \]], + -- [[ / \ \]], + -- [[ / /\ \ \]], + -- [[ / / \ \ \]], + -- [[ / / \ \ \]], + -- [[ / / / \ \ \]], + -- [[ / / / \ \ \]], + -- [[ / / /---------' \]], + -- [[/ / /_______________\]], + -- [[\ / /]], + -- [[ \/_____________________/ ]], + -- } + + -- Layout For Luavim ascii art + dashboard.config.layout = { + { type = "padding", val = 5 }, + dashboard.section.header, + { type = "padding", val = 2 }, + dashboard.section.buttons, + { type = "padding", val = 1 }, + dashboard.section.footer, + } + + alpha.setup(dashboard.opts) + end, +} diff --git a/configs/nvim/lua/max/plugins/git-conflict.lua b/configs/nvim/lua/max/plugins/git-conflict.lua new file mode 100644 index 0000000..6e1a61f --- /dev/null +++ b/configs/nvim/lua/max/plugins/git-conflict.lua @@ -0,0 +1,6 @@ +return { + "akinsho/git-conflict.nvim", + version = "*", + event = "BufReadPost", + config = true, +} diff --git a/configs/nvim/lua/max/plugins/git-signs.lua b/configs/nvim/lua/max/plugins/git-signs.lua new file mode 100644 index 0000000..1f5cef7 --- /dev/null +++ b/configs/nvim/lua/max/plugins/git-signs.lua @@ -0,0 +1,5 @@ +return { + "lewis6991/gitsigns.nvim", + event = "BufReadPost", + config = true, +} diff --git a/configs/nvim/lua/max/plugins/jump.lua b/configs/nvim/lua/max/plugins/jump.lua new file mode 100644 index 0000000..f29a8b7 --- /dev/null +++ b/configs/nvim/lua/max/plugins/jump.lua @@ -0,0 +1,8 @@ +return { + "ggandor/flit.nvim", + dependencies = { + "ggandor/leap.nvim", + }, + event = "VeryLazy", + config = true, +} diff --git a/configs/nvim/lua/max/plugins/lsp.lua b/configs/nvim/lua/max/plugins/lsp.lua new file mode 100644 index 0000000..c370da1 --- /dev/null +++ b/configs/nvim/lua/max/plugins/lsp.lua @@ -0,0 +1,213 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + "arkav/lualine-lsp-progress", + "williamboman/mason.nvim", + "jose-elias-alvarez/null-ls.nvim", + "williamboman/mason-lspconfig.nvim", + "onsails/lspkind.nvim", + "lukas-reineke/lsp-format.nvim" + }, + event = "BufReadPost", + config = function() + local mason = require("mason") + local mason_lsp = require("mason-lspconfig") + local lsp = require("lspconfig") + + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, + { border = 'single' } + ) + vim.diagnostic.config({ + float = { + border = 'single', + }, + }) + + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.diagnostics.eslint_d, + }, + }) + + mason.setup() + mason_lsp.setup({ + ensure_installed = { "lua_ls", "jsonls", "tsserver", "svelte", "cssls", "prismals" }, + }) + + local function on_attach(client) + require("lsp-format").on_attach(client) + end + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + capabilities.textDocument.completion.completionItem.snippetSupport = true + + local custom_lsp = {} + + custom_lsp.tsserver = { + root_dir = lsp.util.root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git"), + } + + local runtime_path = vim.split(package.path, ";") + table.insert(runtime_path, "lua/?.lua") + table.insert(runtime_path, "lua/?/init.lua") + custom_lsp.lua_ls = { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + -- Setup your lua path + path = runtime_path, + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, + } + + custom_lsp.jsonls = { + settings = { + provideFormatter = false, + json = { + schemas = { + { + description = "TypeScript compiler configuration file", + fileMatch = { "tsconfig.json", "tsconfig.*.json" }, + url = "http://json.schemastore.org/tsconfig", + }, + { + description = "ESLint config", + fileMatch = { ".eslintrc.json", ".eslintrc" }, + url = "http://json.schemastore.org/eslintrc", + }, + { + description = "Prettier config", + fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" }, + url = "http://json.schemastore.org/prettierrc", + }, + { + description = "JSON schema for Import Maps files", + fileMatch = { "importmap.json", "import_map.json", "import-map.json" }, + name = "importmap.json", + url = "https://json.schemastore.org/importmap.json", + }, + { + description = "NPM configuration file", + fileMatch = { "package.json" }, + name = "package.json", + url = "https://json.schemastore.org/package.json", + }, + }, + }, + }, + } + + custom_lsp.intelephense = { + settings = { + intelephense = { + stubs = { + "wordpress", + "woocommerce", + "wordpress-globals", + "wp-cli", + }, + environment = { + includePaths = "/home/max/.composer/vendor/php-stubs/", -- this line forces the composer path for the stubs in case inteliphense don't find it... + }, + files = { + maxSize = 5000000, + }, + }, + }, + } + + custom_lsp.rust_analyzer = { + settings = { + ["rust-analyzer"] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, + }, + }, + } + + custom_lsp.yamlls = { + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*", + ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", + ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml", + ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml", + }, + }, + }, + } + + -- local glslls_config = require("max.configs.lsp-glsl") + -- glslls_config.on_attach = on_attach; + -- lsp.glslls.setup(glslls_config) + + custom_lsp.ltex = { + settings = { + ltex = { + language = "de", + disabledRules = { ["en-US"] = { "PROFANITY" } }, + dictionary = { + ["en-US"] = { "perf", "ci", "neovim" }, + }, + hiddenFalsePositives = { + "neovim", + "Neovim", + "waybar", + }, + }, + }, + } + + mason_lsp.setup_handlers({ + function(server_name) + local config = { + on_attach = on_attach, + capabilities = capabilities, + } + + if custom_lsp[server_name] ~= nil then + for k, v in pairs(custom_lsp[server_name]) do + config[k] = v + end + end + + lsp[server_name].setup(config) + end, + }) + end, +} diff --git a/configs/nvim/lua/max/configs/lsp-glsl.lua b/configs/nvim/lua/max/plugins/lsp/glsl.lua similarity index 100% rename from configs/nvim/lua/max/configs/lsp-glsl.lua rename to configs/nvim/lua/max/plugins/lsp/glsl.lua diff --git a/configs/nvim/lua/max/plugins/lualine.lua b/configs/nvim/lua/max/plugins/lualine.lua new file mode 100644 index 0000000..9b13cdd --- /dev/null +++ b/configs/nvim/lua/max/plugins/lualine.lua @@ -0,0 +1,245 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { + "chrisgrieser/nvim-recorder", + }, + lazy = false, + config = function() + ----------------- + -- Status Line -- + ----------------- + + -- Eviline / Vimline config for lualine + -- Author: shadmansaleh + -- Credit: glepnir + -- Credit: Elai + + local lualine = require("lualine") + + -- Color table for highlights + -- stylua: ignore + local colors = { + bg = '#00000000', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#B7BD82', + orange = '#8d6141', + violet = '#B294BB', + magenta = '#AE84BB', + blue = '#81A2BE', + red = '#CC8282', + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand("%:p:h") + local gitdir = vim.fn.finddir(".git", filepath .. ";") + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + -- Config + local config = { + options = { + -- Disable sections and component separators + component_separators = "", + section_separators = "", + globalstatus = true, + theme = require("max.plugins.theme").name, + }, + -- These are to remove the defaults + sections = { + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x ot right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + -- Icon Of Diffrent Mode: -- normal -- | -- insert -- | -- visual -- + ins_left({ + -- mode component + function() + return "◬" + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [""] = colors.blue, + V = colors.blue, + c = colors.red, + no = colors.red, + s = colors.orange, + S = colors.orange, + [""] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ["r?"] = colors.cyan, + ["!"] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + }) + + -- File Name + ins_left({ + "filename", + file_status = true, -- Displays file status (readonly status, modified status) + path = 2, -- 0: Just the filename + -- 1: Relative path + -- 2: Absolute path + shorting_target = 100, -- Shortens path to leave 40 spaces in the window + -- for other components. (terrible name, any suggestions?) + symbols = { + modified = "  ", -- Text to show when the file is modified. + readonly = " ", -- Text to show when the file is non-modifiable or readonly. + unnamed = "[No Name]", -- Text to show for unnamed buffers. + }, + }) + + ins_left { + require("recorder").recordingStatus + } + + ins_left { + 'lsp_progress', + display_components = { 'lsp_client_name', { 'title', 'percentage', 'message' } }, + -- With spinner + -- display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' }}, + colors = { + percentage = colors.cyan, + title = colors.cyan, + message = colors.cyan, + spinner = colors.cyan, + lsp_client_name = colors.magenta, + use = true, + }, + separators = { + component = ' ', + progress = ' | ', + message = { pre = '(', post = ')' }, + percentage = { pre = '', post = '%% ' }, + title = { pre = '', post = ': ' }, + lsp_client_name = { pre = '[', post = ']' }, + spinner = { pre = '', post = '' }, + }, + timer = { progress_enddelay = 500, spinner = 1000, lsp_client_name_enddelay = 1000 }, + spinner_symbols = { '🌑 ', '🌒 ', '🌓 ', '🌔 ', '🌕 ', '🌖 ', '🌗 ', '🌘 ' }, + } + + -- Git Diff + local function diff_source() + local gitsigns = vim.b.gitsigns_status_dict + if gitsigns then + return { + added = gitsigns.added, + modified = gitsigns.changed, + removed = gitsigns.removed, + } + end + end + + ins_right({ "diff", source = diff_source }) + + -- Git Branch + ins_right({ + "branch", + icon = "", + -- icon = '', + -- color = { fg = colors.green }, + -- padding = { right = 1 }, + -- padding = { left = 1 }, + }) + + -- File Type + ins_right({ + "filetype", + icon_only = true, + padding = { right = 2, left = 1 }, + }) + + -- File Encoding + ins_right({ + "o:encoding", -- option component same as &encoding in viml + fmt = string.upper, -- I'm not sure why it's upper case either ;) + cond = conditions.hide_in_width, + padding = { right = 2 }, + -- color = { fg = colors.green, gui = 'bold' }, + -- Add components to right sections + }) + + -- File Size + ins_right({ + -- filesize component + "filesize", + padding = { right = 2 }, + cond = conditions.buffer_not_empty, + }) + + -- File Location + ins_right({ + "location", + padding = { right = 0 }, + }) + + -- Insert mid section. You can make any number of sections in neovim :) + -- for lualine it's any number greater then 2 + ins_left({ + function() + return "%=" + end, + }) + + -- End Of The Status Bar + ins_right { + function() + return '' + end, + color = { fg = colors.blue }, -- Sets highlighting of component + padding = { left = 1, right = 0 }, -- We don't need space before this + } + + -- Now don't forget to initialize lualine + lualine.setup(config) + end +} diff --git a/configs/nvim/lua/max/plugins/mini.lua b/configs/nvim/lua/max/plugins/mini.lua new file mode 100644 index 0000000..8f4ebb1 --- /dev/null +++ b/configs/nvim/lua/max/plugins/mini.lua @@ -0,0 +1,21 @@ +return { + 'echasnovski/mini.nvim', + version = false, + event = "VeryLazy", + config = function() + require("mini.comment").setup({ + }) + + require("mini.pairs").setup({ + }) + + require("mini.surround").setup({ + }) + + require("mini.animate").setup({ + cursor = { + enable = false, + } + }) + end +} diff --git a/configs/nvim/lua/max/plugins/neotest.lua b/configs/nvim/lua/max/plugins/neotest.lua new file mode 100644 index 0000000..d04dff7 --- /dev/null +++ b/configs/nvim/lua/max/plugins/neotest.lua @@ -0,0 +1,16 @@ +return { + "nvim-neotest/neotest", + cmd = "NeoTest", + config = function() + require("neotest").setup({ + adapters = { + require("neotest-vitest")({}), + }, + }) + end, + dependencies = { + "haydenmeade/neotest-jest", + "KaiSpencer/neotest-vitest", + "antoinemadec/FixCursorHold.nvim", + }, +} diff --git a/configs/nvim/lua/max/configs/neotree.lua b/configs/nvim/lua/max/plugins/neotree.lua similarity index 100% rename from configs/nvim/lua/max/configs/neotree.lua rename to configs/nvim/lua/max/plugins/neotree.lua diff --git a/configs/nvim/lua/max/plugins/noice.lua b/configs/nvim/lua/max/plugins/noice.lua new file mode 100644 index 0000000..6708f4f --- /dev/null +++ b/configs/nvim/lua/max/plugins/noice.lua @@ -0,0 +1,45 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + enabled = true, + opts = { + lsp = { + progress = { + enabled = false + }, + hover = { + enabled = false + } + }, + views = { + cmdline_popup = { + border = { + style = "single", + padding = { 0, 1 }, + }, + filter_options = {}, + win_options = { + winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder", + }, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + lsp_doc_border = true + }, + }, + keys = { + { + "", + function() require("noice").redirect(vim.fn.getcmdline()) end, + mode = "c", + desc = + "Redirect Cmdline" + }, + { "snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, + { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, + { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, + }, +} diff --git a/configs/nvim/lua/max/plugins/notify.lua b/configs/nvim/lua/max/plugins/notify.lua new file mode 100644 index 0000000..309f598 --- /dev/null +++ b/configs/nvim/lua/max/plugins/notify.lua @@ -0,0 +1,23 @@ +return { + "rcarriga/nvim-notify", + config = function() + local notify = require("notify") + notify.setup( + { + stages = "fade_in_slide_out", + max_width = 50, + render = "minimal", + background_colour = "#000000", + icons = { + ERROR = "", + WARN = "", + INFO = "", + DEBUG = "", + TRACE = "✎" + } + } + ) + vim.notify = notify; + end, + event = "VimEnter", +} diff --git a/configs/nvim/lua/max/plugins/recorder.lua b/configs/nvim/lua/max/plugins/recorder.lua new file mode 100644 index 0000000..fda030f --- /dev/null +++ b/configs/nvim/lua/max/plugins/recorder.lua @@ -0,0 +1,7 @@ +return { + "chrisgrieser/nvim-recorder", + event = "VeryLazy", + opts = { + logLevel = vim.log.levels.OFF, + }, +} diff --git a/configs/nvim/lua/max/plugins/scrollbar.lua b/configs/nvim/lua/max/plugins/scrollbar.lua new file mode 100644 index 0000000..20b83d7 --- /dev/null +++ b/configs/nvim/lua/max/plugins/scrollbar.lua @@ -0,0 +1,22 @@ +return { + "petertriho/nvim-scrollbar", + event = "VeryLazy", + config = function() + require("scrollbar").setup({ + handlers = { + cursor = true, + diagnostic = true, + gitsigns = true, -- Requires gitsigns + handle = true, + search = false, -- Requires hlslens + }, + excluded_filetypes = { + "prompt", + "TelescopePrompt", + "noice", + "NvimTree", + "neo-tree" + }, + }) + end, +} diff --git a/configs/nvim/lua/max/plugins/session.lua b/configs/nvim/lua/max/plugins/session.lua new file mode 100644 index 0000000..74cc1cc --- /dev/null +++ b/configs/nvim/lua/max/plugins/session.lua @@ -0,0 +1,7 @@ +return { + "olimorris/persisted.nvim", + lazy = false, + opts = { + autoload = true, + }, +} diff --git a/configs/nvim/lua/max/plugins/sniprun.lua b/configs/nvim/lua/max/plugins/sniprun.lua new file mode 100644 index 0000000..01c9c9f --- /dev/null +++ b/configs/nvim/lua/max/plugins/sniprun.lua @@ -0,0 +1,9 @@ +return { + "michaelb/sniprun", + event = "BufRead", + opts = { + selected_interpreters = { "JS_TS_deno" }, + repl_enable = { "JS_TS_deno" } + }, + build = "bash ./install.sh", +} diff --git a/configs/nvim/lua/max/plugins/tabs.lua b/configs/nvim/lua/max/plugins/tabs.lua new file mode 100644 index 0000000..8a4107b --- /dev/null +++ b/configs/nvim/lua/max/plugins/tabs.lua @@ -0,0 +1,13 @@ +return { + "romgrk/barbar.nvim", + dependencies = 'nvim-tree/nvim-web-devicons', + event = "VeryLazy", + config = function() + require("bufferline").setup({ + auto_hide = true, + icons = { + seperator = { left = "│", right = "" } + } + }) + end, +} diff --git a/configs/nvim/lua/max/plugins/telescope.lua b/configs/nvim/lua/max/plugins/telescope.lua new file mode 100644 index 0000000..590e343 --- /dev/null +++ b/configs/nvim/lua/max/plugins/telescope.lua @@ -0,0 +1,82 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/popup.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-fzf-native.nvim", + }, + event = "VeryLazy", + config = function() + local telescope = require("telescope") + telescope.setup({ + defaults = {}, + }) + + local function open_with_trouble() + require("trouble.providers.telescope").open_with_trouble() + end + + local default = { + extensions = { + sessions_picker = { + sessions_dir = vim.fn.stdpath("data") .. "/sessions/", + }, + }, + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--ignore-file", + ".gitignore", + }, + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "ascending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8, + }, + vertical = { + mirror = false, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + file_sorter = require("telescope.sorters").get_fuzzy_file, + file_ignore_patterns = { "node_modules", "*pnpm-lock*" }, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + path_display = { "truncate" }, + winblend = 0, + border = {}, + mappings = { + i = { [""] = open_with_trouble }, + n = { [""] = open_with_trouble }, + }, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + use_less = true, + set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, + file_previewer = require("telescope.previewers").vim_buffer_cat.new, + grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, + qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, + }, + } + + telescope.setup(default) + telescope.load_extension("notify") + -- telescope.load_extension("persisted") -- To load the telescope extension + -- + end, +} diff --git a/configs/nvim/lua/max/plugins/theme.lua b/configs/nvim/lua/max/plugins/theme.lua new file mode 100644 index 0000000..b58c56c --- /dev/null +++ b/configs/nvim/lua/max/plugins/theme.lua @@ -0,0 +1,2 @@ +require("max.plugins.theme.statuscolumn") +return require("max.plugins.theme.catpuccin"); diff --git a/configs/nvim/lua/max/theme/ayu.lua b/configs/nvim/lua/max/plugins/theme/ayu.lua similarity index 100% rename from configs/nvim/lua/max/theme/ayu.lua rename to configs/nvim/lua/max/plugins/theme/ayu.lua diff --git a/configs/nvim/lua/max/theme/catpuccin.lua b/configs/nvim/lua/max/plugins/theme/catpuccin.lua similarity index 100% rename from configs/nvim/lua/max/theme/catpuccin.lua rename to configs/nvim/lua/max/plugins/theme/catpuccin.lua diff --git a/configs/nvim/lua/max/theme/everblush.lua b/configs/nvim/lua/max/plugins/theme/everblush.lua similarity index 100% rename from configs/nvim/lua/max/theme/everblush.lua rename to configs/nvim/lua/max/plugins/theme/everblush.lua diff --git a/configs/nvim/lua/max/plugins/theme/init.lua b/configs/nvim/lua/max/plugins/theme/init.lua new file mode 100644 index 0000000..e69de29 diff --git a/configs/nvim/lua/max/theme/statuscolumn.lua b/configs/nvim/lua/max/plugins/theme/statuscolumn.lua similarity index 100% rename from configs/nvim/lua/max/theme/statuscolumn.lua rename to configs/nvim/lua/max/plugins/theme/statuscolumn.lua diff --git a/configs/nvim/lua/max/theme/tokyo.lua b/configs/nvim/lua/max/plugins/theme/tokyo.lua similarity index 100% rename from configs/nvim/lua/max/theme/tokyo.lua rename to configs/nvim/lua/max/plugins/theme/tokyo.lua diff --git a/configs/nvim/lua/max/theme/tundra.lua b/configs/nvim/lua/max/plugins/theme/tundra.lua similarity index 100% rename from configs/nvim/lua/max/theme/tundra.lua rename to configs/nvim/lua/max/plugins/theme/tundra.lua diff --git a/configs/nvim/lua/max/plugins/toggleterm.lua b/configs/nvim/lua/max/plugins/toggleterm.lua new file mode 100644 index 0000000..c52feeb --- /dev/null +++ b/configs/nvim/lua/max/plugins/toggleterm.lua @@ -0,0 +1,44 @@ +return { + "akinsho/nvim-toggleterm.lua", + event = "VeryLazy", + config = function() + local Terminal = require("toggleterm.terminal").Terminal + local lazygit = Terminal:new({ + cmd = "lazygit", + dir = "git_dir", + direction = "float", + float_opts = { + winblend = 0, + border = "shadow", + }, + on_close = function() + Terminal:close() + end, + }) + + function _Lazygit_toggle() + lazygit:toggle() + end + + vim.api.nvim_set_keymap("n", "", "lua _Lazygit_toggle()", { noremap = true, silent = true }) + + local pnpm = Terminal:new({ + dir = "git_dir", + direction = "float", + float_opts = { + winblend = 0, + padding = 10, + border = "single", + }, + on_close = function() + Terminal:close() + end, + }) + + function _Pnpm_toggle() + pnpm:toggle() + end + + vim.api.nvim_set_keymap("n", "", "lua _Pnpm_toggle()", { noremap = true, silent = true }) + end, +} diff --git a/configs/nvim/lua/max/plugins/translate.lua b/configs/nvim/lua/max/plugins/translate.lua new file mode 100644 index 0000000..80b688b --- /dev/null +++ b/configs/nvim/lua/max/plugins/translate.lua @@ -0,0 +1,7 @@ +return { + "uga-rosa/translate.nvim", + event = "InsertEnter", + config = function() + require("translate").setup({ default = { output = "replace" } }) + end, +} diff --git a/configs/nvim/lua/max/plugins/treesitter.lua b/configs/nvim/lua/max/plugins/treesitter.lua new file mode 100644 index 0000000..d6dc483 --- /dev/null +++ b/configs/nvim/lua/max/plugins/treesitter.lua @@ -0,0 +1,75 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + "JoosepAlviste/nvim-ts-context-commentstring", + "windwp/nvim-ts-autotag", + }, + config = function() + require("nvim-treesitter.configs").setup({ + context_commentstring = { + enable = true + }, + autotag = { + enable = true, + }, + indent = { + enable = true, + }, + ensure_installed = { + "bash", + "yaml", + "http", + "svelte", + "css", + "svelte", + "typescript", + "javascript", + "tsx", + "go", + "lua", + "json", + "yaml", + "prisma", + }, + highlight = { enable = true }, + textobjects = { + select = { + enable = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + -- You can choose the select mode (default is charwise 'v') + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * method: eg 'v' or 'o' + -- and should return the mode ('v', 'V', or '') or a table + -- mapping query_strings to modes. + selection_modes = { + ["@parameter.outer"] = "v", -- charwise + ["@function.outer"] = "V", -- linewise + ["@class.outer"] = "", -- blockwise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true of false + include_surrounding_whitespace = true, + }, + }, + }) + end, + build = ":TSUpdate", +} diff --git a/configs/nvim/lua/max/plugins/undotree.lua b/configs/nvim/lua/max/plugins/undotree.lua new file mode 100644 index 0000000..a7f16f9 --- /dev/null +++ b/configs/nvim/lua/max/plugins/undotree.lua @@ -0,0 +1,4 @@ +return { + "mbbill/undotree", + cmd = { "Undotree", "UndotreeToggle" } +} diff --git a/configs/nvim/lua/max/plugins/which-key.lua b/configs/nvim/lua/max/plugins/which-key.lua new file mode 100644 index 0000000..e6b0faa --- /dev/null +++ b/configs/nvim/lua/max/plugins/which-key.lua @@ -0,0 +1,7 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + config = function() + require("which-key").setup({}) + end, +} diff --git a/configs/nvim/lua/max/theme/init.lua b/configs/nvim/lua/max/theme/init.lua deleted file mode 100644 index bf2a1cd..0000000 --- a/configs/nvim/lua/max/theme/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -require("max.theme.statuscolumn") -return require("max.theme.catpuccin");