Closed YuFei29 closed 11 months ago
A solution using lua:
local w = [[width = math.ceil(vim.api.nvim_get_option("columns") * 0.8), ]]
local h = [[height = math.ceil(vim.api.nvim_get_option("lines") * 0.8), ]]
local r = [[col = math.ceil(vim.api.nvim_get_option("columns") * 0.1 - 1), ]]
local c = [[row = math.ceil(vim.api.nvim_get_option("lines") * 0.1 - 1), ]]
local floating_opts = [[relative = 'editor', style='minimal', border = "single"]]
vim.g.plug_window = [[lua vim.api.nvim_open_win(vim.api.nvim_create_buf(true, false), true, {]] ..
w .. h .. r .. c .. floating_opts .. "})"
vim.cmd("PlugUpdate")
--- reset to default vim-plug behavior after opening in new window
vim.fn.timer_start(5000, function()
vim.g.plug_window = [[vertical topleft new]]
end)
thanks for your reply, but I use vim. seems like your solution based on neovim. anyway, thank you
If I'm not mistaken, this is not possible due to the limitation of popup window of Vim. You can't put cursor on it.
Thank you for pointing that out. I think I may have been mistaken. I vaguely recall seeing vim-plug pinned in a floating window in vim, so I must have remembered incorrectly. I probably implemented that previously when I trying out neovim.
Hello, everyone. I wonder how can I open vim-plug buffer inside a popup window? I mean after
PlugInstall
I can get a popup window like thisI know there's a g:plug_window option, I searched vim help, seems like it only support normal window (vertical and horizontal). No functional enhancements, just aesthetic considerations, I want this.