dotfiles/modules/neovim/default.nix

48 lines
1.2 KiB
Nix
Raw Normal View History

2022-05-07 20:54:47 +00:00
{ config, pkgs, lib, ... }: {
2022-04-28 23:11:33 +00:00
home-manager.users.${config.user} = {
2022-04-28 23:11:33 +00:00
home.packages = with pkgs; [
neovim
gcc # for tree-sitter
shfmt # used everywhere
shellcheck # used everywhere
];
2022-04-28 23:11:33 +00:00
xdg.configFile = {
2022-07-09 21:27:04 +00:00
"nvim/init.lua".source = ./init.lua;
2022-07-09 21:57:56 +00:00
"nvim/lua" = {
source = ./lua;
recursive = true; # Allows adding more files
};
2022-07-26 03:36:06 +00:00
"nvim/lua/packer/colors.lua".source = config.colorscheme.neovimConfig;
};
programs.git.extraConfig.core.editor = "nvim";
2022-05-12 01:13:41 +00:00
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
};
2022-04-30 14:21:43 +00:00
programs.fish = {
2022-05-30 17:09:50 +00:00
shellAliases = { vim = "nvim"; };
2022-05-29 17:44:45 +00:00
shellAbbrs = {
v = lib.mkForce "nvim";
vl = lib.mkForce "vim -c 'normal! `0' -c 'bdelete 1'";
2022-05-29 17:44:45 +00:00
vll = "nvim -c 'Telescope oldfiles'";
};
2022-04-30 14:21:43 +00:00
};
2022-07-10 23:48:11 +00:00
# Always run packer.nvim sync
home.activation.nvimPackerSync =
config.home-manager.users.${config.user}.lib.dag.entryAfter
2022-07-11 03:31:48 +00:00
[ "writeBoundary" ] ''
2022-07-11 13:23:41 +00:00
$DRY_RUN_CMD ${pkgs.neovim}/bin/nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
2022-07-10 23:48:11 +00:00
'';
};
2022-04-28 23:11:33 +00:00
2022-04-29 01:56:21 +00:00
# Used for icons in Vim
fonts.fonts = with pkgs; [ nerdfonts ];
2022-04-28 23:11:33 +00:00
}