2023-07-19 21:52:35 -04:00
|
|
|
# https://breuer.dev/blog/nixos-home-manager-neovim
|
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
2023-09-18 23:21:45 -04:00
|
|
|
configDir = "/home/matt/.nix/config";
|
|
|
|
|
2023-07-19 21:52:35 -04:00
|
|
|
# installs a vim plugin from git with a given tag / branch
|
|
|
|
pluginGit = ref: repo: pkgs.vimUtils.buildVimPluginFrom2Nix {
|
|
|
|
pname = "${lib.strings.sanitizeDerivationName repo}";
|
|
|
|
version = ref;
|
|
|
|
src = builtins.fetchGit {
|
|
|
|
url = "https://github.com/${repo}.git";
|
|
|
|
ref = ref;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# always installs latest version
|
|
|
|
plugin = pluginGit "HEAD";
|
|
|
|
in {
|
2023-09-18 23:21:45 -04:00
|
|
|
xdg.configFile = {
|
|
|
|
"nvim/coc-settings.json".source = pkgs.writeText "coc-settings.json" ''
|
|
|
|
{
|
|
|
|
"java.jdt.ls.java.home": "${pkgs.temurin-bin-18}",
|
|
|
|
"colors.enable": true,
|
|
|
|
"Lua.misc.parameters": [
|
|
|
|
"--metapath",
|
|
|
|
"~/.cache/sumneko_lua/meta",
|
|
|
|
"--logpath",
|
|
|
|
"~/.cache/sumneko_lua/log"
|
|
|
|
],
|
2023-09-19 09:36:14 -04:00
|
|
|
"sumneko-lua.serverDir": "${pkgs.lua-language-server}/share/lua-language-server",
|
|
|
|
"bashIde.shellcheckPath": "${pkgs.shellcheck}/bin/shellcheck"
|
2023-09-18 23:21:45 -04:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-19 21:52:35 -04:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.neovim-nightly;
|
|
|
|
|
|
|
|
# read in the vim config from filesystem
|
|
|
|
# this enables syntaxhighlighting when editing those
|
|
|
|
extraConfig = builtins.concatStringsSep "\n" [
|
2023-09-18 23:21:45 -04:00
|
|
|
(lib.strings.fileContents "${configDir}/nvim/base.vim")
|
2023-07-19 21:52:35 -04:00
|
|
|
# (lib.strings.fileContents ./.nvim/plugins.vim)
|
|
|
|
# (lib.strings.fileContents ./.nvim/lsp.vim)
|
|
|
|
''
|
|
|
|
lua << EOF
|
2023-09-18 23:21:45 -04:00
|
|
|
${lib.strings.fileContents "${configDir}/nvim/config.lua"}
|
|
|
|
${lib.strings.fileContents "${configDir}/nvim/lsp.lua"}
|
2023-07-19 21:52:35 -04:00
|
|
|
EOF
|
|
|
|
''
|
|
|
|
];
|
|
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
tree-sitter
|
2023-09-18 23:21:45 -04:00
|
|
|
nodejs_latest
|
|
|
|
bat
|
2023-09-19 09:36:14 -04:00
|
|
|
|
|
|
|
python311Packages.pylint
|
2023-07-19 21:52:35 -04:00
|
|
|
];
|
|
|
|
plugins = with pkgs.vimPlugins; [
|
|
|
|
vim-which-key
|
|
|
|
|
2023-09-19 09:36:14 -04:00
|
|
|
coc-nvim
|
|
|
|
coc-java
|
|
|
|
coc-css
|
|
|
|
coc-sumneko-lua
|
|
|
|
coc-highlight
|
2023-09-18 23:21:45 -04:00
|
|
|
coc-json
|
|
|
|
coc-pairs
|
2023-09-19 09:36:14 -04:00
|
|
|
coc-pyright
|
2023-09-18 23:21:45 -04:00
|
|
|
coc-sh
|
|
|
|
coc-snippets
|
|
|
|
coc-vimlsp
|
|
|
|
coc-yaml
|
|
|
|
coc-toml
|
2023-09-19 09:36:14 -04:00
|
|
|
coc-markdownlint
|
2023-09-18 23:21:45 -04:00
|
|
|
|
|
|
|
coc-fzf
|
|
|
|
(plugin "junegunn/fzf.vim")
|
|
|
|
(plugin "junegunn/fzf")
|
|
|
|
|
2023-07-19 21:52:35 -04:00
|
|
|
nvim-treesitter.withAllGrammars
|
|
|
|
nvim-treesitter
|
|
|
|
|
|
|
|
(plugin "Mofiqul/dracula.nvim")
|
2023-07-20 23:00:57 -04:00
|
|
|
(plugin "lukas-reineke/indent-blankline.nvim")
|
|
|
|
(plugin "lewis6991/gitsigns.nvim")
|
|
|
|
(plugin "nvim-lualine/lualine.nvim")
|
|
|
|
|
|
|
|
# neo-tree and deps
|
2023-07-19 21:52:35 -04:00
|
|
|
(plugin "nvim-neo-tree/neo-tree.nvim")
|
2023-07-20 23:00:57 -04:00
|
|
|
(plugin "nvim-lua/plenary.nvim")
|
|
|
|
(plugin "nvim-tree/nvim-web-devicons")
|
|
|
|
(plugin "MunifTanjim/nui.nvim")
|
2023-07-19 21:52:35 -04:00
|
|
|
|
2023-07-20 23:00:57 -04:00
|
|
|
# to explore more
|
|
|
|
(plugin "sindrets/diffview.nvim")
|
|
|
|
(plugin "folke/todo-comments.nvim")
|
|
|
|
(plugin "petertriho/nvim-scrollbar")
|
2023-07-19 21:52:35 -04:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|