diff --git a/hosts/bebop/home.nix b/hosts/bebop/home.nix index 40d68c4..d692742 100644 --- a/hosts/bebop/home.nix +++ b/hosts/bebop/home.nix @@ -1,7 +1,8 @@ -{ config, pkgs, ... }: +{ ... }: { imports = [ ../../modules/common-home.nix + ../../modules/neovim/nvim.nix ]; } diff --git a/hosts/hermes/doom/config.org b/hosts/hermes/doom/config.org index 64804ea..dbba957 100644 --- a/hosts/hermes/doom/config.org +++ b/hosts/hermes/doom/config.org @@ -1162,7 +1162,7 @@ When Emacs is opened in Windows Subsystem for Linux, open web links in Firefox o ** Lua #+begin_src emacs-lisp :lexical t (use-package! lua-mode - :config + :init (setq! lua-indent-close-paren-align nil lua-indent-level 4 lua-indent-nested-block-content-align t)) diff --git a/hosts/hermes/home.nix b/hosts/hermes/home.nix index 805473b..e3e7d31 100644 --- a/hosts/hermes/home.nix +++ b/hosts/hermes/home.nix @@ -3,6 +3,7 @@ { imports = [ ../../modules/common-home.nix + ../../modules/neovim/nvim.nix ./mail.nix ./emacs.nix diff --git a/modules/common-home.nix b/modules/common-home.nix index c6d7273..7585fd4 100644 --- a/modules/common-home.nix +++ b/modules/common-home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { home.stateVersion = "22.05"; @@ -78,52 +78,6 @@ enableFishIntegration = true; }; - neovim = { - enable = true; - vimAlias = true; - withPython3 = false; - withRuby = false; - withNodeJs = false; - plugins = with pkgs.vimPlugins; [ - nvim-treesitter.withAllGrammars - neogit - orgmode - lualine-nvim - ]; - extraConfig = '' - set nobackup - set number - set relativenumber - ''; - extraLuaConfig = '' - -- Neogit (magit clone) - local neogit = require('neogit') - neogit.setup {} - - -- Lualine - require('lualine').setup() - - -- Load custom treesitter grammar for org filetype - require('orgmode').setup_ts_grammar() - - -- Treesitter configuration - require('nvim-treesitter.configs').setup { - -- If TS highlights are not enabled at all, or disabled via `disable` prop, - -- highlighting will fallback to default Vim syntax highlighting - highlight = { - enable = true, - -- Required for spellcheck, some LaTex highlights and - -- code block highlights that do not have ts grammar - additional_vim_regex_highlighting = {'org'}, - }, - } - - require('orgmode').setup({ - org_agenda_files = {'~/org/**/*'}, - }) - ''; - }; - htop = { enable = true; settings = { diff --git a/modules/neovim/init.lua b/modules/neovim/init.lua new file mode 100644 index 0000000..db24cf1 --- /dev/null +++ b/modules/neovim/init.lua @@ -0,0 +1,32 @@ +-- Vim/NeoVim built-ins +vim.o.nobackup = true +vim.o.number = true +vim.o.relativenumber = true + +-- Neogit (magit clone) +require('neogit').setup() + +-- Lualine +require('lualine').setup() + +-- Load custom treesitter grammar for org filetype +require('orgmode').setup_ts_grammar() + +-- Treesitter configuration +require('nvim-treesitter.configs').setup { + -- If TS highlights are not enabled at all, or disabled via `disable` prop, + -- highlighting will fallback to default Vim syntax highlighting + highlight = { + enable = true, + -- Required for spellcheck, some LaTex highlights and + -- code block highlights that do not have ts grammar + additional_vim_regex_highlighting = {'org'}, + }, +} + +-- Orgmode +require('orgmode').setup({ + org_agenda_files = { + '~/org/**/*' + }, +}) diff --git a/modules/neovim/nvim.nix b/modules/neovim/nvim.nix new file mode 100644 index 0000000..0671ca4 --- /dev/null +++ b/modules/neovim/nvim.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: +{ + xdg.configFile = { + "nvim/init.lua" = { + source = ./init.lua; + }; + }; + + programs = { + neovim = { + enable = true; + vimAlias = true; + withPython3 = false; + withRuby = false; + withNodeJs = false; + plugins = with pkgs.vimPlugins; [ + nvim-treesitter.withAllGrammars + neogit + orgmode + lualine-nvim + ]; + }; + }; +} diff --git a/modules/root-home.nix b/modules/root-home.nix index c80cb82..6df54a9 100644 --- a/modules/root-home.nix +++ b/modules/root-home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { imports = [