-
-
Notifications
You must be signed in to change notification settings - Fork 45
Support show on winbar #99
Comments
You can simply configure For example: _G.gps_location = function()
local gps = require "nvim-gps"
return gps.is_available() and gps.get_location() or ""
end
vim.opt.winbar = "%{%v:lua.gps_location()%}" Or via your favorite statusline/tabline plugin. |
@wookayin Thanks for the code. However, |
@rockyzhang24 No, that's not correct and the above code works as you'd expect. Did you try them out? |
@wookayin Yes, I know it works as expected and no bugs for Confirmed that this is a bug of the newly added So far, until this _G.gps_location = function()
local gps = require "nvim-gps"
return gps.is_available() and gps.get_location() or ""
end
vim.opt.winbar = "%{%v:lua.gps_location()%}"
vim.api.nvim_create_autocmd ("CursorMoved", {
pattern = '*',
command = "set winbar=%{%v:lua.gps_location()%}",
}) |
@leaxoy Use my code above and it works well currently. Because winbar won't be updated when you move your cursor (it's a bug and the PR solving it will be merged soon), thus you need the autocmd to refresh it. When that mentioned issue gets fixed, you can remove the autocmd part. |
@rockyzhang24 This causes Telescope to turn from looking like the first image to the second. Other than that, it works really great! |
@emuel-vassallo Using the autocmd is just a temporary workaround to solve the winbar update issue I mentioned above and it causes this telescope side effect. Waiting for the fix (neovim/neovim#18646) to be merged, and then the autocmd will not be needed. |
@emuel-vassallo Try to change the autocmd event to |
@rockyzhang24 That works, thank you! |
Will add instructions in README on how to setup in winbar 👍🏽 |
@SmiteshP Great! You can wait until that PR fixing the update bug gets merged. |
it's merged |
Great. Then adding gps to winbar is the same with adding it to statusline. It's very handy. And this issue can be closed now. |
This comment was marked as off-topic.
This comment was marked as off-topic.
perhaps open a new issue for that @nghialm269 |
neovim/neovim#17336 winbar ui has been merged into nightly, it's general to show the gps component, there is vscode example:
and neovim example:
The text was updated successfully, but these errors were encountered: