54 lines
1.5 KiB
Nix
Raw Normal View History

2022-11-29 20:40:15 -07:00
{ config, pkgs, lib, ... }:
2022-04-28 19:11:33 -04:00
2022-11-29 20:40:15 -07:00
let
2022-04-28 19:11:33 -04:00
2022-11-29 20:40:15 -07:00
neovim = import ./package {
inherit pkgs;
colors = config.theme.colors;
2022-11-29 20:40:15 -07:00
};
2022-04-28 19:11:33 -04:00
2022-11-29 20:40:15 -07:00
in {
2022-12-21 14:18:03 -07:00
options.neovim.enable = lib.mkEnableOption "Neovim.";
2022-11-29 20:40:15 -07:00
2022-12-21 14:18:03 -07:00
config = lib.mkIf config.neovim.enable {
home-manager.users.${config.user} =
2022-11-29 20:40:15 -07:00
2022-12-21 14:18:03 -07:00
{
2022-11-29 20:40:15 -07:00
2022-12-21 14:18:03 -07:00
home.packages = [ neovim ];
programs.git.extraConfig.core.editor = "nvim";
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
};
programs.fish = {
shellAliases = { vim = "nvim"; };
shellAbbrs = {
v = lib.mkForce "nvim";
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
vll = "nvim -c 'Telescope oldfiles'";
};
2022-11-29 20:40:15 -07:00
};
programs.kitty.settings.scrollback_pager = ''
$SHELL -c 'sed -r "s/[[:cntrl:]]\]133;[AC]..//g" | ${neovim}/bin/nvim -c "setlocal nonumber norelativenumber nolist laststatus=0" -c "lua baleia = require(\"baleia\").setup({}); baleia.once(0)" -c "map <silent> q :qa!<CR>" -c "autocmd VimEnter * normal G"' '';
2022-12-21 14:18:03 -07:00
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
2023-03-08 22:55:34 -05:00
name = "Neovim wrapper";
exec = "kitty nvim %F";
};
xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux {
"text/plain" = [ "nvim.desktop" ];
"text/markdown" = [ "nvim.desktop" ];
2023-03-08 22:55:34 -05:00
};
2022-11-29 20:40:15 -07:00
};
2022-12-21 14:18:03 -07:00
# # Used for icons in Vim
# fonts.fonts = with pkgs; [ nerdfonts ];
2022-04-28 19:11:33 -04:00
2022-12-21 14:18:03 -07:00
};
2022-04-28 21:56:21 -04:00
2022-04-28 19:11:33 -04:00
}