9 ms·
Vim After 15 Years (2017)
- Ancapistani 4y ago[2017]
- gw99 4y agoAfter 23 years now I pretty much use it as it is out of the box and still only know a small subset of commands. It has been my primary editor that entire time other than when I had to work on C# projects. I have never encountered a bug or crash in that period.
- mfonda 4y ago> Note that :Ack will jump to the first result in the QuickFix list by default. If you dislike this, use :Ack! Wow, I've been using :Ack for years and have always found that behavior rather annoying. I had no idea about :Ack! -- definitely going to remember this one.
- petepete 4y agoMy setup is very similar to the one described in the post, but I switched to neovim for the TreeSitter and LSP. Still, after all these years it's Tim Pope's plugins and fzf that make my editing experience so quick and fun. I could live without the rest, but an honourable mention goes to LuaSnip.
- mixedmath 4y agoThis seems to hold pretty well. I've been using vim for approximately 15 years now too and my current setup and preferences are surprisingly similar to those in this post. There is a certain organizational aspect here that I think is important to emphasize: the given paradigm is that vim is a text editor forming one part of the design environment. Assembling this environment inside a tmux session is particularly easy and powerful. And plugins can add some quality of life. In addition, I also like the vim-slime plugin. All this does is facilitate sending lines/regions/blocks to a REPL (or in principle, any tmux pane). It's similar to the tmux send-keys function described in the OP. A different paradigm of vim use is growing in popularity, which is the transform vim into a full IDE on its own.
- aidos 4y agoI’d say that vim will never be an IDE as such, because the focus is on personal configuration. Personal Development Environment is how one of the neovim contributors is half rebranding it. The things that make modern IDEs good (like LSP) at all available but you get to shape them how you want, rather than being forced into your IDE of choices way of doing things. (I imagine from your comment that you are probably aware of all this already)
- Jorengarenar 4y agoVim will never be an IDE because it does not aim to be one. It's a text editor - a central component of development environment, but only a component. I really like the "PDE" term - it gives us a simple division: IDE is when program ships all components by default (hence the "integrated" in the name), PDE is when you yourself attach components of your liking (hence "personalized").
- Beltalowda 4y agoPersonally I think Vim has been an IDE for at least 10-15 years now. You could argue for a long time about the exact definitions of "IDE" and "editor", but Vim can do compile-cycle, completion, finding identifiers, file browsing, spelling checking, terminal window, debugger, scripting, and a bunch of other stuff out of the box, without plugins. It certainly does these things different than your average IDE. Again, you could argue for a long time about what is or isn't an "IDE", but merely "editor" really does injustice to some of the more advanced features in Vim because it can do so much more than just "edit text", and "IDE" certainly seems a lot better of a fit than "editor".
- Trufa 4y agoIt's alway pretty fascinating to me that people can actually be productive without an IDE. I've tried several times Vim and I just don't get it how you can live without certain functionalities, I'm sure that with enough tinkering you can get pretty close but, for example, search seems to always be kind of a pain in the ass for the complex queries with regex through many files and stuff like that, specially the presenting of results has never been close in my opinion as to something like IntelliJ does it. Things like "god damn, I've done goofed or I don't quite remember something" and having the internal file history with a diff readily available. Some of the click and find implementation/usages never seems to quite there to me. I could go on, if you're truly being productive and not missing out on feature, more power to you, but I honestly wonder if there's no element of fun/pride in using something like vim now-a-days, which of course is totally fine and way more important in my book (to an extent) to pure productivity. There is also the point of being able to use vim bindings inside of the IDE. Maybe I'm just an idiot that can't Vim, totally open to that idea, but I'm truly wondering how productive it actually is.
- imran-iq 4y agoJust my 2 cents on this > I don't quite remember something and having the internal file history with a diff readily available. You're already in a terminal, git is just one command away > Some of the click and find implementation/usages never seems to quite there to me. This really depends on the language you are working in, but generally vim's gd (and plugins that augment it) enough most of the time, otherwise grep/rg if you know what you are looking for. If you are using something really dynamic, e.g. ruby, then you're pretty much shit out of luck. > I could go on, if you're truly being productive and not missing out on feature, more power to you. Here's the thing, the best part about it vim is that it is not slow (plus paired with a terminal emulator like kitty/wez/alacritty). When I type the characters actually appear on the screen as I type them. With most IDE's (at least the ones I have used) there is a noticeable delay from when I have stopped typing and characters appearing on screen. Another thing to add is that vim is very fast to start up and shut down, I open and close vim multiple times as I am working. With an IDE, startup times are atrocious and dont really fit my work style of cd'ing somewhere quickly editing something, cd'ing somewhere else and rinse and repeat. In general I find the original command line tools to be much better than IDE provided equivalents or integrations, there's no unnecessary animations and much less cpu/ram usage. Though one exception for me is the database clients, where I much rather prefer a GUI than using the CLI client. Your tests are already runnable from command line (assuming CI is setup). Basically, Unix becomes your IDE
- hnzix 4y agoFZF is awesome but I would hesitate to remap ; as you lose that binding for movement repeat.
- deleted 4y ago[deleted]
- dogmatism 4y agoI wish there were a vim equivalent for electronic medical records Or at least the ecosystem that you could choose your tools to help do your job, rather than be victim of the world of shit that is the (pick any) EMR
- statico 4y agoAuthor here. Many will be disappointed to know that I've been using VS Code almost exclusively since 2019 (with the Vim plugin of course). I've been meaning to write a follow-up article, but unfortunately writing is low on the priority list. The main reason is that these days, when I _am_ coding, I mostly write TypeScript and React on my local machine (not much SSH these days), and VS Code Just Works™. I tried twice to get neovim and LSP stuff working but never could, and I can't justify spending time twiddling my editor these days. And as much as I love the terminal, using multiple font sizes lets me fit more information on the screen. My dotfiles are always available: https://statico.link/dotfiles https://statico.link/dotfiles (Also, I lost all the great comments on my blog somehow, so sorry to those who left them. I had Commento running for a while but it appears to be abandoned. Disqus has them but I refuse to use Disqus anymore because it's awful.)
- statico 4y agoAnother thing: I think I use VS Code more because I spend much less time in the terminal than I did 5, 10, or 20 years ago. Everything happens in the browser now. I used to write lots of tools and services and commands for myself based in the terminal, but now web-based tools have replaced most of them. Some notable examples of things I would have used the command line for a decade ago: - Gmail for email (I'll switch to Fastmail someday) - The eight billion other chat apps I use — I dropped IRC many years ago but used IRCCloud to ask NetHack questions recently - CyberChef for exploring binary data - Pixlr for image tweaking - Google Sheets, Airtable, and Notion for notes & databases - A password manager for passwords - Pinboard for bookmarks - NextDNS & PiHole for DNS settings - Postico for Postgres (not web-based, but massively I'm tremendously more productive with it than with psql)
- statico 4y agoI do miss the terminal in a lot of ways. I feel a lot of nostalgia for the days when I got all my work done with just 2x2 terminals taking up the entire screen. (You could just fit them in with 1024x768 and the 8px high Tixus font.) But in 2022 it feels impossible to live entirely in a terminal unless you're in very specific areas of work.
- kazinator 4y agoVim has an "autochdir" mode whereby the current directory of each buffer is the working directory of the file. It sucks. For instance, when you're editing a .git/COMMIT_EDITMSG, it makes the directory .git/. It has no concept of intelligent exceptions. I made myself a better one: On startup, we save the current (i.e. project top) directory in the `$top` variable: :let $top=getcwd() When entering new buffer, we lcd to the directory of the path: :au BufWinEnter * exec "lcd " . expand('%:h') But if the buffer is new, without a name, we change to the top. :au BufWinEnter * if expand("%") == "" | exec "lcd $top" | endif If we are in .git, go to top. :au BufWinEnter *.git/* exec "lcd $top" Why is the variable $top and not top? The dollar sign makes it an environment variable, exported to child processes. Why on earth would we do that? Because Vim interpolates $-sigiled environment variables in more contexts than regular variables! I can use $top pretty much anywhere.
- kazinator 4y agoAnother Vim tip: I use a plugin called bufexplorer. I patched bufexplorer.vim with this: if !hasmapto('BufExplorer') && g:bufExplorerDisableDefaultKeyMapping == 0 nnoremap <script> <silent> <unique> <Leader>\ :BufExplorer<CR> endif What that does is make the buffer explorer's window accessible just by hitting backslash twice. The \ key is the default <Leader> key in Vim. So <Leader>\ means \\. Bufexplorer lists the open buffers one per line in a window that is searchable. The window can be sorted by recently used. Switching among buffers with plain Vim is a paint: using :ls to list buffers, and :b <number> and such. A more ergonomic buffer switcher is a must.
- Scarbutt 4y agoI settled on fzf.vim for that (since I'm already using fzf on the terminal) which also has other niceties.
- kazinator 4y agoAnother Vim tip: use sessions. vim -S <sessfile> will recover a session file. I set up these items in my .vimrc to make sessions a little easier to work with: The + key (which has a useless default role of moving to the next line) is mapped to save the current session: :nmap + :wa<Bar>exe "mksession! " . v:this_session<CR> Then, a :S command for creating a new session, e.g. :S foo. :command -nargs=1 S exec "mksession! " . expand('$top/') . expand('<args>') This relies on a $top variable which I set like this: :let $top=getcwd() that has to do with https://news.ycombinator.com/item?id=33351155 https://news.ycombinator.com/item?id=33351155 I want sessions to be created in the top directory, rather than the directory of the current buffer.
- Keyframe 4y agohttps://github.com/xolox/vim-session https://github.com/xolox/vim-session I actually have in normal mode ,ss for save session and ,so for opening them. Central location of session dirs and that's it. Save session saves everything from files open, positions, tabs, you name it.
- auraham 4y agoThis is the list of features (in Eclipse) that I'd like to use in Vim: - Show in Breadcrumb to show the package name > class > function in the top of the editor - Open Call Hierarchy to show all places where a class/variable is used. - Show Type Hierarchy to show how a given class is derived from Object. - Debug Shell for running snippets in the debugger. I know that I can use grep or ag for some of them, but I rather prefer to see the hierarchy as shown in Eclipse.
- petepete 4y agoI think you can get most of the first three of your requirements from TreeSitter and LSP. The treesitter context plugin (https://github.com/nvim-treesitter/nvim-treesitter-context https://github.com/nvim-treesitter/nvim-treesitter-context) provides the package/class/function info at the top and the LSP gives you features like 'find-references' and 'go-to-definition' you can bind to the keys of your choice. I use 'gr' for 'find-references' and 'gd' for 'go-to-definition. I don't use a debug shell (I use a tmux pane and a repl usually) but I'm certain there are options.
- decafninja 4y agoI would still love to learn vim if only for the nerd credentials. However I cannot imagine how I would reproduce the workflow to even come close to approaching my current productivity level with VS Code. I'd love to sit down with a vim expert for a day and see how much of my workflow I could replicate.
- johnthedebs 4y agoI'd be willing to take you up on that (well, maybe an hour or so rather than a day). I feel the same about vim - there are certain workflows I have that I can't adequately recreate in other editors, so I keep coming back. I'm curious what your workflow looks like.
- omarelbie 4y agoI use the Vim plugin within VScode. For me it's really the best of both worlds: Full-blown IDE features along with fast Vim editing. Highly recommend it!
- embeng4096 4y agoI also use VSCodeVim! One struggle I have though is that navigating with Ctrl+d / Ctrl+u or Shift+[ / Shift+] still opens folds if the cursor lands in the middle of a folded section. Do you run into this also and/or know a fix/workaround?
- urthor 4y agoSadly, the Vim/Emacs configuration burden is growing every year. IDE developers just keep inventing new tools. GitHub Copilot is the latest, who knows what's next? Especially for Rust, JVM & Java. Rust without a IDE warnings is... extremely difficult. Unless you're extremely practiced with it. As time goes on, feature parity with fully featured IDEs like Jetbrains is steadily becoming harder. I'd readily consider a "nvim distribution" via Patreon at this point. Configuring Vim to catch-up with Intellij is becoming a part time job.
- alwillis 4y agoConfiguring Vim to catch-up with Intellij is becoming a part time job. It doesn't have to be. I tried a bunch of things but LSP-Zero just works. The UI/UX for installing LSPs and linters, etc. is better than VS Code. As time goes on, feature parity with fully featured IDEs like Jetbrains is steadily becoming harder. As far as I can tell, there's no stated goal by anyone involved with Neovim to reach feature parity with any IDE. That's not the point. What's great about Neovim and similar projects: there's a middle ground between a full-blown IDE and a "text-editor". Just because a coder/developer wants some nice things like autocompletions, diagnostics, refactoring and semantic formatting and syntax highlighting doesn't necessarily mean they must use a IDE, especially when some of the underlying technologies for providing these features (Treesitter, Language Server Protocol) are exactly the same. It won't take long for text editor users--Vim, Neovim, emacs, Hexlix--to expect these capabilities. It'll just become the norm. Just like how most young people today know a world without the internet being everywhere, we'll have users who've never known a time when every decent text editor didn't have what old-timers call "IDE" features.
- urthor 4y ago> What's great about Neovim and similar projects: there's a middle ground between a full-blown IDE and a "text-editor". That's a perfectly fine goal. I wrote the above in the context of so many comments saying "what's the point of an IDE." There's absolutely a place for CLI text editors and REPLs. I simply doubt they will ever replace the IDE as my collection of the more arcane JVM tools.
- throwaway_au_1 4y agoI would like to add my perspective to the mix, as it seems Vim pops up here every so often and commonly the discussion becomes one of Text Editor Vs. IDE capabilities. As I get older (33 now), I feel more and more annoyed by Things That Just Work TM changing on me for (IMO) no good reason. There are very few applications that I update as soon as I'm notified, because more often than not, something changes which at best disrupts my workflow and at worst breaks it. It seems as developers we are both best placed and very much expected to cope with this onslaught of change in our tooling. But when something that worked 2 days ago stops working, to me, that's only an impediment and I feel zero excitement for whatever improvement might have justified it. IMHO. To me, Vim is a stable, battle-tested, and (IMHO) quite ergonomic way to write and modify code. At this point, I know what I'm doing when I write code (mostly.. maybe), how I want to do it, and I only want to do those things the way I want to do them. To me, Vim is my workshop, a workbench with my tools laid out on it exactly where I want them. Something like VS/VSCode feels like a public space with toolboxes everywhere, which I have to step around to work. I have no idea what's in some of these toolboxes, nor do I care, and I'm pretty sure I saw a lawn mower in here somewhere. Obviously some people out there, people with a brain wired differently to mine, can work productively or even enjoy that kind of environment, but that's not me. At the risk of sounding like a wanker, I just like the zen of working on some code without all of the noise, in the same way I've always done it. It feels good to be efficient. Hell, there are enough self-inflicted frustrating moments in software development without my tools turning on me, too. So I use Vim because I'm happy to sacrifice the incredible, broad capabilities of something more for a tool that gets out and stays out of my way, and that I know has no agenda beyond doing exactly what it says on the tin (and maybe soliciting some donations for Ugandan children).
- penguin_booze 4y agoFeels like you robbed me of my words and made it better.
- cersei 4y agoI've grown tired of big proprietary software, even if it's open source. Companies like Microsoft will keep doing whatever their business whims dictate, deprecating tools, etc... I want to live in a world where I'm in control of my software instead of constantly adapting for reasons that have nothing to do with how I like to work. I also don't like the common paradigms like having a cockpit of information in my face at all times. I want the information that I need magnified and the ability to dig into it with intentionality in whichever way I choose. When working with text, I want text in the forefront, not widgets and GUIs. Those are some philosophical, but also pragmatic reasons for prefering the shell based tools and Vim. If there is a visualization that is better conveyed graphically then yes, I can of course open tools for that purpose. Luckily I'm able to use Vim for my workflow, but I totally get that it's not always possible or feasible.
- gigatexal 4y agoi3 user here so no need for tmux. And terminals in neovim give me all I need there. Still a very cool article.
- deleted 4y ago[deleted]
- jrms 4y agoI still do like 80% of my daily work from a terminal