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

Feature: could we make the help window configurable? #1638

Closed
1 task done
Bekaboo opened this issue Dec 24, 2024 · 3 comments
Closed
1 task done

Feature: could we make the help window configurable? #1638

Bekaboo opened this issue Dec 24, 2024 · 3 comments
Labels
feature request New feature

Comments

@Bekaboo
Copy link
Contributor

Bekaboo commented Dec 24, 2024

Have you RTFM'd?

  • I have done proper research

Feature Request

Currently, the help window is hard-coded to open at the bottom of the screen, which can overlap with the fzf window when using split layout:

Before opening help:
image

After opening help:
image

If putting at top with border = "single":

image

Could we expose an option help_winopts that accepts a table as the parameter passed to vim.api.nvim_open_win() so user can customize the border and position of the help window? I am glad to submit a PR for it.

@Bekaboo Bekaboo added the feature request New feature label Dec 24, 2024
@ibhagwan
Copy link
Owner

Could we expose an option help_winopts that accepts a table as the parameter passed to vim.api.nvim_open_win() so user can customize the border and position of the help window? I am glad to submit a PR for it.

Im thinking maybe it’s better to supply a help_open_win opt, the option will be a function responsible for opening a new window, you can then set whatever options you want in nvim_open_win or even open in a top split using vim.cmd(…)?

This would also simplify the config (one single opt) as I don’t foresee too many users customizing the help window.

@Bekaboo
Copy link
Contributor Author

Bekaboo commented Dec 25, 2024

Im thinking maybe it’s better to supply a help_open_win opt, the option will be a function responsible for opening a new window, you can then set whatever options you want in nvim_open_win or even open in a top split using vim.cmd(…)?

Sounds great, thanks!

@ibhagwan
Copy link
Owner

24dff52

Added my changes on top of your commit, made the option picker local so you can now do this per call (because why not):

require("fzf-lua").files({
  help_open_win = function(buf, enter, opts)
    opts.border = 'single'
    opts.row = 0
    opts.col = 0
    return vim.api.nvim_open_win(buf, enter, opts)
  end,
})

Note that I moved your changes from fzf-lua-opts.txtto OPTIONS.md as that's the original source of the options, the file is then auto-generated with ts-vimdoc.nvim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants