7 ms·
Coming Home to Vim (2010)
- tpoacher 4y ago> I was using vim like a glorified nano I daresay that most nano users use nano like a "glorified nano" too. I wouldn't blame nano for this. Nano can actually be a pretty slick little editor if you're willing to dive a bit deeper.
- kasperset 4y agoFrom 2010 but very well written.
- behnamoh 4y agoCorrected the title.
- jrumbut 4y agoIf memory serves me right, this is the blog post that got me into vim when it first made the rounds. Prior to that I was just another developer googling "how do I quit vi."
- alwillis 4y agoSame—this was the article that got me over the hump and started using Vim. Also, his .vimrc file is epic. It’s a little dated now but it shows how deeply Vim can be customized, in ways that most editors cannot.
- jez 4y agoSteve Losh is also the author of Learn Vimscript the Hard Way, one of the best resources for writing Vim plugins. https://learnvimscriptthehardway.stevelosh.com/ https://learnvimscriptthehardway.stevelosh.com/
- amelius 4y agoI love Vim. But I have two problems with it: 1. When opening a file that is already open in another editor in another terminal, Vim gives me many options, but it doesn't give me the option to kill the other process (or ask that process to save its buffer and exit). 2. My .vimrc should really follow me around automatically. Too often I find myself installing a new machine and missing my settings. I don't know how it should be implemented, but this is something that should work. Edit: if SSH can pass the DISPLAY variable around, then it could do the same with (a key to) .vimrc. Once a .vimrc is associated with an account, it will stay there, so if I log into the machine from the console, I should have my .vimrc (this also happens to the .Xauthority file, although less useful). This could also apply to other settings, of course. And it would be even better if my Vim binary followed me around too, but this is perhaps too futuristic.
- Alekhine 4y agoA .vimrc is literally one file, and we've come up with lots of solutions for moving dotfiles around easily. Some jank, some not. But it is a hundred million miles out of scope for vim to implement some kind of sync. That would require accounts, databases, all kinds of tedious details an OSS project does not have the resources or volunteers to do.
- amelius 4y agoI was thinking that perhaps SSH should do this the way they also pass X11 credentials around.
- the_cat_kittles 4y agoan option to have vim use a url for the vimrc?
- simplotek 4y ago> an option to have vim use a url for the vimrc? Is copying .vimrc whenever logging in for the first time too much work?
- quickthrower2 4y agoI am half thinking of getting back into Vim (or trying again), because: * The how-to-use and keybindings, while weird, are going to stick around for another 40 years and probably outlive me! * Support for languages as good as VSCode * It is fast * It can load, search and navigate big files (e.g. 1Gb) quite easily, which most non-text editors seem to struggle with (Notepad++, VSCode, etc.) This is also the reasons I am learning to use tmux, even when using Windows. Just feel it is a good investment, it is nice to use and scriptable. What puts me off is getting the muscle memory to feel productive!
- harry8 4y ago> Support for languages as good as VSCode Oh come on now that's can't even be close. Surely vim supports and order of magnitude more languages than vscode at least. I actually haven't found one without vim support yet, including a dozen assembly languages, verilog & vhdl, various horrible proprietary scripting languages and so on. Does vscode use vim syntax and script files to try and match that or something?
- simplotek 4y ago> Does vscode use vim syntax and script files to try and match that or something? Vs code supports language server protocol [1] and also includes support for syntax highlighting [2] If I recall correctly, vim supports syntax highlighting through less-than-elegant regex searches. [1] https://code.visualstudio.com/api/language-extensions/language-server-extension-guide https://code.visualstudio.com/api/language-extensions/langua... [2] https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide https://code.visualstudio.com/api/language-extensions/syntax...
- harry8 4y agoMicrosoft have made choices for vscode. Maybe even good ones? What %ge of languages supported by vim are actually supported by microsoft - or "the microsoft community?"
- omar_alt 4y agoIt just shows that ten years some plugins have come and gone as have many GUI text editors however Vim endures
- riwsky 4y agoI found myself coming home to vim recently, as well—I just now call it [helix](https://helix-editor.com https://helix-editor.com). Cuteness aside: for all the awesomeness that a tailored vim setup provides, I haven't been able to keep one stable since a decade ago, when I used an ubuntu desktop for work. Maybe I'm just getting old, but Helix's batteries-included approach to reimplementing vim has resulted in a much better experience for me in practice, even though it's lost me some features in theory (I miss you, vim-fugitive!). And my hands can't even tell it's not vim…mostly!
- AlchemistCamp 4y agoOne possible replacement for vim fugitive is tig. It’s very vim-like and gets the job done.
- ar_lan 4y agoPinning package versions has helped me ensure a completely reproducible environment. I’ve not had any instability.
- rgoulter 4y ago+1 to helix. I like the idea of using "<motion><verb>" instead of "<verb><motion>". Though, when I was first trying it out, enough of helix's keybindings conflicted (or were different).. it definitely takes a bit of effort to adjust. (e.g. I like vim's `$` to go to the end of line, but helix uses this for "filter through shell command". Helix uses gh/gs/gl instead of 0/^/$; which is arguably nicer).
- behnamoh 4y ago> And my hands can't even tell it's not vim…mostly! How? Helix is <noun> → <verb> whereas Vim is <verb> → <noun>. I'm used to deleting entire sentences using `das`, but the order is completely the opposite in Helix.
- themenomen 4y agoAnd that makes it `sad`
- keithnz 4y agoI love vim modal keybindings more than Vim, I don't really use actual vim much at all, certainly not for coding. Luckily most editors / IDEs have Vim support
- bee_rider 4y agoI can't stand the Vim plugin in VSCode, it is this awful uncanny valley thing. I'd rather just abandon all hope and get it over with.
- revicon 4y agoThis was my experience as well. I really tried to use the vim plugin for vscode but there were too many behavior differences between it and native vim. And VSCode just has too many features that I've grown to love that I just find myself learning the native VSCode bindings and using those most of the time now. I miss VIM, I really do, but I really only use it these days if I need to ad-hoc modify an individual file while I'm in a terminal somewhere.
- mcluck 4y agoYou can bind VS Code commands to vim-style commands. I have plenty of VS Code specific features bound to leader-based commands
- another_story 4y agoAre you using the plugin backed by Neovim or the other one? https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim https://marketplace.visualstudio.com/items?itemName=asvetlia...
- scruple 4y agoI use it but it's typically a source of problems to the point that I have to save everything and restart my session. You can have very, very little custom neovim configuration present. My vimrc checks if it's inside of VSCode and does nothing but I still frequently encounter problems. Weekly, at the very least. I'd love to get outside of VSCode fulltime but where I work today uses Docker for development and it's a complete pain in the ass to connect text editor plugins with services running on a remote host. VSCode has this out of the box, so it wins. My next job, I'll be sure to press for this level of detail about the development experience.
- vehemenz 4y agoTo me, the draw of Vim is the editing paradigm—modal editing, default key bindings, and complex commands. However, these things can be replicated with Vim emulation. What is the benefit of using Vim proper these days?
- llimllib 4y ago- I love the keybindings, but the draw for me is mostly in the way it handles splits. Being able to say "split this window horizontally/vertically with this other file" in very few keystrokes is the best thing since sliced bread to me - That said, I do love the keybindings, and I've not found a single vim emulation that doesn't feel wrong within a few minutes of usage. It's very, very difficult to get a realistic vim emulation mode, to the point that I'd rather not try to use it in another editor
- harry8 4y agoIn my experience vim emulation is great, almost as good as using native vim for keybindings, navigation etc but still not so comfortable. Like cuddling someone you love wearing blizzard clothing - better than no cuddle for sure but not the cuddle you'd choose as your favourite. Depending on what you're doing, the native vim plugins might well be vastly better. I swear by YouCompleteMe as a wrapper for clang-complete for navigation of a C codebase. The autocompletion is pretty good too. I Haven't seen anything better with any other editor/ide vim key bindings or not. I'm sure if you work hard enough at your s-exepression configs emacs can be as good if those are the keybindings you know and love. But why look elsewhere? <- Not rhetorical, genuine question - have you found a reason?
- dang 4y agoRelated threads - two different homecomings: Coming Home to Vim - https://news.ycombinator.com/item?id=4218575 https://news.ycombinator.com/item?id=4218575 - July 2012 (118 comments) Coming Home to Vim - https://news.ycombinator.com/item?id=1710702 https://news.ycombinator.com/item?id=1710702 - Sept 2010 (121 comments) Coming home to Vim - https://news.ycombinator.com/item?id=1619544 https://news.ycombinator.com/item?id=1619544 - Aug 2010 (34 comments) * Coming home to Vim* - https://news.ycombinator.com/item?id=329525 https://news.ycombinator.com/item?id=329525 - Oct 2008 (12 comments)
- kartoshechka 4y agonow someone needs to write nvim version of this, because some plugins have arguably better alternatives (fzf, nvimtree), you have ton of lsp clients, each with their own blows and whistles, treesitter and plugins a working on top of its tokens, also there are far more options to disguise vim as the slickest gui editor you've seen
- urthor 4y agoDark patterns in mainstream IDEs, Jetbrains & Microsoft, are extremely common. Jetbrains actively forces developers to avoid the terminal for vendor lock-in. Microsoft, ha. Embrace, extend, extinguish, (first Python, now Copilot) isn't new. Sadly, commercial software turns success into "selfish dark patterns," at the drop of a hat. I've an extremely strong urge to go to Vim. The quantity of work won't be small however. Setting up graphical debugging, refactoring, inheritance visualization, will be an enormous mountain. I'm not sure I'll ever use Vim for JVM languages. JVM languages lend themselves to enormous complexity. Likely because the IDE enables it.
- lemper 4y agoi like modal editing but i don't really care what editor it is. as long as it supports my editing habit, i'm fine with it. edit: i also keep the binding as close as vim's vanilla as possible. and that's it.
- deafpolygon 4y agoHey, so this article is 12 years old. VSC didn't exist yet (2015). I used vim because it was installed by default on just about every modern Linux server, so as an admin it was much simpler to just use vi (less easy to fat-finger a config file due to the modal). But I wasn't porting my personal config around 100's of Linux servers, unless when absolutely necessary [not every admin wants the same config]. As far as having a huge ecosystem with vi - has anyone actually done a comparison of number of 'things' that make up an ecosystem and active users between VSC, emacs, vi? I know reddit isn't a good sample size, but looking at subbed users: - vscode 95k - vi 151k - emacs 62k I'm not doubting that vi would have the larger community, but I'd have expected emacs to be larger than vscode on reddit but it is not.
- teo_zero 4y agoThe article is 10 years old. Hopefully by now he has found out how to disable Vim's smart indenting of HTML files!
- Beltalowda 4y agoHe was barking up the wrong tree too, as HTML indentation is controlled by 'indentexpr' and not 'cindent' or 'smartindent' (and was in 2011 too). These options are kind of legacy from back when Vim was mostly just an editor for C code and before there was anything like VimScript so indentation had to be in Vim itself, rather than a runtime file. It's unfortunate; I still see people confused by it today.