5 ms·
> nvim_open_win: create floating windows (and external, for supporting UIs) I've been running 0.4.0 since it came out for this feature. Also I recommend you c
by spraak 7y ago
> nvim_open_win: create floating windows (and external, for supporting UIs)
I've been running 0.4.0 since it came out for this feature.
Also I recommend you check out coc.vim for the best completer. It uses the same language server protocol that VS Code uses (and many of the plugins for coc.vim are forked fr VS Code plugins)
- shmerl 7y agoAre there any screenshots? What exactly is a "floating window"?
- justinmk 7y agoFloating windows: - Are real windows showing real buffers. No shortcuts, hacks, or compromises. - Can be (re)positioned, anchored, or "external" (if supported by the UI). - Support all features and API of normal windows, plus more. Screenshot showing floating window with 'winblend': https://twitter.com/Neovim/status/1145446583573594112 https://twitter.com/Neovim/status/1145446583573594112 Yes, that screenshot shows Nvim in a terminal. The 'winblend' feature works in all UIs, including the TUI (all terminals that support RGB colors).
- shmerl 7y agoI see, thanks!
- Sean1708 7y agoJust to make sure I understand correctly, that floating window is entirely within neovim (i.e. it isn't a separate window as far as your window manager is concerned)? And if that's correct, does this mean that it would work if you SSHed into a server?
- justinmk 7y agoyes and yes.
- maccam94 7y agoYes, neovim is compositing the windows inside the text UI in a terminal.
- PeCaN 7y agoThat's an extremely cool party trick but I'm also slightly concerned that neovim started to cut bloat in vim and ended up implementing a compositing window manager with fake transparency. Though the idea is just pretty damn cool in general so I can't get too grumpy about it.
- oblio 7y agoVim already had floating windows, why not make them cool/useful if they're there, anyway? :)
- maccam94 7y agoOn the bright side, this is actually a demonstration of the extensive work the neovim team has done cleaning up the UI layers. justinmk's comment above goes into more detail, but basically vim has gone from having a single array of characters that gets manipulated by every type of display item to windows with their own positioning and dimensions. In addition, these windows will be exposed via APIs that external GUIs can use.
- justinmk 7y agoReplying to PeCaN: > slightly concerned that neovim started to cut bloat in vim and ended up implementing a compositing window manager with fake transparency. "Window manager" existed since vim got split-windows (1990s). Redesigning it as a compositor: - isolates windows logically, so that UIs can do their own layout instead of being stuck with the TUI grid - useful for implementing floating windows - allows reasoning about layers instead of one grid driven by special-cases throughout the project - helps with features such as "click through", z-index, etc. The blending (fake transparency) was a small (~200 LoC) amount of code, added only for fun (and to ruffle feathers).
- 7y ago
- jez 7y agoHere’s an example of it used for populating some completion menus (like docs) on LSP completion in coc.vim: https://mobile.twitter.com/neovim/status/1101893773561348096?lang=en https://mobile.twitter.com/neovim/status/1101893773561348096...
- shmerl 7y agoI see, thanks!
- iKnowWhyIamHere 7y agoCan coc.vim be used for vim?
- howtofly 7y agoNow coc+ccls is the best vim plugin for C/C++. Though compared to Eclipse/CDT, several features still missed, e.g. step-by-step macro expansion.
- norcalli 7y agoAll completers will be able to utilize floating windows immediately, so it's not a special feature of coc.nvim. Using LSP is also not unique to coc.nvim. Deoplete, for instance, supports both as well. I personally have no interest in using coc since it's a javascript based project.
- blux 7y agoAre there any good alternatives for coc.vim? I do not like the NodeJS dependency.
- maccam94 7y agodeoplete is the other major completion engine, and it's written in python.
- sjustinas 7y agoSee https://langserver.org/#implementations-client https://langserver.org/#implementations-client
- L0stLink 7y agoI have been using LanguageClient-neovim[0]. It is great, the main difference I have observed between LanguageClient-neovim and coc.vim is that LanguageClient-neovim provides a more vim centered UX (e.g. it automatically populates location/quickfix list with errors, warnings and hints which enables quickly jumping between error locations) while coc.vim provides a great out-of-the box experience but feels like VSCode strapped to nvim (It has its own extension ecosystem based on VSCode extensions) - I greatly appreciate the effort by coc.vim's developer, he has done great work and coc.vim defiantly has its advantages[1] over LanguageClient-neovim. LanguageClient-neovim requires a lot of customization in order to fit it to your work flow but once it is done, the experience feels a lot more native. On the topic of which, LanguageClient-neovim feels lighter and faster to me and has the added advantage of being usable without any external dependencies (because it is a compiled binary). I highly recommend checking it out. tl;dr: coc.vim is for those looking for a VSCode like experience out of nvim (stuff works out of the box requiring minimal customization, installing plugins to get the required functionality) where LanguageClient-neovim is for those who prefer a vim centric approach (extremely minimal, manually customizing everything to get it to fit you workflow). If you are interested in LanguageClient-neovim you can checkout my config[2][3] you might find it helpful . [0] https://github.com/autozimu/LanguageClient-neovim https://github.com/autozimu/LanguageClient-neovim [1] It shows documentation for completion list items in a floating window similar to VSCode. [2] https://github.com/L0stLink/anvil https://github.com/L0stLink/anvil [3] https://github.com/L0stLink/anvil/blob/master/settings/LanguageClient-neovim.vim https://github.com/L0stLink/anvil/blob/master/settings/Langu...