2024-04-16 12:00:00 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
2023-11-06 23:48:09 +00:00
|
|
|
{
|
|
|
|
programs.zsh = {
|
2024-06-25 09:19:28 +00:00
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
2024-12-23 18:05:40 +00:00
|
|
|
enableSyntaxHighlighting = true;
|
2023-11-06 23:48:09 +00:00
|
|
|
|
2024-08-28 12:00:09 +00:00
|
|
|
cdpath = [ "~/Code" ];
|
2024-12-23 18:05:40 +00:00
|
|
|
dotDir = ".config/zsh";
|
2024-08-28 12:00:09 +00:00
|
|
|
|
2024-06-30 13:22:55 +00:00
|
|
|
shellAliases = (import ./zsh/aliases.nix);
|
2024-04-16 12:00:00 +00:00
|
|
|
|
2024-08-19 21:08:01 +00:00
|
|
|
localVariables = {
|
|
|
|
ABBR_SET_EXPANSION_CURSOR = 1;
|
|
|
|
};
|
|
|
|
|
2024-06-09 19:51:23 +00:00
|
|
|
initExtra = ''
|
2024-08-19 21:18:02 +00:00
|
|
|
# suffix
|
|
|
|
alias -s gz="tar -tf"
|
|
|
|
alias -s {html,HTML}="background firefox"
|
|
|
|
alias -s {jpg,JPG,png,PNG}="background okular"
|
|
|
|
alias -s {pdf,PDF}="background okular"
|
|
|
|
alias -s {zip,ZIP}="unzip -l"
|
|
|
|
|
2024-05-09 22:57:05 +00:00
|
|
|
git() {
|
|
|
|
if [[ "''${1}" == "root" ]]; then
|
|
|
|
shift
|
|
|
|
|
|
|
|
local ROOT="$(${pkgs.git}/bin/git rev-parse --show-toplevel 2> /dev/null || echo -n .)"
|
|
|
|
|
|
|
|
if [[ $# == 0 ]]; then
|
|
|
|
cd "''${ROOT}"
|
|
|
|
else
|
|
|
|
(cd "''${ROOT}" && eval "''${@}")
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
${pkgs.git}/bin/git "''${@}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-05-09 22:19:54 +00:00
|
|
|
ttyper() {
|
|
|
|
command ${pkgs.ttyper}/bin/ttyper --language english1000 --words 50 "''${@}"
|
|
|
|
}
|
|
|
|
|
2024-08-28 12:00:36 +00:00
|
|
|
yt-dlp() {
|
|
|
|
command yt-dlp --paths ~/Videos "$@"
|
|
|
|
}
|
|
|
|
|
2024-12-15 10:16:25 +00:00
|
|
|
bindkey -s ^f "tmux-sessionizer\n"
|
2024-07-23 19:46:25 +00:00
|
|
|
bindkey -s ^v "nvim\n"
|
2023-11-06 23:48:09 +00:00
|
|
|
|
|
|
|
setopt auto_cd
|
|
|
|
setopt auto_pushd
|
|
|
|
setopt pushd_ignore_dups
|
|
|
|
setopt pushdminus
|
|
|
|
'';
|
|
|
|
|
|
|
|
zplug = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
plugins = [
|
2024-11-25 08:03:59 +00:00
|
|
|
{ name = "Aloxaf/fzf-tab"; }
|
2024-06-25 09:19:28 +00:00
|
|
|
{ name = "olets/zsh-abbr"; }
|
2023-11-06 23:48:09 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-06-09 19:51:23 +00:00
|
|
|
|
2024-06-30 13:22:55 +00:00
|
|
|
home.file.".config/zsh-abbr/user-abbreviations".text = builtins.readFile ./zsh/abbreviations.zsh;
|
2023-11-06 23:48:09 +00:00
|
|
|
}
|