Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Convert non-configurable Zsh defaults into configurable options #1399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NixChaos
Copy link

@NixChaos NixChaos commented Mar 24, 2025

This converts the following hard-coded options from /etc/zshrc into configurable options, but sets the previously hard-coded values as default.

SAVEHIST=2000
HISTSIZE=2000
HISTFILE=$HOME/.zsh_history

setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK

bindkey -e

The exception being that I changed the default HISTFILE path to "${ZDOTDIR:-$HOME}/.zsh_history" because that's what Apple sets by default. ${ZDOTDIR:-$HOME} indicates that it will look for ZDOTDIR, then revert to $HOME, if it doesn't find it.

The new configurable options are:
programs.zsh = {

  • defaultKeymap
  • history.ignoreDups
  • history.path
  • history.save
  • history.share
  • history.size
    };

Fixes #983.

Convert the forced (and undocumented?) Zsh defaults into options.
@NixChaos
Copy link
Author

Fixes #983.

@bew
Copy link
Contributor

bew commented Mar 24, 2025

Fixes #983.

NOTE: this line needs to be in the PR description (not in a separate comment) to be considered by Github as a command to auto-close the linked issue when this PR is merged.

@NixChaos
Copy link
Author

Fixes #983.

NOTE: this line needs to be in the PR description (not in a separate comment) to be considered by Github as a command to auto-close the linked issue when this PR is merged.

Thanks. I've updated it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why does generated /etc/zshrc hardcode HISTFILE?
2 participants