mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
zsh: vanilla
This commit is contained in:
parent
dfcbd50294
commit
97be9c3dbf
2 changed files with 68 additions and 19 deletions
|
|
@ -5,6 +5,4 @@
|
||||||
defaultTerminalRunner = "alacritty";
|
defaultTerminalRunner = "alacritty";
|
||||||
iconTheme = "Papirus";
|
iconTheme = "Papirus";
|
||||||
};
|
};
|
||||||
currentHost = {
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,20 @@ in {
|
||||||
historySubstringSearch.enable = true;
|
historySubstringSearch.enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
dotDir = "${config.xdg.configHome}/zsh";
|
dotDir = "${config.xdg.configHome}/zsh";
|
||||||
shellAliases = aliases;
|
# shellAliases = aliases;
|
||||||
defaultKeymap = "emacs";
|
defaultKeymap = "emacs";
|
||||||
|
zsh-abbr = {
|
||||||
|
enable = true;
|
||||||
|
abbreviations = aliases;
|
||||||
|
};
|
||||||
syntaxHighlighting = {
|
syntaxHighlighting = {
|
||||||
enable = true;
|
enable = true;
|
||||||
patterns = {
|
patterns = {
|
||||||
"rm -rf *" = "fg=blue,bold,bg=red";
|
"rm -rf *" = "fg=blue,bold,bg=red";
|
||||||
};
|
};
|
||||||
|
styles = {
|
||||||
|
path = "fg=cyan";
|
||||||
|
};
|
||||||
highlighters = [
|
highlighters = [
|
||||||
"main"
|
"main"
|
||||||
"pattern"
|
"pattern"
|
||||||
|
|
@ -31,23 +38,67 @@ in {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
initContent = ''
|
initContent = ''
|
||||||
# # Emacs Hybrid
|
# Options
|
||||||
# bindkey '^A' beginning-of-line
|
# ==========
|
||||||
# bindkey '^E' end-of-line
|
|
||||||
# bindkey '^F' forward-char
|
|
||||||
# bindkey '^B' backward-char
|
|
||||||
# bindkey '^P' up-line-or-history
|
|
||||||
# bindkey '^N' down-line-or-history
|
|
||||||
# # bindkey '^R' history-incremental-search-backward # Use fzf
|
|
||||||
# bindkey '^K' kill-line
|
|
||||||
#
|
|
||||||
# bindkey -M viins '^?' backward-delete-char
|
|
||||||
# bindkey -M viins '^H' backward-kill-word
|
|
||||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 'r:|=*'
|
|
||||||
|
|
||||||
# fzf-tab 模糊匹配
|
# ! This breaks the nixos-rebuild --flake .#something
|
||||||
zstyle ':fzf-tab:*' use-fzf-default-bindings yes
|
# setopt INTERACTIVE_COMMENTS # Allow comments in interactive mode
|
||||||
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
|
||||||
|
# Globbing
|
||||||
|
setopt EXTENDED_GLOB # Extended globbing
|
||||||
|
setopt GLOB_DOTS # Include dotfiles in globbing
|
||||||
|
|
||||||
|
# Error correction
|
||||||
|
setopt CORRECT # Suggest corrections for commands
|
||||||
|
setopt CORRECT_ALL # Suggest corrections for arguments
|
||||||
|
|
||||||
|
# edit command line
|
||||||
|
autoload -Uz edit-command-line
|
||||||
|
zle -N edit-command-line
|
||||||
|
|
||||||
|
### completion
|
||||||
|
### =================
|
||||||
|
|
||||||
|
# use tab to select
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
|
||||||
|
# substring matching
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||||
|
|
||||||
|
# use cache
|
||||||
|
zstyle ':completion:*' use-cache on
|
||||||
|
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache"
|
||||||
|
|
||||||
|
# Colours in completion
|
||||||
|
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
|
||||||
|
|
||||||
|
# Complete . and .. special directories
|
||||||
|
zstyle ':completion:*' special-dirs true
|
||||||
|
|
||||||
|
# Key bindings (Emacs with modern enhancement)
|
||||||
|
# ===============================================
|
||||||
|
|
||||||
|
bindkey '^H' backward-kill-word # Ctrl-Backspace
|
||||||
|
bindkey '^[^?' backward-kill-line # Alt-Backspace
|
||||||
|
|
||||||
|
bindkey '^[[1;5D' backward-word # Ctrl-Left
|
||||||
|
bindkey '^[[1;5C' forward-word # Ctrl-Right
|
||||||
|
|
||||||
|
bindkey '^[[1;3D' beginning-of-line # Alt-Left
|
||||||
|
bindkey '^[[1;3C' end-of-line # Alt-Right
|
||||||
|
|
||||||
|
|
||||||
|
bindkey '^[[H' beginning-of-line # Home
|
||||||
|
bindkey '^[[F' end-of-line # End
|
||||||
|
|
||||||
|
|
||||||
|
bindkey '^[[3~' delete-char # Delete
|
||||||
|
bindkey '^[[3;5~' kill-word # Ctrl-Delete
|
||||||
|
bindkey '^[[3;3~' kill-line # Alt-Delete
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
# ========
|
||||||
|
# source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue