Remix.run Logo
dotancohen 6 days ago

I am a die hard VIM user. VIM is a text editor, not an IDE. You can I many D tools into it's E, but it remains a text editor with disparate tools.

godelski 6 days ago | parent | next [-]

  > VIM is a text editor, not an IDE
I'm with you, but I don't see the problem with their argument. They should have mentioned GDB, Valgrind, and maybe things like pdb and ruff, but I think their point was clear enough without it. Hell, in vim I use ruff for linting and you can jump into a debugger. When you have it configured that way people do refer to it as an IDE. It isn't technically correct but it gets the point across to the people who wouldn't know that
63stack 6 days ago | parent | prev [-]

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 6 days ago | parent | next [-]

- 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"

63stack 6 days ago | parent | next [-]

Don'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 6 days ago | parent [-]

> 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 5 days ago | parent [-]

Sorry 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.

godelski 6 days ago | parent | prev [-]

  > 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

[1] https://vimdoc.sourceforge.net/htmldoc/options.html#'balloon...

[2] https://github.com/wfxr/minimap.vim

[3] https://github.com/preservim/tagbar

[4] https://github.com/preservim/nerdtree

[5] https://vimhelp.org/pi_netrw.txt.html#netrw

viraptor 6 days ago | parent [-]

> 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 6 days ago | parent [-]

  > [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

[1] https://vim.fandom.com/wiki/Search_and_replace_in_multiple_b...

[2] https://github.com/ThePrimeagen/refactoring.nvim

viraptor 6 days ago | parent [-]

> you use completion, right? That's interaction?

Very basic one. What I mean is once you get the completion, how do you interact with that view - let's say you want to dig into a type that's displayed. Then you want to get to the longer docs for that type. There's nothing out there that does it as far as I know.

> Wait... you want it as an image?

Yes, the asciiart minimaps are cool, but they really don't have enough resolution for more complex longer files in my experience.

> The best way is probably with bufdo and having all the files opened in a buffer

You see why this is not great, right? That's an extra thing to think about.

> Maybe you don't know what ctags are?

I know. It's step 1 out of many for implementing proper refactoring system.

> but you are asking about "search and replace" right?

Search and replace with language and context awareness. You can diy it in vim or start stacking plugins. Then you can do the same with the next feature (like inserting method stub). But... I can just use an actual IDE with vim mode instead.

> And in that case I would avoid language like "vim doesn't"

Vim doesn't do those things though. There's a whole ecosystem of additions of plugins of the day that add one thing or another. But it turns out it's easier to embed nvim in an ide than play with vim plugins until you get something close to ide. Been there for years, done that, got tired. VS with vim mode has better ide features than vim with all the customised plugins.

godelski 6 days ago | parent [-]

  > Very basic one
I guess because I don't use VSC I don't know what you're talking about (can you show me?) but getting docs is not an issue to me. If I want the doc on a function I press K in normal mode.

  > That's an extra thing to think about.
Is it? I mean the difference is literally

  %s/foo/bar/g
  bufdo %s/foo/bar/g
I don't see how that's more than what you'd do in any other system. You want to be able to replace one instance, all instances in the file, and all instances everywhere, right? Those can't all be exact same commands.

And it's not very hard to remember things like bufdo, windo, tabdo because I'm already familiar with a buffer, tab, and window. It's not an extra item in memory for me, so no, I don't see. It's just as easy and clear as if I clicked a button that said "do you all files"

  > Search and replace with language and context awareness
You mean ins-completion? That's native. I can complete things from other files (buffers), ctags, and whatever. You can enable auto suggest if you really want but that's invasive for me and distracting. But to each their own. I mean the right setup is only the right setup for you, right?

  > Vim doesn't do those things though.
Yet I'm really not sure what's missing. I'll give you the minimap but I personally don't really care about that one. Is it that big of a deal? (I already know what percentage of the file I'm in and personally I'd rather the real estate be used for other things. But that's me). But so far this conversation has been you telling me vim doesn't do something, me showing you it does, and you just saying no. To me it just sounds like you don't know vim. It's cool, most people don't read docs ¯\_(ツ)_/¯

I mean there's a lot of stuff that people that have been using vim for years don't know but is in vimtutor. I mean how many people don't know about basic things like ci, competition (including line or file path), or <C-[>? How many people use :wq lol

I just like vim man. You don't have to, that's okay. I like that I can do marks. I love the powerful substitution system. I mean I can just write the signatures of my init functions and automatically create the class variables. Or deal with weird situations like this time some Python code had its documentation above the function and I could just bufdo a string replace to turn those into proper docstrings. I love that I can write macros on the fly, trivially, and can apply them generously. I love registers and how powerful they are. I mean I can write the command I want on a line, push it into a register, and then just call it with @. It's trivial to add to my rc if I like it enough. I love that it's really easy to drop in a local config file that sets the standards for the project I'm working on when it differs from my defaults and I can even share that with everyone! I really like the fact that I can have my editor on just about every nix machine and I don't even need to install it. I can work effectively on a novel machine disconnected from the internet.

I mean my love for vim isn't really just the navigation. But even in the navigation I'm constantly using bindings that most vim plugins don't have. It's not easier for me to use another system and add vim keybindings because that's only a very small portion of vim. I'd rather have all of vim and a fuck ton more of my resources.

viraptor 5 days ago | parent [-]

I don't think you understand what I mean with the language aware rename. It's not even close to %s. Let's say I've got a c# app and I rename a class in VS. This will rename the class in the file, all class usages (but not as text - if I rename A.B, then it will not touch X.B due to different namespaces), including other projects in the solution, optionally will rename the file it lives in and optionally will/won't replace the text in comments. All listed for review and approval and I don't have to have any of those files open ahead of time.

63stack 5 days ago | parent [-]

This is something that the LSP provides (even in VScode), and is available in nvim yes. The command is vim.lsp.buf.rename(), and it is bound to "grn" by default.

https://neovim.io/doc/user/lsp.html#vim.lsp.buf.rename() (HN seems to not link the () part, you have to add it yourself)

All the other similar fanciness like renaming a file and automatically updating module references is also provided by the LSP, and is also available in nvim.

viraptor 5 days ago | parent [-]

That's cool. This was not easily accessible last time I used plain nvim. I'm glad the functionality has made its way there.

nsm 6 days ago | parent | prev [-]

The "integrated" part. I've written some here https://news.ycombinator.com/item?id=42871586