I set all 376 Vim options and I'm still a fool
124 points by todsacerdoti 3 days ago | 68 comments
  • wonger_ 3 days ago |
    Kudos for reading all those docs and sharing some nuggets.

    Does anyone else feel vim clumsy like the author? I'm trying to understand how one could accidentally lowercase a whole buffer, or trigger scary messages or open unrecognized menus. Not condescending, just curious. I find the q: thing relatable, but not the rest.

    • qbrass 3 days ago |
      If you're at the top of the buffer, guG will lowercase the whole thing.

      So if you open a file, go to type G to jump to a line, but accidentally hit g, then try to undo it with u out of habit, before hitting G again, you do the same thing.

    • psyclobe 3 days ago |
      Uh to be perfectly honest for the past … 30 years I’ve ran with a buddies vimrc and really never took the time to understand it; it was perfectly good lol and to this day I could not recreate it if I lost it.

      > lowercase a whole buffer,

      Happens a lot to me actually!

      That and accidentally incrementing a numeric value haha..

      • rcbdev 2 days ago |
        Mind sharing your .vimrc file with the world? Would love to try it.
        • psyclobe a day ago |
          • iguessthislldo 14 hours ago |
            Most of it is commented very well. Also I like it because it has a little bit of personal character.

              > " Incrementally match the search.  I orignally hated this
              > " but someone forced me to live with it for a while and told
              > " me that I would grow to love it after getting used to it...
              > " turns out he was right :)
              > set incsearch
      • swyx 15 hours ago |
        maybe throw it in your friendly neighborhood LLM
    • riedel 2 days ago |
      While I had times discovering myself to accidentally putting 'i' accidentally into MS Word docs and having vim key binding ls in VS Code (and formally eclipse) as well for that reason, I still feel clumsy. I think this is because I mostly rely on muscle memory rather than understanding deeply what I am doing to also allow me to go beyond what I normally do ) which already makes me faster than in any other editor). I found VimSpeak [1] interesting because I somehow understood how to really compose vim commands in a way

      [1] http://www.youtube.com/watch?v=TEBMlXRjhZY

    • dbalatero 14 hours ago |
      I miss keys sometimes, but if it makes bad edits (it doesn't always!), I just hit `u` to undo.
  • Lapsa 15 hours ago |
    "The feeling of true Vim fluency—one where every keystroke is exact, I never make mistakes, and I’m exploiting every obscure feature—is a fantasy, at least for me." - that's a wrong mindset. bash that jk hundred times and adapt when it becomes a nuisance
    • philipwhiuk 15 hours ago |
      > that's a wrong mindset

      The very idea there is a 'right mindset' is weird to me.

      • dbalatero 14 hours ago |
        OP didn't necessarily say that, they just said _that_ particular mindset is not it.
  • GameOfKnowing 15 hours ago |
    … (For Your Love)” -Frankie Valli
  • swyx 15 hours ago |
    > single keystroke could move the cursor halfway across the file to exactly the right spot.

    sorry what is this? exaggeration?

    • astrobe_ 14 hours ago |
      Nope! "G" moves the cursor to the end of the file. Very useful. Inferior editors have ctrl-end or alt-end, but with Vim, 90% of your lazy fingers stay on the home row!
      • massysett 14 hours ago |
        Then there’s Emacs, where Meta - > takes three fingers!
      • Izkata 13 hours ago |
        Also H, M, and L for high/middle/low of the lines currently visible on the screen.
    • GrowingSideways 14 hours ago |
      Yes, it's exaggeration. Modal editing cannot read your mind.
    • tuan 14 hours ago |
      I can see how that could work depends on the setup and the context. For example: People might use `. to jump to the last edit, or to a mark they set manually. Or simply `ciq` to edit inside the next quote without any manual cursor movements. I see people use plugin like harpoon to jump to their favorite location quickly. If you don't know about such setup, seeing people type <leader>1 to jump not just within a file, but across files, seems magical.
      • Izkata 13 hours ago |
        Capital letters for marks work across files without plugins.
    • lelanthran 14 hours ago |
      >> single keystroke could move the cursor halfway across the file to exactly the right spot.

      > sorry what is this? exaggeration?

      It is indeed. I need two keystrokes to move from an arbitrary positions in an arbitrarily long file to the exact spot I need to be.

      I use it all the time, in fact. Multiple times an hour. It's muscle memory now for me, while reading/navigating code, to automatically do `ma` or `mb` etc.

      At some later point I realise "let me read the function definition again" and then I do `'a` or `'b`, etc.

      • tuan 13 hours ago |
        if someone really want to have single keystroke, there's always F<number> key that they can map to their frequently used movements, such as last edit, next function, special marker (such as `m`), etc.
    • slim 12 hours ago |
      This can happen if you hit * when cursor is on say a function name. it gets you to the next occurance of that word. very useful
  • untech 15 hours ago |
    I rerun vimtutor from time to time, because I still don't remember every trick from it. I've recently tried to read the whole embedded "introductory documentation" on a train, learned a lot, but probably need to do it again. Setting every option in the .vimrc seems a nice exercise, will need to do it some time! I like to nuke my config from time to time anyway. (My experience with Vim is about 14 years I think.)
  • dbalatero 14 hours ago |
    > The feeling of true Vim fluency—one where every keystroke is exact, I never make mistakes, and I’m exploiting every obscure feature—is a fantasy, at least for me.

    Perfection is not particularly attainable, or necessarily the point. Nor would it be that fun, I think? It's nice to have some aspect to improve upon. See this Casals quote:

    > A reporter asked Casals, "You are 95 and the greatest cellist that ever lived. Why do you still practice six hours a day?" He answered, "Because I think I'm making progress".

    • bee_rider 14 hours ago |
      Although, also, perfection probably doesn’t come from adding options either.

      I can use hjkl y and d perfectly! :set rnu and I can even throw some numbers in there!

      • dbalatero 14 hours ago |
        > Although, also, perfection probably doesn’t come from adding options either.

        No. However, the first step to _refinement_ is knowing about the thing you want to refine, so in that sense actively engaging and learning about the option lets you know whether to pursue it further.

  • jrm4 14 hours ago |
    This feels like the "wrong" direction today with the advent of AI? Just seems like in the realm of "bending yourself to the tool vs bending the tool to yourself," it's the LATTER that's about to get a whole lot easier, if it isn't already.

    So, sure, there are probably things you can learn, but e.g. I'm much more about "I think it should be THIS way so how do I make it do that."

    • massysett 14 hours ago |
      The problem is both (1) knowing what you want, and (2) specifying what you want.

      (1) is hard enough and a necessary prerequisite to (2) which, even so, is even harder than (1).

      Good, documented software is the accumulated knowledge of people who (1) knew what they wanted, (2) implemented it, and (3) communicated how it works. AI can ease the building of such software but does not make the process trivial.

      • jrm4 6 hours ago |
        I don't believe your last sentence at all -- especially if we're talking about "bespoke software for individuals."

        I strongly predict it will be trivial.

    • AlexandrB 14 hours ago |
      Learning Vim has been one of the highest-longevity skill I picked up in University. With every new technology - autocomplete, IDEs, various GUI design interfaces - there's always a chorus of folks who say: "Well now you don't need to Vim, this new tool makes that obsolete." And every time I end up having to manipulate a mountain of text regardless - whether that's in logs, source code, configuration, or documentation. With the amount of text that AI outputs I don't see the need to manipulate text going away and Vim is one of the fastest and most flexible ways to do that.
      • jrm4 6 hours ago |
        But the thing is -- will it be?

        Which is to say, let's take two extremes. The "vim" way vs. the ultra-Emacs way, right? The thing is, it will soon become trivially easy to modify your own "text editing environment," and by you I mean everyone?

        The more I read this, the more I'm strongly predicting a resurgence in this sort of individualization.

    • uselesswords 13 hours ago |
      You are getting downvoted quite heavily but I do wonder what percentage of people are growing more and more accustomed to the latter.

      I say this someone who was dedicated to (neo)vim for a decade. With AI I spend a lot less time writing/editing pure code these days, and all the VSCode based IDEs have become so essential to my workflow/productivity that using vim only would be masochistic. I still enable the vim binds in my editor and while they’re never a perfect 100% replacement I get so much value out of other tools I can’t see myself going back.

      • jrm4 6 hours ago |
        Exactly. My journey is similar, probably because I've never had to code for a living. I started learning Vim. I dedicated 2 years to Emacs + Org-Mode.

        And eventually I left. I've come to realize (for me) anything that can't do CUA keybinding easily and well, usually out of the box, is useless to me because I use other software.

        So now I'm riding this weird middle space between Vim and Geany mostly because I haven't had time to dig into making something different. But I'm just about 100% certain that I'll be able to make a perfect-for-me bespoke text editor very soon, thanks to AI. I know it would have been possible in Emacs, I just didn't have the time.

    • shmerl 13 hours ago |
      neovim is pretty flexible and extensible if you don't want to follow default behavior.
  • GrowingSideways 14 hours ago |
    I never understood this idea that you should min/max your typing. The editor should serve you, not the other way around.

    Then again, I'm an emacs user.

  • omoikane 14 hours ago |
    Instead of having encyclopedic knowledge of every feature, I think editor fluency is being really good at the few features you need such that the editor is no longer the bottleneck.

    The few features you really need to know for VIM are mostly in `:help motion.txt`. Knowledge of other features is obviously helpful in actually editing text, but being able to navigate well should remove most of the bottlenecks, especially considering how most VIM commands take motion into account.

    • michaelbarton 12 hours ago |
      Does anyone have a motion jump plugin they use with neovim they can recommend? I used to use a plugin where you could just to a given character in a given buffer, but I can’t remember the name or if it even works with neovim.
      • jmholla 10 hours ago |
        Like the nth character in the current buffer? I believe vim has that built-in: `<n>go`. I think `<n><space>` will do it relative to your current position.
        • jmholla 3 hours ago |
          Actually, `<n><space>` ignores things like new lines.
      • arbitrandomuser 3 hours ago |
        leap.nvim

        you press a keybind and then press one or two characters , all instances of that character pair in the viewport will get get a hint (a characteror two in highlight) , hit those two hint keys and the cursor jumps to that location

        its incredibly fast to navigate around your viewport with this.

        https://codeberg.org/andyg/leap.nvim

  • simonkagedal 13 hours ago |
    I applaud this project, “setting all the options”. I think it’s a really good idea to become close friends with the software you use all the time, and getting acquainted through the lens of configuration is one way. Messing around with stuff is good.

    I feel it’s worth mentioning that there is a sense in which I think it might be a bad idea. It could be that you’d now be fixating some value that may be optimal right now, rather than benefiting from future improvements to the default settings. But it all depends, of course, on how close friends you plan to be.

    • pdmccormick 13 hours ago |
      "Become close friends with the software you use all the time." That is a beautifully evocative phrase for a lovely idea, thank you for sharing.

      If I may share an idea for which I don't have nearly as nice and succinct a summation, but I've come to view my personal computing environments through the lens of being a garden. I spend so much time within them, working, learning, playing and writing. I can see the different seasons of my life reflected through naming conventions, directory structures, scripts I've written and bookmarks I've long ignored. There are new things I want to try and explore in the spring when I hopefully have a bit more free time. I have planted seeds while children slept in my arms or in the next room, and I have enabled their dreams with the fruits of my labour. I would even say I have occasionally communed with the close and holy darkness on long, late nights.

      In time everything I have created will return to dust, and probably no one will ever know this garden as I have. But it has still been a place of growth and blessing.

  • Uptrenda 13 hours ago |
    I never understood the appeal of these command-line editors with a million commands for different edge-cases. Why not just use VSCode? It has every possible extension you already need and a simple GUI. No need to type commands just to edit text when there's a file manager... It has remote SSH and features for vm machines. To me the kinds of people using these editors are the kinds of people that love making everything more complex to seem smart.
    • suchoudh 13 hours ago |
      you do not need to install it anywhere... its already everywhere ( I am vim enthusiast )

      for eg: Keep right hand free for writing/eating by reserving left hand for mouse. (keep same settings for right handed mouse) Brrrr... :p

      • Uptrenda 13 hours ago |
        So would the use-case mostly be for people who edit lots of files over shells? I guess I was mostly thinking of coding stuff. Or do people use it for coding too?
        • Rotundo 12 hours ago |
          Of course vi/Vim is used for programming ('coding').

          I've been doing that since the early nineties. First vi, later Vim.

          I like it better than Visual Studio, better than Eclipse and way better than VScode.

        • saila 12 hours ago |
          I mostly use IDEs for day to day coding, and pretty much every IDE supports vim keybindings, which I always have enabled. I also use vim in the terminal for small edits and one-off files, so it's not either/or.

          After the initial learning curve and fiddling with settings, it just becomes natural and you can edit code or other text at blazing fast speeds. I also find that it helps with RSI by reducing arm motions reaching for the mouse.

          Of course, there are other good options out there, but if vim fits your brain, it can significantly boost your editing speed. For those who say programmers don't spend that much time typing, that's true sometimes, but there are periods after the design/planning phase where we type a lot, and I want that to go as fast as possible while I have an implementation loaded into short term memory.

          As someone who used to be a vim skeptic myself, I'd suggest you either give it another look or just accept that it works well for other people and go on with your day.

    • Rotundo 13 hours ago |
      Why use C++ when you can use BASIC?

      The learning curve can be steep but once you learn vi/Vim you can never go back to an IDE like VScode because it is so unbelievably limited.

      When you get comfortable with vi it really begins to feel like you can type text in VScode but you can't edit it.

    • tasty_freeze 12 hours ago |
      > To me the kinds of people using these editors are the kinds of people that love making everything more complex to seem smart.

      If your instinct is to be denigrate people who do things differently than you, you will never understand them. However, you get the advantage of feeling superior.

      Let me say why I continue using vi. I started using vi in the early 80s, then moved to vim in the mid 90s. Even people who aren't as old at me have more than a decade of using vi/vim/nvi. Those commands that seem like a burden to remember are completely transparent to me -- that is, I don't need to think about what keystroke to hit to achieve my ends. Why should I climb another learning curve?

      If you tell me to just download a vi mode for vscode, I can tell you that the basic motions work, but that last 10% cause unending grief. It is like eating pasta where every 10th noodle is actually a rock disguised to look like a noodle -- completely disruptive.

      I can edit quickly when I don't need to move my hands off the keyboard. Likely your dominant hand is flopping back and forth between the mouse and the keyboard when using your gui-centric editor.

      > I never understood the appeal of these command-line editors with a million commands for different edge-cases. Why not just use VSCode? It has every possible extension you already need

      I'd prefer to have a few dozen composable verbs and nouns than having to research and download "a million" extensions for the edge cases.

      > No need to type commands just to edit text when there's a file manager

      I have no idea what you mean by this. How does a file manager edit your text?

      > It has remote SSH and features for vm machines

      You can do that from vim as well. vim/nvi has a plugin ecosystem too. My own philosophy is to use as few of them as I can: one (the 'matchit' feature which ships with the editor).

      The final thing you are missing is that nobody uses all the commands -- they find the ones that work for them and they use them without further thought once it becomes muscle memory. If the need ever arises to learn a new command or setting, I'll get around to it when the time comes. If I learn a bunch of things and don't use them, they get quickly forgotten anyway.

      • zvr 10 hours ago |
        This matches my experience completely: more than 40 years using vi and then vim, my fingers and my brain know to do.

        I've tried to use VScode, especially since people said that it could emulate vi... it can't. Some of the basics are there, but then you forget you are in a different program, and use something that works in vim... and it fails. A couple of times with catastrophic results: I lost a file completely after typing a command.

        I actually repeat the experiment every year or so, but I do not see much improvement.

    • CyberDildonics 12 hours ago |
      these command-line editors with a million commands for different edge-cases

      Have you ever actually tried vim? You use the keyboard to move around and search for terms. You don't actually need to learn much.

      Why not just use VSCode?

      Because it's a bloated electron program that takes huge resources to edit text.

      To me the kinds of people using these editors are the kinds of people that love making everything more complex to seem smart.

      Seems like insecurity if you've never learned it yourself.

    • tecoholic 11 hours ago |
      I use zed now, Pycharm before that, Emacs before that, VSCode before that - one common thing amongst them all, I always install the “vim mode” plugin as the first thing. I always have a working vim/neovim setup beside all of them.

      It’s not to look smart or because I like making things complex. I am not the one to tinker too much (hence the jump between editors, if I get too invested, I move). The benefits of VIM motions have nothing to do with the editors themselves. If you have never tried it, I would strongly recommend giving vim mode a go, in whatever editor you fancy.

    • Lio 33 minutes ago |
      Since you asked:

      * I’m old. I learned Vim many years before VSCode existed and I have good muscle memory for using it.

      * Vim defines many editing commands are available in other places such as shells, db clients, REPLs so I can bring my way of working with me across OSs.

      * Learn Vim once and you know it for all time as other editors come and go.

      * Vim/NeoVim has even more plugins than VSCode both its own and via LSP, etc.

      * Vim is true FOSS. No one can take it away from you, control how you use it or insist they are given ownership of your work including training rights.

      * I’ve worked with many VSCode users since it launched. The way I see them using it seems slow to do simple tasks and unappealing.

      * Vim is getting easier to use because LLMs are making it easier to learn some of the obscure features.

      I don’t mind what editor anyone else wants to use so long as I can use NeoVim. I’ve worked some jobs where the boss insisted everyone has to use what they use and I’ve never stayed long when that happens.

  • shmerl 13 hours ago |
    I'm using neovim all the time, but I don't find this "zipping through the code" to be very critical. Most of the time is spent on thinking and analyzing it, not on fast typing or jumping through it.
    • shimman 13 hours ago |
      Maybe but I often find the bottle neck between thoughts in my head is often the speed of which I can put them in motion, with that in mind vim motions are an absolutely amazing way to interact with a keyboard efficiently.

      When using any new software my first thought is often how can I map these actions to vim motions and enable a full keyboard experience.

    • tecoholic 11 hours ago |
      Depends on what you are doing. When it’s a large codebase, trying to debug or understand a implementation, hitting * to cycle through the occurrences in a file, “gd” to jump to the function definition, Ctrl+o to go to previous position are crucial.
      • shmerl 9 hours ago |
        I sure use Ctrl-O, Ctrl-I, * and N / Shift-N etc.

        Though for definitions I rely on LSP and Ctrl-] most of the time. Never really used gd.

  • kelnos 13 hours ago |
    I've been using vim for over 20 years as my primary editor. I'm faster and more comfortable in it than I am in any other editor, but I still feel like a vim noob

    I still have to look up how to do things I rarely do (like insert the contents of another file at the cursor position). And I don't really use many (if any) of vim's intermediate features, let alone advanced ones.

    I've tried various ways to get more fluent, but nothing really stuck or kept my interest. This has always annoyed me a bit...

    • optymizer 12 hours ago |
      I've been using vim for 20 years as well, for everything other than Java code. I type my .vimrc by hand on each new machine to set a half dozen options.

      Of the intermediate features, I use tabs and, more recently, split windows.

      My favorite 'advanced' feature is visual block selection and replacement over multiple lines - super convenient.

  • scelerat 13 hours ago |
    I think it took me about four months of daily use to know most of the editor basics without having to pause to look up things. Another eight for it all to feel natural. And, maybe about six years later, it remains my favorite text entry and code editing environment.

    I've been using the LazyVim <https://www.lazyvim.org/> neovim setup and a handful of extras, but not too many. I still have to look up some esoteric stuff, but for the most part, it's completely natural.

    And for the first few years, I was a hardline keyboard-only absolutist, but lately I've been using the mouse where it makes sense, and sometimes it does.

    (MacOS, iTerm2, neovim, lazyvim, love this combo)

    • 0xFEE1DEAD 12 hours ago |
      Have you tried WezTerm yet? It also uses lua for writing its configs which makes it highly customizable.

      I've switched to it from iTerm2 a couple of years ago and gradually added more and more to my config and it's super powerful.

      • misnome 24 minutes ago |
        I have various issues with it (e.g. wrapping on resize is just broken) and miss iTerm a little, but the built-in tabs aren’t too bad (unlike Kitty’s hardline stance) and it’s available cross-platform, so I can have the same config on many machines.
    • tomcam 12 hours ago |
      > but lately I've been using the mouse where it makes sense

      Get off my lawn, hippie

  • samgranieri 9 hours ago |
    I’ve been using vim and now neovim for 15 years. Before that I was using TextMate. I’ve hand written my own config. I used Janus by Carlhuda, SolarVim, and now I’m on lazyvim because Folke is a goddamn wizard and I want to spend more time getting work done that dealing with breakage in my neovim config
  • chmod775 2 hours ago |
    Stuff like typing "10j" made sense when text editing was high latency. Nowadays you can just hold j and stop precisely where you wanted to, even if you're ssh'ing into a server on the other side of the country. There's nothing wrong with it (and in fact I prefer it because of the 0 finger movement required).

    The only times I use "precise" movement commands like that is when I'm in the odd situation of having to ssh into something from my phone.

    • laserbeam 29 minutes ago |
      I found that moving between empty lines is the nicest way to navigate most code across all programming languages, markup languages and just regular text. I don’t have to think, I don’t have to count, I just move and select text big chunks at a time… (not in vim, but I first saw someone have key bindings for this in vim)