Skip to content

Commit

Permalink
[neovim] Update config
Browse files Browse the repository at this point in the history
- Disable copilot and null-ls plugins
- Migrate from nvim-cmp to blink.cmp
  • Loading branch information
sestrella committed Jan 8, 2025
1 parent 40be5df commit 8fff761
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
];
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
# https://nixos.wiki/wiki/Overlays
overlays = [
inputs.devenv.overlays.default
Expand Down
9 changes: 5 additions & 4 deletions home/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@
enable = true;
defaultEditor = true;
extraPackages = [
pkgs.bash-language-server
pkgs.gopls
pkgs.lua-language-server
pkgs.nixd
pkgs.nixfmt-rfc-style
pkgs.nodePackages.bash-language-server
pkgs.nodePackages.typescript-language-server
pkgs.pyright
pkgs.ruby-lsp
pkgs.stylua
pkgs.terraform-ls
pkgs.typescript-language-server
pkgs.vscode-langservers-extracted
pkgs.yaml-language-server
];
extraLuaConfig = builtins.readFile ./extra-config.lua;
plugins = builtins.concatMap (plugin: pkgs.callPackage plugin { }) [
# ./plugins/cmp
# ./plugins/copilot
# ./plugins/null-ls
./plugins/auto-dark-mode
./plugins/cmp
./plugins/comment
./plugins/conform
./plugins/gitsigns
./plugins/lspconfig
./plugins/lualine
./plugins/null-ls
./plugins/solarized
./plugins/telescope
./plugins/treesitter
Expand Down
9 changes: 1 addition & 8 deletions home/neovim/plugins/conform/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ require("conform").setup({
go = { "gofmt" },
lua = { "stylua" },
nix = { "nixfmt" },
python = { "black" },
terraform = { "terraform" },
},
formatters = {
terraform = {
command = "terraform",
args = { "fmt" },
},
terraform = { "terraform_fmt" },
},
})
5 changes: 5 additions & 0 deletions home/neovim/plugins/copilot/config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require("copilot").setup({
suggestion = {
enabled = false,
},
})
9 changes: 9 additions & 0 deletions home/neovim/plugins/copilot/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs, ... }:

[
{
plugin = pkgs.vimPlugins.copilot-lua;
config = builtins.readFile ./config.lua;
type = "lua";
}
]
12 changes: 5 additions & 7 deletions home/neovim/plugins/lspconfig/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ local servers = {
},
}

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())

local blink = require("blink.cmp")
local lspconfig = require("lspconfig")
for server, options in pairs(servers) do
lspconfig[server].setup(vim.tbl_extend("keep", options, {
capabilities = capabilities,
}))

for server, config in pairs(servers) do
config.capabilities = blink.get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end

-- https://github.com/neovim/nvim-lspconfig
Expand Down
1 change: 1 addition & 0 deletions home/neovim/plugins/lspconfig/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
config = builtins.readFile ./config.lua;
type = "lua";
}
pkgs.vimPlugins.blink-cmp
]

0 comments on commit 8fff761

Please sign in to comment.