Skip to content

How do I mix --select-1 and become(vim{})? #3803

Answered by junegunn
elazar125 asked this question in Q&A
Discussion options

You must be logged in to vote

one and unbind strategy works just fine.

find_file_and_edit() {
  fzf \
      --sync \
      --multi \
      --query "$*" \
      --bind 'change:unbind(one),enter:become("$EDITOR" {+}),one:become("$EDITOR" {})' \
      --preview 'bat --color=always {}'
}

Your command has some errors.

  • You should remove --select-1 since you're relying on the event binding mechanism within the finder
  • You should use result event instead of load event because you're interested in the "result" for your initial --query.
    • Loading and matching runs asynchronously in parallel, so load event doesn't guarantee that you have the result for your query
  • Use FZF_MATCH_COUNT instead of FZF_TOTAL_COUNT to see the number…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@LangLangBart
Comment options

@elazar125
Comment options

@elazar125
Comment options

@junegunn
Comment options

Answer selected by elazar125
@elazar125
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants