From 5f5ac1793595cb935e828c0a8e8bf2f9a5ab776c Mon Sep 17 00:00:00 2001 From: iofq Date: Sat, 5 Jul 2025 21:18:10 -0500 Subject: [PATCH] no more copilot --- flake.lock | 17 --------- flake.nix | 32 +++++++---------- nix/neovim-overlay.nix | 20 ++++------- nvim/lsp/gopls.lua | 32 +++++++++++++++++ nvim/lsp/lua_ls.lua | 23 ++++++++++++ nvim/lua/config/init.lua | 1 - nvim/lua/plugins/ai.lua | 14 -------- nvim/lua/plugins/completion.lua | 16 --------- nvim/lua/plugins/lsp.lua | 62 +++------------------------------ nvim/lua/plugins/snacks.lua | 2 -- 10 files changed, 78 insertions(+), 141 deletions(-) create mode 100644 nvim/lsp/gopls.lua create mode 100644 nvim/lsp/lua_ls.lua delete mode 100644 nvim/lua/plugins/ai.lua diff --git a/flake.lock b/flake.lock index 7cf582e..efa8973 100644 --- a/flake.lock +++ b/flake.lock @@ -278,22 +278,6 @@ "type": "github" } }, - "mini-nvim": { - "flake": false, - "locked": { - "lastModified": 1750602124, - "narHash": "sha256-cfgANg0vRJg31x+BiSfYhwBSyQnYt/aRDx6+BaS0YYY=", - "owner": "echasnovski", - "repo": "mini.nvim", - "rev": "1b32a3f61f1f649cadc748bd4b7a32b4b4785d29", - "type": "github" - }, - "original": { - "owner": "echasnovski", - "repo": "mini.nvim", - "type": "github" - } - }, "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat_2", @@ -398,7 +382,6 @@ "inputs": { "flake-utils": "flake-utils", "gen-luarc": "gen-luarc", - "mini-nvim": "mini-nvim", "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs_2" } diff --git a/flake.nix b/flake.nix index 78131bc..984342b 100644 --- a/flake.nix +++ b/flake.nix @@ -9,10 +9,6 @@ url = "github:mrcjkb/nix-gen-luarc-json"; inputs.nixpkgs.follows = "nixpkgs"; }; - mini-nvim = { - url = "github:echasnovski/mini.nvim"; - flake = false; - }; # Add bleeding-edge plugins here. # They can be updated with `nix flake update` (make sure to commit the generated flake.lock) # wf-nvim = { @@ -20,22 +16,19 @@ # flake = false; # }; }; - outputs = - inputs@{ - self, - nixpkgs, - flake-utils, - ... - }: - let - systems = builtins.attrNames nixpkgs.legacyPackages; + outputs = inputs @ { + self, + nixpkgs, + flake-utils, + ... + }: let + systems = builtins.attrNames nixpkgs.legacyPackages; - # This is where the Neovim derivation is built. - neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; }; - in + # This is where the Neovim derivation is built. + neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;}; + in flake-utils.lib.eachSystem systems ( - system: - let + system: let pkgs = import nixpkgs { inherit system; config.allowUnfree = true; @@ -64,8 +57,7 @@ ln -Tfns $PWD/nvim ~/.config/nvim-dev ''; }; - in - { + in { packages = rec { default = nvim; nvim = pkgs.nvim-pkg; diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 1e2a8b2..d3e6df7 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -1,32 +1,25 @@ # This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs. -{ inputs }: -final: prev: -with final.pkgs.lib; -let +{inputs}: final: prev: +with final.pkgs.lib; let pkgs = final; pkgs-wrapNeovim = prev; - mkNvimPlugin = - src: pname: + mkNvimPlugin = src: pname: pkgs.vimUtils.buildVimPlugin { inherit pname src; version = src.lastModifiedDate; }; - mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; }; - - mini-nvim-git = mkNvimPlugin inputs.mini-nvim "mini.nvim"; + mkNeovim = pkgs.callPackage ./mkNeovim.nix {inherit pkgs-wrapNeovim;}; all-plugins = with pkgs.vimPlugins; [ blink-cmp - blink-copilot blink-ripgrep-nvim conform-nvim - copilot-lua diffview-nvim eyeliner-nvim friendly-snippets lazy-nvim - mini-nvim-git + mini-nvim nightfox-nvim nvim-lint nvim-lspconfig @@ -63,8 +56,7 @@ let jujutsu fd ]; -in -{ +in { nvim-pkg = mkNeovim { plugins = all-plugins; appName = "nvim"; diff --git a/nvim/lsp/gopls.lua b/nvim/lsp/gopls.lua new file mode 100644 index 0000000..46d47d8 --- /dev/null +++ b/nvim/lsp/gopls.lua @@ -0,0 +1,32 @@ +return { + settings = { + gopls = { + gofumpt = true, + codelenses = { + gc_details = true, + test = true, + }, + analyses = { + unusedvariable = true, + unusedparams = true, + useany = true, + unusedwrite = true, + nilness = true, + shadow = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + rangeVariableTypes = true, + parameterNames = true, + }, + usePlaceholders = true, + staticcheck = true, + completeUnimported = true, + semanticTokens = true, + }, + }, +} diff --git a/nvim/lsp/lua_ls.lua b/nvim/lsp/lua_ls.lua new file mode 100644 index 0000000..a2244c8 --- /dev/null +++ b/nvim/lsp/lua_ls.lua @@ -0,0 +1,23 @@ +return { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + version = 'LuaJIT', + }, + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + }, + }, + }) + end, + settings = { + Lua = {}, + }, +} diff --git a/nvim/lua/config/init.lua b/nvim/lua/config/init.lua index af169ee..1f048e1 100644 --- a/nvim/lua/config/init.lua +++ b/nvim/lua/config/init.lua @@ -87,7 +87,6 @@ vim.keymap.set('n', '', vim.cmd.bprev, { noremap = true, silent = true }) vim.keymap.set('v', '<', '', '>gv') vim.keymap.set({ 'v', 'n' }, 'q:', '') -vim.keymap.set({ 'n', 'v' }, '', '') -- usually have C-a mapped to tmux -- resize splits if window got resized vim.api.nvim_create_autocmd({ 'VimResized' }, { diff --git a/nvim/lua/plugins/ai.lua b/nvim/lua/plugins/ai.lua deleted file mode 100644 index 8529175..0000000 --- a/nvim/lua/plugins/ai.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - 'zbirenbaum/copilot.lua', - cmd = 'Copilot', - opts = { - panel = { - enabled = false, - }, - suggestion = { - enabled = false, - }, - }, - }, -} diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 62368fb..b91c370 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -4,7 +4,6 @@ return { event = 'VeryLazy', dependencies = { 'mikavilpas/blink-ripgrep.nvim', - 'fang2hou/blink-copilot', }, opts = { enabled = function() @@ -24,7 +23,6 @@ return { 'snippets', 'omni', 'ripgrep', - 'copilot', }, providers = { snippets = { @@ -36,20 +34,6 @@ return { score_offset = -30, async = true, }, - copilot = { - module = 'blink-copilot', - name = 'Copilot', - score_offset = 10, - async = true, - opts = { - max_completions = 2, - debounce = 500, - auto_refresh = { - backward = false, - forward = true, - }, - }, - }, }, }, cmdline = { diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index bcab147..09c5a0a 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -5,7 +5,8 @@ return { opts = { pinned = true, focus = true, - auto_jump = true, + follow = false, + auto_close = false, win = { size = 0.25, position = 'right', @@ -29,62 +30,6 @@ return { 'saghen/blink.cmp', }, config = function() - vim.lsp.config('gopls', { - settings = { - gopls = { - gofumpt = true, - codelenses = { - gc_details = true, - test = true, - }, - analyses = { - unusedvariable = true, - unusedparams = true, - useany = true, - unusedwrite = true, - nilness = true, - shadow = true, - }, - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - rangeVariableTypes = true, - parameterNames = true, - }, - usePlaceholders = true, - staticcheck = true, - completeUnimported = true, - semanticTokens = true, - }, - }, - }) - vim.lsp.config('lua_ls', { - on_init = function(client) - local path = client.workspace_folders[1].name - if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then - return - end - - client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { - runtime = { - version = 'LuaJIT', - }, - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - }, - }, - }) - end, - settings = { - Lua = {}, - }, - }) - vim.lsp.enable { 'nil_ls', 'phpactor', @@ -207,6 +152,9 @@ return { go = { 'golangcilint' }, ruby = { 'rubocop' }, fish = { 'fish' }, + bash = { 'bash' }, + nix = { 'nix' }, + php = { 'php' }, } vim.api.nvim_command('au BufWritePost * lua require("lint").try_lint()') end, diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index acf66ea..a6206a0 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -9,14 +9,12 @@ return { opts = { bigfile = { enabled = true }, bufdelete = { enabled = true }, - dim = { enabled = true }, quickfile = { enabled = true }, notifier = { enabled = true }, terminal = { enabled = true }, indent = { enabled = true }, input = { enabled = true }, words = { enabled = true }, - scope = { enabled = true }, picker = { enabled = true, matcher = { frecency = true },