emacs: Load neovim config from a Lua file
this allows for better editing experience compared to the stringly mess from before. So now Emacs is good for modifying NeoVim config, with support for both Nix and Lua, and NeoVim is capable of editing Emacs config via orgmode. Nice :)
This commit is contained in:
parent
43b013d7da
commit
f131210561
7 changed files with 62 additions and 50 deletions
|
@ -1,7 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/common-home.nix
|
../../modules/common-home.nix
|
||||||
|
../../modules/neovim/nvim.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1162,7 +1162,7 @@ When Emacs is opened in Windows Subsystem for Linux, open web links in Firefox o
|
||||||
** Lua
|
** Lua
|
||||||
#+begin_src emacs-lisp :lexical t
|
#+begin_src emacs-lisp :lexical t
|
||||||
(use-package! lua-mode
|
(use-package! lua-mode
|
||||||
:config
|
:init
|
||||||
(setq! lua-indent-close-paren-align nil
|
(setq! lua-indent-close-paren-align nil
|
||||||
lua-indent-level 4
|
lua-indent-level 4
|
||||||
lua-indent-nested-block-content-align t))
|
lua-indent-nested-block-content-align t))
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/common-home.nix
|
../../modules/common-home.nix
|
||||||
|
../../modules/neovim/nvim.nix
|
||||||
|
|
||||||
./mail.nix
|
./mail.nix
|
||||||
./emacs.nix
|
./emacs.nix
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.stateVersion = "22.05";
|
home.stateVersion = "22.05";
|
||||||
|
@ -78,52 +78,6 @@
|
||||||
enableFishIntegration = true;
|
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 = {
|
htop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
32
modules/neovim/init.lua
Normal file
32
modules/neovim/init.lua
Normal file
|
@ -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/**/*'
|
||||||
|
},
|
||||||
|
})
|
24
modules/neovim/nvim.nix
Normal file
24
modules/neovim/nvim.nix
Normal file
|
@ -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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
Reference in a new issue