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

Pick bufnr function, to allow selecting which split to open a selected file in #1036

Open
3 of 6 tasks
Leandros opened this issue Sep 15, 2023 · 2 comments
Open
3 of 6 tasks

Comments

@Leandros
Copy link

Leandros commented Sep 15, 2023

  • vim or neovim?
    • vim
    • neovim
  • Output of vim --version or nvim --version:
NVIM v0.9.2
Build type: Release
LuaJIT 2.1.1692716794

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
  • Output of :echo has("python"): 0
  • Output of :echo has("python3"): 1
  • Output of :py print(sys.version):
3.7.16 (default, Aug 30 2023, 20:37:53)
[GCC 7.3.1 20180712 (Red Hat 7.3.1-15)]
  • Output of :py3 print(sys.version):
3.7.16 (default, Aug 30 2023, 20:37:53)
[GCC 7.3.1 20180712 (Red Hat 7.3.1-15)]
  • Operating system:
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Configurations related to LeaderF in vimrc:

Describe your question, feature request, or bug.

LeaderF will always open the specified file in the least recently focused buffer (the buffer that you previously edited before triggering leaderf).

I would like to be able to select which buffer the file is opened in, similar to what I can achieve with nvim-tree and window-picker:
Screenshot 2023-09-15 at 11 58 33

The green bars below each split is telling me which key to press to open the file in this split.

As far as I understand, LeaderF would need to provide a "callback" that's called before opening the file. The pick() function from window-picker will return a bufnr in which the new file is opened.

@Leandros
Copy link
Author

There is also vim-choosewin: https://github.com/t9md/vim-choosewin

@Yggdroot
Copy link
Owner

Why not move the cursor to the destination window, then use LeaderF?

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

No branches or pull requests

2 participants