usable vim config

This commit is contained in:
zoe 2022-10-24 21:14:09 +02:00
parent a65e93cfec
commit a4d0b06bfa
6 changed files with 65 additions and 6 deletions

View File

@ -7,10 +7,10 @@
{
imports =
[
# Include the results of the hardware scan.
<home-manager/nixos>
./hardware-configuration.nix
./packages.nix
<home-manager/nixos>
./home.nix
];
# Bootloader.
@ -98,7 +98,6 @@
];
};
home-manager.users.zoe = { pkgs, ... }: { };
# Allow unfree packages
nixpkgs.config.allowUnfree = true;

14
home.nix Normal file
View File

@ -0,0 +1,14 @@
{ config, pkgs, ... }:
let
nvimCustom = import nvim/settings.nix;
in
{
home-manager.users.zoe = { pkgs, ... }: {
programs.neovim = nvimCustom pkgs;
programs.git = {
enable = true;
userName = "zoe";
userEmail = "ZoeOosting@outlook.com";
};
};
}

View File

@ -4,7 +4,15 @@ local g = vim.g
-- allow mouse
opt.mouse = "a"
-- colors
-- look
opt.termguicolors = true
opt.cursorline = true
opt.cursorline = false -- dont highlight current line
opt.number = true
-- highlight yanked text for 200ms using the "Visual" highlight group
vim.cmd[[
augroup highlight_yank
autocmd!
au TextYankPost * silent! lua vim.highlight.on_yank({higroup="Visual", timeout=200})
augroup END
]]

26
nvim/settings.nix Normal file
View File

@ -0,0 +1,26 @@
pkgs:
{
enable = true;
vimAlias = true;
extraConfig = ''
luafile /etc/nixos/nvim/settings.lua
'';
plugins = with pkgs.vimPlugins; [
# coc
coc-nvim
coc-rust-analyzer
coc-lua
# make brackets nicer
nvim-autopairs
# colorize hex codes
nvim-colorizer-lua
# colorize brackets
rainbow
];
}

View File

@ -12,5 +12,7 @@
wireguard-tools
networkmanagerapplet
vscodium
neofetch
nodejs
];
}

12
sync.sh
View File

@ -1,7 +1,17 @@
#!/bin/sh
# update in case i was fucking around somewhere else
git pull
# format everything to look nice
nixpkgs-fmt *.nix
nixpkgs-fmt ./nvim/*.nix
# make a backup just in case
cp -r /etc/nixos/ ./backup
sudo cp -r ./configuration.nix ./nvim/ ./packages.nix /etc/nixos/
# copy over all the files to /etc/nixos/
sudo cp -r ./configuration.nix ./nvim/ ./packages.nix ./home.nix /etc/nixos/
# update and build my new config
sudo nixos-rebuild switch --upgrade