chore: update neovim config to use extraConfig 🎨

This commit is contained in:
DannyDannyDanny 2026-01-11 15:03:46 +01:00
parent 086d6d898a
commit da93ae365e

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
configure = {
customRC = ''
# TODO: refactor (some parts) to extraLuaConfig
extraConfig = ''
set title
set go=a
set mouse=a
@ -15,10 +15,9 @@
lua << EOF
local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
local f=io.open(config_file, "r")
if f~=nil then
local f = io.open(config_file, "r")
if f ~= nil then
local system_theme = f:read()
-- f:close()
io.close(f)
if system_theme == 'dark' then
vim.cmd("set bg=dark")
@ -27,11 +26,11 @@
else
print('warning: expected value "light" or "dark"')
print(' got:', system_theme)
print(' expected path:', file)
print(' expected path:', config_file)
end
else
print('warning: nvim color scheme not found')
print(' expected path:', file)
print(' expected path:', config_file)
end
EOF
@ -56,10 +55,8 @@
set spell spelllang=en_us
setlocal spell! spelllang=en_us
'';
# vimPlugins inspired from Alexnortung
# https://discourse.nixos.org/t/neovim-no-longer-uses-config-or-plugins/13399/4
packages.nix = with pkgs.vimPlugins; {
start = [
plugins = with pkgs.vimPlugins; [
vim-surround # shortcuts for setting () {} etc.
vim-gitgutter # git diff in sign column
# vim-airline # nice and light status bar # doesn't work nicely with tmux
@ -74,8 +71,5 @@
goyo-vim # write prose
limelight-vim # prose paragraph highlighter
];
opt = [];
};
};
};
}