feat: set zsh config to mine (mostly)

This commit is contained in:
Ahwx 2024-06-21 09:40:23 +02:00
parent 99954a97f1
commit 382d4c34d8

View file

@ -1,38 +1,47 @@
{ hostname, config, pkgs, host, ...}: { hostname, config, pkgs, host, ...}:
{ {
programs.zsh = { programs = {
zsh = {
enable = true; enable = true;
enableCompletion = true; autocd = true;
autosuggestion.enable = true; autosuggestion.enable = true;
syntaxHighlighting.enable = true; enableCompletion = true;
oh-my-zsh = {
enable = true; localVariables = {
plugins = [ "git" "fzf" ]; # Looks like this: '~/some/path > '
PS1 = "%F{magenta}%~%f > ";
# Gets pushed to the home directory otherwise
LESSHISTFILE = "/dev/null";
# Make Vi mode transitions faster (in hundredths of a second)
# KEYTIMEOUT = 1;
LANG = "en_US.UTF-8";
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=#808080";
}; };
initExtraFirst = ''
DISABLE_MAGIC_FUNCTIONS=true
export "MICRO_TRUECOLOR=1"
'';
shellAliases = { shellAliases = {
# record = "wf-recorder --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor -f $HOME/Videos/$(date +'%Y%m%d%H%M%S_1.mp4')"; ls = "eza -lh";
la = "eza -A";
# Utils ll = "eza -l";
c = "clear"; lla = "eza -lA";
cd = "z"; # :q = "exit";
tt = "gtrash put"; ezit = "exit";
cat = "bat"; notes = "nvim ~/Documents/todo.md";
nano = "micro"; todo = "nvim ~/Documents/todo.md";
code = "codium"; irc = "ssh irc";
py = "python"; tmuxconf = "nvim ~/.config/tmux/tmux.conf";
icat = "kitten icat"; nvimconf = "cd ~/.config/nvim && nvim";
dsize = "du -hs"; termconf = "nvim ~/.config/alacritty/alacritty.yml";
findw = "grep -rl"; wc = "wl-copy";
zshrc = "nvim ~/.zshrc";
l = "eza --icons -a --group-directories-first -1"; #EZA_ICON_SPACING=2 yt-dlp-audio = "yt-dlp -f 'ba' -x --audio-format mp3";
ll = "eza --icons -a --group-directories-first -1 --no-user --long"; emerge = "doas emerge";
zshconf = "nvim ~/.zshrc";
open = "xdg-open";
tree = "eza --icons --tree --group-directories-first"; tree = "eza --icons --tree --group-directories-first";
nvim = "nix run /home/liv/Development/nixvim --";
doas = "sudo";
# Nixos # NixOS
cdnix = "cd ~/nixos-config && codium ~/nixos-config"; cdnix = "cd ~/nixos-config && codium ~/nixos-config";
ns = "nix-shell --run zsh"; ns = "nix-shell --run zsh";
nix-shell = "nix-shell --run zsh"; nix-shell = "nix-shell --run zsh";
@ -40,35 +49,50 @@
nix-switchu = "sudo nixos-rebuild switch --upgrade --flake ~/nixos-config#${host}"; nix-switchu = "sudo nixos-rebuild switch --upgrade --flake ~/nixos-config#${host}";
nix-flake-update = "sudo nix flake update ~/nixos-config#"; nix-flake-update = "sudo nix flake update ~/nixos-config#";
nix-clean = "sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/* && nix-collect-garbage && nix-collect-garbage -d"; nix-clean = "sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/* && nix-collect-garbage && nix-collect-garbage -d";
# Git
ga = "git add";
gaa = "git add --all";
gs = "git status";
gb = "git branch";
gm = "git merge";
gpl = "git pull";
gplo = "git pull origin";
gps = "git push";
gpst = "git push --follow-tags";
gpso = "git push origin";
gc = "git commit";
gcm = "git commit -m";
gcma = "git add --all && git commit -m";
gtag = "git tag -ma";
gch = "git checkout";
gchb = "git checkout -b";
gcoe = "git config user.email";
gcon = "git config user.name";
# python
piv = "python -m venv .venv";
psv = "source .venv/bin/activate";
};
}; };
programs.zoxide = { plugins = with pkgs; [
{
name = "zsh-syntax-highlighting";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.6.0";
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
};
file = "zsh-syntax-highlighting.zsh";
}
{
name = "zsh-abbr";
src = fetchFromGitHub {
owner = "olets";
repo = "zsh-abbr";
rev = "752e9fcc4daff680545c30f8f857913d66f6f5e6";
sha256 = "sha256-HY/F43fpWn1PBYb2c+qp0CyF3hpSFHUZdZLZRS1d9Yc=";
};
file = "zsh-abbr.sh";
}
{
name = "zsh-autopair";
src = fetchFromGitHub {
owner = "hlissner";
repo = "zsh-autopair";
rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49";
sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1";
};
file = "autopair.zsh";
}
];
};
fzf = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
}; };
zoxide = {
enable = true;
enableZshIntegration = true;
};
};
} }