8 ms·
The Vim/Neovim ecosystem has gotten unbelievably better over the last 5-10 years. "Living in the terminal" for core development work is IMO better than pretty m
by reissbaker 4y ago
The Vim/Neovim ecosystem has gotten unbelievably better over the last 5-10 years. "Living in the terminal" for core development work is IMO better than pretty much anything else out there; my Neovim setup has a modern plugin manager; an IDE-like experience with fast autocompletion as I type, goto definition, and automated refactor support; and a side-drawer file browser navigable with Vim motions. It feels like an IDE, except that it launches in ~100ms and has ultra-low typing latency. Using it with tmux panes means I can have various drawers and panes with a series of full, incredibly fast terminals wherever I want, with long-running tasks like automated test watching/running while I edit code placed wherever I want around the editor panel. Not to mention the Cambrian explosion of "modern" terminal tooling getting built, like xplr [1], hyperfine [2], httpie [3], etc.
That being said, I think "living in the terminal" for general purpose computing, like browsing the web or talking to your coworkers, has been in a kind of frozen standstill while the rest of the world has moved on. I think it isn't worth trying to push non-dev work into the terminal currently.
1: https://github.com/sayanarijit/xplr https://github.com/sayanarijit/xplr
2: https://github.com/sharkdp/hyperfine https://github.com/sharkdp/hyperfine
3: https://github.com/httpie/httpie https://github.com/httpie/httpie
- greymalik 4y agoWhat 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.
- Ian_Macharia 4y agoLunarvim 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.
- ablob 4y agoDepending 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)
- tonto 4y agolsp-zero is a good way to get a completion running without configuring many plugins...it installs several of the above.
- lelandbatey 4y agoThere'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.
- adriand 4y agoI 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.
- gpanders 4y agoCan 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)
- adriand 4y agoI 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.)
- jmcphers 4y agoIn 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 https://github.com/github/copilot.vim
- acapybara 4y agoHave this running in Termux on my phone. Copilot + nvim + Termux makes it reasonable to code on a phone.
- reissbaker 4y agoI've had great success with coc.nvim for IDE-like features; it manages language servers for you: https://github.com/neoclide/coc.nvim 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!
- markmaglana 4y agoI 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_070_install_vim_plugins.sh.tmpl https://github.com/relaxdiego/dotfiles/blob/main/run_once_07...
- lizardking 4y agoI 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 https://github.com/nvim-telescope/telescope.nvim) - Copilot (https://github.com/github/copilot.vim https://github.com/github/copilot.vim) - Nerd tree for file browsing (https://github.com/preservim/nerdtree https://github.com/preservim/nerdtree) - commentary for commenting (https://github.com/tpope/vim-commentary https://github.com/tpope/vim-commentary) - ALE for linting (https://github.com/dense-analysis/ale https://github.com/dense-analysis/ale) - Mason for installing LSP servers (https://github.com/williamboman/mason.nvim 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_xxNtJC_hJbQ7R 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 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.
- thomasahle 4y agoIs 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.
- rockwotj 4y agoJetbrains 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
- gateorade 4y agoIf 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.
- stonecharioteer 4y agoLook 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.
- yeswecatan 4y agoDo you have your dotfiles on github?
- _blz2 4y agoThis is a good place for a basic neovim setup for programming https://github.com/NvChad/NvChad https://github.com/NvChad/NvChad
- reissbaker 4y agoI do, but I keep the repo private. I've seen too many people accidentally check their keys into public dotfile repos. coc.nvim (https://github.com/neoclide/coc.nvim https://github.com/neoclide/coc.nvim) is a great starting point though!
- _blz2 4y agowhy use coc when native lsp is supported. lspconfig plugin is pretty straightforward to setup.
- 29athrowaway 4y agoCan you: - Edit code - Autocomplete - Navigate code, find references, go to definitions - Run your code - Debug your code - Test your code (including running a specific test) - Profile your code - Run multiple static analyzers simultaneously - Use version control and annotate code using version control - Do all that remotely or with containers involved - Query a database and get results in a tabular format - Spell checking - Have collaborative editing - Work with issue tracker tickets - And more... The sad reality is that for 99.9% of people using vim is reinventing the square wheel to produce a worse development experience and inferior code.
- tpoacher 4y agoVim? Heck I can do all that with nano ... wth are you talking about?
- jalbertoni 4y agoI'm curious, how would you handle collaborative editing in nano? All the others seem doable if a bit hacky, but that one confused me.
- tpoacher 4y agoYeap, what the other guy said. I prefer byobu to vanilla tmux, but the idea is the same. Create a byobu session, detach, give it group permissions, group collaborators attach, enjoy the nano editing party. :)
- Lio 4y agoI’m a (Neo)Vim user rather than Nano but off the top of my head, I’d use tmux to share a Nano session on multiple computers at the same time.
- bananadonkey 4y agoEverything up to and including spell checking, yes. In fact none of those first items are remotely unreasonable to do in a terminal, rather surprising to see them being used as arguments against the terminal. - vim, neovim, Emacs configured with LSP - https://git-scm.com/ https://git-scm.com/ - http://aspell.net/ http://aspell.net/ - https://github.com/tmux/tmux https://github.com/tmux/tmux - https://github.com/dbcli https://github.com/dbcli Emacs also exists which runs in the terminal mostly (I only miss image rendering personally). Collaborative editing is something I don't do much of but would guess there's a neovim plugin which could be used for backend sync. Interacting with your issue tracker depends on the issue tracker software you use (flat file would work for example, Jira has unofficial clients, etc). - https://www.emacswiki.org/emacs/JiraMode https://www.emacswiki.org/emacs/JiraMode - https://marketplace.atlassian.com/apps/6398/jira-command-line-interface-cli?tab=overview&hosting=cloud https://marketplace.atlassian.com/apps/6398/jira-command-lin...
- mekster 4y agoYou sound like a sales pitch but my NeoVIM based off of AstroNvim breaks in very random ways across a dozen of servers even under same configuration, I'm about to try Helix instead of the ecosystem with pile of random quality plugins. It looks promising at first with LSP and all that but I don't know when I had any stable moments.
- ar_lan 4y agoAre you using different OS? This sounds like the programs your NeoVim is calling is failing you - not nvim itself. _cough cough_ NixOS can help you out here
- mekster 4y agoUbuntu 22.04. I'm guessing the few dozens of plugins are probably messed up in a way or another after each updates. Apparently, there's no unified QA testing among community supported ecosystem with 20 different authors.
- ar_lan 4y agoIn packer, at least, you can pin plug-in versions. I’ve never had the issue you describe - I suspect precisely because I keep my plugin count lean and pin each dependency so it’s always deterministic.
- selfmodruntime 4y agoIt's not neovim, but the surrounding plugin architecture I need. I'm using coc.nvim to get autocompletions and documentation and I find that to be increasingly brittle. Also the python3 provider stuff randomly breaks in a venv sometime.
- reissbaker 4y agoHuh, sorry to hear that. Personally the only annoyance I've had with coc.nvim was when they changed how autocomplete worked and I had to update my keybindings, but that wasn't particularly bad.
- gtsop 4y agocoworker #1 was literally waiting 30seconsa for his webstorm to open a subdirectory (in a really big code tree) coworker #2 was struggling with his vscode autodeleting some imports strange times when you are the vim developer in the house and the one with the most solid IDE...