News for hackers. Stuff that matters.
Re:Ask HN: Is it still possible to live in a terminal? by greymalik on Friday October 14, 2022 @05:56PM (#33209279)
What setup/plugins do you recommend for using Neovim as an IDE replacement? I use vi for minor text editing but have never used it for development.
Re:Ask HN: Is it still possible to live in a terminal? by ablob on Friday October 14, 2022 @06:14PM (#33209441)
Depending on what you deem to be a suitable replacement i'd recommend:

  nvim-telescope/telescope.nvim // integrates well with code actions and searching (very extensible in general, similar to ctrl-p)
  hrsh7th/nvim-cmp
  hrsh7th/cmp-nvim-lsp // for language server completion
  neovim/nvim-lspconfig // a bunch of language server specific stuff
note, that you'll probably need a bit of time to configure it to your liking and that nvim doesn't install the language server by itself, so that is something that you need to take care of by yourself as well.

If you want to see what a preconfigured IDE-replacement might look like you can take a look at lunarvim(but beware, it misbehaves on windows quite a bit, you're better of with a linux system here)

Re:Ask HN: Is it still possible to live in a terminal? by tonto on Friday October 14, 2022 @10:49PM (#33211225)
lsp-zero is a good way to get a completion running without configuring many plugins...it installs several of the above.
Re:Ask HN: Is it still possible to live in a terminal? by Ian_Macharia on Friday October 14, 2022 @06:04PM (#33209359)
Lunarvim is a pretty solid choice and comes fully stocked with cool plugins that match most of the popular editors out there. Sometimes I even forget i'm in a terminal.
Re:Ask HN: Is it still possible to live in a terminal? by lelandbatey on Friday October 14, 2022 @06:29PM (#33209552)
There's really only one "class" of plugin that's a "must have" to turn Vim (Vim or Neovim) into an IDE replacement and that's some kind of Language Server integration; there are several you could pick, they all allow your Vim to automatically start and talk to a local Language Server, giving you all the fancy autocomplete/go-to-definition/inline documentation/etc that you expect from an IDE. Otherwise, I dunno, maybe a nice color theme? Probably the only one I really depend on that's not part of "general" vim is the FZF plugin, which lets me rapidly and quickly fuzzy search for files by their name anywhere in the folder I'm in.
Re:Ask HN: Is it still possible to live in a terminal? by adriand on Friday October 14, 2022 @06:46PM (#33209695)
I use Neovim all the time but although I do have some linters installed I find all the fancy stuff so much worse than in a more visually appealing editor. I love vim and I do have a lot of affection for the terminal but things get extremely visually noisy with language servers in a way they just don’t with a more graphical interface.

It sucks because I want to use vim for TypeScript dev but I just can’t stand it compared to VS Code. For non-typed languages I still use vim, and I love how I can fluently edit anything on servers I shell into, but I kind of wish there was a middle ground of some kind.

Re:Ask HN: Is it still possible to live in a terminal? by gpanders on Friday October 14, 2022 @08:34PM (#33210407)
Can you explain what you mean by “visually noisy”? If you’re referring to the diagnostics messages (virtual text and signs and such), that is easily configurable to disable (I would know, I wrote it)
Re:Ask HN: Is it still possible to live in a terminal? by adriand on Saturday October 15, 2022 @07:59PM (#33219794)
I mean like all the stuff that displays in and around the code, that isn’t the code itself. For example warnings, hints, etc. An obvious example of something you can’t do in Neovim is display information in a smaller font. Generally speaking you just don’t have nearly as many options for creating information hierarchies in a UI consisting of ASCII characters.

In terms of turning things off, if you turn them off, then what’s the point of having the language server? (Not a rhetorical question - I would describe myself as a workaday programmer, not a master by any means.)

Re:Ask HN: Is it still possible to live in a terminal? by gpanders on Sunday October 16, 2022 @12:22AM (#33221002)
>In terms of turning things off, if you turn them off, then what’s the point of having the language server?

Code navigation and completion, for one.

But there are plenty of knobs to turn that provide a spectrum between “show nothing” and “show everything”. I also find the inline diagnostic text noisy, so I configure it to only show on the line where my cursor is. You can also use the “open_float” function to open the diagnostics on your current line in a floating window. That way you can leave them off my and simply view them on-demand.

Re:Ask HN: Is it still possible to live in a terminal? by lizardking on Friday October 14, 2022 @08:51PM (#33210492)
You can use the vim extension for vs code, which let's you have your cake and eat it to. All the convenience of vs code with all the speed from using vim commands.

https://marketplace.visualstudio.com/items?itemName=vscodevi...

Re:Ask HN: Is it still possible to live in a terminal? by IggleSniggle on Friday October 14, 2022 @09:44PM (#33210822)
If you really want speed, you’ll want the neovim extension. This replaces VSCode in many ways, making it neovim under the hood…which means no waiting for VSCode to figure out what’s going on in your giant codebase, no wondering why it takes literally a full half-second sometimes before the characters you just typed pop onto the screen. But it’s still VSCode “on top,” so you can tap into the other features you might want when you want them.

Full disclosure: it’s been years since I used it, but I was super impressed

Re:Ask HN: Is it still possible to live in a terminal? by jmcphers on Friday October 14, 2022 @07:47PM (#33210133)
In addition to all the language servers folks have already pointed to, Github Copilot works -- surprisingly --- great in Neovim. Tim Pope (author of fugitive and many other popular Vim plugins) wrote the integration.

https://github.com/github/copilot.vim

Re:Ask HN: Is it still possible to live in a terminal? by acapybara on Friday October 14, 2022 @08:26PM (#33210368)
Have this running in Termux on my phone.

Copilot + nvim + Termux makes it reasonable to code on a phone.

Re:Ask HN: Is it still possible to live in a terminal? by reissbaker on Friday October 14, 2022 @08:04PM (#33210247)
I've had great success with coc.nvim for IDE-like features; it manages language servers for you: https://github.com/neoclide/coc.nvim

For file browser side-panes there are tons of options, but no one ever got fired for using the venerable old NERDTree.

The rest is mostly just tmux!

Re:Ask HN: Is it still possible to live in a terminal? by lizardking on Friday October 14, 2022 @08:47PM (#33210474)
I use a lot of them, many specific to my work, but here are some of the ones that I think will most improve the quality of life for most developers.

- For a plug-in manager I user packer

- For file/text search I recommend telescope (https://github.com/nvim-telescope/telescope.nvim)

- Copilot (https://github.com/github/copilot.vim)

- Nerd tree for file browsing (https://github.com/preservim/nerdtree)

- commentary for commenting (https://github.com/tpope/vim-commentary)

- ALE for linting (https://github.com/dense-analysis/ale)

- Mason for installing LSP servers (https://github.com/williamboman/mason.nvim)

Once you have the proper tooling in place you can do pretty much everything in vim that you are doing in vs code or intelliJ. I've just started using it for most of my dev work recently and I have found ThePrimeagen's youtube videos on vim to be a great resource.

Series on using vim as you editor (https://www.youtube.com/playlist?list=PLm323Lc7iSW_wuxqmKx_x...)

Introduction to setting up your vim configuration (https://www.youtube.com/watch?v=x2QJYq4IX6M&t=512s)

I recommend giving it a try. The process of learning it all was fun, and as you may have heard you can eventually get pretty quick using Vim.

Re:Ask HN: Is it still possible to live in a terminal? by thomasahle on Friday October 14, 2022 @08:56PM (#33210524)
Is there an LSP that allows refactoring Python code like PyCharm?

I haven't found any other tools that does simple things like extracting a function, renaming or inlining variables. For example, vscode's Python support is terrible.

Re:Ask HN: Is it still possible to live in a terminal? by rockwotj on Friday October 14, 2022 @11:13PM (#33211373)
Jetbrains IDEs have refactorings that are light-years ahead of any LSP functionality. I can use nvim for simple or small code bases, but for any real work project I've had to use IntelliJ.

For example, I had a VSCode coworker who was asking to switch all typescript string union types to enums so they could be refactored, but IntelliJ is able to refactor (in this case rename) the string union types

Re:Ask HN: Is it still possible to live in a terminal? by mekster on Saturday October 15, 2022 @12:50AM (#33211850)
Right. vim (and the likes) are only good for server side config editing but these days remote plugin of vs code can also take that role away.
Re:Ask HN: Is it still possible to live in a terminal? by ar_lan on Saturday October 15, 2022 @01:29AM (#33212021)
This just simply isn’t true. Neovim is perfectly capable of (and I would argue excels at) being a daily driver on large projects.
Re:Ask HN: Is it still possible to live in a terminal? by mekster on Saturday October 15, 2022 @02:03AM (#33212163)
Compared to JetBrains, no thanks.

I can't even get Neovim to run stably without throwing random errors every now and then, especially after I update plugins.

Re:Ask HN: Is it still possible to live in a terminal? by ar_lan on Saturday October 15, 2022 @02:34AM (#33212336)
I do love JetBrains products. But they were too memory-hungry for me. I stepped away from GoLand and into Neovim and it’s been by far the best experience the past year and a half. So far, there is not a single feature I miss or haven’t been able to duplicate.

Regarding stability - pinning plug-in versions could be helpful. That’s what I’ve done and I’ve never had an issue with stability.

Re:Ask HN: Is it still possible to live in a terminal? by rockwotj on Saturday October 15, 2022 @04:03AM (#33212806)
Agreed - neovim is plenty stable for me. The built in package management and git submodules in my dotfiles works really well and is dead simple.
Re:Ask HN: Is it still possible to live in a terminal? by perlwle on Saturday October 15, 2022 @09:58AM (#33214883)
I have both PHPStorm and Pycharm running, each takes up 4+GB memory on a 8G M1. Slowly growing memory usage for WindowServer process makes matter worse.

For the last week, I have been playing with Neovim in spare time using a setup based on https://github.com/LunarVim/nvim-basic-ide It does pinning plug-in too.

It's working well for small projects so far.

Re:Ask HN: Is it still possible to live in a terminal? by rockwotj on Saturday October 15, 2022 @04:02AM (#33212792)
It can be yes, especially depending on what you're doing. I'm so much more productive with some of the impressive refactoring actions. An example cool one for me in React is "Extract Component" where you can pull out a component and it automatically picks out your props (including types for TSX).

A recent example is that I removed all import cycles from our app last week (there where over 200) and I was able to do this purely with the IntelliJ "move symbols" refactor in a codebase of xxx,xxx lines of typescript. I can't figure out how to move a symbol to another file with LSP. I spent the first year of development at my current job when working on the front end and I'm simply more productive in IntelliJ compared to vim - I'm in vim for everything else tho (as long as it's not kotlin/java as I can't get LSP working for JVM projects).

https://www.jetbrains.com/help/idea/react.html#react_refacto...

Re:Ask HN: Is it still possible to live in a terminal? by rockwotj on Saturday October 15, 2022 @03:55AM (#33212753)
Oh I'd much rather use vim than VSCode
Re:Ask HN: Is it still possible to live in a terminal? by markmaglana on Friday October 14, 2022 @08:54PM (#33210512)
I still haven’t made the transition to Neovim in favor of stability, but here’s part of my dotfiles repo that installs all the plugins that I use with Vim:

https://github.com/relaxdiego/dotfiles/blob/main/run_once_07...

Re:Ask HN: Is it still possible to live in a terminal? by gateorade on Friday October 14, 2022 @10:07PM (#33210939)
If you’re just jumping in, you can’t beat starting with lunarvim or astrovim and then customizing further from there if you need to. Neovim is fantastic, and the best way to edit code IMO, but getting it set up to a point where it has the features of vscode/IDEs can be a project in itself.
Re:Ask HN: Is it still possible to live in a terminal? by stonecharioteer on Saturday October 15, 2022 @12:22AM (#33211726)
Look up astronvim for a pre-configured setup that'll work for you. You cam try that and add your own stuff in the user configuration. It's pretty easy.