Skip to content
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

[vim] Let users decide to use --height instead of terminal buffer #2723

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

Conversation

liskin
Copy link
Contributor

@liskin liskin commented Feb 3, 2022

Commit 85ae745 forced the use of terminal buffers whenever they're
available to improve consistency and avoid confusion. This, however, has
drawbacks:

This commit adds g:fzf_prefer_height to optionally restore the old behaviour.

Commit 85ae745 forced the use of terminal buffers whenever they're
available to improve consistency and avoid confusion. This, however, has
drawbacks:

* Using a terminal buffer is slightly slower (not noticeable to most
  people but visible to me).

* It breaks certain features of fzf.vim, requiring workarounds like
  junegunn/fzf.vim#1363. And, unfortunately, it
  also breaks junegunn/fzf.vim#1196 (a fix for
  :Snippets in insert-mode which relies on `<Cmd>` and the cursor
  staying behind the end-of-line) which I have no workaround for yet.

This commit adds `g:fzf_prefer_height` to optionally restore the old
behaviour.
liskin added a commit to liskin/dotfiles that referenced this pull request Feb 7, 2022
@junegunn
Copy link
Owner

I'm okay with having this option if we keep it undocumented as we may decide to remove it in the future.

Using a terminal buffer is slightly slower

Indeed. It is especially so on the popup window. I'm currently using regular Vim, but IIRC, the rendering of the terminal buffer on Neovim was slightly better.

By the way, if you use tmux, I recommend that you set up tmux layout as it's more responsive and flexible. I like tmux popup as it can display across multiple tmux split panes.

if exists('$TMUX')
  " Using tmux pop-up window
  let g:fzf_layout = { 'tmux': '-p90%,60%' }

  " Or tmux split pane below the current pane
  " let g:fzf_layout = { 'tmux': '-d40%' }
else
  let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
endif

a fix for :Snippets in insert-mode

I don't use UltiSnips anymore so I'm not super motivated in fixing the command, but I'm well aware it has some issues. I'll see if I can improve it when I get some time.

@liskin
Copy link
Contributor Author

liskin commented Feb 11, 2022

Indeed. It is especially so on the popup window. I'm currently using regular Vim, but IIRC, the rendering of the terminal buffer on Neovim was slightly better.

Yeah, I'm on regular vim too still.

By the way, if you use tmux, I recommend that you set up tmux layout as it's more responsive and flexible. I like tmux popup as it can display across multiple tmux split panes.

I use it less often than many tmux users do (with a tiling WM I often don't need it), but I'll try your config snippet as it appears to be fast and less visually disruptive than --height. I still need stuff to work outside of tmux, though. :-/

I don't use UltiSnips anymore so I'm not super motivated in fixing the command, but I'm well aware it has some issues. I'll see if I can improve it when I get some time.

I'm okay with running my own branch but if you ever get to it, I'll be happy to test whatever you come up with or chat/brainstorm or whatever. :-)


Thanks!

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.

None yet

2 participants