5 ms·
What is there in an IDE today, that is missing from (n)vim? With the advent of DAP and LSP servers, I can't find anything that I would use a "proper" IDE for.
by 63stack 1y ago
What is there in an IDE today, that is missing from (n)vim? With the advent of DAP and LSP servers, I can't find anything that I would use a "proper" IDE for.
- viraptor 1y ago- debuggers - popup context windows for docs (kind of there, but having to respect the default character grid makes them much less capable and usually they don't allow further interaction) - contextual buttons on a line of code (sure, custom commands exist, but they're not discoverable) - "minimap"
- godelski 1y ago> debuggers Parent mentioned >> DAP Here's the docs[0] > popup context windows for docs These are called "balloon"s[1]. Plenty of people have setups for things like docs (press "K") or other things (By default "K" assumes a man page) > contextual buttons on a line of code I don't know what this means, can you explain? > minimap Do you mean something like this?[2] Personally, I use tagbar[3] as I like using ctags and being able to jump around in the project. The "minimap" is the only one here that isn't native. You can also have the file tree on the left if you want. Most people tend to use NerdTree[4], but like with a lot of plugins, there's builtins that are just as good. Here's the help page for netrw[5], vim's native File Explorer Btw, this all works in vim. No need for neovim for any of this stuff. Except for the debugger, this stuff has been here for quite some time. The debugger has been around as a plugin for awhile too. All this stuff has been here since I started using vim, which was over a decade ago (maybe balloons didn't have as good of an interface? Idk, it's been awhile) [0] https://vimdoc.sourceforge.net/htmldoc/debugger.html https://vimdoc.sourceforge.net/htmldoc/debugger.html [1] https://vimdoc.sourceforge.net/htmldoc/options.html#'balloondelay' https://vimdoc.sourceforge.net/htmldoc/options.html#'balloon... [2] https://github.com/wfxr/minimap.vim https://github.com/wfxr/minimap.vim [3] https://github.com/preservim/tagbar https://github.com/preservim/tagbar [4] https://github.com/preservim/nerdtree https://github.com/preservim/nerdtree [5] https://vimhelp.org/pi_netrw.txt.html#netrw https://vimhelp.org/pi_netrw.txt.html#netrw
- viraptor 1y ago> These are called "balloon" And are not interactive as far as I know. I've not seen a way to get a balloon on the type in another balloon and then go to the browser docs from a link in that. > Do you mean something like this? Yes, but that's still restricted to terminal characters (you could probably do something fancy with sixel, but still) - for larger files with big indents it's not useful anymore. > contextual buttons on a line of code For example options to refactor based on the current location. I could construct this manually from 3 different pieces, but this exists in other IDEs already integrated and configured by default. Basically where's the "extract this as named constant", "rename this type across the project" and others that I don't have to implement from scratch.
- godelski 1y ago> [balloons] are not interactive as far as I know I mean you use completion, right? That's interaction? In insert mode <C-p> or <C-n>, same to scroll through options. > [tabbar is] still restricted to terminal characters (you could probably do something fancy with sixel, Wait... you want it as an image? I mean... sure? You could, but I'm really curious why you would want that. I told you this was one option, but there are others. Are you referring to the one that was more visual and didn't show actual text? Idk, I'm not going to hunt down that plugin for you and I'm willing to bet you that it exists. > For example options to refactor based on the current location. First off, when quoting it helps to add more >'s to clarify the depth. So ">>>" in this case. I was confused at first as I didn't say those words (Also, try adding two leading spaces ;) Second, sure, I refactor all the time. There's 3 methods I know. The best way is probably with bufdo and having all the files opened in a buffer (tabs, windows, or panes are not required). But I'm not sure why this is surprising. Maybe you don't know what ctags are? If not, they are what makes all that possible and I'd check them out because I think it will answer a lot of your questions. > Basically where's the "extract this as named constant", "rename this type across the project" Correct me if I'm wrong, but you are asking about "search and replace" right? I really do recommend reading about ctags and I think these two docs will give you answers to a lot more things that just this question[0,1]. Hell, there's even The Primeagen's refactoring plugin in case you wanted to do it another way that's not vim-native. But honestly, I really can't tell if you're just curious or trying to defend your earlier position. I mean if you're curious and want to learn more we can totally continue and I'm sure others would love to add more. And in that case I would avoid language like "vim doesn't" and instead phrase it as "can vim ___?", "how would I do ____ in vim?", or "I find ___ useful in VS code, how do people do this in vim?" Any of those will have the same result but not be aggressive. But if you're just trying to defend your position, well... Sun Tzu said you should know your enemy and I don't think you know your enemy. [0] https://vim.fandom.com/wiki/Browsing_programs_with_tags https://vim.fandom.com/wiki/Browsing_programs_with_tags [1] https://vim.fandom.com/wiki/Search_and_replace_in_multiple_buffers https://vim.fandom.com/wiki/Search_and_replace_in_multiple_b... [2] https://github.com/ThePrimeagen/refactoring.nvim https://github.com/ThePrimeagen/refactoring.nvim
- 63stack 1y agoDon't IDEs use DAP as well? That would mean neovim has 1:1 feature parity with IDEs when it comes to debugging. I understand the UI/UX might need some customization, but it's not like the defaults in whatever IDE fit everyone either. Popup context windows for docs are super good in neovim, I would make a bet that they are actually better than what you find in IDEs, because they can use treesitter for automatic syntax highlighting of example code. Not sure what you mean with further interaction. Contextual buttons are named code actions, and are available, and there are like 4 minimap plugins to choose from.
- viraptor 1y ago> That would mean neovim has 1:1 feature parity with IDEs when it comes to debugging. How do I get a memory graph with custom event markers overlayed on it then? That's the default for VS for example.
- 63stack 1y agoSorry I don't know enough about VS to answer this, but if the debugger in question is using DAP then there is a more than fair chance it's available in neovim as well.
- nsm 1y agoThe "integrated" part. I've written some here https://news.ycombinator.com/item?id=42871586 https://news.ycombinator.com/item?id=42871586