Update zsh configuration

This commit is contained in:
Oliver Davies 2024-12-23 18:05:40 +00:00
parent 2dad0a487d
commit be93343023
2 changed files with 2 additions and 60 deletions

View file

@ -223,9 +223,6 @@
programs.dconf.enable = true; programs.dconf.enable = true;
programs.zsh.enable = true;
programs.zsh.histSize = 5000;
users.defaultUserShell = "/etc/profiles/per-user/${username}/bin/zsh"; users.defaultUserShell = "/etc/profiles/per-user/${username}/bin/zsh";
zramSwap.enable = true; zramSwap.enable = true;

View file

@ -2,11 +2,12 @@
{ {
programs.zsh = { programs.zsh = {
dotDir = ".config/zsh";
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
enableSyntaxHighlighting = true;
cdpath = [ "~/Code" ]; cdpath = [ "~/Code" ];
dotDir = ".config/zsh";
shellAliases = (import ./zsh/aliases.nix); shellAliases = (import ./zsh/aliases.nix);
@ -22,12 +23,6 @@
alias -s {pdf,PDF}="background okular" alias -s {pdf,PDF}="background okular"
alias -s {zip,ZIP}="unzip -l" alias -s {zip,ZIP}="unzip -l"
background() {
for ((i=2;i<=$#;i++)); do
''${@[1]} ''${@[$i]} &> /dev/null &
done
}
git() { git() {
if [[ "''${1}" == "root" ]]; then if [[ "''${1}" == "root" ]]; then
shift shift
@ -52,46 +47,9 @@
command yt-dlp --paths ~/Videos "$@" command yt-dlp --paths ~/Videos "$@"
} }
# Case insensitive autocompletion.
zstyle ":completion:*" matcher-list "" "m:{a-zA-Z}={A-Za-z}" "r:|=*" "l:|=* r:|=*"
autoload -Uz compinit && compinit
bindkey -s ^f "tmux-sessionizer\n" bindkey -s ^f "tmux-sessionizer\n"
bindkey -s ^v "nvim\n" bindkey -s ^v "nvim\n"
clear-ls-all() {
clear
ls -al
zle reset-prompt
}
zle -N clear-ls-all
clear-git-status() {
clear
git status
zle reset-prompt
}
zle -N clear-git-status
clear-tree-2() {
clear
tree -L 2
zle reset-prompt
}
zle -N clear-tree-2
clear-tree-3() {
clear
tree -L 3
zle reset-prompt
}
zle -N clear-tree-3
bindkey '^G' clear-git-status
# bindkey '^H' clear-tree-3
# bindkey '^J' clear-tree-2
# bindkey '^K' clear-ls-all
setopt auto_cd setopt auto_cd
setopt auto_pushd setopt auto_pushd
setopt pushd_ignore_dups setopt pushd_ignore_dups
@ -102,21 +60,8 @@
enable = true; enable = true;
plugins = [ plugins = [
{
name = "plugin/git";
tags = [ "from:oh-my-zsh" ];
}
{
name = "plugin/vi-mode";
tags = [ "from:oh-my-zsh" ];
}
{ name = "Aloxaf/fzf-tab"; } { name = "Aloxaf/fzf-tab"; }
{ name = "olets/zsh-abbr"; } { name = "olets/zsh-abbr"; }
{ name = "zsh-users/zsh-completions"; }
{ name = "zsh-users/zsh-syntax-highlighting"; }
]; ];
}; };
}; };