diff --git a/flake.lock b/flake.lock index 8ab2bdf..3a98af2 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,38 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -34,6 +66,48 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741352980, + "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738453229, + "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -99,6 +173,29 @@ "type": "github" } }, + "git-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_3", + "gitignore": "gitignore_2", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741379162, + "narHash": "sha256-srpAbmJapkaqGRE3ytf3bj4XshspVR5964OX5LfjDWc=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -121,6 +218,50 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1739595404, + "narHash": "sha256-0CjCfbq0yHWexOrpO06e2WU1r5JAqR6ffy1zgM3NksI=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "06519cec8fb32d219006da6eacd255504a9996af", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "luvit-meta": { "flake": false, "locked": { @@ -137,18 +278,58 @@ "type": "github" } }, + "neovim-nightly-overlay": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_2", + "git-hooks": "git-hooks_2", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": "nixpkgs", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1741738202, + "narHash": "sha256-S98JgCHJJFBI9XFXPdn/ATjux6JfrjLN7jGHEGvxsYM=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "6e291160fc740378dc846f9bb402653c4e50a313", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1741737177, + "narHash": "sha256-MxPM5FawrHrUywZXAHJ4+0+Wj4dITHDMHKf4aIwC9zk=", + "owner": "neovim", + "repo": "neovim", + "rev": "092529ebbf6fe566399aa47c274d708b8dea5334", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1738680400, - "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", + "lastModified": 1741678040, + "narHash": "sha256-rmBsz7BBcDwfvDkxnKHmolKceGJrr0nyz5PQYZg0kMk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "799ba5bffed04ced7067a91798353d360788b30d", + "rev": "3ee8818da146871cd570b164fc4f438f78479a50", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -167,11 +348,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1738831044, - "narHash": "sha256-6y2I2h4hX8d+LXLCzgu7QJ3Wvkx89R0x3WFQ5ovhwco=", + "lastModified": 1741842650, + "narHash": "sha256-gyA3ngXZroBeWdrVsM+bL63hQMUheYCrC+V78TEgBeU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4b6440d7ca1649bb95bd59f39b2279db959e498", + "rev": "b1f2198021490b51fb92b8b09db97b9ba2a7b4ce", "type": "github" }, "original": { @@ -197,11 +378,28 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1741513245, + "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "gen-luarc": "gen-luarc", - "nixpkgs": "nixpkgs", + "neovim-nightly-overlay": "neovim-nightly-overlay", + "nixpkgs": "nixpkgs_2", "nixpkgs-master": "nixpkgs-master" } }, @@ -219,6 +417,27 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1739829690, + "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "3d0579f5cc93436052d94b73925b48973a104204", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 1bec7e0..c9a0c03 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-master.url = "github:NixOS/nixpkgs/master"; flake-utils.url = "github:numtide/flake-utils"; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; gen-luarc = { url = "github:mrcjkb/nix-gen-luarc-json"; inputs.nixpkgs.follows = "nixpkgs"; @@ -31,6 +32,7 @@ inherit system; overlays = [ neovim-overlay + inputs.neovim-nightly-overlay.overlays.default gen-luarc.overlays.default ]; }; diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 8bc35af..b3c7409 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -2,8 +2,7 @@ {inputs}: final: prev: with final.pkgs.lib; let pkgs = final; - - pkgs-wrapNeovim = inputs.nixpkgs.legacyPackages.${pkgs.system}; + pkgs-wrapNeovim = prev; mkNvimPlugin = src: pname: pkgs.vimUtils.buildVimPlugin { @@ -14,9 +13,7 @@ with final.pkgs.lib; let all-plugins = with pkgs.vimPlugins; [ aerial-nvim - inputs.nixpkgs-master.legacyPackages.${pkgs.system}.vimPlugins.blink-cmp - blink-cmp-copilot - blink-compat + blink-cmp blink-ripgrep-nvim codecompanion-nvim copilot-lua @@ -27,7 +24,6 @@ with final.pkgs.lib; let lazy-nvim luasnip mini-nvim - neogen neogit none-ls-nvim nightfox-nvim @@ -65,9 +61,6 @@ with final.pkgs.lib; let python312Packages.jedi-language-server ruby-lsp - # debuggers - delve - #other jujutsu ]; diff --git a/nvim/lua/config/init.lua b/nvim/lua/config/init.lua index ddc501b..09e91cb 100644 --- a/nvim/lua/config/init.lua +++ b/nvim/lua/config/init.lua @@ -80,6 +80,7 @@ vim.diagnostic.config { -- random keymaps vim.keymap.set('n', 'gq', vim.cmd.bdelete, { silent = true }) +vim.keymap.set('n', 'gQ', '%bd|e#', { silent = true }) vim.keymap.set('n', 'gt', vim.cmd.bnext, { silent = true }) vim.keymap.set('n', 'gr', vim.cmd.bprev, { silent = true }) vim.keymap.set('n', 'tr', 'gT', { noremap = true, silent = true }) diff --git a/nvim/lua/plugins/ai.lua b/nvim/lua/plugins/ai.lua index 2706552..3d88f34 100644 --- a/nvim/lua/plugins/ai.lua +++ b/nvim/lua/plugins/ai.lua @@ -11,14 +11,22 @@ return { } }, opts = { - panel = { enabled = true, keymap = { accept = "ga" } }, + panel = { + enabled = true, + auto_refresh = true, + keymap = { + jump_prev = "", + jump_next = "", + accept = "", + } + }, suggestion = { enabled = true, auto_trigger = true, + hide_during_completion = true, keymap = { accept = "", next = "", - dismiss = "", }, }, completion = { @@ -60,25 +68,11 @@ return { "zbirenbaum/copilot.lua", }, opts = { - -- adapters = { - -- copilot = function() - -- return require("codecompanion.adapters").extend("copilot", { - -- schema = { - -- model = { - -- default = "claude-3.5-sonnet" - -- }, - -- }, - -- }) - -- end - -- }, strategies = { chat = { adapter = "copilot", }, inline = { adapter = "copilot", }, }, }, - init = function() - vim.api.nvim_create_user_command('CC', ':CodeCompanion', {}) - end, keys = { { 'ac', @@ -90,12 +84,14 @@ return { 'as', 'CodeCompanionChat Add', noremap = true, + mode = { "n", "v" }, desc = 'Copilot chat add selection' }, { 'aa', 'CodeCompanionActions', noremap = true, + mode = { "n", "v" }, desc = 'Copilot inline' } } diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 7e48e87..fda1de5 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -3,28 +3,9 @@ return { 'saghen/blink.cmp', event = "VeryLazy", dependencies = { - 'saghen/blink.compat', 'rafamadriz/friendly-snippets', - 'giuxtaposition/blink-cmp-copilot', 'mikavilpas/blink-ripgrep.nvim' }, - config = function(_, opts) - require('blink.cmp').setup(opts) - vim.api.nvim_create_autocmd('User', { - pattern = 'BlinkCmpMenuOpen', - callback = function() - require("copilot.suggestion").dismiss() - vim.b.copilot_suggestion_hidden = true - end, - }) - - vim.api.nvim_create_autocmd('User', { - pattern = 'BlinkCmpMenuClose', - callback = function() - vim.b.copilot_suggestion_hidden = false - end, - }) - end, opts = { sources = { default = { @@ -33,24 +14,22 @@ return { "snippets", "buffer", "ripgrep", - "copilot" }, providers = { ripgrep = { module = "blink-ripgrep", name = "rg", score_offset = -10, - }, - copilot = { - name = "copilot", - module = "blink-cmp-copilot", - score_offset = 100, async = true, }, } }, - keymap = { - [""] = { "show", "select_and_accept" } + cmdline = { + completion = { + menu = { + auto_show = true, + }, + }, }, completion = { documentation = { @@ -63,14 +42,10 @@ return { auto_insert = true, } }, - accept = { - auto_brackets = { - enabled = true - } + ghost_text = { + enabled = true, }, menu = { - -- auto show in cmdline - auto_show = true, draw = { treesitter = { "lsp" }, columns = { @@ -80,12 +55,9 @@ return { } }, trigger = { - show_on_keyword = false, + show_on_keyword = true, } }, - appearance = { - use_nvim_cmp_as_default = true, - }, signature = { enabled = true } } }, diff --git a/nvim/lua/plugins/misc.lua b/nvim/lua/plugins/misc.lua index 67968f3..e8144c5 100644 --- a/nvim/lua/plugins/misc.lua +++ b/nvim/lua/plugins/misc.lua @@ -4,11 +4,6 @@ return { event = "InsertEnter", config = true }, - { - 'danymat/neogen', - event = 'VeryLazy', - config = true, - }, { 'jinh0/eyeliner.nvim', event = 'VeryLazy', diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index b0f8330..f323ea8 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -25,6 +25,10 @@ return { files = { hidden = true }, grep = { hidden = true }, explorer = { hidden = true }, + git_files = { untracked = true }, + smart = { + multi = { "buffers", "recent", "files", "git_files" } + } }, }, actions = { @@ -53,14 +57,20 @@ return { vim.api.nvim_set_hl(0, 'SnacksPickerDir', { fg = '#cccccc' }) end, keys = { - { '', function() Snacks.terminal.toggle() end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, - { 'm', function() Snacks.words.jump(1, true) end, noremap = true, desc = 'next reference' }, - { 'M', function() Snacks.words.jump(-1, true) end, noremap = true, desc = 'next reference' }, + { '', function() Snacks.terminal.toggle() end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, + { 't', function() Snacks.terminal.toggle('$SHELL') end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, + { 'm', function() Snacks.words.jump(1, true) end, noremap = true, desc = 'next reference' }, + { 'M', function() Snacks.words.jump(-1, true) end, noremap = true, desc = 'next reference' }, { 'ff', function() Snacks.picker.smart() end, { noremap = true, silent = true, desc = 'Fuzzy find files' } }, + { + 'fe', + function() Snacks.picker.explorer() end, + { noremap = true, silent = true, desc = 'snacks explorer' } + }, { 'fg', function() Snacks.picker.files() end, @@ -81,6 +91,16 @@ return { function() Snacks.picker.pickers() end, { noremap = true, silent = true, desc = 'See all pickers' } }, + { + 'fd', + function() Snacks.picker.diagnostics() end, + { noremap = true, silent = true, desc = 'Pick diagnostics' } + }, + { + 'fj', + function() Snacks.picker.jumps() end, + { noremap = true, silent = true, desc = 'Pick jumps' } + }, { 'f.', function() Snacks.picker.resume() end, @@ -91,6 +111,11 @@ return { function() Snacks.picker.buffers() end, { noremap = true, silent = true, desc = 'Fuzzy find buffers' } }, + { + 'fn', + function() Snacks.picker.notifications() end, + { noremap = true, silent = true, desc = 'pick notifications' } + }, } } }