2024-11-07 01:11:48 +01:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
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
|
|
|
|
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
|
|
|
|
tree-sitter
|
|
|
|
tree-sitter-grammars.tree-sitter-bash
|
2024-11-06 20:43:59 +01:00
|
|
|
tree-sitter-grammars.tree-sitter-c
|
|
|
|
tree-sitter-grammars.tree-sitter-comment
|
|
|
|
tree-sitter-grammars.tree-sitter-css
|
|
|
|
tree-sitter-grammars.tree-sitter-cue
|
|
|
|
tree-sitter-grammars.tree-sitter-fish
|
|
|
|
tree-sitter-grammars.tree-sitter-gdscript
|
2024-10-06 23:00:01 +02:00
|
|
|
tree-sitter-grammars.tree-sitter-go
|
2024-11-06 20:43:59 +01:00
|
|
|
tree-sitter-grammars.tree-sitter-gomod
|
|
|
|
tree-sitter-grammars.tree-sitter-hcl
|
2024-10-06 23:00:01 +02:00
|
|
|
tree-sitter-grammars.tree-sitter-html
|
2024-11-06 20:43:59 +01:00
|
|
|
tree-sitter-grammars.tree-sitter-javascript
|
|
|
|
tree-sitter-grammars.tree-sitter-json
|
|
|
|
tree-sitter-grammars.tree-sitter-lua
|
|
|
|
tree-sitter-grammars.tree-sitter-markdown
|
2024-10-06 23:00:01 +02:00
|
|
|
tree-sitter-grammars.tree-sitter-nix
|
2024-11-06 20:43:59 +01:00
|
|
|
tree-sitter-grammars.tree-sitter-proto
|
|
|
|
tree-sitter-grammars.tree-sitter-rego
|
|
|
|
tree-sitter-grammars.tree-sitter-rust
|
|
|
|
tree-sitter-grammars.tree-sitter-scss
|
|
|
|
tree-sitter-grammars.tree-sitter-sql
|
|
|
|
tree-sitter-grammars.tree-sitter-svelte
|
|
|
|
tree-sitter-grammars.tree-sitter-toml
|
|
|
|
tree-sitter-grammars.tree-sitter-tsx
|
|
|
|
tree-sitter-grammars.tree-sitter-typescript
|
|
|
|
tree-sitter-grammars.tree-sitter-vim
|
|
|
|
tree-sitter-grammars.tree-sitter-yaml
|
|
|
|
tree-sitter-grammars.tree-sitter-zig
|
2024-10-06 23:00:01 +02:00
|
|
|
vscode-langservers-extracted
|
|
|
|
];
|
|
|
|
|
|
|
|
plugins = with pkgs.vimPlugins; [
|
|
|
|
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-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";
|
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "https://patagia.dev/Patagia/dieter.nvim.git";
|
|
|
|
rev = "08fae6ffec4ae70ba6b2e1cafa780ff317ef0b61";
|
|
|
|
hash = "sha256-C+Vo2SUVfNMkBwuLWqLoA59Pmy9aFwur7fBpfVkLm6Q=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
type = "lua";
|
|
|
|
config = ''
|
|
|
|
vim.cmd.colorscheme "dieter"
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2024-11-06 20:43:59 +01:00
|
|
|
plugin = nvim-treesitter-context;
|
|
|
|
type = "lua";
|
|
|
|
config = ''
|
|
|
|
vim.keymap.set('n', '<space>ut', "<cmd>TSContextToggle<cr>", {noremap = true, silent = true, desc = "TS Context"})
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = nvim-treesitter.withAllGrammars;
|
2024-10-06 23:00:01 +02:00
|
|
|
type = "lua";
|
|
|
|
config = ''
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
|
|
highlight = { enable = true, },
|
|
|
|
indent = { enable = true },
|
2024-11-06 20:43:59 +01:00
|
|
|
textobjects = {
|
|
|
|
select = {
|
|
|
|
enable = true,
|
|
|
|
lookahead = true,
|
|
|
|
},
|
|
|
|
},
|
2024-10-06 23:00:01 +02:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimUtils.buildVimPlugin {
|
|
|
|
name = "nvim-tree-pairs"; # make % match in TS
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "yorickpeterse";
|
|
|
|
repo = "nvim-tree-pairs";
|
|
|
|
rev = "e7f7b6cc28dda6f3fa271ce63b0d371d5b7641da";
|
|
|
|
hash = "sha256-fb4EsrWAbm8+dWAhiirCPuR44MEg+KYb9hZOIuEuT24=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
type = "lua";
|
|
|
|
config = "require('tree-pairs').setup()";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = nvim-treesitter-textobjects; # helix-style selection of TS tree
|
|
|
|
type = "lua";
|
|
|
|
config = ''
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
|
|
incremental_selection = {
|
|
|
|
enable = true,
|
|
|
|
keymaps = {
|
|
|
|
init_selection = "<M-o>",
|
|
|
|
scope_incremental = "<M-O>",
|
|
|
|
node_incremental = "<M-o>",
|
|
|
|
node_decremental = "<M-i>",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = mini-nvim;
|
|
|
|
type = "lua";
|
|
|
|
config = lib.fileContents ./mini.lua;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = nvim-lspconfig; # Interface for LSPs
|
|
|
|
type = "lua";
|
|
|
|
config = lib.fileContents ./lsp.lua;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|