Start vim config

This commit is contained in:
Sam W 2022-01-18 01:01:59 +00:00
parent cec04d523c
commit 8bbc2c94c6
3 changed files with 16 additions and 3 deletions

View File

@ -4,7 +4,7 @@ let mypkgs = (import ../modules/pkgs.nix { inherit pkgs; });
in {
home.packages = mypkgs.all;
home.sessionVariables = {
"EDITOR" = "nvim";
"EDITOR" = "vim";
"WORDCHARS" = "\${WORDCHARS/\\/}"; # ctrl-w on paths without make angery
};
programs = {
@ -16,7 +16,6 @@ in {
shellAliases = {
g = "git";
cat = "bat";
vim = "nvim";
hmswitch = ''home-manager switch --flake ".#$(hostname -s)"'';
nrswitch = "sudo nixos-rebuild switch --flake '.#'";
};

View File

@ -1,5 +1,5 @@
{
dev = { ... }: {
imports = [ ./default.nix ./git.nix ./macs.nix ./rust.nix ];
imports = [ ./default.nix ./git.nix ./macs.nix ./rust.nix ./vim.nix ];
};
}

14
home/vim.nix Normal file
View File

@ -0,0 +1,14 @@
# This module sets up a "full" neovim install with plugins and unicorns. It also
# makes neovim the default editor and aliases vim to nvim.
{ pkgs, ... }: {
home.sessionVariables = { "EDITOR" = "nvim"; };
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [ vim-nix rust-vim ];
extraConfig = ''
set relativenumber
let g:rustfmt_autosave = 1
'';
};
programs.zsh.shellAliases = { vim = "nvim"; };
}