From a627ebcfcfa39b4bbeb3a3d7d349a3ad7c8e4b79 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Wed, 23 Jul 2025 11:25:47 -0500 Subject: [PATCH] folding and avante enabled --- flake.lock | 142 +++++++++---------- flake.nix | 114 +++++++-------- lua/{plugins_disabled => plugins}/avante.lua | 28 ++-- lua/tools/folding.lua | 27 ++++ 4 files changed, 171 insertions(+), 140 deletions(-) rename lua/{plugins_disabled => plugins}/avante.lua (83%) create mode 100644 lua/tools/folding.lua diff --git a/flake.lock b/flake.lock index e09f6b1..ef0ed2d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1752155833, - "narHash": "sha256-bFgBh1ILsr4Af6H0oul+BvuK4AYFF17JzSSW4KHLt/o=", + "lastModified": 1753120340, + "narHash": "sha256-KCdpqZUlk+KgeGS4D4z4SNU1uDs91UfCjeADBjcmIWo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2bc8941d52e3ca07e46ecd4ef56777f9895113e4", + "rev": "bf76d8af397b7a40586b4cbc89dc2e3d2370deaa", "type": "github" }, "original": { @@ -34,11 +34,11 @@ "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": { "flake": false, "locked": { - "lastModified": 1752078859, - "narHash": "sha256-XclK1lZmYUWkSzUnibQTpGzCRofq2FSmO/XlJPiUvD4=", + "lastModified": 1752279616, + "narHash": "sha256-UGdXlbgYAu6qNPKi9+M6R2YcfCHdY8UwcWTvE15+a3I=", "owner": "CopilotC-Nvim", "repo": "CopilotChat.nvim", - "rev": "a90a92af7514edbacdde09fa10e7550af2ffdc36", + "rev": "f7eb423baccbb27f5b5608fb91acee2d6bc769c7", "type": "github" }, "original": { @@ -66,11 +66,11 @@ "nvim_plugin-L3MON4D3/LuaSnip": { "flake": false, "locked": { - "lastModified": 1751838474, - "narHash": "sha256-vEHHSE3lt6iBkoA4ye6NbU5xyBS0J29dLjQrljxk6LU=", + "lastModified": 1752960652, + "narHash": "sha256-og3qUQSB27pKLmguWUWJodvcgu5+mCS1rUMODS17fF4=", "owner": "L3MON4D3", "repo": "LuaSnip", - "rev": "66b5c2707e624dcd2cd3605676c64a2efe47e9d1", + "rev": "831a130291eb6dae0dabd2748d0a99401a2eebc4", "type": "github" }, "original": { @@ -82,11 +82,11 @@ "nvim_plugin-MeanderingProgrammer/render-markdown.nvim": { "flake": false, "locked": { - "lastModified": 1752129139, - "narHash": "sha256-UVJyd/ljCvyR/0WtJbp3Tv8e0ZwKx8W1BeWXpAW5Nn0=", + "lastModified": 1753120390, + "narHash": "sha256-5ZBst20C7eZHYxos/aBlUpzWRYLaocClefs9Dak8JX4=", "owner": "MeanderingProgrammer", "repo": "render-markdown.nvim", - "rev": "b977c94b32afdcadb8e53ba33d5934d1937d4eab", + "rev": "b540997fbf7ccf3a39ce21162ce8957be2f67e37", "type": "github" }, "original": { @@ -130,11 +130,11 @@ "nvim_plugin-Saecki/crates.nvim": { "flake": false, "locked": { - "lastModified": 1748637634, - "narHash": "sha256-sDjG6fjnQsyYtdf7xpmOW193e7USh6ghrFzo6NoLyP8=", + "lastModified": 1752682149, + "narHash": "sha256-7TnexolxNjkytFInl5m7VjthAb+uMDcejTcL2pArBAo=", "owner": "Saecki", "repo": "crates.nvim", - "rev": "5d8b1bef686db0fabe5f1bb593744b617e8f1405", + "rev": "33ec63096f7f72b610ed3bb1760be34c2fffb694", "type": "github" }, "original": { @@ -162,11 +162,11 @@ "nvim_plugin-b0o/schemastore.nvim": { "flake": false, "locked": { - "lastModified": 1752080544, - "narHash": "sha256-uX3J4KUBWKNTJ5tVnTZlccIWHXOq/axO7ZFa/hCHNCU=", + "lastModified": 1752652847, + "narHash": "sha256-5qXEd44NyFGCN4LC2NNK7OO62diykpTARhNK6kGERzw=", "owner": "b0o", "repo": "schemastore.nvim", - "rev": "47af5f9bc7b344ad879405901a2ff5589d8561c8", + "rev": "c957914d75b4a008ce09f4116e57e59fe6e3fae1", "type": "github" }, "original": { @@ -370,11 +370,11 @@ "nvim_plugin-lewis6991/gitsigns.nvim": { "flake": false, "locked": { - "lastModified": 1752069390, - "narHash": "sha256-bIpIT3yS+Mk6p8FRxEUQ3YcsaoOjkSVZGOdcvCvmP00=", + "lastModified": 1753114065, + "narHash": "sha256-B7ZEw4XEMm31SN09fhuX36mxkpIKWxLMqEoYFljxeEc=", "owner": "lewis6991", "repo": "gitsigns.nvim", - "rev": "7bbc674278f22376850576dfdddf43bbc17e62b5", + "rev": "93f882f7041a2e779addbd34943812ca66edef5a", "type": "github" }, "original": { @@ -418,11 +418,11 @@ "nvim_plugin-m4xshen/hardtime.nvim": { "flake": false, "locked": { - "lastModified": 1751971540, - "narHash": "sha256-x0tka78ar/ENv2VkpesANBzOk0nd6vsjdZ/R8k95Sc0=", + "lastModified": 1753067501, + "narHash": "sha256-hZGG30Uxj6Sc17thJNi5l0jogYMFdQHkhEKPkb862i8=", "owner": "m4xshen", "repo": "hardtime.nvim", - "rev": "a706043b6e9f865f631d23c9a32cb0c1201a4471", + "rev": "3541ad24faff78274669eceaf130502eb7f1261a", "type": "github" }, "original": { @@ -434,11 +434,11 @@ "nvim_plugin-mbbill/undotree": { "flake": false, "locked": { - "lastModified": 1751577781, - "narHash": "sha256-N3JAk2jr6b2USpJ7B6JEufENkTPAfMT7Kn1OA/1MeGM=", + "lastModified": 1752437854, + "narHash": "sha256-5WofUOTYE+Nmx3A5OoZBneJBHZ8bdGEYDZ6vTMx1OE0=", "owner": "mbbill", "repo": "undotree", - "rev": "15d91b0afe04ea9ba5cd53e30190d1602af9a925", + "rev": "28f2f54a34baff90ea6f4a735ef1813ad875c743", "type": "github" }, "original": { @@ -450,11 +450,11 @@ "nvim_plugin-mfussenegger/nvim-lint": { "flake": false, "locked": { - "lastModified": 1751618912, - "narHash": "sha256-CvpDvJEm3MKUhoi2p/7DmqV6aIBUZkbq5ryU2V3SMdQ=", + "lastModified": 1753039571, + "narHash": "sha256-ly5S0KAZN8Jeag22SCX+5XKqn3d+zCRN/8Jf5HlEn9I=", "owner": "mfussenegger", "repo": "nvim-lint", - "rev": "3c5e34c24834a67b1cb37600ab7663eefd2b0390", + "rev": "9c6207559297b24f0b7c32829f8e45f7d65b991f", "type": "github" }, "original": { @@ -466,11 +466,11 @@ "nvim_plugin-mrcjkb/rustaceanvim": { "flake": false, "locked": { - "lastModified": 1752141288, - "narHash": "sha256-UonBsSehzFZjcn+7Hou0weHSvSbiAyhvSym6N9BMsvY=", + "lastModified": 1752971263, + "narHash": "sha256-CTkXGLEY52mx5cgPXc/SbI9bEfH3D2rO5A4GxUgGBLo=", "owner": "mrcjkb", "repo": "rustaceanvim", - "rev": "c86d5d36456fdaa91a3a9dddb4bac09c58fc8cd3", + "rev": "628ff0137003d2ff245a06aff101142a5c88391e", "type": "github" }, "original": { @@ -482,11 +482,11 @@ "nvim_plugin-neovim/nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1752153294, - "narHash": "sha256-EBj7TR2rHsdYRCu6IZsmEQtYx4hpWJ1RKIf3Ry97BiY=", + "lastModified": 1752946955, + "narHash": "sha256-dr5zHWzlfUd4lSUZbqbWa9Fg/hPnN4tCnmHdKvO07nY=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "dbdb80d3bd311989d21029c63918d67a786d5013", + "rev": "f47cd681d7cb6048876a2e908b6d8ba1e530d152", "type": "github" }, "original": { @@ -626,11 +626,11 @@ "nvim_plugin-nvim-tree/nvim-tree.lua": { "flake": false, "locked": { - "lastModified": 1750467468, - "narHash": "sha256-D9alC4jYvw5B/aqRW9x1T9kXoZH++PYR11YEPuw+dKI=", + "lastModified": 1753068176, + "narHash": "sha256-kz0P9h5iwCXGnUPYYmdp3udvIJGkr4u1gLYijhS8hsY=", "owner": "nvim-tree", "repo": "nvim-tree.lua", - "rev": "b0b49552c9462900a882fe772993b01d780445fe", + "rev": "543ed3cac212dc3993ef9f042f6c0812e34ddd43", "type": "github" }, "original": { @@ -642,11 +642,11 @@ "nvim_plugin-nvim-tree/nvim-web-devicons": { "flake": false, "locked": { - "lastModified": 1752044159, - "narHash": "sha256-ZDDBU0LznpZBMh/o1XhgaNLRhlwI4LQWF7R0LpaZHRg=", + "lastModified": 1752501000, + "narHash": "sha256-jcPlqFbO7XKx6WS8SenOCRgEV3LjK7M8r4Xx7uF60WI=", "owner": "nvim-tree", "repo": "nvim-web-devicons", - "rev": "a1366758b3a232036dc97be8ca41184aa3f50506", + "rev": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d", "type": "github" }, "original": { @@ -690,11 +690,11 @@ "nvim_plugin-rcarriga/nvim-notify": { "flake": false, "locked": { - "lastModified": 1750713957, - "narHash": "sha256-2ptDlOG3fUl69a3kExVdK8AB/jkYkoMv8/hIJHDdrZs=", + "lastModified": 1753086914, + "narHash": "sha256-uQBB3fajHowivArxbtmEJvVU3+QO0VApYpVNMA58UkI=", "owner": "rcarriga", "repo": "nvim-notify", - "rev": "a22f5d7ac511c2df2fd3290a9f04c48d5a822e2e", + "rev": "397c7c1184745fca649e5104de659e6392ef5a4d", "type": "github" }, "original": { @@ -706,11 +706,11 @@ "nvim_plugin-rmagatti/auto-session": { "flake": false, "locked": { - "lastModified": 1749967462, - "narHash": "sha256-1pIGu/GJ4FiMH/yHhoo6Gu0HLC3rFQiesJBuv8uE7Vw=", + "lastModified": 1753073315, + "narHash": "sha256-H1db4XzKlZvz92DoO3xMWhZFKW6k4SYuWl95YXnYySQ=", "owner": "rmagatti", "repo": "auto-session", - "rev": "fffb13dcbe8731b8650e5bf1caa749a485d20556", + "rev": "ee320d7a59c1dfe83df7c9d58150d9f194690d53", "type": "github" }, "original": { @@ -799,22 +799,6 @@ "type": "github" } }, - "nvim_plugin-supermaven-inc/supermaven-nvim": { - "flake": false, - "locked": { - "lastModified": 1728314930, - "narHash": "sha256-1z3WKIiikQqoweReUyK5O8MWSRN5y95qcxM6qzlKMME=", - "owner": "supermaven-inc", - "repo": "supermaven-nvim", - "rev": "07d20fce48a5629686aefb0a7cd4b25e33947d50", - "type": "github" - }, - "original": { - "owner": "supermaven-inc", - "repo": "supermaven-nvim", - "type": "github" - } - }, "nvim_plugin-tpope/vim-sleuth": { "flake": false, "locked": { @@ -879,6 +863,22 @@ "type": "github" } }, + "nvim_plugin-yetone/avante.nvim": { + "flake": false, + "locked": { + "lastModified": 1753113754, + "narHash": "sha256-Jnhh6LsgyoWuycOj8f8Yq0/iRNpMa0lwguCokIPnmQg=", + "owner": "yetone", + "repo": "avante.nvim", + "rev": "e9c031ab6ba26e01ba4be534b2756005583efd11", + "type": "github" + }, + "original": { + "owner": "yetone", + "repo": "avante.nvim", + "type": "github" + } + }, "nvim_plugin-zbirenbaum/copilot-cmp": { "flake": false, "locked": { @@ -898,11 +898,11 @@ "nvim_plugin-zbirenbaum/copilot.lua": { "flake": false, "locked": { - "lastModified": 1751995038, - "narHash": "sha256-Ntj1KjSPfw9MuJMpXYaHklZpv5BglGS8TZcrt2B6yjg=", + "lastModified": 1752677816, + "narHash": "sha256-IV/IxZdGzC3KdvPmKo3CmA88HUxHkY5ENclGVI0tPLM=", "owner": "zbirenbaum", "repo": "copilot.lua", - "rev": "3680bebcc95dfd6c7509466367e66f6dc64a5140", + "rev": "14bf786180b2ca4578915c56989b6d676dddc6f3", "type": "github" }, "original": { @@ -963,11 +963,11 @@ "nvim_plugin-sindrets/diffview.nvim": "nvim_plugin-sindrets/diffview.nvim", "nvim_plugin-stevearc/conform.nvim": "nvim_plugin-stevearc/conform.nvim", "nvim_plugin-stevearc/dressing.nvim": "nvim_plugin-stevearc/dressing.nvim", - "nvim_plugin-supermaven-inc/supermaven-nvim": "nvim_plugin-supermaven-inc/supermaven-nvim", "nvim_plugin-tpope/vim-sleuth": "nvim_plugin-tpope/vim-sleuth", "nvim_plugin-tpope/vim-surround": "nvim_plugin-tpope/vim-surround", "nvim_plugin-uga-rosa/ccc.nvim": "nvim_plugin-uga-rosa/ccc.nvim", "nvim_plugin-windwp/nvim-ts-autotag": "nvim_plugin-windwp/nvim-ts-autotag", + "nvim_plugin-yetone/avante.nvim": "nvim_plugin-yetone/avante.nvim", "nvim_plugin-zbirenbaum/copilot-cmp": "nvim_plugin-zbirenbaum/copilot-cmp", "nvim_plugin-zbirenbaum/copilot.lua": "nvim_plugin-zbirenbaum/copilot.lua", "rust-overlay": "rust-overlay" @@ -980,11 +980,11 @@ ] }, "locked": { - "lastModified": 1752115281, - "narHash": "sha256-3i0sUli3sWCglfpj+yS1gtA+4m2ao2UMIxa4IfifUUU=", + "lastModified": 1753066249, + "narHash": "sha256-j2UBrfDRIePGx3532Bbb9UeosNX2F73hfOAHtmACfnM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "e5b68250e585c60d1679803045575fb71801d822", + "rev": "0751b65633a1785743ca44fd7c14a633c54c1f91", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a6a8b6d..84343c3 100644 --- a/flake.nix +++ b/flake.nix @@ -114,8 +114,8 @@ "nvim_plugin-zbirenbaum/copilot.lua".flake = false; "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim".url = "github:CopilotC-Nvim/CopilotChat.nvim"; "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim".flake = false; - # "nvim_plugin-yetone/avante.nvim".url = "github:yetone/avante.nvim"; - # "nvim_plugin-yetone/avante.nvim".flake = false; + "nvim_plugin-yetone/avante.nvim".url = "github:yetone/avante.nvim"; + "nvim_plugin-yetone/avante.nvim".flake = false; # "nvim_plugin-HakonHarnes/img-clip.nvim".url = "github:HakonHarnes/img-clip.nvim"; # "nvim_plugin-HakonHarnes/img-clip.nvim".flake = false; "nvim_plugin-stevearc/dressing.nvim".url = "github:stevearc/dressing.nvim"; @@ -132,8 +132,8 @@ "nvim_plugin-ron/ron.vim".flake = false; "nvim_plugin-nosduco/remote-sshfs.nvim".url = "github:nosduco/remote-sshfs.nvim"; "nvim_plugin-nosduco/remote-sshfs.nvim".flake = false; - "nvim_plugin-supermaven-inc/supermaven-nvim".url = "github:supermaven-inc/supermaven-nvim"; - "nvim_plugin-supermaven-inc/supermaven-nvim".flake = false; + # "nvim_plugin-supermaven-inc/supermaven-nvim".url = "github:supermaven-inc/supermaven-nvim"; + # "nvim_plugin-supermaven-inc/supermaven-nvim".flake = false; }; outputs = { @@ -176,43 +176,43 @@ "nvim_plugin-nvim-treesitter/nvim-treesitter" = nvim-treesitter.withAllGrammars; }; - # avante-nvim-lib = pkgs.rustPlatform.buildRustPackage { - # pname = "avante-nvim-lib"; - # version = "0.0.0"; - # src = inputs."nvim_plugin-yetone/avante.nvim"; - # - # buildFeatures = [ "luajit" ]; - # doCheck = false; - # cargoLock = { - # lockFile = inputs."nvim_plugin-yetone/avante.nvim" + "/Cargo.lock"; - # allowBuiltinFetchGit = true; - # }; - # - # nativeBuildInputs = with pkgs; [ - # pkg-config - # ]; - # - # buildInputs = with pkgs; [ - # openssl.dev - # ]; - # env = { - # OPENSSL_NO_VENDOR = "1"; - # OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; - # OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; - # OPENSSL_DIR = "${pkgs.openssl.dev}"; - # }; - # postInstall = '' - # # mv $out/lib/libavante_repo_map.so $out/lib/avante_repo_map.so - # for f in $out/lib/lib*; do - # mv "$f" "$out/lib/''${f##*/lib}" - # done - # ''; - # meta = { - # description = "Avante nvim libraries"; - # homepage = "https://github.com/yetone/avante.nvim"; - # license = pkgs.lib.licenses.asl20; - # }; - # }; + avante-nvim-lib = pkgs.rustPlatform.buildRustPackage { + pname = "avante-nvim-lib"; + version = "0.0.0"; + src = inputs."nvim_plugin-yetone/avante.nvim"; + + buildFeatures = [ "luajit" ]; + doCheck = false; + cargoLock = { + lockFile = inputs."nvim_plugin-yetone/avante.nvim" + "/Cargo.lock"; + allowBuiltinFetchGit = true; + }; + + nativeBuildInputs = with pkgs; [ + pkg-config + ]; + + buildInputs = with pkgs; [ + openssl.dev + ]; + env = { + OPENSSL_NO_VENDOR = "1"; + OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; + OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; + OPENSSL_DIR = "${pkgs.openssl.dev}"; + }; + postInstall = '' + # mv $out/lib/libavante_repo_map.so $out/lib/avante_repo_map.so + for f in $out/lib/lib*; do + mv "$f" "$out/lib/''${f##*/lib}" + done + ''; + meta = { + description = "Avante nvim libraries"; + homepage = "https://github.com/yetone/avante.nvim"; + license = pkgs.lib.licenses.asl20; + }; + }; # This will be how we put any nix related stuff into our lua config luaNixGlobal = @@ -321,22 +321,22 @@ "LAZY" "${lazyPath}" ] - # ++ [ - # # Link avante libraries - # "--prefix" - # "LD_LIBRARY_PATH" - # ":" - # "${avante-nvim-lib}/lib" - # # Add Lua C modules path TODO make these conditional so on linux, and dylib for mac it shouldn't be both... - # "--prefix" - # "LUA_CPATH" - # ";" - # "${avante-nvim-lib}/lib/?.so" - # "--prefix" - # "LUA_CPATH" - # ";" - # "${avante-nvim-lib}/lib/?.dylib" - # ] + ++ [ + # Link avante libraries + "--prefix" + "LD_LIBRARY_PATH" + ":" + "${avante-nvim-lib}/lib" + # Add Lua C modules path TODO make these conditional so on linux, and dylib for mac it shouldn't be both... + "--prefix" + "LUA_CPATH" + ";" + "${avante-nvim-lib}/lib/?.so" + "--prefix" + "LUA_CPATH" + ";" + "${avante-nvim-lib}/lib/?.dylib" + ] ++ [ # Don't use default directories to not collide with another neovim config # All things at runtime should be deletable since we are using nix to handle downloads and bins diff --git a/lua/plugins_disabled/avante.lua b/lua/plugins/avante.lua similarity index 83% rename from lua/plugins_disabled/avante.lua rename to lua/plugins/avante.lua index 8ad598e..0e9714a 100644 --- a/lua/plugins_disabled/avante.lua +++ b/lua/plugins/avante.lua @@ -39,19 +39,23 @@ return { return { provider = "copilot", auto_suggestions_provider = "copilot", - -- providers = { - -- ollama = { - -- endpoint = "http://100.64.0.6:11434/", -- Note that there is no /v1 at the end. - -- model = "gemma3:12b", - -- }, - -- ollamafast = { - -- __inherited_from = "ollama", - -- endpoint = "http://100.64.0.6:11434/", -- Note that there is no /v1 at the end. - -- model = "gemma3:4b", - -- }, - -- }, - hints = { enabled = true }, + providers = { + morph = { + model = "auto", + }, + -- ollama = { + -- endpoint = "http://100.64.0.6:11434/", -- Note that there is no /v1 at the end. + -- model = "gemma3:12b", + -- }, + -- ollamafast = { + -- __inherited_from = "ollama", + -- endpoint = "http://100.64.0.6:11434/", -- Note that there is no /v1 at the end. + -- model = "gemma3:4b", + -- }, + }, + hints = { enabled = false }, behavior = { + enable_fastapply = true, auto_suggestions = true, auto_set_highlight_group = true, auto_set_keymaps = false, diff --git a/lua/tools/folding.lua b/lua/tools/folding.lua new file mode 100644 index 0000000..19d61bd --- /dev/null +++ b/lua/tools/folding.lua @@ -0,0 +1,27 @@ +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" + +vim.opt.foldcolumn = "0" +vim.opt.foldtext = "" + +vim.opt.foldlevel = 99 +vim.opt.foldlevelstart = 99 + +vim.opt.foldnestmax = 3 + +vim.keymap.set('n', 'z', function() + local any_fold_open = false + for lnum = 1, vim.fn.line('$') do + if vim.fn.foldclosed(lnum) ~= -1 then + any_fold_open = true + break + end + end + if any_fold_open then + -- There's at least one closed fold, so open all + vim.cmd('normal! zR') + else + -- All folds are open, so close all + vim.cmd('normal! zM') + end +end, { noremap = true, silent = true })