From 1d0b4786d16b3d6ddf1addc4ef953d498800b6e5 Mon Sep 17 00:00:00 2001 From: kenobi Date: Tue, 6 May 2025 23:37:19 +0200 Subject: [PATCH 01/15] delete old stuff --- nvim/.neoconf.json | 15 -- nvim/LICENSE | 201 ------------------ nvim/README.md | 4 - nvim/lazyvim.json | 19 -- nvim/lua/config/autocmds.lua | 13 -- nvim/lua/config/keymaps.lua | 22 -- nvim/lua/plugins/catpuccin.lua | 12 -- nvim/lua/plugins/disabled.lua | 9 - nvim/lua/plugins/example.lua | 266 ------------------------ nvim/lua/plugins/fugitive.lua | 3 - nvim/lua/plugins/neotest-adapters.lua | 26 --- nvim/lua/plugins/neotest-rust.lua | 14 -- nvim/lua/plugins/neotree.lua | 15 -- nvim/lua/plugins/nvim-dap-vscode-js.lua | 6 - nvim/lua/plugins/surround.lua | 14 -- nvim/lua/plugins/toggleterm.lua | 17 -- nvim/stylua.toml | 3 - 17 files changed, 659 deletions(-) delete mode 100644 nvim/.neoconf.json delete mode 100644 nvim/LICENSE delete mode 100644 nvim/README.md delete mode 100644 nvim/lazyvim.json delete mode 100644 nvim/lua/config/autocmds.lua delete mode 100644 nvim/lua/config/keymaps.lua delete mode 100644 nvim/lua/plugins/catpuccin.lua delete mode 100644 nvim/lua/plugins/disabled.lua delete mode 100644 nvim/lua/plugins/example.lua delete mode 100644 nvim/lua/plugins/fugitive.lua delete mode 100644 nvim/lua/plugins/neotest-adapters.lua delete mode 100644 nvim/lua/plugins/neotest-rust.lua delete mode 100644 nvim/lua/plugins/neotree.lua delete mode 100644 nvim/lua/plugins/nvim-dap-vscode-js.lua delete mode 100644 nvim/lua/plugins/surround.lua delete mode 100644 nvim/lua/plugins/toggleterm.lua delete mode 100644 nvim/stylua.toml diff --git a/nvim/.neoconf.json b/nvim/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/nvim/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/nvim/LICENSE b/nvim/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/nvim/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/nvim/README.md b/nvim/README.md deleted file mode 100644 index 185280b..0000000 --- a/nvim/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# 💤 LazyVim - -A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). -Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json deleted file mode 100644 index 145587e..0000000 --- a/nvim/lazyvim.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extras": [ - "lazyvim.plugins.extras.editor.illuminate", - "lazyvim.plugins.extras.editor.navic", - "lazyvim.plugins.extras.editor.outline", - "lazyvim.plugins.extras.lang.json", - "lazyvim.plugins.extras.dap.nlua", - "lazyvim.plugins.extras.lang.rust", - "lazyvim.plugins.extras.lang.typescript", - "lazyvim.plugins.extras.linting.eslint", - "lazyvim.plugins.extras.lsp.none-ls", - "lazyvim.plugins.extras.test.core" - ], - "install_version": 7, - "news": { - "NEWS.md": "10960" - }, - "version": 8 -} diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua deleted file mode 100644 index 803242d..0000000 --- a/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here -local function open_nvim_tree(data) - local directory = vim.fn.isdirectory(data.file) == 1 - if not directory then - return - end - - vim.cmd.cd(data.file) -end - -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua deleted file mode 100644 index fb66a25..0000000 --- a/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,22 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here - -local function map(mode, lhs, rhs, opts) - local keys = require("lazy.core.handler").handlers.keys - ---@cast keys LazyKeysHandler - -- do not create the keymap if a lazy keys handler exists - if not keys.active[keys.parse({ lhs, mode = mode }).id] then - opts = opts or {} - opts.silent = opts.silent ~= false - if opts.remap and not vim.g.vscode then - opts.remap = nil - end - vim.keymap.set(mode, lhs, rhs, opts) - end -end - -map("t", "", [[]], {}) --- map("", "tl", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" }) -map("n", "mgg", ":diffget //2", {}) -map("n", "mgh", ":diffget //3", {}) diff --git a/nvim/lua/plugins/catpuccin.lua b/nvim/lua/plugins/catpuccin.lua deleted file mode 100644 index eb1cff3..0000000 --- a/nvim/lua/plugins/catpuccin.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - { - "catppuccin/nvim", - name = "catppuccin", - }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "catppuccin-latte", - }, - }, -} diff --git a/nvim/lua/plugins/disabled.lua b/nvim/lua/plugins/disabled.lua deleted file mode 100644 index 5573ec1..0000000 --- a/nvim/lua/plugins/disabled.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "nvim-lspconfig", - opts = { - inlay_hints = { enabled = false }, - diagnostics = { - virtual_text = true, - }, - }, -} diff --git a/nvim/lua/plugins/example.lua b/nvim/lua/plugins/example.lua deleted file mode 100644 index 78a3370..0000000 --- a/nvim/lua/plugins/example.lua +++ /dev/null @@ -1,266 +0,0 @@ --- since this is just an example spec, don't actually load anything here and return an empty spec --- stylua: ignore -if true then return {} end - --- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim --- --- In your plugin files, you can: --- * add extra plugins --- * disable/enabled LazyVim plugins --- * override the configuration of LazyVim plugins -return { - -- add gruvbox - { "ellisonleao/gruvbox.nvim" }, - - -- Configure LazyVim to load gruvbox - { - "LazyVim/LazyVim", - opts = { - colorscheme = "gruvbox", - }, - }, - - -- change trouble config - { - "folke/trouble.nvim", - -- opts will be merged with the parent spec - opts = { use_diagnostic_signs = true }, - }, - - -- disable trouble - { "folke/trouble.nvim", enabled = false }, - - -- add symbols-outline - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - config = true, - }, - - -- override nvim-cmp and add cmp-emoji - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local cmp = require("cmp") - opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) - end, - }, - - -- change some telescope options and a keymap to browse plugin files - { - "nvim-telescope/telescope.nvim", - keys = { - -- add a keymap to browse plugin files - -- stylua: ignore - { - "fp", - function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, - desc = "Find Plugin File", - }, - }, - -- change some options - opts = { - defaults = { - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - }, - - -- add telescope-fzf-native - { - "telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, - - -- add pyright to lspconfig - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- pyright will be automatically installed with mason and loaded with lspconfig - pyright = {}, - }, - }, - }, - - -- add tsserver and setup with typescript.nvim instead of lspconfig - { - "neovim/nvim-lspconfig", - dependencies = { - "jose-elias-alvarez/typescript.nvim", - init = function() - require("lazyvim.util").on_attach(function(_, buffer) - -- stylua: ignore - vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) - vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) - end) - end, - }, - ---@class PluginLspOpts - opts = { - ---@type lspconfig.options - servers = { - -- tsserver will be automatically installed with mason and loaded with lspconfig - tsserver = {}, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - tsserver = function(_, opts) - require("typescript").setup({ server = opts }) - return true - end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, - }, - - -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, - -- treesitter, mason and typescript.nvim. So instead of the above, you can use: - { import = "lazyvim.plugins.extras.lang.typescript" }, - - -- add more treesitter parsers - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - }, - }, - - -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above - -- would overwrite `ensure_installed` with the new value. - -- If you'd rather extend the default config, use the code below instead: - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - -- add tsx and treesitter - vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", - }) - end, - }, - - -- the opts function can also be used to change the default opts: - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function(_, opts) - table.insert(opts.sections.lualine_x, "😄") - end, - }, - - -- or you can return new options to override all the defaults - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - opts = function() - return { - --[[add your custom lualine config here]] - } - end, - }, - - -- use mini.starter instead of alpha - { import = "lazyvim.plugins.extras.ui.mini-starter" }, - - -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc - { import = "lazyvim.plugins.extras.lang.json" }, - - -- add any tools you want to have installed below - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - }, - }, - }, - - -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- this way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }) - end, - }, -} diff --git a/nvim/lua/plugins/fugitive.lua b/nvim/lua/plugins/fugitive.lua deleted file mode 100644 index 2c2efeb..0000000 --- a/nvim/lua/plugins/fugitive.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-fugitive", -} diff --git a/nvim/lua/plugins/neotest-adapters.lua b/nvim/lua/plugins/neotest-adapters.lua deleted file mode 100644 index 7a93b0b..0000000 --- a/nvim/lua/plugins/neotest-adapters.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - { "nvim-neotest/neotest-jest" }, - { - "nvim-neotest/neotest", - opts = function(_, opts) - table.insert( - opts.adapters, - require("neotest-jest")({ - jestCommand = "npm test --", - jestConfig = "jest.config.js", - env = { CI = true }, - cwd = function() - return vim.fn.getcwd() - end, - }) - ) - end, - keys = { - { - "tw", - "lua require('neotest').run.run({ jestCommand = 'jest --watch ' })", - desc = "Jest Watch", - }, - }, - }, -} diff --git a/nvim/lua/plugins/neotest-rust.lua b/nvim/lua/plugins/neotest-rust.lua deleted file mode 100644 index 8c90637..0000000 --- a/nvim/lua/plugins/neotest-rust.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { "rouge8/neotest-rust" }, - { - "nvim-neotest/neotest", - opts = function(_, opts) - table.insert( - opts.adapters, - require("neotest-rust")({ - args = { "--no-capture" }, - }) - ) - end, - }, -} diff --git a/nvim/lua/plugins/neotree.lua b/nvim/lua/plugins/neotree.lua deleted file mode 100644 index b39826f..0000000 --- a/nvim/lua/plugins/neotree.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - opts = { - require("neo-tree").setup({ - window = { - mappings = { - ["P"] = function(state) - local node = state.tree:get_node() - require("neo-tree.ui.renderer").focus_node(state, node:get_parent_id()) - end, - }, - }, - }), - }, -} diff --git a/nvim/lua/plugins/nvim-dap-vscode-js.lua b/nvim/lua/plugins/nvim-dap-vscode-js.lua deleted file mode 100644 index e22d40f..0000000 --- a/nvim/lua/plugins/nvim-dap-vscode-js.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "mxsdev/nvim-dap-vscode-js", - opts = function() - adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" } - end, -} diff --git a/nvim/lua/plugins/surround.lua b/nvim/lua/plugins/surround.lua deleted file mode 100644 index 605222a..0000000 --- a/nvim/lua/plugins/surround.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "echasnovski/mini.surround", - opts = { - mappings = { - add = "gsa", -- Add surrounding in Normal and Visual modes - delete = "gsd", -- Delete surrounding - find = "gsf", -- Find surrounding (to the right) - find_left = "gsF", -- Find surrounding (to the left) - highlight = "gsh", -- Highlight surrounding - replace = "gsr", -- Replace surrounding - update_n_lines = "gsn", -- Update `n_lines` - }, - }, -} diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua deleted file mode 100644 index 54a9473..0000000 --- a/nvim/lua/plugins/toggleterm.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - { - "akinsho/toggleterm.nvim", - version = "*", - opts = { - open_mapping = [[]], - hide_numbers = true, - direction = "float", - float_opts = { - border = "curved", - }, - winbar = { - enabled = false, - }, - }, - }, -} diff --git a/nvim/stylua.toml b/nvim/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file -- 2.45.2 From 850670d44c164f49ba66864174a9150c0527269b Mon Sep 17 00:00:00 2001 From: kenobi Date: Tue, 6 May 2025 23:37:41 +0200 Subject: [PATCH 02/15] lazy init --- nvim/init.lua | 3 +- nvim/lazy-lock.json | 55 +++-------------------------- nvim/lua/config/lazy.lua | 76 ++++++++++++++++++---------------------- 3 files changed, 40 insertions(+), 94 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index 2514f9e..a9edd2d 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,2 +1,3 @@ --- bootstrap lazy.nvim, LazyVim and your plugins require("config.lazy") + + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index f39939c..09838dc 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,56 +1,9 @@ { - "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" }, - "SchemaStore.nvim": { "branch": "main", "commit": "d521e71f9d5ac1c29a7653528d4e5c66ffe229c5" }, - "blink.cmp": { "branch": "main", "commit": "4f38ce99a472932d5776337f08f7a8180f1f571a" }, - "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "b7bbdf93b42866f166af98d39a2563eedb7cabac" }, - "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" }, - "crates.nvim": { "branch": "main", "commit": "2c8f4fab02e3e9ea42c6ad9b547e4207a914a397" }, - "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf-lua": { "branch": "main", "commit": "b11467c3fbfe48e4a815e4909f5c4e5b413ce6d0" }, - "gitsigns.nvim": { "branch": "main", "commit": "1796c7cedfe7e5dd20096c5d7b8b753d8f8d22eb" }, - "grug-far.nvim": { "branch": "main", "commit": "6ff8a205a29db3a9b08e5debe09452b4d6fd6591" }, + "kanagawa.nvim": { "branch": "master", "commit": "cc3b68b08e6a0cb6e6bf9944932940091e49bb83" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" }, - "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, - "neo-tree.nvim": { "branch": "main", "commit": "71bfdeddc90225e281ce34c378dc1b5914f5018d" }, - "neotest": { "branch": "master", "commit": "6267dcd577aa519c828d2526b05844770d3a2c6a" }, - "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, - "neotest-rust": { "branch": "main", "commit": "e1cb22ecf0341fb894ef2ebde344389fe6e6fc8e" }, - "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, - "none-ls.nvim": { "branch": "main", "commit": "a49f5a79cdb76e0dc1a98899c8598f4db014c5e7" }, - "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" }, - "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, - "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, - "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, - "nvim-lspconfig": { "branch": "master", "commit": "46434074f188e6bfccf9d9153dd8be6b1381498b" }, - "nvim-navic": { "branch": "master", "commit": "d0a8c17c4dc721b00bc2ac305c6ffbb036beeb74" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "mini.statusline": { "branch": "main", "commit": "e331175f10d9f400b42523b3890841aba202ce16" }, "nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" }, - "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "one-small-step-for-vimkind": { "branch": "main", "commit": "f11704f46b97297cce48a390f6a5eea469908fda" }, - "outline.nvim": { "branch": "main", "commit": "321f89ef79f168a78685f70d70c52d0e7b563abb" }, - "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "rustaceanvim": { "branch": "master", "commit": "3f2b7a94b7fa3c0f301dfa9644c94b543000efc2" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, - "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, - "vim-illuminate": { "branch": "master", "commit": "fbc16dee336d8cc0d3d2382ea4a53f4a29725abf" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } } diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index fe4f167..7ef81bc 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -1,47 +1,39 @@ +-- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +vim.opt.rtp:prepend(lazypath) +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +require("config.options") + +-- Setup lazy.nvim require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, - -- import/override with your plugins - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = false, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "kanagawa" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) + +require("config.keymap") -- 2.45.2 From cd3a5784fba02af2a16283f69473dd9e1557f58f Mon Sep 17 00:00:00 2001 From: kenobi Date: Tue, 6 May 2025 23:37:50 +0200 Subject: [PATCH 03/15] plugins and config --- nvim/lua/config/keymap.lua | 2 + nvim/lua/config/options.lua | 120 +++++++++++++++++++++++++-- nvim/lua/plugins/kanagawa.lua | 17 ++++ nvim/lua/plugins/nvim-treesitter.lua | 25 +++++- nvim/lua/plugins/oil.lua | 11 +++ nvim/lua/plugins/sleuth-vim.lua | 3 + nvim/lua/plugins/statusline.lua | 1 + 7 files changed, 166 insertions(+), 13 deletions(-) create mode 100644 nvim/lua/config/keymap.lua create mode 100644 nvim/lua/plugins/kanagawa.lua create mode 100644 nvim/lua/plugins/oil.lua create mode 100644 nvim/lua/plugins/sleuth-vim.lua create mode 100644 nvim/lua/plugins/statusline.lua diff --git a/nvim/lua/config/keymap.lua b/nvim/lua/config/keymap.lua new file mode 100644 index 0000000..cb32878 --- /dev/null +++ b/nvim/lua/config/keymap.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "-", "Oil --float", {desc="Open Parent Dir in Oil"}) +vim.keymap.set("n", "l", "Lazy", {desc="Open Lazy"}) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index ec667d5..7e4755e 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,10 +1,112 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here --- +vim.opt.langmap = "+]ü[" +vim.keymap.set("n", "ü", "[", {remap=true}) +-- Set to true if you have a Nerd Font installed and selected in the terminal +vim.g.have_nerd_font = false -local opt = vim.opt -opt.scrolloff = 999 -vim.diagnostic.config({ virtual_text = true }) -opt.title = true -opt.conceallevel = 0 +-- Make line numbers default +vim.opt.number = true +-- You can also add relative line numbers, to help with jumping. +-- Experiment for yourself to see if you like it! +vim.opt.relativenumber = true + +-- Enable mouse mode, can be useful for resizing splits for example! +vim.opt.mouse = 'a' + +-- Don't show the mode, since it's already in the status line +vim.opt.showmode = false + +-- Sync clipboard between OS and Neovim. +-- Schedule the setting after `UiEnter` because it can increase startup-time. +-- Remove this option if you want your OS clipboard to remain independent. +-- See `:help 'clipboard'` +vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' +end) + +-- Enable break indent +vim.opt.breakindent = true + +-- Save undo history +vim.opt.undofile = true + +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.opt.ignorecase = true +vim.opt.smartcase = true + +-- Keep signcolumn on by default +vim.opt.signcolumn = 'yes' + +-- Decrease update time +vim.opt.updatetime = 250 + +-- Decrease mapped sequence wait time +vim.opt.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` +-- and `:help 'listchars'` +vim.opt.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +vim.opt.inccommand = 'split' + +-- Show which line your cursor is on +vim.opt.cursorline = true +vim.opt.cursorcolumn = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.opt.scrolloff = 10 + +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.opt.confirm = true + +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic keymaps +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- TIP: Disable arrow keys in normal mode +-- vim.keymap.set('n', '', 'echo "Use h to move!!"') +-- vim.keymap.set('n', '', 'echo "Use l to move!!"') +-- vim.keymap.set('n', '', 'echo "Use k to move!!"') +-- vim.keymap.set('n', '', 'echo "Use j to move!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + +-- Highlight when yanking (copying) text +-- Try it with `yap` in normal mode +-- See `:help vim.highlight.on_yank()` +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) diff --git a/nvim/lua/plugins/kanagawa.lua b/nvim/lua/plugins/kanagawa.lua new file mode 100644 index 0000000..8707121 --- /dev/null +++ b/nvim/lua/plugins/kanagawa.lua @@ -0,0 +1,17 @@ +return { + "rebelot/kanagawa.nvim", + config = function() + require('kanagawa').setup({ + compile=true, + transparent=true, + background = { + dark = "wave", + light = "lotus" + }, + }); + vim.cmd("colorscheme kanagawa"); + end, + build = function() + vim.cmd("KanagawaCompile"); + end, +} diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua index ce1806b..bebb367 100644 --- a/nvim/lua/plugins/nvim-treesitter.lua +++ b/nvim/lua/plugins/nvim-treesitter.lua @@ -1,6 +1,23 @@ return { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = "all", - }, + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + + configs.setup({ + ensure_installed = "all", + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "" + }, + } + }) + end } diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..e29d31e --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,11 @@ +return { + "stevearc/oil.nvim", + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + -- Optional dependencies + dependencies = { { "echasnovski/mini.icons", opts = {} } }, + -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons + -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. + lazy = false, +} diff --git a/nvim/lua/plugins/sleuth-vim.lua b/nvim/lua/plugins/sleuth-vim.lua new file mode 100644 index 0000000..fddd2af --- /dev/null +++ b/nvim/lua/plugins/sleuth-vim.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-sleuth", +} diff --git a/nvim/lua/plugins/statusline.lua b/nvim/lua/plugins/statusline.lua new file mode 100644 index 0000000..bc6de63 --- /dev/null +++ b/nvim/lua/plugins/statusline.lua @@ -0,0 +1 @@ +return { "echasnovski/mini.statusline", version = false, opts = {} } -- 2.45.2 From d7b6c3b4503669542fe61bc1031cf4970c713508 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 00:24:52 +0200 Subject: [PATCH 04/15] formatting --- nvim/.editorconfig | 3 +++ nvim/lua/config/options.lua | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 nvim/.editorconfig diff --git a/nvim/.editorconfig b/nvim/.editorconfig new file mode 100644 index 0000000..de847ab --- /dev/null +++ b/nvim/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_size=2 +indent_style=space diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 7e4755e..84d1a96 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,5 +1,15 @@ vim.opt.langmap = "+]ü[" vim.keymap.set("n", "ü", "[", {remap=true}) + +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 + +vim.opt.smarttab = true +vim.opt.smartindent = true +vim.opt.autoindent = true + -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = false -- 2.45.2 From c234f6957a117a972ab4c1e31d439402c40360c3 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 00:25:07 +0200 Subject: [PATCH 05/15] navigation --- nvim/lua/plugins/fzflua.lua | 5 ++ .../plugins/nvim-treesitter-textobjects.lua | 62 +++++++++++++++++++ nvim/lua/plugins/which-key.lua | 14 +++++ 3 files changed, 81 insertions(+) create mode 100644 nvim/lua/plugins/fzflua.lua create mode 100644 nvim/lua/plugins/nvim-treesitter-textobjects.lua create mode 100644 nvim/lua/plugins/which-key.lua diff --git a/nvim/lua/plugins/fzflua.lua b/nvim/lua/plugins/fzflua.lua new file mode 100644 index 0000000..43c0c7d --- /dev/null +++ b/nvim/lua/plugins/fzflua.lua @@ -0,0 +1,5 @@ +return { + "ibhagwan/fzf-lua", + dependencies = { "echasnovski/mini.icons" }, + opts = {} +} diff --git a/nvim/lua/plugins/nvim-treesitter-textobjects.lua b/nvim/lua/plugins/nvim-treesitter-textobjects.lua new file mode 100644 index 0000000..7b71e89 --- /dev/null +++ b/nvim/lua/plugins/nvim-treesitter-textobjects.lua @@ -0,0 +1,62 @@ +return { + "nvim-treesitter/nvim-treesitter-textobjects", + dependencies = { + "nvim-treesitter/nvim-treesitter" + }, + init = function() + require'nvim-treesitter.configs'.setup { + textobjects = { + select = { + enable = true, + + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["bi"] = "@block.inner", + -- You can optionally set descriptions to the mappings (used in the desc parameter of + -- nvim_buf_set_keymap) which plugins like which-key display + ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" }, + -- You can also use captures from other query groups like `locals.scm` + ["as"] = { query = "@local.scope", query_group = "locals", desc = "Select language scope" }, + }, + -- 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 or false + include_surrounding_whitespace = true, + }, + swap = { + enable = true, + swap_next = { + ["a"] = "@parameter.inner", + }, + swap_previous = { + ["s"] = "@parameter.inner", + }, + }, + }, + } + end +} diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..7333b95 --- /dev/null +++ b/nvim/lua/plugins/which-key.lua @@ -0,0 +1,14 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = {}, + keys = { + { + "?", + function() + require("which-key").show({global = false}) + end, + desc = "Buffer local Keymaps (which-key)", + }, + }, +} -- 2.45.2 From 186e2def11b379fc6aee0fec6a7e1905a189f208 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 00:25:12 +0200 Subject: [PATCH 06/15] formatting --- nvim/lua/plugins/kanagawa.lua | 30 +++++++++++----------- nvim/lua/plugins/nvim-treesitter.lua | 38 ++++++++++++++-------------- nvim/lua/plugins/statusline.lua | 6 ++++- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/nvim/lua/plugins/kanagawa.lua b/nvim/lua/plugins/kanagawa.lua index 8707121..bca6c78 100644 --- a/nvim/lua/plugins/kanagawa.lua +++ b/nvim/lua/plugins/kanagawa.lua @@ -1,17 +1,17 @@ return { - "rebelot/kanagawa.nvim", - config = function() - require('kanagawa').setup({ - compile=true, - transparent=true, - background = { - dark = "wave", - light = "lotus" - }, - }); - vim.cmd("colorscheme kanagawa"); - end, - build = function() - vim.cmd("KanagawaCompile"); - end, + "rebelot/kanagawa.nvim", + config = function() + require('kanagawa').setup({ + compile=true, + transparent=true, + background = { + dark = "wave", + light = "lotus" + }, + }); + vim.cmd("colorscheme kanagawa"); + end, + build = function() + vim.cmd("KanagawaCompile"); + end, } diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua index bebb367..0bd7c3f 100644 --- a/nvim/lua/plugins/nvim-treesitter.lua +++ b/nvim/lua/plugins/nvim-treesitter.lua @@ -1,23 +1,23 @@ return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function () + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function () local configs = require("nvim-treesitter.configs") - configs.setup({ - ensure_installed = "all", - sync_install = false, - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "" - }, - } - }) - end + configs.setup({ + ensure_installed = "all", + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "" + }, + } + }) + end } diff --git a/nvim/lua/plugins/statusline.lua b/nvim/lua/plugins/statusline.lua index bc6de63..e05838a 100644 --- a/nvim/lua/plugins/statusline.lua +++ b/nvim/lua/plugins/statusline.lua @@ -1 +1,5 @@ -return { "echasnovski/mini.statusline", version = false, opts = {} } +return { + "echasnovski/mini.statusline", + version = false, + opts = {} +} -- 2.45.2 From 13700286da4a51c0244449e48fcc2ac0a3ad6329 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 00:25:13 +0200 Subject: [PATCH 07/15] lock --- nvim/lazy-lock.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 09838dc..f378a51 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,9 +1,12 @@ { + "fzf-lua": { "branch": "main", "commit": "6302f7ac9de6e293c3eb6c20c015155e117b598b" }, "kanagawa.nvim": { "branch": "master", "commit": "cc3b68b08e6a0cb6e6bf9944932940091e49bb83" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, "mini.statusline": { "branch": "main", "commit": "e331175f10d9f400b42523b3890841aba202ce16" }, - "nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" }, + "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" }, "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, - "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } -- 2.45.2 From 059484dc4b380f52bd649d02e33641d0fcd2e75f Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 23:49:50 +0200 Subject: [PATCH 08/15] fzf keys --- nvim/lua/plugins/fzflua.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nvim/lua/plugins/fzflua.lua b/nvim/lua/plugins/fzflua.lua index 43c0c7d..32c0981 100644 --- a/nvim/lua/plugins/fzflua.lua +++ b/nvim/lua/plugins/fzflua.lua @@ -1,5 +1,18 @@ return { "ibhagwan/fzf-lua", dependencies = { "echasnovski/mini.icons" }, - opts = {} + opts = {}, + keys = { + { "ff", function() require('fzf-lua').files() end, desc="Find Files in current dir"}, + { "fb", function() require('fzf-lua').buffers() end, desc="Find open buffers"}, + { "", function() require('fzf-lua').buffers() end, desc="Find open buffers"}, + { "fgf", function() require('fzf-lua').git_files() end, desc="Find git files"}, + { "fgb", function() require('fzf-lua').git_branches() end, desc="Find git branches"}, + { "fB", function() require('fzf-lua').builtin() end, desc="Find builtin finders"}, + { "fr", function() require('fzf-lua').resume() end, desc="Resume last search"}, + { "fG", function() require('fzf-lua').live_grep() end, desc="Grep files live"}, + { "fw", function() require('fzf-lua').grep_cword() end, desc="Grep current word"}, + { "fW", function() require('fzf-lua').grep_cWORD() end, desc="Grep current WORD"}, + { "/", function() require('fzf-lua').lgrep_curbuf() end, desc="Grep current buffer"}, + } } -- 2.45.2 From 29017286ed0602fdf18811a060dc43871061b6a9 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 23:49:54 +0200 Subject: [PATCH 09/15] lsp --- nvim/lua/plugins/lazydev.lua | 12 ++ nvim/lua/plugins/lsp.lua | 235 +++++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 nvim/lua/plugins/lazydev.lua create mode 100644 nvim/lua/plugins/lsp.lua diff --git a/nvim/lua/plugins/lazydev.lua b/nvim/lua/plugins/lazydev.lua new file mode 100644 index 0000000..447ce66 --- /dev/null +++ b/nvim/lua/plugins/lazydev.lua @@ -0,0 +1,12 @@ +return { + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins + -- used for completion, annotations and signatures of Neovim apis + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + }, + }, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..d01025a --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,235 @@ +return { + -- Main LSP Configuration + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs and related tools to stdpath for Neovim + -- Mason must be loaded before its dependents so we need to set it up here. + -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` + { 'williamboman/mason.nvim', opts = {} }, + 'williamboman/mason-lspconfig.nvim', + 'WhoIsSethDaniel/mason-tool-installer.nvim', + + -- Useful status updates for LSP. + { 'j-hui/fidget.nvim', opts = {} }, + + -- Allows extra capabilities provided by blink.cmp + 'saghen/blink.cmp', + }, + config = function() + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + -- NOTE: Remember that Lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + -- Rename the variable under your cursor. + -- Most Language Servers support renaming across files, etc. + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + + -- Find references for the word under your cursor. + map('grr', require('fzf-lua').lsp_references, '[G]oto [R]eferences') + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + map('gri', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation') + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + map('grd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition') + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header. + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols') + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + map('gW', require('fzf-lua').lsp_live_workspace_symbols, 'Open Workspace Symbols') + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + map('grt', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition') + + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) + ---@param client vim.lsp.Client + ---@param method vim.lsp.protocol.Method + ---@param bufnr? integer some lsp support methods only in specific files + ---@return boolean + local function client_supports_method(client, method, bufnr) + if vim.fn.has 'nvim-0.11' == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) + end + + -- The following code creates a keymap to toggle inlay hints in your + -- code, if the language server you are using supports them + -- + -- This may be unwanted, since they displace some of your code + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + map('th', function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) + end, '[T]oggle Inlay [H]ints') + end + end, + }) + + -- Diagnostic Config + -- See :help vim.diagnostic.Opts + vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = vim.g.have_nerd_font and { + text = { + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }, + } or {}, + virtual_text = { + source = 'if_many', + spacing = 2, + format = function(diagnostic) + local diagnostic_message = { + [vim.diagnostic.severity.ERROR] = diagnostic.message, + [vim.diagnostic.severity.WARN] = diagnostic.message, + [vim.diagnostic.severity.INFO] = diagnostic.message, + [vim.diagnostic.severity.HINT] = diagnostic.message, + } + return diagnostic_message[diagnostic.severity] + end, + }, + } + + -- LSP servers and clients are able to communicate to each other what features they support. + -- By default, Neovim doesn't support everything that is in the LSP specification. + -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. + -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. + local capabilities = require('blink.cmp').get_lsp_capabilities() + + -- Enable the following language servers + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- + -- Add any additional override configuration in the following tables. Available keys are: + -- - cmd (table): Override the default command used to start the server + -- - filetypes (table): Override the default list of associated filetypes for the server + -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. + -- - settings (table): Override the default settings passed when initializing the server. + -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + local servers = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs + -- + -- Some languages (like typescript) have entire language plugins that can be useful: + -- https://github.com/pmizio/typescript-tools.nvim + -- + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, + -- + vtsls={ + settings={} + }, + + lua_ls = { + -- cmd = { ... }, + -- filetypes = { ... }, + -- capabilities = {}, + settings = { + Lua = { + completion = { + callSnippet = 'Replace', + }, + -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- diagnostics = { disable = { 'missing-fields' } }, + }, + }, + }, + } + + -- Ensure the servers and tools above are installed + -- + -- To check the current status of installed tools and/or manually install + -- other tools, you can run + -- :Mason + -- + -- You can press `g?` for help in this menu. + -- + -- `mason` had to be setup earlier: to configure its options see the + -- `dependencies` table for `nvim-lspconfig` above. + -- + -- You can add other tools here that you want Mason to install + -- for you, so that they are available from within Neovim. + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + 'stylua', -- Used to format Lua code + }) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } + + require('mason-lspconfig').setup { + ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) + automatic_installation = false, + automatic_enable = true, + handlers = { + function(server_name) + local server = servers[server_name] or {} + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for ts_ls) + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) + end, + }, + } + end, +} -- 2.45.2 From 2ea53bfb09758c721458c549dab25e54c95331f2 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 23:50:22 +0200 Subject: [PATCH 10/15] snacks --- nvim/lua/plugins/projects.lua | 7 +++++ nvim/lua/plugins/snacks.lua | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 nvim/lua/plugins/projects.lua create mode 100644 nvim/lua/plugins/snacks.lua diff --git a/nvim/lua/plugins/projects.lua b/nvim/lua/plugins/projects.lua new file mode 100644 index 0000000..58fdfbf --- /dev/null +++ b/nvim/lua/plugins/projects.lua @@ -0,0 +1,7 @@ +return { + "ahmedkhalf/project.nvim", + init = function() + require("project_nvim").setup { + } + end +} diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua new file mode 100644 index 0000000..32d5ac5 --- /dev/null +++ b/nvim/lua/plugins/snacks.lua @@ -0,0 +1,54 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, + keys = { + { "gg", function() Snacks.lazygit() end, desc = "Lazygit" } + }, + init = function() + vim.api.nvim_create_autocmd("User", { + pattern = "VeryLazy", + callback = function() + -- Setup some globals for debugging (lazy-loaded) + _G.dd = function(...) + Snacks.debug.inspect(...) + end + _G.bt = function() + Snacks.debug.backtrace() + end + vim.print = _G.dd -- Override print to use snacks for `:=` command + + -- Create some toggle mappings + Snacks.toggle.option("spell", { name = "Spelling" }):map("us") + Snacks.toggle.option("wrap", { name = "Wrap" }):map("uw") + Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("uL") + Snacks.toggle.diagnostics():map("ud") + Snacks.toggle.line_number():map("ul") + Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map("uc") + Snacks.toggle.treesitter():map("uT") + Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("ub") + Snacks.toggle.inlay_hints():map("uh") + Snacks.toggle.indent():map("ug") + Snacks.toggle.dim():map("uD") + end, + }) + end, +} -- 2.45.2 From e7cea6c88d7ec8559cac3cfb29529a6f5a71fdf2 Mon Sep 17 00:00:00 2001 From: kenobi Date: Wed, 7 May 2025 23:50:27 +0200 Subject: [PATCH 11/15] lock --- nvim/lazy-lock.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index f378a51..aa3b362 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,12 +1,21 @@ { - "fzf-lua": { "branch": "main", "commit": "6302f7ac9de6e293c3eb6c20c015155e117b598b" }, + "blink.cmp": { "branch": "main", "commit": "307761556c48a6b4db62674ae4df42e01317d8b7" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "fzf-lua": { "branch": "main", "commit": "02def6b972d7687866738d6f6a5f4839ce5b5a7a" }, "kanagawa.nvim": { "branch": "master", "commit": "cc3b68b08e6a0cb6e6bf9944932940091e49bb83" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "aafae207d5a2a28c59c9d478d8581c2739135d09" }, + "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, "mini.statusline": { "branch": "main", "commit": "e331175f10d9f400b42523b3890841aba202ce16" }, + "nvim-lspconfig": { "branch": "master", "commit": "4bc481b6f0c0cf3671fc894debd0e00347089a4e" }, "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "0e3be38005e9673d044e994b1e4b123adb040179" }, "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } -- 2.45.2 From f17b2cd074322fd67e58bf1dbd58c3362851b7f3 Mon Sep 17 00:00:00 2001 From: kenobi Date: Thu, 8 May 2025 00:10:06 +0200 Subject: [PATCH 12/15] square bracket reamp --- nvim/lua/config/options.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 84d1a96..79834ff 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,5 +1,6 @@ vim.opt.langmap = "+]ü[" vim.keymap.set("n", "ü", "[", {remap=true}) +vim.keymap.set("n", "Ü", "]", {remap=true}) vim.opt.expandtab = true vim.opt.shiftwidth = 4 -- 2.45.2 From 1f597043ebd170ec195ad25bb2051fffadf6afd1 Mon Sep 17 00:00:00 2001 From: kenobi Date: Thu, 8 May 2025 00:10:10 +0200 Subject: [PATCH 13/15] bufferline --- nvim/lua/plugins/bufferline.lua | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 nvim/lua/plugins/bufferline.lua diff --git a/nvim/lua/plugins/bufferline.lua b/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..3d56281 --- /dev/null +++ b/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,48 @@ +return { + "akinsho/bufferline.nvim", + event = "VeryLazy", + keys = { + { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, + { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, + { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, + { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[B", "BufferLineMovePrev", desc = "Move buffer prev" }, + { "]B", "BufferLineMoveNext", desc = "Move buffer next" }, + }, + opts = { + options = { + -- stylua: ignore + close_command = function(n) Snacks.bufdelete(n) end, + -- stylua: ignore + right_mouse_command = function(n) Snacks.bufdelete(n) end, + diagnostics = "nvim_lsp", + always_show_bufferline = true, + offsets = { + { + filetype = "neo-tree", + text = "Neo-tree", + highlight = "Directory", + text_align = "left", + }, + { + filetype = "snacks_layout_box", + }, + }, + }, + }, + config = function(_, opts) + require("bufferline").setup(opts) + -- Fix bufferline when restoring a session + vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { + callback = function() + vim.schedule(function() + pcall(nvim_bufferline) + end) + end, + }) + end, +} -- 2.45.2 From bb026a1bf61886e6188ff198fda232de639c44bd Mon Sep 17 00:00:00 2001 From: kenobi Date: Thu, 8 May 2025 00:10:21 +0200 Subject: [PATCH 14/15] spacing --- nvim/lua/plugins/nvim-treesitter.lua | 12 ++++++------ nvim/lua/plugins/statusline.lua | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nvim/lua/plugins/nvim-treesitter.lua b/nvim/lua/plugins/nvim-treesitter.lua index 0bd7c3f..f07bf83 100644 --- a/nvim/lua/plugins/nvim-treesitter.lua +++ b/nvim/lua/plugins/nvim-treesitter.lua @@ -1,7 +1,7 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", - config = function () + config = function () local configs = require("nvim-treesitter.configs") configs.setup({ @@ -15,9 +15,9 @@ return { init_selection = "", node_incremental = "", scope_incremental = false, - node_decremental = "" - }, - } - }) - end + node_decremental = "" + }, + } + }) + end } diff --git a/nvim/lua/plugins/statusline.lua b/nvim/lua/plugins/statusline.lua index e05838a..dc85d07 100644 --- a/nvim/lua/plugins/statusline.lua +++ b/nvim/lua/plugins/statusline.lua @@ -1,5 +1,5 @@ -return { - "echasnovski/mini.statusline", - version = false, +return { + "echasnovski/mini.statusline", + version = false, opts = {} } -- 2.45.2 From 068782f050a377b20e61c3ff968c30a2e564e51b Mon Sep 17 00:00:00 2001 From: kenobi Date: Thu, 8 May 2025 00:10:28 +0200 Subject: [PATCH 15/15] lsp keys and lock --- nvim/lazy-lock.json | 1 + nvim/lua/plugins/lsp.lua | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index aa3b362..7be4a44 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "blink.cmp": { "branch": "main", "commit": "307761556c48a6b4db62674ae4df42e01317d8b7" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "fzf-lua": { "branch": "main", "commit": "02def6b972d7687866738d6f6a5f4839ce5b5a7a" }, "kanagawa.nvim": { "branch": "master", "commit": "cc3b68b08e6a0cb6e6bf9944932940091e49bb83" }, diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index d01025a..3c87c97 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -31,40 +31,40 @@ return { -- Rename the variable under your cursor. -- Most Language Servers support renaming across files, etc. - map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + map('rn', vim.lsp.buf.rename, '[R]e[n]ame') -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + map('ca', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) -- Find references for the word under your cursor. - map('grr', require('fzf-lua').lsp_references, '[G]oto [R]eferences') + map('gr', require('fzf-lua').lsp_references, '[G]oto [R]eferences') -- Jump to the implementation of the word under your cursor. -- Useful when your language has ways of declaring types without an actual implementation. - map('gri', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation') + map('gi', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation') -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. -- To jump back, press . - map('grd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition') + map('gd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition') -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. - map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') -- Fuzzy find all the symbols in your current document. -- Symbols are things like variables, functions, types, etc. - map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols') + map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols') -- Fuzzy find all the symbols in your current workspace. -- Similar to document symbols, except searches over your entire project. - map('gW', require('fzf-lua').lsp_live_workspace_symbols, 'Open Workspace Symbols') + map('gW', require('fzf-lua').lsp_live_workspace_symbols, 'Open Workspace Symbols') -- Jump to the type of the word under your cursor. -- Useful when you're not sure what type a variable is and you want to see -- the definition of its *type*, not where it was *defined*. - map('grt', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition') + map('gT', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition') -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) ---@param client vim.lsp.Client -- 2.45.2