nixos-configs/nixos/home/nvim.nix

85 lines
2.4 KiB
Nix
Raw Permalink Normal View History

2023-07-19 21:52:35 -04:00
# https://breuer.dev/blog/nixos-home-manager-neovim
{ config, pkgs, lib, ... }:
let
# 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 {
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" [
(lib.strings.fileContents ./.nvim/base.vim)
# (lib.strings.fileContents ./.nvim/plugins.vim)
# (lib.strings.fileContents ./.nvim/lsp.vim)
''
lua << EOF
${lib.strings.fileContents ./.nvim/config.lua}
${lib.strings.fileContents ./.nvim/lsp.lua}
EOF
''
];
extraPackages = with pkgs; [
tree-sitter
# https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
nodePackages.bash-language-server
shellcheck
nixd
2023-07-20 23:00:57 -04:00
sumneko-lua-language-server
vscode-langservers-extracted
2023-07-19 21:52:35 -04:00
];
plugins = with pkgs.vimPlugins; [
vim-which-key
nvim-treesitter.withAllGrammars
nvim-treesitter
2023-07-20 23:00:57 -04:00
#telescope-nvim
#telescope-fzf-native-nvim
2023-07-19 21:52:35 -04:00
(plugin "Mofiqul/dracula.nvim")
2023-07-20 23:00:57 -04:00
(plugin "neovim/nvim-lspconfig")
(plugin "lukas-reineke/indent-blankline.nvim")
(plugin "lewis6991/gitsigns.nvim")
(plugin "nvim-lualine/lualine.nvim")
# plugins for completion
(plugin "hrsh7th/nvim-cmp")
(plugin "hrsh7th/cmp-nvim-lsp")
(plugin "hrsh7th/cmp-buffer")
(plugin "hrsh7th/cmp-path")
(plugin "hrsh7th/cmp-cmdline")
(plugin "hrsh7th/cmp-vsnip")
(plugin "hrsh7th/vim-vsnip")
# 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 "iamcco/markdown-preview.nvim")
(plugin "sindrets/diffview.nvim")
(plugin "windwp/nvim-autopairs")
(plugin "mhartington/formatter.nvim")
(plugin "folke/todo-comments.nvim")
(plugin "petertriho/nvim-scrollbar")
2023-07-19 21:52:35 -04:00
];
};
}