2024-03-24 23:39:49 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
2024-05-08 05:20:11 +02:00
|
|
|
lib,
|
2024-03-24 23:39:49 +01:00
|
|
|
...
|
|
|
|
}: {
|
|
|
|
programs.starship.enableZshIntegration = true;
|
|
|
|
programs.fzf.enableZshIntegration = true;
|
|
|
|
programs.zoxide.enableZshIntegration = true;
|
|
|
|
programs.yazi.enableZshIntegration = true;
|
2024-03-25 01:41:56 +01:00
|
|
|
programs.direnv.enableZshIntegration = true;
|
2024-03-25 04:09:58 +01:00
|
|
|
programs.kitty.shellIntegration.enableZshIntegration = true;
|
2024-03-31 01:43:52 +01:00
|
|
|
services.gpg-agent.enableZshIntegration = true;
|
2024-04-10 01:20:05 +02:00
|
|
|
programs.carapace.enableZshIntegration = false;
|
2024-03-24 23:39:49 +01:00
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
2024-05-08 05:20:11 +02:00
|
|
|
initExtra = lib.mkMerge [
|
|
|
|
''
|
|
|
|
#have the menu highlight while we cycle through options
|
|
|
|
zstyle ':completion:*' menu select
|
|
|
|
#case insensitive completion
|
|
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
|
|
|
#allow completion from midword
|
|
|
|
setopt COMPLETE_IN_WORD
|
|
|
|
#move cursor to end of word after completing
|
|
|
|
setopt ALWAYS_TO_END
|
|
|
|
#complete aliases as well
|
|
|
|
setopt COMPLETE_ALIASES
|
|
|
|
#select first item when you press tab the first time.
|
|
|
|
setopt MENU_COMPLETE
|
2024-05-15 18:32:19 +02:00
|
|
|
#case insensitive globbing
|
|
|
|
setopt NO_CASE_GLOB
|
|
|
|
#sort globs that expand to numbers by number rather than alphabeticly
|
|
|
|
setopt NUMERIC_GLOB_SORT
|
|
|
|
#allows for some neat globbing.
|
|
|
|
setopt EXTENDED_GLOB
|
|
|
|
#allow backspacing beyond the point you entered insert mode:
|
|
|
|
bindkey -v '^?' backward-delete-char
|
|
|
|
bindkey "^W" backward-kill-word
|
2024-05-08 05:20:11 +02:00
|
|
|
''
|
2024-05-09 20:11:22 +02:00
|
|
|
(lib.mkIf (!config.programs.starship.enable) ''
|
2024-05-08 05:20:11 +02:00
|
|
|
autoload -U promptinit
|
|
|
|
promptinit
|
|
|
|
autoload -U colors
|
|
|
|
colors
|
2024-04-10 01:20:05 +02:00
|
|
|
|
2024-05-08 05:20:11 +02:00
|
|
|
#stuff to show git things.
|
|
|
|
autoload -Uz vcs_info
|
|
|
|
setopt prompt_subst
|
|
|
|
precmd_vcs() {vcs_info}
|
|
|
|
#when not in a repo, show full path to current directory. when in one, show path from base direcory of the repo.
|
|
|
|
zstyle ':vcs_info:*' nvcsformats '%~'
|
|
|
|
zstyle ':vcs_info:*' formats '%r/%S %F{green}[%b]%f'
|
|
|
|
zstyle ':vcs_info:*' actionformats '%r/%S %F{green}[%b] %F{red}<%a>%f'
|
|
|
|
|
|
|
|
#the precmd function, called just before printing the prompt.
|
|
|
|
function precmd() {
|
|
|
|
precmd_vcs
|
|
|
|
}
|
|
|
|
|
|
|
|
#Make the right prompt blank, just to be sure.
|
|
|
|
RPROMPT=""
|
|
|
|
|
|
|
|
#on the top line, show a whole bunch of info. botton line should be as minimal as possilbe (just a single char to input next to...)
|
|
|
|
PROMPT=$'%F{cyan}[%n@%m]%f%F{red}├────┤%f$${vcs_info_msg_0_} %F{white}[%D %T]%f\n»'
|
|
|
|
'')
|
|
|
|
];
|
2024-03-24 23:39:49 +01:00
|
|
|
autocd = true;
|
2024-05-15 18:32:19 +02:00
|
|
|
autosuggestion.enable = true;
|
|
|
|
defaultKeymap = "viins";
|
2024-03-24 23:39:49 +01:00
|
|
|
history = {
|
|
|
|
ignoreAllDups = true;
|
|
|
|
extended = true;
|
|
|
|
};
|
|
|
|
shellAliases = {
|
|
|
|
ll = "ls -lh";
|
2024-05-14 12:17:52 +02:00
|
|
|
la = "ls -lha";
|
2024-03-24 23:39:49 +01:00
|
|
|
please = "sudo $(fc -ln -1)";
|
|
|
|
pyactivate = "source ./.venv/bin/activate";
|
|
|
|
};
|
|
|
|
syntaxHighlighting = {
|
|
|
|
enable = true;
|
|
|
|
highlighters = [
|
|
|
|
"main"
|
|
|
|
"brackets"
|
|
|
|
"pattern"
|
|
|
|
"regexp"
|
|
|
|
"root"
|
|
|
|
"line"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|