junegunn / junegunn/fzf.vim

incorrect statusline if FZF is run in autocmd

Open
#638 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
10.3k
Forks
608
Avg merge
5d 8h
Merged PRs (30d)
2

Description

- Category
- [ ] Question
- [ X] Bug
- [ X] Suggestion
- OS
- [ X] Linux
- [ X] macOS
- [ X] Windows
- [ ] Etc.
- Vim
- [ ] Vim - not reproducible
- [ X] Neovim

I want FZF (or actually FZFMru, but the symptoms are identical), to execute if I start nvim without any arguments.

To achieve this, I have the following in autocmd in my `init.vim` (don't run if there are any buffers, if the current buffer is named, or if the buffers have any lines (piped content))

au VimEnter * if (len(getbufinfo({'buflisted':1})) == 1 && empty(bufname('%')) && (line('$') < 2)) | silent exe ":FZF" | endif

I consider this fairly useful, so feel free to add it to under Usage if you are interested.

This results in the statusline showing the executed command:
`TERMINAL  +0 ~0 -0  term://.//39692:( /bin/bash '/tmp/nvimUr1CIg/3' )|'/home/username/.fzf/bin/fzf' '--multi' '--prompt' '~/s/somedir/' --expect=ctrl-v,ctrl-x,ctrl-t --no-height > /tmp/nvimUr1CIg/2;#FZF[-]`

This does not happen if I e.g manually type `:FZF`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.