Skip to content

Commit

Permalink
Work around performance issue with Nix prezto
Browse files Browse the repository at this point in the history
nix-community/home-manager#2255
It's still unclear why this helps but it does:
Setting `programs.zsh.prezto.caseSensitive = True` is the key, see issue
description for more context.
  • Loading branch information
axeltlarsson committed Aug 8, 2021
1 parent 45f7c78 commit 5c8ac77
Showing 1 changed file with 4 additions and 34 deletions.
38 changes: 4 additions & 34 deletions config/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@

programs.zsh = {
enable = true;
initExtraFirst = "";

envExtra = ''
# TODO: autolaod
function zet {
nvim "+Zet $*"
}
# TODO: why this required?
if [ -e ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh ]; then
. ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh;
fi
Expand All @@ -74,6 +74,8 @@
enable = true;
editor.keymap = "vi";
prompt.theme = "pure";
# ensures performant shell https://github.com/nix-community/home-manager/issues/2255
caseSensitive = true;

pmodules = [
"environment"
Expand All @@ -88,39 +90,7 @@
"history-substring-search"
"prompt"
"tmux"
"fzf-tab"
];
pmoduleDirs = [ ../zprezto-modules ];
extraConfig = ''
# fzf-tab https://github.com/Aloxaf/fzf-tab
# zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
# disable sort when completing `git checkout`
# set descriptions format to enable group support
zstyle ':completion:*:descriptions' format '[%d]'
# set list-colors to enable filename colorizing
#zstyle ':completion:*' list-colors \$\{("s.:.")LS_COLORS\}
# preview directory's content with exa when completing cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
zstyle ':fzf-tab:complete:cd:*' popup-pad 30 0
# switch group using `,` and `.`
# TODO: not all of this works as expected
zstyle ':fzf-tab:*' switch-group ',' '.'
zstyle ':fzf-tab:complete:git-(add|diff|restore):*' fzf-preview \
'git diff $word | delta'|
zstyle ':fzf-tab:complete:git-log:*' fzf-preview \
'git log --color=always $word'
zstyle ':fzf-tab:complete:git-show:*' fzf-preview \
'case "$group" in
"commit tag") git show --color=always $word ;;
*) git show --color=always $word | delta ;;
esac'
zstyle ':fzf-tab:complete:git-checkout:*' fzf-preview \
'case "$group" in
"modified file") git diff $word | delta ;;
"recent commit object name") git show --color=always $word | delta ;;
*) git log --color=always $word ;;
esac'
'';

tmux.autoStartLocal = true;
tmux.defaultSessionName = "local";
Expand Down

0 comments on commit 5c8ac77

Please sign in to comment.