refactor: split into modules

This commit is contained in:
Oliver Davies 2022-09-26 23:50:43 +01:00
parent 501fe8533f
commit 8c281cd5d2
5 changed files with 229 additions and 215 deletions

View file

@ -0,0 +1,47 @@
{ config, pkgs, lib, libs, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = false;
dotDir = ".config/zsh";
shellAliases = {
run = "./run";
};
autocd = true;
cdpath = [
"$HOME/Code"
"$HOME/Code/*"
"$HOME"
];
initExtra = ''
# Case insensitive autocompletion.
zstyle ":completion:*" matcher-list "" "m:{a-zA-Z}={A-Za-z}" "r:|=*" "l:|=* r:|=*"
autoload -Uz compinit && compinit
# No arguments: `git status`
# With arguments: acts like `git`
g() {
if [[ $# -gt 0 ]]; then
git "$@"
else
git status
fi
}
'';
zplug = {
enable = true;
plugins = [
{ name = "mollifier/cd-gitroot"; }
{ name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; }
{ name = "zsh-users/zsh-autosuggestions"; }
{ name = "zsh-users/zsh-completions"; }
{ name = "zsh-users/zsh-syntax-highlighting"; }
];
};
};
}