Skip to content
Snippets Groups Projects
  • Daniel Hahler's avatar
    38a2076b
    zsh: pass through exit code from widgets · 38a2076b
    Daniel Hahler authored
    This allows to have a custom widget like the following, which would
    additionally accept the line, but only in case of entries being
    selected:
    
        fzf-file-widget-with-accept() {
          zle fzf-file-widget
          if [[ "$?" == 0 ]] && (( $#BUFFER )); then
            zle accept-line
          fi
        }
        zle     -N   fzf-file-widget-with-accept
        bindkey '\e^T' fzf-file-widget-with-accept
    
    With this `<C-a>t` will launch fzf, and simulate the pressing of "Enter"
    afterwards.
    38a2076b
    History
    zsh: pass through exit code from widgets
    Daniel Hahler authored
    This allows to have a custom widget like the following, which would
    additionally accept the line, but only in case of entries being
    selected:
    
        fzf-file-widget-with-accept() {
          zle fzf-file-widget
          if [[ "$?" == 0 ]] && (( $#BUFFER )); then
            zle accept-line
          fi
        }
        zle     -N   fzf-file-widget-with-accept
        bindkey '\e^T' fzf-file-widget-with-accept
    
    With this `<C-a>t` will launch fzf, and simulate the pressing of "Enter"
    afterwards.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.