13 ms·
Vim Anti-Patterns That Cause Beginners To:Quit
- ggm 5y ago"not being compatible with nvi (keith bostic) all the time"
- keithnz 5y agoThe article isn't really antipatterns, more just some advice on how you might want to get started. Different people like to approach things in different ways, and tend to do things however they want anyways. I'd just suggest not to give up on Vim too early, and maybe look for an easier introduction if necessary. If you are using another editor/ide, just use vim mode in that ( most have it ).
- garren 5y ago> I found myself going very deep down that rabbit hole of plugins and tweaks on multiple occasions. Of course, every time I did it for the sake of “productivity” until I snapped out of it. I’m guilty of this, although I typically don’t snap out of it so much as blow away my vimrc or start fresh. > Usually after taking a step back, asking myself “do I really need this?” - it turned out I can do just fine without devicons and the latest plugins Agreed, however the latest neovim + native lsp/lua offerings are pretty amazing. It’s a rabbit hole that I find it hard to stay out of. It’s still early days, but it seems to me that there’s a significant amount of functionality that this combo unlocks while side stepping some classic vim/vimscript pain.
- civilized 5y agoI just don't buy the premise that I will profit from spending a lot of time optimally customizing a text editor to my supposedly very unique and special needs. Seems more like a weird para-work hobby than an actual productivity hack.
- nikau 5y ago> I just don't buy the premise that I will profit from spending a lot of time optimally customizing a text editor to my supposedly very unique and special needs. > Seems more like a weird para-work hobby than an actual productivity hack. Because you will use the skills for forty years throughout your career?
- angelzen 5y agoThe set of unique and special needs follows a power law: you are going to get most of the benefits from a small set of very common commands. The long tail will be rarely used. Under a reasonable assumption that 'brain space' is finite, not filling it up with editor commands that may be used at most once a month will leave room for something more valuable instead. This applies for many other aspects in the life of an engineer: indiscriminately memorizing the options of ps/ls, specific APIs, etc.
- bluedays 5y agoThen don't. Just learn the basics. Learn how to use insert mode, edit some files, ignore anything not directly relevant. Eventually you'll come across a particular use case where opening a full blown IDE doesn't feel worth the effort, so you'll open vim. You'll learn a few shortcuts, because it would be nice to delete an entire line, or just look at the end of the file. What do you know `dd`, and `G` respectively do that for you. Eventually things will become easier in vim, and you'll just have another tool at your disposal. It took me years to begin to appreciate vim. I don't have a .vimrc, I use all the base settings. However, now that I know how to use vim it's become invaluable. The thing about vim is that it doesn't have to be complicated. It can be as easy or as hard as you want it to be.
- jpe90 5y ago> Eventually you'll come across a particular use case where opening a full blown IDE doesn't feel worth the effort, so you'll open vim. Imho there are strictly better options than vim for this nowadays for people who are not already invested in vim. Sublime text is easier for people that prefer GUIs. For CLI, Kakoune has better discoverability, better thought/more consistent commands, and actually usable colorschemes and syntax highlighting out of the box.
- civilized 5y agoYeah. It's pretty easy to delete a line in Sublime, and contrary to CLI fan wisdom, a single accurate trackpad gesture is simpler and faster than the barrage of commands needed to jump to a particular line. The studies that "prove" CLIs are faster than GUIs are decades old now, and my experience says they're obsolete.
- echelon 5y agoVim movements allow you to compose rich intentions with a matter of a few keystrokes. I find it very hard to believe that can be beat with a mouse unless someone is using gestures. More than anything, it's about not switching devices. Typing feels like playing the keyboard. Switching to the mouse feels like having to pick up a trombone between keys. (I know that's a bit dramatic of an analogy, but...)
- kovek 5y agoMost text editors work in what vim calls "insert mode" Vim also has normal mode where every key has an effect on the editing. You can jump forward, backward, delete a word, a line, yank(copy), paste. readline and MacOS Cocoa also have interesting ctrl/alt+key combinations. It's useful. You can use those vim skills in most IDEs. So, your editing will be faster in those IDEs. I believe vscode is doing a better job at extensions UX than vim. These days, webkit is allowing a smoother experience than TUIs.
- lawn 5y agoI spend all days writing code in my editor, and will probably do so for many decades to come. Even small improvements will add up to to large differences over time.
- ihateolives 5y agoMy speed of writing code (or anything else really apart from commenting on random websites) is limited mainly to my thought process about the logic I'm about to write. If you can code so fast that fractions of a second make a difference then more power to you but most people probably can't.
- lawn 5y agoAnd I spend even more time reading and refactoring code than writing it. Vim has many improvements for both of these, and all these seconds here and there really adds up in the end.
- theonemind 5y agoI used vim as my primary editor for about 2 years. It was definitely the fastest way to edit text. However, editing text is pretty minor compared to time spent thinking. For me personally, I just find moded editing slightly grating. It would also be faster if I moved around at a break-neck sprint all of the time, but slightly tiresome and unpleasant. I had the same experience with vim. It was fast, tiresome, and unpleasant. Humans don't deal well with exceptions and moded interfaces. The background hum of hitting escape and confirming my mode or occasionally hitting keys in the wrong mode was just grating.
- stnmtn 5y agoAfter 2 years you still felt that way? I've been using it for ~5 years and felt that after a year or so having to think about vim melted away and it just feels like the natural way to edit text, I barely think about the modes I'm in anymore It's that line in the Matrix where he goes "Eventually you don't see the numbers. You just see blonde, redhead, brunette"
- bravetraveler 5y agoCustomizing can definitely be a time sink, and I tend to agree. It's not portable! I'd rather know/use the defaults, there's benefit to be had there. Most importantly for me, it will be on every server I ever have to log into/maintain. GUI editors won't, and the hassle getting the output to where I need it doesn't fit well with workflows like mine. Also... the config management stuff I write (YAML/Python+Jinja) is well enough supported as-is. Don't need much more than indentation preservation... There's always a pane available to the side for ansible-doc/manual pages as a reference. The only unusual thing I carry around with me is this: alias vimtabs="vim -c ':tab all'" It just makes it easier to open many files in the same editor with simple shell globbing.
- gegtik 5y agosame here. vim is on every machine that I need, and if I become accustomed to non-standard bindings now I am burdened with context switching between personal-vim and standard-vim. I'd rather adapt to stock standard
- asdff 5y agoThis is why I use nano. forgot one of the important keybinds? its right there on the footer.
- heavyset_go 5y agoCheck out micro[1], there's no need to learn key shortcuts because it uses the same ones that every IDE or text editor ever uses. It also has full mouse support. [1] https://micro-editor.github.io/ https://micro-editor.github.io/
- nemetroid 5y agoI agree. My .vimrc, that I've used for the last ten years or so, is six lines long.
- ashton314 5y agoWait until you get RSI. I’ve tried to cut down on the number of keystrokes I have to do something (Emacs user here, recently switched to evil-mode) and I’m more comfortable and productive. Do you customize your command line at all? What about your desktop? Keyboard? Chair? Office? Editor is just another part of the stack.
- smitty1e 5y agoI came to vim via https://www.spacemacs.org/ https://www.spacemacs.org/ I recommend https://vimvalley.com/ https://vimvalley.com/ highly. Devoting resources to getting into modal editing was a helpful investment for doing headless work in the cloud over SSH.
- systemvoltage 5y agoI used to dislike vim because of its steep learning curve - my brain would say "I'll always forget it and it won't be worth it". After learning vim (only the very basics), it continues to put a smile on my face now and then. It's like someone has given me 8 to 10 lego pieces and what I can do can be imagined on the spot. Stack the lego pieces and voila, yet another smile on a rather dim morning. Vim is great, but I totally understand my old self that was put off by the elite/snob culture and their ways to scare you away. All said, if you don't know vim and don't want to learn it, you're not missing out on an occasional smile and a kick in discovering ysa2t or whatever the command. It's not as hyped up as it is treated by the elites. It's good.
- elsjaako 5y agoI completely agree. Vim isn't lifechanging, but it's good. Once you're basically confident it's very nice, but you can still use other editors. RPN calculators on the other hand...
- Scarbutt 5y agovim anti-pattern number one: not switching to emacs
- pliftkl 5y agoAs an older guy this made my smile, and also a little nostalgic for the flame war that this might have ignited 20 years ago.
- blackbear_ 5y agoThe flame is alive and well, just look at the comments! Now that Emacs got out of the way (hah!) Vim is dealing with the next contender, vs code.
- mehphp 5y agoI tried, I really did, but it legitimately turned into a literal painful experience for me.
- drekipus 5y agoThere's been a number of "anti-vim, use a real ide(TM)" posts coming into my feed lately and I don't get why. Do people really get buttmad about this? I switched from vscode to vim as I found it to be largely much faster in getting around when I started my new job, some people find the opposite. A ok. Why do people try to force us into these largely closed solutions? ( Mainly it's vscode, which has a real EEE threat)
- vintermann 5y agoI've never gone for vi(m), even after roughly 25 years of using Linux now. I'm not trying to force you into anything, certainly not anything closed. I used NEdit until its lack of utf-8 and ancient GUI library started causing trouble. Then I used Slava Pestov's JEdit, which was wonderfully extensible and portable. Now I use vscode, which is just so outrageously well made that even electron and Microsoft can't scare me away from it. All are open source. (Don't know what you mean by EEE threat, googling it doesn't help.) But modal editing is just a bad idea. We've known since the 70s. One of the most solid things to come out of behavioural psychology was the idea that switching contexts - so that the same thing does something different - has a cost, and isn't a great idea when designing a user interface. Imagine you had a car with stick shift. But you also had a little button on the dashboard, which, if you pressed it, toggled so that the stick shift controlled your car radio instead of your gearbox. Obviously, that would be a terrible idea. Still, people might get used to it. They might even get so used to it that they would defend it and complain when the feature wasn't there. All I see that's really different about modal editing is that the stakes are lower when you make mistakes. But it's, bizarrely to me, become a matter of prestige and pride for some to use an antiquated UI design. I'd understand it if you grew up with it, but odds are you didn't. Even the guy who tried to push it on me back in the 90s didn't either. It's like everyone's zipping around in electric cars, and some people still swear by those gear/radio sticks.
- wruza 5y agostick shift That is an unfair comparison on the edge of a strawman. In vim, you see your mode right at the cursor shape (bar in insert, block in normal, selection in visual). It’s like saying that DEs are bad because switching active windows is modal. Why not send input to the first window in the taskbar by holding ctrl and to the second by holding ctrl-shift then? Does that sound absurd? Even when you make a modal mistake once in a while, no stakes are lost because uu. One thing I agree on is that UI could use more graphics, smoothness and features. But all my attempts to adopt vscode failed miserably. It’s just too mouse-y and too configure-y but still lacks futuristic features I want.
- Aperocky 5y ago> Don’t go all-in That's how I got over the learning cliff though.. I had a rudimentary understanding of vim for a few years, but what really made me prolific at it was a point where I decided to forego productivity for a month and use it full time (not vim binding in IDE, just full vim, with vim plugins and whatnot). It coincided with a new job, and I only had to slightly wean myself off vim by conceding Java to intellij (but with vim binding). I still edit all other languages in vim directly, when there are many packages and distracting threads, vim is fast because it skips setup process and works everywhere in the same way.
- travisgriggs 5y agoI’ve used vi(m) since 1989. I still use it lots. A while ago though, I made an interesting realization/admission (at least for me). Vim is great for small files (because it’s ingress is so quick and fluid and universal) and pretty good at editing/tweaking existing content. But I have found it painful for original authoring of large original content. So if I need to rough out the first go at a python/elixir/c code base of anything that’s gonna be larger than two screens of text, I’ll pull out a “real” editor and build it up. As I switch back into tweaking mode past the original splurge of content creation I often go back to Vi(m). It’s ability to navigate/modify existing code is unparalleled. That’s been my experience at least.
- drekipus 5y ago> But I have found it painful for original authoring of large original content, .... anything larger than two screens of text. I guess the balance is in how much you're writing compared to editing; I'd hazard a guess to say that most programmers are editing code mainly, with only short bouts of creation. Whenever I'm creating, I always need to modify as I go; spelling errors, re-order thoughts, delete entire words, etc. and I find the vim keybindings too mnemonic to not use anywhere else. Even when I'm writing research papers on sharelatex.org, I still try to turn on vim mode, because I find myself trying to type ":w" and "ciw" all over the place.
- jonfw 5y agoThat's funny, I'll actually do the opposite I like to rough out code in Vim, and clean it up before I run it in vscode. Vim is so fast and I can get the majority of the structure out quickly, and than I can mouse around in vscode and make sure my arguments to functions are in the right order and that sort of thing
- imbnwa 5y agoI honestly can't stand editing large amounts of text without vim after learning it six years ago. Writing social media comments in a <textarea> is one thing, but anything I actually intend on seriously editing? Can't live without (neo)vim. My brain now cringes at the thought of reaching for my mouse, pointing, clicking, then dragging, and moving my fingers in weird, uncomfortable positions to do things like copy and paste.
- weaksauce 5y agoi have taken to vscode because of the nice that is all the extensions. that said it can have neovim as a backing editor so that's what i use and it's not amazing but pretty great overall
- hresvelgr 5y agoI used to spend a lot of time messing with Vim configs, memorised enough shortcuts to save me time, and set them up in my dotfile repo. I have since switched to VS Code permanently and I would not look back. It just works with so many toolchains/workflows, and as much as I dislike electron, it is in my estimation, no less productive than my Vim-zealot setup. The command palette is good enough to navigate functionality for me. It is my personal opinion that there is no good reason to learn Vim or its variants nowadays with the current tooling available. We should be trying to innovate on something better than text editing for producing code because there has been next to _zero_ innovation (imo) in paradigms for producing code for literal decades and I know there is an opportunity for something better. I don't know what that kind of 'better' would look like but I'd be really interested to find out.
- MobiusHorizons 5y agoprobably the single most useful thing in NeoVim is :set inccommand=nosplit This lets you see the results of commands (like complex regex for example) while you type them. For me this has made a huge difference to the enjoyment of refactoring code. It is both possible and fun to try a ridiculous regular expression with lots of capture groups or even one that works across newlines when I can watch the results as I type. Saddly this only works in NeoVim to my knowledge, not in regular vim, but it's pretty amazing.
- jeppesen-io 5y agoThank you so so much!
- MobiusHorizons 5y agoIt really is amazing isn’t it?
- btheshoe 5y agoI know enough vim and emacs that if I'm stuck somewhere and have to use it, I'll be fine. I'm sticking with vscode for day to day work though. I've experimented with vscode's vim extension , and it seems like the best of both worlds.
- rasz 5y agoFirst time I tried VIM I just rebooted my computer to quit.
- gojiberries 5y agoThe best tip imho is to use `vimtutor`. It's installed on every machine that has vim (to the best of my knowledge) and provides an interactive tutorial that builds on itself to teach vim knowledge. It's really cool, if you haven't checked it out just fire up a terminal and give it a play.
- HomeDeLaPot 5y agoVimtutor is what finally got me into vim after trying it and quickly abandoning it a couple times. The interface finally "clicked" in my head and I was able to edit text quickly with a little practice. I've used vim a lot more since.
- buescher 5y agoHow would you distinguish between an exhaustive list of vi anti-patterns and a vi tutorial?
- deeblering4 5y agoVim is like anything in computing. Confusing at first, eventually you have an "ah-ha!" moment, and in time it becomes second nature. But there are also different personal preferences. I'd say vim is great if you work frequently in a terminal and prefer the keyboard to the mouse. It's not for everyone and that's ok.
- Symmetry 5y agoSomething I've always wanted to do is create modal editor keybindings designed to have the easiest learning curve possible for someone coming from CUA keybindings but still off the power of what you get with vim down the road. The idea is that in insert mode ctrl-c, ctrl-v, and so on work the say you'd expect and in normal mode you would just type c or v for the same effect.
- bern4444 5y agoOne tool that helped me a lot was learning about :h usr_01.txt. There are 45 or so of these pages. Reading through some of them was one of the most useful ways to learn vim. What's weird is very few blogs or articles mention these even existing despite the suggestions for using vimtutor or reviewing the :h command for finding help on specific settings.
- blacktriangle 5y agoSame goes for Emacs, nobody points you to the Info system, which is absolutely amazing. Perhaps this is because both vimtutor and the Emacs tutor do refer to their respective help systems, but given the sad state of most help systems beginners are familiar with I think they can be forgiven for not taking the recomendation seriously. Its worth really emphasizing to beginners that there is a follow up to the simple vimtutor/TUTORIAL built right into the editor.
- Jach 5y agoIn the age of google everything, it seems like people don't even consider that built-in help could be a thing. And people just don't seem to read. vim's startup message contains: VIM - Vi IMproved version whatever by Bram Moolenaar et al. Vim is open source and freely distributable Become a registered Vim user! type :help register<Enter> for information type :q<Enter> to exit type :help<Enter> or <F1> for on-line help type :help version8<Enter> for version info Things in <> are even colored so you can see them easier. Wow, it's so hard to figure out how to exit! Oh well, vim is doing fine.
- ziml77 5y agohow often are people opening vim with no buffers? Even if I'm creating a file, I know what name I want to give it so I'll invoke vim with that as the argument
- markenqualitaet 5y agoPersonally I think, whatever ctrl-s is doing instead of saving, is the only really hostile default in vim. To a beginner it's the "mysteriously break vim for good" shortcut. And maybe the lack of ctrl-c/-v clipboard management. I hate pasting things into default vim.
- justinsaccount 5y agoThat is not vim, ctrl-s/control-q turn on/off flow control. Very useful if you want to temporarily pause command output. You can turn it off using `stty -ixon`, and this also wouldn't be a problem in a graphical vim, but vim would need to have a keybinding for it.
- markenqualitaet 5y agoOh, yeah right. Thanks. I forgot the details there. This even goes to your e.g. .bashrc right? Tho, couldn't vim overwrite this somehow? In any case, this legacy feature is a major pain in the ass for beginners. Today ctrl-s/-c/-v and maybe ctrl-z have another meaning IMO and sticking to legacy is messing with heads unnecessarily. Pantheon terminal manages to e.g. make ctrl-c context dependent copy/cancel.
- flyinghamster 5y agoCan distros quit shoving unexpected behaviors and options down our throats? Nothing like trying to edit a YML file and have vim go all wacky on the indentation, or trying to paste text into an xterm and have vim intercept my mouse. No, I was expecting to see my terminal's right-click menu. Yes, that's what .vimrc is for, but now that's one more config file to keep track of.
- Koshkin 5y agoWhile I enjoy using vi*, in today's practical terms it itself seems like an anti-pattern, unfortunately: as soon as I leave my closet and reenter the big world, I always have trouble readjusting to the "normal people's" keybindings...
- vram22 5y agoMay not be relevant for all beginners to vim, but this StackOverflow answer is really like (for lack of a better term) the Zen of vim (for beginners): "Your problem with Vim is that you don't grok vi.": It is the top answer to this question: https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim https://stackoverflow.com/questions/1218390/what-is-your-mos... Also check out the "A sobering thought paragraph" at the end. Related to that, a plug by yours truly, for my own vi quickstart tutorial (including why it was written), is linked from this tweet: "Why I teach vim" (the "I" there is someone else): https://mobile.twitter.com/vasudevram/status/1327912230881435648 https://mobile.twitter.com/vasudevram/status/132791223088143...