dotfiles/home/common/nvim/default.nix

169 lines
3.9 KiB
Nix
Raw Normal View History

2024-11-07 01:11:48 +01:00
{
inputs,
lib,
pkgs,
...
}:
2024-10-06 23:00:01 +02:00
{
2024-11-07 21:00:06 +01:00
imports = [
./treesitter.nix
];
2024-11-07 12:05:47 +01:00
programs.man.generateCaches = false;
2024-10-06 23:00:01 +02:00
programs.neovim = {
2024-11-07 01:11:48 +01:00
enable = true;
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default;
2024-10-06 23:00:01 +02:00
defaultEditor = true;
2024-11-07 01:11:48 +01:00
viAlias = true;
vimAlias = true;
withNodeJs = false;
withPython3 = false;
withRuby = false;
2024-10-06 23:00:01 +02:00
extraLuaConfig = lib.fileContents ./init.lua;
2024-11-06 00:40:41 +01:00
2024-10-06 23:00:01 +02:00
extraPackages = with pkgs; [
black
2024-11-07 17:57:44 +01:00
codeium
2024-10-06 23:00:01 +02:00
cue
go
gopls
gotools
lua-language-server
nil
nixd
nodePackages.prettier
2024-11-07 01:11:48 +01:00
nodePackages.typescript
2024-10-06 23:00:01 +02:00
nodePackages.typescript-language-server
2024-11-07 01:11:48 +01:00
nodePackages.bash-language-server
2024-10-06 23:00:01 +02:00
rust-analyzer
2024-11-06 20:43:59 +01:00
rustfmt
2024-10-06 23:00:01 +02:00
shellcheck
shfmt
stylua
vscode-langservers-extracted
];
plugins = with pkgs.vimPlugins; [
2024-11-09 10:09:10 +01:00
friendly-snippets
2024-10-06 23:00:01 +02:00
go-nvim
rustaceanvim
2024-11-07 01:11:48 +01:00
targets-vim
2024-11-06 20:43:59 +01:00
ts-comments-nvim
2024-10-06 23:00:01 +02:00
{
2024-11-09 10:09:10 +01:00
plugin = nvim-lspconfig;
type = "lua";
config = lib.fileContents ./lsp.lua;
}
{
plugin = blink-cmp;
type = "lua";
config = ''
require'blink-cmp'.setup({
2024-11-09 10:09:10 +01:00
keymap = {
preset = 'enter',
["<PageDown>"] = { "scroll_documentation_down" },
["<PageUp>"] = { "scroll_documentation_up" },
},
trigger = {
completion = {
show_in_snippet = true,
},
signature_help = {
enabled = true,
},
},
2024-11-09 01:33:49 +01:00
windows = {
autocomplete = {
border = 'none',
2024-11-09 10:09:10 +01:00
selection = 'preselect',
2024-11-09 01:33:49 +01:00
},
documentation = {
border = 'rounded',
2024-11-09 10:09:10 +01:00
auto_show = false,
auto_show_delay_ms = 800,
2024-11-09 01:33:49 +01:00
},
signature_help = {
border = 'rounded',
},
},
})
'';
}
2024-11-07 17:57:44 +01:00
{
plugin = codeium-nvim;
type = "lua";
config = ''
require'codeium'.setup {
enable_chat = false,
}
'';
}
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "neocodeium";
src = pkgs.fetchFromGitHub {
owner = "monkoose";
repo = "neocodeium";
2024-11-09 10:09:10 +01:00
rev = "4da81528468b33585c411f31eb390dce573ccb14"; # v1.8.0
2024-11-07 17:57:44 +01:00
hash = "sha256-1n9nNqBNwNDSzbAkm8eB4HZLNy5HmMg25jPwQAnW5OU=";
};
};
type = "lua";
config = ''
local neocodeium =require('neocodeium')
neocodeium.setup()
vim.keymap.set("i", "<C-j>", neocodeium.accept, { remap = true })
vim.keymap.set("i", "<A-f>", neocodeium.accept, { remap = true })
vim.keymap.set("i", "<C-h>", neocodeium.cycle_or_complete, { remap = true })
'';
}
2024-11-06 01:00:29 +01:00
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "diagflow";
src = pkgs.fetchFromGitHub {
owner = "dgagn";
repo = "diagflow.nvim";
rev = "fc09d55d2e60edc8ed8f9939ba97b7b7e6488c99";
hash = "sha256-2WNuaIEXcAgUl2Kb/cCHEOrtehw9alaoM96qb4MLArw=";
};
};
type = "lua";
config = ''
require('diagflow').setup {
scope = "line",
gap_size = 0,
max_width = 50,
max_height = 20,
show_borders = true,
toggle_event = { "InsertEnter", "InsertLeave" },
}
'';
}
2024-10-06 23:00:01 +02:00
{
plugin = pkgs.vimUtils.buildVimPlugin {
name = "dieter-nvim";
2024-11-07 12:05:47 +01:00
src = ./dieter;
2024-10-06 23:00:01 +02:00
};
type = "lua";
config = ''
vim.cmd.colorscheme "dieter"
'';
}
{
plugin = mini-nvim;
type = "lua";
config = lib.fileContents ./mini.lua;
}
];
};
}