dotfiles/modules/editor/neovim/default.nix
2022-07-10 23:48:11 +00:00

48 lines
1.1 KiB
Nix

{ config, pkgs, lib, ... }: {
home-manager.users.${config.user} = {
home.packages = with pkgs; [
neovim
gcc # for tree-sitter
shfmt # used everywhere
shellcheck # used everywhere
];
xdg.configFile = {
"nvim/init.lua".source = ./init.lua;
"nvim/lua" = {
source = ./lua;
recursive = true; # Allows adding more files
};
"nvim/lua/packer/colors.lua".text = config.gui.colorscheme.neovimConfig;
};
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'";
vll = "nvim -c 'Telescope oldfiles'";
};
};
# Always run packer.nvim sync
home.activation.nvimPackerSync =
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
$DRY_RUN_CMD nvim +PackerSync +qa
'';
};
# Used for icons in Vim
fonts.fonts = with pkgs; [ nerdfonts ];
}