Skip to content

Latest commit

 

History

History
123 lines (114 loc) · 5.81 KB

changelog.md

File metadata and controls

123 lines (114 loc) · 5.81 KB

v4 => v5

  • The default fzf key bindings for Tab/Shift+Tab and Ctrl+R/Ctrl+S have been changed to Up/Down in default layout and Down/Up in reversed layout. It is recommended to remove the following lines from ~/.zshrc if you have them:

    # When fzf menu opens on TAB, another TAB moves the cursor down ('tab:down')
    # or accepts the selection and triggers another TAB-completion ('tab:repeat')?
    zstyle ':z4h:fzf-complete'    fzf-bindings     'tab:down'
    # When fzf menu opens on Alt+Down, TAB moves the cursor down ('tab:down')
    # or accepts the selection and triggers another Alt+Down ('tab:repeat')?
    zstyle ':z4h:cd-down'         fzf-bindings     'tab:down'
  • FreeBSD is no longer supported.

  • zstyle ':z4h:...' passthrough has been replaced with zstyle ':z4h:...' enable that has the opposite meaning. The default value is no. If your ~/.zshrc mentions passthrough, you need to change those styles. Here's how it looks in the default .zshrc now:

    # Enable ('yes') or disable ('no') automatic teleportation of z4h over
    # ssh when connecting to these hosts.
    zstyle ':z4h:ssh:example-hostname1'   enable 'yes'
    zstyle ':z4h:ssh:*.example-hostname2' enable 'no'
    # The default value if none of the overrides above match the hostname.
    zstyle ':z4h:ssh:*'                   enable 'no'
  • Function ssh has been moved from .zshrc to z4h proper. If your .zshrc defines it, you need to remove it.

  • When connecting over ssh to a host for which zstyle ':z4h:ssh:...' enable is set to 'no', TERM value of tmux-256color gets replaced with screen-256color. This can be customized with zstyle ':z4h:ssh:...' term.

  • New option to disable preview in z4h-fzf-history:

    zstyle :z4h:fzf-history fzf-preview no
  • iTerm2 integration can no longer be enabled by sourcing ~/.iterm2_shell_integration.zsh. Instead, you need to put this line in ~/.zshrc:

    zstyle ':z4h:' iterm2-integration 'yes'
  • The following bindings have been changed:

    • Ctrl+P/Up: z4h-up-local-history => z4h-up-substring-local
    • Ctrl+N/Down: z4h-down-local-history => z4h-down-substring-local
  • The following widgets have been renamed:

    • z4h-up-local-history => z4h-up-prefix-local
    • z4h-down-local-history => z4h-down-prefix-local
    • z4h-up-global-history => z4h-up-prefix-global
    • z4h-down-global-history => z4h-down-prefix-global
  • It's now possible to automatically start tmux when zsh4humans is initializing.

    zstyle :z4h: start-tmux [arg]...

    Where [arg]... is either integrated (the default), no, command <cmd> [flag]..., or system. The latter is equivalent to command tmux -u.

  • Widgets the perform recursive directory traversal (z4h-cd-down and z4h-fzf-complete) now use bfs instead of find if it's installed. You can get the original behavior with the following declaration:

    zstyle ':z4h:(cd-down|fzf-complete)' find-command command find

    You can also use a custom function in place of command find if you want to transform command line arguments.

  • z4h-fzf-history (Ctrl+R) now uses BUFFER instead of LBUFFER for the initial query. This makes a difference only when the widget is invoked when the cursor is not at the very end of the command line.

  • All z4h-kill-* and z4h-backward-kill-* widgets now add the killed region to the kill ring.

  • z4h install now allows specifying the branch explicitly: z4h install user/repo@branch.

  • If brew is installed, zsh4humans now automatically installs homebrew/command-not-found.

  • command_not_found_handler now uses homebrew/command-not-found if it's available.

  • Auto-update is now disabled by default. It is recommended to use z4h update to update manually.

  • Recursive file completions can now be disabled:

    zstyle ':z4h:fzf-complete' recurse-dirs 'no'
  • It's now possible to contract prompt on Ctrl+D when using Transient Prompt.

    z4h bindkey z4h-eof Ctrl+D
    setopt ignore_eof
  • There is now builtin integration with direnv. It is much faster than the stock one and works well with all z4h features. Specifically:

    • If there is .envrc in the current or ancestor directory when starting zsh, it gets ingested before instant prompt.
    • Messages from direnv are displayed not only if you execute cd foo but also when you change the current directory with one of the specialized z4h widgets (z4h-cd-up, z4h-cd-back, etc.).
    • "Loading" and "unloading" notifications from direnv can be suppressed.

    Note that powerlevel10k has a prompt segment for direnv. It shows an icon if some .envrc has been loaded and not yet unloaded. If you are using direnv, you'll probably want to use this segment. If the icon is enough, consider suppressing "loading" and "unloading" notifications from direnv.

    Enable direnv integration:

    zstyle ':z4h:direnv' enable 'yes'

    Disable "loading" and "unloading" notifications from direnv:

    zstyle ':z4h:direnv:success' notify 'no'

    If you enable direnv integration in this way, the stock integration won't do anything useful. zsh4humans will dismantle it as soon as it sees it. It's highly recommended to remove stock integration calls from your zshrc to avoid wasting time on zsh startup and tripping over direnv quirks. The stock integration calls usually look like this:

    eval "$(direnv export zsh)"
    eval "$(direnv hook zsh)"

    Or perhaps like this:

    emulate zsh -c "$(direnv export zsh)"
    emulate zsh -c "$(direnv hook zsh)"
  • New zle widget: z4h-quote-prev-zword.