aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/neovim/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home-manager/neovim/default.nix')
-rw-r--r--modules/home-manager/neovim/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/home-manager/neovim/default.nix b/modules/home-manager/neovim/default.nix
new file mode 100644
index 0000000..415861a
--- /dev/null
+++ b/modules/home-manager/neovim/default.nix
@@ -0,0 +1,57 @@
+{ config, lib, pkgs, ... }:
+
+let
+ cfg = config.neovim;
+in {
+ options.neovim.enable = lib.mkEnableOption "Enable and setup neovim";
+
+ config = lib.mkIf cfg.enable {
+ xdg.configFile."nvim/lua".source = pkgs.lib.mkForce ./lua;
+
+ programs.neovim = {
+ enable = true;
+ vimAlias = true;
+
+ extraPackages = with pkgs; [
+ lua-language-server
+ ];
+
+ plugins = with pkgs.vimPlugins; [
+ lazy-nvim
+ nvim-lspconfig
+ friendly-snippets
+ telescope-nvim
+
+ (nvim-treesitter.withPlugins (plugins: with plugins; [
+ tree-sitter-bash
+ tree-sitter-c
+ tree-sitter-json
+ tree-sitter-lua
+ tree-sitter-python
+ tree-sitter-nix
+ tree-sitter-vim
+ tree-sitter-vimdoc
+ tree-sitter-yaml
+ tree-sitter-markdown
+ tree-sitter-markdown_inline
+ ]))
+ ];
+
+ extraLuaConfig = ''
+ vim.g.mapleader = " "
+ vim.g.maplocalleader = "\\"
+
+ require('options')
+ require('keymaps')
+ require('plugins')
+ require('autocmds')
+ '';
+ };
+
+ home.sessionVariables = rec {
+ EDITOR = "nvim";
+ GIT_EDITOR = EDITOR;
+ };
+ };
+}
+