1

add neovim module

This commit is contained in:
2022-08-10 21:55:00 +02:00
parent cbb51d26c8
commit 27607212f1
2 changed files with 144 additions and 0 deletions

60
modules/kitty.nix Normal file
View File

@ -0,0 +1,60 @@
{ config, nixosConfig, lib, mylib, pkgs, ... }:
with lib;
with mylib.modules;
let
cfg = config.modules.kitty;
cfgnv = config.modules.neovim;
in {
options.modules.kitty = {
enable = mkEnableOpt "Kitty";
};
config = mkIf cfg.enable {
# TODO: Copy config from Arch dots, also move the entire config folder (to allow ephemereal configs)
# TODO: Light/Dark theme option
programs.kitty = {
enable = true;
font = {
package = pkgs.victor-mono;
name = "Victor Mono SemiBold";
size = 12;
};
settings = {
editor = (if cfgnv.enable then "nvim" else "nano");
scrollback_lines = 10000;
window_padding_width = 10;
# hide_window_decorations = "yes";
# Light Theme
# background = "#f7f7f7";
# foreground = "#494542";
# selection_background = "#a4a1a1";
# selection_foreground = "#f7f7f7";
# cursor = "#494542";
# color0 = "#090200";
# color1 = "#da2c20";
# color2 = "#00a152";
# color3 = "#ffcc00";
# color4 = "#00a0e4";
# color5 = "#a06994";
# color6 = "#0077d9";
# color7 = "#a4a1a1";
# color8 = "#5b5754";
# color9 = "#e8bacf";
# color10 = "#3a3332";
# color11 = "#494542";
# color12 = "#7f7c7b";
# color13 = "#d6d4d3";
# color14 = "#ccab53";
# color15 = "#d2b3ff";
};
keybindings = {
"kitty_mod+j" = "next_window";
"kitty_mod+k" = "previous_window";
};
};
};
}

84
modules/neovim.nix Normal file
View File

@ -0,0 +1,84 @@
{ config, nixosConfig, lib, mylib, pkgs, ... }:
with lib;
with mylib.modules;
let
cfg = config.modules.neovim;
in {
options.modules.neovim = {
enable = mkEnableOpt "NeoVim";
alias = mkBoolOpt "Link nvim to vim/vi";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
extraConfig = ''
set incsearch
set hlsearch
set ignorecase
set autoindent
set expandtab
set smartindent
set smarttab
set shiftwidth=4
set softtabstop=4
set backspace=indent,eol,start
set ruler
set number
set laststatus=2
set noshowmode
set undofile
set undodir=~/.vim/undo
set hidden
set printfont=Victor\ Mono\ SemiBold:h10
set guifont=Victor\ Mono\ SemiBold:h12
let printencoding='utf-8'
set encoding=utf-8
'';
plugins = with pkgs.vimPlugins; [
# vim-nix
surround-nvim
# lightline-vim
{
plugin = lualine-nvim;
config = ''
lua << EOF
require('lualine').setup {}
EOF
'';
}
# vim-gitgutter
# YouCompleteMe
{
plugin = nvim-autopairs;
config = ''
lua << EOF
require('nvim-autopairs').setup {}
EOF
'';
}
{
plugin = (nvim-treesitter.withPlugins
(plugins: pkgs.tree-sitter.allGrammars));
config = ''
lua << EOF
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
EOF
'';
}
];
viAlias = cfg.alias;
vimAlias = cfg.alias;
};
};
}