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

feat(fzf.vim): Adding option g:fzf_fullscreen_layout #3504

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alps2006
Copy link

@alps2006 alps2006 commented Nov 6, 2023

The behavior of fzf Command! (fullscreen) has some differences between Vim and Neovim.

In Neovim, it create a new tab to cause some exceptions when using vimspector (but Vim does not).

puremourning/vimspector#771

This option g:fzf_fullscreen_layout can customize the fullscreen layout as you like. Below is an example:

    if has('nvim')
        let g:fzf_layout = { 'window': { 'width': 1, 'height': 0.4, 'relative': v:true, 'xoffset': 0, 'yoffset': 1 } }
        let g:fzf_fullscreen_layout = { 'window': { 'width': 1, 'height': 1, 'relative': v:false, 'xoffset': 0, 'yoffset': 1 } }
    else
        if exists('$TMUX')
            " See `fzf-tmux --help` for available options
            let g:fzf_layout = { 'tmux': '-p99%,40% -y 60%' }
            let g:fzf_fullscreen_layout = { 'tmux': '-p99%,96% -y 4%' }
        endif
    endif

@junegunn
Copy link
Owner

junegunn commented Nov 7, 2023

I have no experience with the plugin and I don't use Neovim, so I'm not sure what's going on, but I don't quite understand how opening a tab, which is a mundane operation, would cause a problem. Shouldn't it be addressed by the plugin?

@alps2006
Copy link
Author

alps2006 commented Nov 7, 2023

I think this option is very useful in some situations. Below is an operation in Neovim that create a new tab.

2023-11-07_11-05-07 (1)

@junegunn
Copy link
Owner

junegunn commented Nov 8, 2023

Your primary motivation for this new configuration variable is to work around the vimspector problem, so I insist that the original problem be fixed first. After that, we can discuss whether we really need a new variable here.

I have read through the discussion you linked above (puremourning/vimspector#771), and it doesn't sound like an unfixable problem. Do we have to rely on tab numbers? Can we set up a tab-local variable (t:something) on the relevant tab and loop through the existing tabs (range(1, tabpagenr('$')) to find the one with the variable using gettabvar()?

@alps2006
Copy link
Author

alps2006 commented Nov 8, 2023

Thanks for your advice. I will resolve the problem first.

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.

2 participants