Add zsh fzf, tweak completion

This commit is contained in:
Sam W 2022-03-01 00:13:47 +00:00
parent 1dd386ed3a
commit 01fb3d60a4
1 changed files with 30 additions and 8 deletions

View File

@ -6,7 +6,8 @@ in {
home.sessionVariables = { home.sessionVariables = {
"PATH" = "$HOME/.local/bin:$PATH"; "PATH" = "$HOME/.local/bin:$PATH";
"EDITOR" = "vim"; "EDITOR" = "vim";
"WORDCHARS" = "\${WORDCHARS//[\\/.]/}"; # ctrl-w on paths without make angery "WORDCHARS" =
"\${WORDCHARS//[\\/.]/}"; # ctrl-w on paths without make angery
}; };
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
@ -20,12 +21,32 @@ in {
hmswitch = ''home-manager switch --flake ".#$(hostname -s)"''; hmswitch = ''home-manager switch --flake ".#$(hostname -s)"'';
nrswitch = "sudo nixos-rebuild switch --flake '.#'"; nrswitch = "sudo nixos-rebuild switch --flake '.#'";
}; };
# Extra .zshrc stuff
plugins = [{ initExtra = ''
# zstyle ':completion:*' menu select # fancy interactive autocomplete
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # tabcomplete lower to upper case
'';
enableSyntaxHighlighting = true;
plugins = [
{
name = "fzf-tab";
src = pkgs.fetchFromGitHub {
owner = "aloxaf";
repo = "fzf-tab";
rev = "master";
sha256 = "y9MuxJzXi1i+zCBzqjjCHL9uHzq/peDZEb3MByMm0Wg=";
};
}
{
name = "zsh-z"; name = "zsh-z";
file = "share/zsh-z/zsh-z.plugin.zsh"; src = pkgs.fetchFromGitHub {
src = pkgs.zsh-z; owner = "agkozak";
}]; repo = "zsh-z";
rev = "master";
sha256 = "1A6WZ+fJSf2WKZD7CYJB/pbgwV2mX+X8qInqQLeuT78=";
};
}
];
}; };
exa = { exa = {
@ -43,7 +64,8 @@ in {
hostname.format = "[$hostname]($style) "; hostname.format = "[$hostname]($style) ";
directory = { truncation_length = -1; }; directory = { truncation_length = -1; };
git_branch.format = "[$symbol$branch]($style) "; git_branch.format = "[$symbol$branch]($style) ";
python.format = "[py \${pyenv_prefix}(\${version} )(\\($virtualenv\\) )]($style)"; python.format =
"[py \${pyenv_prefix}(\${version} )(\\($virtualenv\\) )]($style)";
nodejs.format = "[js ($version )]($style)"; nodejs.format = "[js ($version )]($style)";
nix_shell.format = "[nix $state( \\($name\\))]($style) "; nix_shell.format = "[nix $state( \\($name\\))]($style) ";
}; };