-
Notifications
You must be signed in to change notification settings - Fork 133
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 Suggestion: fzf-tmux support #225
Comments
Ty @sirupsen, I didn’t know about
You’re correct, the way it’s designed the main window and the builtin preview window are both using I understand where you’re coming from though, the way I deal with needing more real estate is this:
Hopefully this helps! |
Thanks for your answer 🙏🏻 Appreciate your suggestions! I didn't know you could toggle fzf-lua full-screen, that's cool! I will give it a shot, but suspect it's not quite enough for me on a 13" and with how much I use tmux splits, but maybe... Thanks for your consideration though, I'll close this as it's essentially a re-architecture for a feature you wouldn't use yourself, as I suspected. 👍🏻 |
FYI, you're not on an island. fzf-tmux is the center of my workflow as well, which is why I'm having to stick with fzf.vim. I keep running into this issue with plugins supporting nvim popups, but not tmux popups, yet I refuse to give up tmux popups. Ideally, it would be wonderful if there were a way to integrate vim popups with tmux popups; some kind of adapter. If I knew more about the internals of nvim itself, I might persue such a thing; but that's too lofty a goal for me as it stands. Anyway; cheers to tmux popups... |
@cpakkala, out of curiosity, how does |
Instead of calling 'fzf', it calls 'fzf-tmux' ( https://github.com/junegunn/fzf/blob/master/bin/fzf-tmux ), which is just a wrapper that spawns the real fzf inside a new tmux popup pane. Obviously, this wouldn't support the vim window settings, but it makes my environment consistent whether in vim, zsh, or any other app that uses fzf-tmux. I'm not averse to using tmux zoom; I use it all the time; however, having to zoom every single time I want to use an FZF-related binding (especially for zsh completions, etc.) gets old REAL fast. Tmux popups are indeed a godsend. |
@sirupsen, @cpakkala, a bit late but you if you're still interested this was just completed, I can't commit it yet as I'm behind a firewall which won't let me SSH auth so probably in a few hours: To use: require("fzf-lua").setup({
fzf_bin = "fzf-tmux",
-- make sure to set fzf-tmux specific flags (otherwise 80%:80% default is used)
fzf_tmux_opts = {
-- use tmux popup 80% width, 80% height (requires tmux >= 3.2)
["-p"] = "80%,80%",
}
-- You probably also want to change the default previewer as only native
-- fzf previewers can work (obviously neovim windows are not possible)
winopts = {
preview = {
default = "bat"
}
}
}) |
Btw, another great option for fullscreen over tmux which I personally use to review The above has the benefit of not being limited to native fzf previewers only, below is the code I use which automatically toggles fullscreen when exiting the function as well: |
Added in 6369ae3, note that I edited the comment above, |
@ibhagwan Thank you for achieving this feature! It's really valuable because Btw, I just encountered a problem: I don't know how to make the popup has a solid-color background... (This is probably not a problem of fzf-lua since it's a tmux split. But it will be great if it is possible to send some commands/options from Neovim to specify the background color just for the tmux popup?) |
You don’t necessarily need to change the tmux popup color, you can use |
Awesome; thank you very much ibhagwan. I will be adding back migration to fzf-lua to my todo list. For those still considering the various "finder" projects (fzf-lua, telescope,etc.), I believe that the reason that they have become so popular is that they provide a CONSISTENT interface for all your query-type interactions with vim/nvim. Well, with fzf-tmux, you extend that consistency to your shell (zsh highly recommended with fzf) and everything else that you do in tmux, which for me, is everything besides web-browsing (and that could be done there as well, if I really wanted). It's like having one interface for my entire operating system, and that is the feature I value the most in all of my computing experience. |
Ty @cpakkala, FYI, some previewers don’t have a “native” equivalent, Lmk if you find other providers where a native previewer is missing and would be desirable and I’ll do my best to add it. |
@ibhagwan Works :)! update: I just resolved the little question by look-up the manual 🫣: fzf_colors = {
['bg'] = { 'bg', 'Normal' },
['border'] = { 'fg', 'FloatBorder' },
},
fzf_opts = {
['--border'] = 'bold',
}, I just noticed a little problem regarding the background color of fzf: there is a blink of transparent background during the toggling/opening of tmux fzf popup: tmux-fzf-popup-blink.mov |
After engaging in junegunn/fzf#3162, I learned
:lua require("fzf-lua").files({ fzf_opts = { ["--border"] = "rounded" } }) Border options are (from
If you wish to color it differently you can use: :lua require("fzf-lua").files({fzf_bin="fzf-tmux",fzf_opts={["--border"]="rounded"},fzf_colors={["border"
]={"fg","Normal"}}}) Full require("fzf-lua").setup({
fzf_bin = "fzf-tmux",
fzf_opts = {
["--border"] = "sharp",
["--no-separator"] = "",
},
fzf_colors = {
["bg"] = { "bg", "Normal" },
["fg"] = { "fg", "Normal" },
["border"] = { "fg", "Normal" },
},
fzf_tmux_opts = { ["-p"] = "80%,90%" },
winopts = { preview = { default = "bat" } },
manpages = { previewer = "man_native" },
helptags = { previewer = "help_native" },
tags = { previewer = "bat_async" },
btags = { previewer = "bat_async" },
}) |
That's the tmux popup background color appearing right before fzf's tmux setw -g popup-style bg=colour2 # terminal green
tmux setw -g popup-style bg=#000000 # RGB black If you wish to avoid the flash find out the exact RGB color of your neovim colorscheme's
|
@ibhagwan I have no problem now! Really love the result! Wish you have a nice day! fzf-lua-tmux-popup-perfect.mov |
Thank you so much for writing fzf-lua! It's a fantastic library, and I've started adopting it in a few places as I move my config further towards the Nvim/Lua ecosystem. 🙏🏻
A blocker for me personally is that I've gotten addicted to using
fzf-tmux
withfzf.vim
😬It's a separate binary that causes
fzf
to usetmux popup
to create a floating window overlaying all panes (if you runfzf-tmux
in your terminal, you'll see it). Here it inside Vim, configured infzf.vim
:Versus
fzf-lua
:This is absolute gold to take advantage of all your
tmux
real-estate, especially if you're using side-panels like I always do... For big repositories (i.e. long file paths, fully resolved ctags, large module hierarchies for LSP symbols) with previews, I need this with my setup because I don't full-screennvim
.I know the way you've engineered
fzf-lua
, you're creating a floating window inside nvim to style, then puttingfzf
into it... which wouldn't work with this design. Secretly I'm hoping you might see the value infzf-tmux
for yourself and consider adding it 🙈 🙃Either way, might serve as an issue to collect other people who might be interested (or maybe I'm on an island, it's not a very documented feature of
fzf
... so usage might be low. But it's so good).The text was updated successfully, but these errors were encountered: