From af0053b08b9bc9897e7575370ae13333618cf54f Mon Sep 17 00:00:00 2001 From: VectorKappa Date: Sun, 1 Feb 2026 15:31:04 +0100 Subject: [PATCH] Nvim revamp --- .config/nvim/init.lua | 75 +++--- .config/nvim/lazy-lock.json | 29 ++- .config/nvim/lua/plugins/comp.lua | 137 ++++++++++ .config/nvim/lua/plugins/rest.lua | 148 ++++------- .config/nvim/lua/plugins/ux.lua | 417 +++++++++++++++--------------- 5 files changed, 450 insertions(+), 356 deletions(-) create mode 100644 .config/nvim/lua/plugins/comp.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index fa63c0d..3ee90f1 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -10,7 +10,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then }) end vim.opt.rtp:prepend(lazypath) ---require("lazy").setup(pluginTable) require("lazy").setup({ spec = { -- import your plugins @@ -23,27 +22,25 @@ require("lazy").setup({ checker = { enabled = true }, }) -if vim.fn.has('persistent_undo') then - local target_path = vim.fn.stdpath('data') .. '/.nvimundodir' +if vim.fn.has("persistent_undo") then + local target_path = vim.fn.stdpath("data") .. "/.nvimundodir" if not vim.fn.isdirectory(target_path) then vim.fn.mkpath(target_path, { mode = 0700 }) -- Use mkpath for parent creation end vim.opt.undodir = target_path - vim.api.nvim_set_option('undofile', true) + vim.api.nvim_set_option("undofile", true) end - vim.api.nvim_create_autocmd("StdinReadPre", { pattern = "*", - command = "let s:std_in=1" + command = "let s:std_in=1", }) --vim.api.nvim_create_autocmd("VimEnter", { -- pattern = "*", -- command = "if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') | execute 'Neotree current' | execute 'cd '.argv()[0] | endif" --}) - vim.g.airline_powerline_fonts = 1 --vim.g.coq_settings = {'clients.tabnine.enabled' = false} @@ -52,11 +49,11 @@ vim.g.airline_powerline_fonts = 1 --vim.g.syntastic_python_checkers = ['bandit', 'python'] --" Keybinds -vim.keymap.set('n', '', ':Neotree toggle', { noremap = true }) -vim.keymap.set('n', '', function() vim.lsp.buf.code_action() end, { noremap = true }) -vim.keymap.set('n', '', ':ZenMode', { noremap = true }) -vim.keymap.set('n', '', function() vim.lsp.buf.format() end, { noremap = true }) -vim.keymap.set('n', '', ':MundoToggle', { noremap = true }) +vim.keymap.set("n", "", ":Neotree toggle", { noremap = true }) +vim.keymap.set("n", "", function() vim.lsp.buf.code_action() end, { noremap = true }) +vim.keymap.set("n", "", ":ZenMode", { noremap = true }) +vim.keymap.set("n", "", function() vim.lsp.buf.format() end, { noremap = true }) +vim.keymap.set("n", "", ":MundoToggle", { noremap = true }) --nnoremap :Goyo --nnoremap :MundoToggle @@ -72,7 +69,7 @@ local dap = require("dap") dap.adapters.gdb = { type = "executable", command = "gdb", - args = { "-i", "dap" } + args = { "-i", "dap" }, } dap.configurations.cpp = { @@ -81,7 +78,7 @@ dap.configurations.cpp = { type = "gdb", request = "launch", program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, cwd = "${workspaceFolder}", stopAtBeginningOfMainSubprogram = false, @@ -90,33 +87,31 @@ dap.configurations.cpp = { -- Mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions local opts = { noremap = true, silent = true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) +vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) +vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts) + vim.keymap.set("n", "", vim.lsp.buf.signature_help, bufopts) + vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set("n", "wl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts) + vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts) + vim.keymap.set("n", "f", function() vim.lsp.buf.format({ async = true }) end, bufopts) end local lsp_flags = { @@ -129,8 +124,8 @@ local lsp_flags = { --lsp.pyright.setup(coq.lsp_ensure_capabilities({})) --lsp.ccls.setup(coq.lsp_ensure_capabilities({})) -vim.lsp.config("ltex",{ settings = { ltex = { language = "pl-PL" } } }) -vim.lsp.config("rust_analyzer",{ +vim.lsp.config("ltex", { settings = { ltex = { language = "pl-PL" } } }) +vim.lsp.config("rust_analyzer", { settings = { ["rust-analyzer"] = { imports = { @@ -145,18 +140,16 @@ vim.lsp.config("rust_analyzer",{ }, }, procMacro = { - enable = true + enable = true, }, - } - } + }, + }, }) require("dapui").setup() require("catppuccin").setup({ flavour = "macchiato" }) -require('colorizer').setup() +require("colorizer").setup() require("circles").setup() -vim.cmd.colorscheme "catppuccin" +vim.cmd.colorscheme("catppuccin") -- committia_open_only_vim_starting vim.g.committia_open_only_vim_starting = 1 - ---autocmd VimEnter * execute 'COQnow -s' diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 60f5928..0bb55de 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,38 +1,43 @@ { + "avante.nvim": { "branch": "main", "commit": "fde9a524457d17661618678f085649d4e8d3fd6f" }, "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "blink.compat": { "branch": "main", "commit": "1454f14a8d855a578ceeba77c62538fa1459a67c" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "ce8d176faa4643e026e597ae3c31db59b63cef09" }, + "catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" }, "circles.nvim": { "branch": "main", "commit": "01b9ac1dc6c181f6982eddd57deb1fc7f92d7a70" }, - "codeium.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" }, "committia.vim": { "branch": "master", "commit": "c8c0f255e8090ed90dd9d5dd2e8672994f8e3671" }, "ctrlp.vim": { "branch": "master", "commit": "86872f021c4e245e3c583054fda82fb820a2faee" }, "firenvim": { "branch": "master", "commit": "a18ef908ac06b52ad9333b70e3e630b0a56ecb3d" }, "formatter.nvim": { "branch": "master", "commit": "b9d7f853da1197b83b8edb4cc4952f7ad3a42e41" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "git-messenger.vim": { "branch": "master", "commit": "fd124457378a295a5d1036af4954b35d6b807385" }, "image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" }, + "img-clip.nvim": { "branch": "main", "commit": "b6ddfb97b5600d99afe3452d707444afda658aca" }, "indentLine.vim": { "branch": "master", "commit": "988ba5557a9d1ff49d27c22a6b5f405075b3cebb" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "bf9e7205192015dc48727744f21e09ac986664f9" }, - "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c953789db7fd28eafe5eb5659846d34b5024b3cc" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, - "neoconf.nvim": { "branch": "main", "commit": "a839efc800b258e953a916e5ff8fb7ed316f75b0" }, + "neoconf.nvim": { "branch": "main", "commit": "a659e840dbfe1dd6eb0f7b67dc367d0080f9da8f" }, "nerdcommenter": { "branch": "master", "commit": "a462bbda1e26f44fb3d3eb9d9d1c6a07aa98e665" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" }, - "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" }, + "nvim-dap": { "branch": "master", "commit": "e47878dcf1ccc30136b30d19ab19fe76946d61cd" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-lightbulb": { "branch": "master", "commit": "aa3a8b0f4305b25cfe368f6c9be9923a7c9d0805" }, - "nvim-lspconfig": { "branch": "master", "commit": "c4f67bf85b01a57e3c130352c0a0e453ab8cd5b9" }, + "nvim-lspconfig": { "branch": "master", "commit": "3f58aeca0c6ece8a9fb8782ea3fcb6024f285be3" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "48934b49a2363b49ae1d698ed4cb30fb79d7efe8" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "syntastic": { "branch": "master", "commit": "8d5e37c29cf5952fbf300b9230bffe424c61a488" }, - "telescope.nvim": { "branch": "master", "commit": "3d757e586ff0bfc85bdb7b46c9d3d932147a0cde" }, + "teamtype-nvim": { "branch": "main", "commit": "799402fc3c49118e4703bc48f379ea6930824dab" }, + "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, - "tree-sitter-c-sharp": { "branch": "master", "commit": "485f0bae0274ac9114797fc10db6f7034e4086e3" }, + "tree-sitter-c-sharp": { "branch": "master", "commit": "f05a2ca99d329de2e6c32f26a21c6169b2bfcbb7" }, "twilight.nvim": { "branch": "main", "commit": "664e752f4a219801265cc3fc18782b457b58c1e1" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, "vim-gitgutter": { "branch": "main", "commit": "0acb772e76064cc406664ab595b58b3fac76488a" }, diff --git a/.config/nvim/lua/plugins/comp.lua b/.config/nvim/lua/plugins/comp.lua new file mode 100644 index 0000000..7adf618 --- /dev/null +++ b/.config/nvim/lua/plugins/comp.lua @@ -0,0 +1,137 @@ +return { + { + "saghen/blink.cmp", + dependencies = { "rafamadriz/friendly-snippets", "saghen/blink.compat" }, + version = "1.*", + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { preset = "default" }, + appearance = { + nerd_font_variant = "mono", + }, + + completion = { documentation = { auto_show = false } }, + + sources = { + default = { + "lazydev", + "lsp", + "path", + "snippets", + "buffer", + "avante_commands", + "avante_mentions", + "avante_shortcuts", + "avante_files", + }, + providers = { + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + score_offset = 100, + }, + avante_commands = { + name = "avante_commands", + module = "blink.compat.source", + score_offset = 90, -- show at a higher priority than lsp + opts = {}, + }, + avante_files = { + name = "avante_files", + module = "blink.compat.source", + score_offset = 100, -- show at a higher priority than lsp + opts = {}, + }, + avante_mentions = { + name = "avante_mentions", + module = "blink.compat.source", + score_offset = 1000, -- show at a higher priority than lsp + opts = {}, + }, + avante_shortcuts = { + name = "avante_shortcuts", + module = "blink.compat.source", + score_offset = 1000, -- show at a higher priority than lsp + opts = {}, + }, + }, + }, + fuzzy = { implementation = "prefer_rust_with_warning" }, + }, + opts_extend = { "sources.default" }, + }, + { + "yetone/avante.nvim", + -- ⚠️ must add this setting! ! ! + build = vim.fn.has("win32") ~= 0 + and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" + or "make", + event = "VeryLazy", + version = false, -- Never set this value to "*"! Never! + ---@module 'avante' + ---@type avante.Config + opts = { + instructions_file = "avante.md", + provider = "ollama_ministral", + providers = { + ollama_devstral = { + endpoint = "http://10.0.32.128:11434", + __inherited_from = "ollama", + model = "devstral-small-2:latest", + }, + ollama_ministral = { + endpoint = "http://10.0.32.128:11434", + __inherited_from = "ollama", + model = "ministral-3:3b", + }, + }, + }, + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + --- The below dependencies are optional, + "nvim-telescope/telescope.nvim", -- for file_selector provider telescope + "folke/snacks.nvim", -- for input provider snacks + "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + "MeanderingProgrammer/render-markdown.nvim", + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/rest.lua b/.config/nvim/lua/plugins/rest.lua index d3ade4e..e6c49db 100644 --- a/.config/nvim/lua/plugins/rest.lua +++ b/.config/nvim/lua/plugins/rest.lua @@ -9,13 +9,13 @@ return { lazy = not vim.g.started_by_firenvim, build = function() vim.fn["firenvim#install"](0) - end + end, }, --'honza/vim-snippets', --'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } - 'vim-scripts/indentLine.vim', - 'rhysd/git-messenger.vim', - 'junegunn/vim-easy-align', + "vim-scripts/indentLine.vim", + "rhysd/git-messenger.vim", + "junegunn/vim-easy-align", "preservim/nerdcommenter", "mg979/vim-visual-multi", "airblade/vim-gitgutter", @@ -26,11 +26,11 @@ return { -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below - } + }, }, --'vim-airline/vim-airline' --'vim-airline/vim-airline-themes' - { 'ctrlpvim/ctrlp.vim' }, + { "ctrlpvim/ctrlp.vim" }, --'godlygeek/tabular' --'easymotion/vim-easymotion' --'nathanaelkane/vim-indent-guides' @@ -46,112 +46,60 @@ return { --'tpope/vim-obsession' --'tpope/vim-fugitive' --'tpope/vim-surround' - { - 'Exafunction/codeium.vim', - event = 'BufEnter', - config = function() - -- Change '' here to any keycode you like. - vim.keymap.set('i', '', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true }) - vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](1) end, - { expr = true, silent = true }) - vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](-1) end, - { expr = true, silent = true }) - vim.keymap.set('i', '', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true }) - end - }, + --{ + --'Exafunction/codeium.vim', + --event = 'BufEnter', + --config = function() + ---- Change '' here to any keycode you like. + --vim.keymap.set('i', '', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true }) + --vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](1) end, + --{ expr = true, silent = true }) + --vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](-1) end, + --{ expr = true, silent = true }) + --vim.keymap.set('i', '', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true }) + --end + --}, --'lambdalisue/suda.vim' - { 'tree-sitter/tree-sitter-c-sharp' }, - { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' }, - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope.nvim', - - 'kosayoda/nvim-lightbulb', + { "tree-sitter/tree-sitter-c-sharp" }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + "kosayoda/nvim-lightbulb", --'antoinemadec/FixCursorHold.nvim' - 'mhartington/formatter.nvim', - 'NvChad/nvim-colorizer.lua', + "mhartington/formatter.nvim", + "NvChad/nvim-colorizer.lua", + "nvim-tree/nvim-web-devicons", + "projekt0n/circles.nvim", - { - 'saghen/blink.cmp', - -- optional: provides snippets for the snippet source - dependencies = { 'rafamadriz/friendly-snippets' }, - - -- use a release tag to download pre-built binaries - version = '1.*', - -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust - -- build = 'cargo build --release', - -- If you use nix, you can build from source using latest nightly rust with: - -- build = 'nix run .#build-plugin', - - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) - -- 'super-tab' for mappings similar to vscode (tab to accept) - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- All presets have the following mappings: - -- C-space: Open menu or open docs if already open - -- C-n/C-p or Up/Down: Select next/previous item - -- C-e: Hide menu - -- C-k: Toggle signature help (if signature.enabled = true) - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - keymap = { preset = 'default' }, - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono' - }, - - -- (Default) Only show the documentation popup when manually triggered - completion = { documentation = { auto_show = false } }, - - -- Default list of enabled providers defined so that you can extend it - -- elsewhere in your config, without redefining it, due to `opts_extend` - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, - }, - - -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance - -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, - -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` - -- - -- See the fuzzy documentation for more information - fuzzy = { implementation = "prefer_rust_with_warning" } - }, - opts_extend = { "sources.default" } - }, --- { 'ms-jpq/coq_nvim', branch = 'coq' }, - --" 9000+ Snippets --- { 'ms-jpq/coq.artifacts', branch = 'artifacts' }, --- { 'ms-jpq/coq.thirdparty', branch = '3p' }, - - 'nvim-tree/nvim-web-devicons', - 'projekt0n/circles.nvim', - - 'nvim-neotest/nvim-nio', + "nvim-neotest/nvim-nio", --'uga-rosa/translate.nvim' --'mechatroner/rainbow_csv' --'christoomey/vim-system-copy' --'eandrju/cellular-automaton.nvim' - --"neovim/nvim-lspconfig", - --"'ranjithshegde/ccls.nvim' "mfussenegger/nvim-dap", "rcarriga/nvim-dap-ui", "folke/which-key.nvim", - {"folke/lazydev.nvim", - ft = "lua", -- only load on lua files - opts = { - library = { - -- See the configuration section for more details - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - }, - }, - }, + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, { "folke/neoconf.nvim", cmd = "Neoconf" }, + { + "teamtype/teamtype-nvim", + keys = { + { "ej", "TeamtypeJumpToCursor" }, + { "ef", "TeamtypeFollow" }, + }, + lazy = false, + }, { "neovim/nvim-lspconfig", dependencies = { diff --git a/.config/nvim/lua/plugins/ux.lua b/.config/nvim/lua/plugins/ux.lua index b49402c..88acf4f 100644 --- a/.config/nvim/lua/plugins/ux.lua +++ b/.config/nvim/lua/plugins/ux.lua @@ -1,207 +1,218 @@ return { - {"nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - {"3rd/image.nvim", - opts={ - backend = "kitty", - processor = "magick_rock", -- or "magick_cli" - integrations = { - markdown = { - enabled = true, - clear_in_insert_mode = false, - download_remote_images = true, - only_render_image_at_cursor = false, - floating_windows = false, -- if true, images will be rendered in floating markdown windows - filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here - }, - neorg = { - enabled = true, - filetypes = { "norg" }, - }, - typst = { - enabled = true, - filetypes = { "typst" }, - }, - html = { - enabled = false, - }, - css = { - enabled = false, - }, - }, - max_width = nil, - max_height = nil, - max_width_window_percentage = nil, - max_height_window_percentage = 50, - window_overlap_clear_enabled = false, -- toggles images when windows are overlapped - window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" }, - editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus - tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) - hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened -} + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + { + "3rd/image.nvim", + opts = { + backend = "kitty", + processor = "magick_rock", -- or "magick_cli" + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + floating_windows = false, -- if true, images will be rendered in floating markdown windows + filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here + }, + neorg = { + enabled = true, + filetypes = { "norg" }, + }, + typst = { + enabled = true, + filetypes = { "typst" }, + }, + html = { + enabled = false, + }, + css = { + enabled = false, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + window_overlap_clear_enabled = false, -- toggles images when windows are overlapped + window_overlap_clear_ft_ignore = { + "cmp_menu", + "cmp_docs", + "snacks_notif", + "scrollview", + "scrollview_sign", + }, + editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus + tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off) + hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened + }, }, -- Optional image support in preview window: See `# Preview Mode` for more information - }, - opts={ - window = { - mappings = { - ["P"] = { "toggle_preview", config = { use_float = false, use_image_nvim = true } }, - ["l"] = "focus_preview", - [""] = { "scroll_preview", config = {direction = 10} }, - [""] = { "scroll_preview", config = {direction = -10} }, - } - } - } + }, + opts = { + window = { + mappings = { + ["P"] = { "toggle_preview", config = { use_float = false, use_image_nvim = true } }, + ["l"] = "focus_preview", + [""] = { "scroll_preview", config = { direction = 10 } }, + [""] = { "scroll_preview", config = { direction = -10 } }, + }, + }, + }, + }, + { "catppuccin/nvim", lazy = true, name = "catppuccin" }, + { + "folke/twilight.nvim", + opts = { + dimming = { + alpha = 0.25, -- amount of dimming + -- we try to get the foreground from the highlight groups or fallback color + color = { "Normal", "#ffffff" }, + term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color + inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer) + }, + context = 10, -- amount of lines we will try to show around the current line + treesitter = true, -- use treesitter when available for the filetype + -- treesitter is used to automatically expand the visible text, + -- but you can further control the types of nodes that should always be fully expanded + expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types + "function", + "method", + "table", + "if_statement", + }, + exclude = {}, -- exclude these filetypes + }, + }, + { + "folke/zen-mode.nvim", + opts = { + window = { + backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal + -- height and width can be: + -- * an absolute number of cells when > 1 + -- * a percentage of the width / height of the editor when <= 1 + -- * a function that returns the width or the height + width = 120, -- width of the Zen window + height = 1, -- height of the Zen window + -- by default, no options are changed for the Zen window + -- uncomment any of the options below, or add other vim.wo options you want to apply + options = { + -- signcolumn = "no", -- disable signcolumn + -- number = false, -- disable number column + -- relativenumber = false, -- disable relative numbers + -- cursorline = false, -- disable cursorline + -- cursorcolumn = false, -- disable cursor column + -- foldcolumn = "0", -- disable fold column + -- list = false, -- disable whitespace characters + }, + }, + plugins = { + -- disable some global vim options (vim.o...) + -- comment the lines to not apply the options + options = { + enabled = true, + ruler = false, -- disables the ruler text in the cmd line area + showcmd = false, -- disables the command in the last line of the screen + -- you may turn on/off statusline in zen mode by setting 'laststatus' + -- statusline will be shown only if 'laststatus' == 3 + laststatus = 0, -- turn off the statusline in zen mode + }, + twilight = { enabled = true }, -- enable to start Twilight when zen mode opens + gitsigns = { enabled = false }, -- disables git signs + tmux = { enabled = false }, -- disables the tmux statusline + -- this will change the font size on kitty when in zen mode + -- to make this work, you need to set the following kitty options: + -- - allow_remote_control socket-only + -- - listen_on unix:/tmp/kitty + kitty = { + enabled = true, + font = "+4", -- font size increment + }, + -- this will change the font size on alacritty when in zen mode + -- requires Alacritty Version 0.10.0 or higher + -- uses `alacritty msg` subcommand to change font size + alacritty = { + enabled = false, + font = "14", -- font size + }, + -- this will change the font size on wezterm when in zen mode + -- See alse also the Plugins/Wezterm section in this projects README + wezterm = { + enabled = true, + -- can be either an absolute font size or the number of incremental steps + font = "+4", -- (10% increase per step) + }, + }, + }, + }, + { + "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 = false, + -- diagnostics_indicator = function(_, _, diag) + -- local icons = LazyVim.config.icons.diagnostics + -- local ret = (diag.error and icons.Error .. diag.error .. " " or "") + -- .. (diag.warning and icons.Warn .. diag.warning or "") + -- return vim.trim(ret) + -- end, + offsets = { + { + filetype = "neo-tree", + text = "Neo-tree", + highlight = "Directory", + text_align = "left", + }, + }, + -- ---@param opts bufferline.IconFetcherOpts + -- get_element_icon = function(opts) + -- return LazyVim.config.icons.ft[opts.filetype] + -- end, + }, + }, + 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, + }, + { "rhysd/committia.vim" }, + { + "s1n7ax/nvim-window-picker", + name = "window-picker", + event = "VeryLazy", + version = "2.*", + config = function() + require("window-picker").setup() + end, }, - {"catppuccin/nvim", lazy=true, name="catppuccin"}, - { - "folke/twilight.nvim", - opts = { - dimming = { - alpha = 0.25, -- amount of dimming - -- we try to get the foreground from the highlight groups or fallback color - color = { "Normal", "#ffffff" }, - term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color - inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer) - }, - context = 10, -- amount of lines we will try to show around the current line - treesitter = true, -- use treesitter when available for the filetype - -- treesitter is used to automatically expand the visible text, - -- but you can further control the types of nodes that should always be fully expanded - expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types - "function", - "method", - "table", - "if_statement", - }, - exclude = {}, -- exclude these filetypes - } -}, -{"folke/zen-mode.nvim", opts={ - window = { - backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal - -- height and width can be: - -- * an absolute number of cells when > 1 - -- * a percentage of the width / height of the editor when <= 1 - -- * a function that returns the width or the height - width = 120, -- width of the Zen window - height = 1, -- height of the Zen window - -- by default, no options are changed for the Zen window - -- uncomment any of the options below, or add other vim.wo options you want to apply - options = { - -- signcolumn = "no", -- disable signcolumn - -- number = false, -- disable number column - -- relativenumber = false, -- disable relative numbers - -- cursorline = false, -- disable cursorline - -- cursorcolumn = false, -- disable cursor column - -- foldcolumn = "0", -- disable fold column - -- list = false, -- disable whitespace characters - }, - }, - plugins = { - -- disable some global vim options (vim.o...) - -- comment the lines to not apply the options - options = { - enabled = true, - ruler = false, -- disables the ruler text in the cmd line area - showcmd = false, -- disables the command in the last line of the screen - -- you may turn on/off statusline in zen mode by setting 'laststatus' - -- statusline will be shown only if 'laststatus' == 3 - laststatus = 0, -- turn off the statusline in zen mode - }, - twilight = { enabled = true }, -- enable to start Twilight when zen mode opens - gitsigns = { enabled = false }, -- disables git signs - tmux = { enabled = false }, -- disables the tmux statusline - -- this will change the font size on kitty when in zen mode - -- to make this work, you need to set the following kitty options: - -- - allow_remote_control socket-only - -- - listen_on unix:/tmp/kitty - kitty = { - enabled = true, - font = "+4", -- font size increment - }, - -- this will change the font size on alacritty when in zen mode - -- requires Alacritty Version 0.10.0 or higher - -- uses `alacritty msg` subcommand to change font size - alacritty = { - enabled = false, - font = "14", -- font size - }, - -- this will change the font size on wezterm when in zen mode - -- See alse also the Plugins/Wezterm section in this projects README - wezterm = { - enabled = true, - -- can be either an absolute font size or the number of incremental steps - font = "+4", -- (10% increase per step) - }, - }, -}}, -{ - "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 = false, --- diagnostics_indicator = function(_, _, diag) --- local icons = LazyVim.config.icons.diagnostics --- local ret = (diag.error and icons.Error .. diag.error .. " " or "") --- .. (diag.warning and icons.Warn .. diag.warning or "") --- return vim.trim(ret) --- end, - offsets = { - { - filetype = "neo-tree", - text = "Neo-tree", - highlight = "Directory", - text_align = "left", - }, - }, --- ---@param opts bufferline.IconFetcherOpts --- get_element_icon = function(opts) --- return LazyVim.config.icons.ft[opts.filetype] --- end, - }, - }, - 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, - }, - {"rhysd/committia.vim"}, - { - 's1n7ax/nvim-window-picker', - name = 'window-picker', - event = 'VeryLazy', - version = '2.*', - config = function() - require'window-picker'.setup() - end, - }, }