2022-11-30 03:40:15 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
2022-04-28 23:11:33 +00:00
|
|
|
|
2022-11-30 03:40:15 +00:00
|
|
|
let
|
2022-04-28 23:11:33 +00:00
|
|
|
|
2022-11-30 03:40:15 +00:00
|
|
|
neovim = import ./package {
|
|
|
|
inherit pkgs;
|
|
|
|
colors = import config.theme.colors.neovimConfig { inherit pkgs; };
|
|
|
|
};
|
2022-04-28 23:11:33 +00:00
|
|
|
|
2022-11-30 03:40:15 +00:00
|
|
|
in {
|
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
options.neovim.enable = lib.mkEnableOption "Neovim.";
|
2022-11-30 03:40:15 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
config = lib.mkIf config.neovim.enable {
|
|
|
|
home-manager.users.${config.user} =
|
2022-11-30 03:40:15 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
{
|
2022-11-30 03:40:15 +00:00
|
|
|
|
2022-12-21 21:18:03 +00: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-30 03:40:15 +00:00
|
|
|
};
|
2022-12-21 21:18:03 +00:00
|
|
|
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
|
|
|
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
|
|
|
|
2023-03-09 15:45:11 +00:00
|
|
|
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
|
2023-03-09 03:55:34 +00:00
|
|
|
name = "Neovim wrapper";
|
|
|
|
exec = "kitty nvim %F";
|
|
|
|
};
|
2023-03-09 15:45:11 +00:00
|
|
|
xdg.mimeApps = lib.mkIf pkgs.stdenv.isLinux {
|
2023-03-09 03:55:34 +00:00
|
|
|
defaultApplications."text/markdown" = [ "nvim.desktop" ];
|
|
|
|
};
|
|
|
|
|
2022-11-30 03:40:15 +00:00
|
|
|
};
|
2022-04-29 01:40:21 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
# # Used for icons in Vim
|
|
|
|
# fonts.fonts = with pkgs; [ nerdfonts ];
|
2022-04-28 23:11:33 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
};
|
2022-04-29 01:56:21 +00:00
|
|
|
|
2022-04-28 23:11:33 +00:00
|
|
|
}
|