9 ms·
I set all 376 Vim options and I'm still a fool
- wonger_ 9mo agoKudos 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 9mo agoIf 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 9mo agoUh 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 9mo agoMind sharing your .vimrc file with the world? Would love to try it.
- psyclobe 9mo agohttps://pastebin.com/YCQmKJRJ https://pastebin.com/YCQmKJRJ
- iguessthislldo 9mo agoMost 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 9mo agomaybe throw it in your friendly neighborhood LLM
- riedel 9mo agoWhile 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 http://www.youtube.com/watch?v=TEBMlXRjhZY
- dbalatero 9mo agoI miss keys sometimes, but if it makes bad edits (it doesn't always!), I just hit `u` to undo.
- otikik 9mo agoI have been using it for 15+ years as my main editor and I still feel clumsy. I move doing jjjjjjjjjjj very often. I guess I have reached a local maxima and I don't want to invest the extra time on improving
- Lapsa 9mo 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
- eviks 9mo agoThat's a waste of time, you can use someone else's experience instead
- philipwhiuk 9mo ago> that's a wrong mindset The very idea there is a 'right mindset' is weird to me.
- GameOfKnowing 9mo ago… (For Your Love)” -Frankie Valli
- swyx 9mo ago> single keystroke could move the cursor halfway across the file to exactly the right spot. sorry what is this? exaggeration?
- astrobe_ 9mo agoNope! "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!
- Izkata 9mo agoAlso H, M, and L for high/middle/low of the lines currently visible on the screen.
- deleted 9mo ago[deleted]
- massysett 9mo agoThen there’s Emacs, where Meta - > takes three fingers!
- schemathings 9mo agoI find myself using '' as a builtin bookmark to go back to my previous spot when I use G, like gg=G'' to apply code formatting for the whole file then return to my spot.
- GrowingSideways 9mo agoYes, it's exaggeration. Modal editing cannot read your mind.
- tuan 9mo agoI 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.
- untech 9mo agoI 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 9mo 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 9mo agoAlthough, 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 9mo 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.
- Xmd5a 9mo agoHokusai wrote at the age of 75 that he would only begin to understand the structure of living beings at 100, and hoped to “reach perfection at 110.” He died at 89.
- jrm4 9mo agoThis 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 9mo agoThe 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 9mo agoI 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 9mo agoLearning 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 9mo agoBut 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.
- GrowingSideways 9mo agoI 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.
- Shellban 9mo agoAnother Emacs user here. I would argue that even Emacs is a bit of a struggle sometimes. More modern editors like Sublime Text, Kate, or even Notepad have an advantage of being intuitive. Typing on a letter always outputs that exact letter. The shift key does one thing and one thing only. Mouse integration allows for rather precise cursor placement in a way that utilizes a human's natural hand-eye coordination. The shortcuts that they do use are common across the OS (no need to remember if the copy you need is Ctrl+A - W, Ctrl+W, Ctrl+Shift+C, or Ctrl+C). Part of the issue is that operating systems have gotten more advanced and more standardized since Vi and Emacs were originally built. However, there is the case that UI designers have learned a lot over the decades. I like Emacs as well, especially when I am doing sysadmin work. However, I have to admit that it is not always intuitive. And even Emacs is more intuitive compared to the modal-nature of Vi.
- iLemming 9mo ago> have an advantage of being intuitive Emacs is incredibly intuitive - with a caveat. Once you internalize the model, things become incredibly intuitive. I love that EVERY single keypress, mouse movement and button press is nothing but the association to a piece of Lisp - documented, always available, fully modifiable, debuggable, profilable source. The intuition required is for Lisp only; once you grok that part, Emacs becomes an irreplaceable ally - nothing even comes close to what you can do in it with text. And btw, Emacs is inherently a modal editor - just like Vim. Only because you're not using modality for "text editing", it doesn't mean it is not.
- omoikane 9mo agoInstead 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 9mo agoDoes 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 9mo agoLike 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 9mo agoActually, `<n><space>` ignores things like new lines.
- arbitrandomuser 9mo agoleap.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 https://codeberg.org/andyg/leap.nvim
- Kilenaitor 9mo ago+1 Leap takes a second to get used to but I love it so much. Even if you don't get to the precise character you want, you can get so close enough that normal motion commands get you the rest of the way. I do change the bindings, tho. I have 's' leap forwards and 'S' leap backwards.
- simonkagedal 9mo agoI 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 9mo 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.
- simonkagedal 9mo agoThat is a very nice metaphor indeed!
- Uptrenda 9mo agoI 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 9mo agoyou 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 9mo agoSo 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 9mo agoOf 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 9mo agoI 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.
- shmerl 9mo agoI'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 9mo agoMaybe 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 9mo agoDepends 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 9mo agoI 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 9mo agoI'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 9mo agoI'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.
- elcapitan 9mo agoSame here. I use vim over other editors / key schemas mostly because it's easier for me than pressing a whole bunch of keys simultaneously. I use it where I can in other apps too. That's also why I only use a relatively small subset (whatever they all implement) and never spent too much time into going totally overboard with learning all its capabilities. Also, typing just isn't really that much of task in the first place. I spend way more time trying to find out what to do and how, and then finally typing it isn't as relevant that I would need to optimize it over a certain point.
- gorjusborg 9mo agoMy time with Vi/Vim is similar, measured in decades. There's a lot in Vim, and there's no requirement to be a tech maximalist. Settling at core features is not being a noob.
- troad 9mo agoI think vim's greatest problem is discoverability. It's a big enough problem that after six or so months working full time in neovim I went back to a GUI editor. I just about barely remember the most common commands, but I do not remember (at all) anything I only need occasionally. I also know myself well enough to know I will never remember this sort of thing well. I have a terrible memory for procedural / administrative / ritualistic knowledge. I'm on Sublime right now. I like it a lot less than vim, but it's far less cryptic. If I need to tile four documents and move text around, I can do so trivially by dragging, without needing a PhD in vim esoterica that I would immediately forget the next day.
- scelerat 9mo agoI 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/ 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 9mo agoHave 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 9mo agoI 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.
- samgranieri 9mo agoI’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 9mo agoStuff 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 9mo agoI 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)
- cstrahan 9mo agohttps://vimhelp.org/motion.txt.html#%7B https://vimhelp.org/motion.txt.html#%7B { [count] paragraphs backward. exclusive motion. } [count] paragraphs forward. exclusive motion.
- fuzztester 9mo agoWhat does exclusive motion mean here?
- daotoad 9mo agoMotions can be inclusive or exclusive. It works like the different ways of annotating ranges: [0,1] and (0,1). Consider the command `d` (delete) combined with the motions for `"`. First we have `da"`, it deletes the everything between the pair of `"` characters that surround my cursor. Next, `di"` deletes the contents of the `"` pair. The movement `a"` is inclusive (think 'a quote') and `i"` is exclusive (think 'inside quote'). Combined with the command you get "delete a quote" and "delete inside quote" when the mnemonics are spelled out. https://vimhelp.org/motion.txt.html#exclusive https://vimhelp.org/motion.txt.html#exclusive
- eviks 9mo agoThat's because you should've fixed the foundation instead. For example, > I frequently opened this by running q: instead of :q, and didn’t know what I had done. Now I know: But you still haven't fixed the typo-prone keybinds! And you still haven't set up a way to get this information so that next time something unexpected happens you can open your log of commands and see exactly what you've done and decide on the spot if you need to fix it. So you'd need to wait for the next chapter of the "let's read all the manuals" quest to when discover the issue > Digraphs are an obscure feature for typing obscure characters. For example, you can enter “½” in Insert mode with CTRL-K 1 2. There’s a big list in :digraphs. I don’t use this much, except for typing fractions, but I use this more than I thought I would. Of course, why would you commit that big list of obscure chars to memory??? The proper interface would be an avoidable visual feedback character picker so that if yo don't remember the "1 2" sequence you can even search for "fractions" But at this point, why bother with a bad vim component when you can invest in a more general symbol input solution and use it in vim and everywhere else.
- sudahtigabulan 9mo ago> But you still haven't fixed the typo-prone keybinds! Which key bindings are you referring to? It's not a trap, I promise! Just fishing for ideas.
- gverrilla 9mo agoAn exercise in submission.
- kuon 9mo agoI love neovim but I always forget the keybind I did set myself, "which key" helps a lot here. There are many very nice addons like this that can help!
- worksonmine 9mo ago> Vim and Neovim have more differences than I thought. Among the many changes, [...], that Q repeats the last recorded macro I followed the link where it says: > Q Repeat the last recorded register [count] times.. > {Visual}Q In linewise Visual mode, repeat the last recorded register for each selected line. That's a surprise, I have both in my config since my time on Vim but I didn't know they were implemented by default in Neovim. I guess the maintainers read the same article I did many moons ago.
- mjmas 9mo agoSomething I did a little while ago was read through most of Busybox vi's source code, and work out my own simple documentation page with most of its options. It doesn't do visual mode but it does still work with registers etc.
- pjmlp 9mo agoI used vi first in 1993 on Xenix, master it enough to use when nothing else is available, still not convinced.
- themadsens 9mo agoI was lucky enough that my first employer ran the very first 4.2BSD in Denmark outside academia (on a DEC-VAX/750), so i grew up with Bill Joy's newfangled "vi" and spent countless hours recap'ing the cheat sheet. To this day stuff like "3dw" and "d}{{[P" are just second nature. Very much enjoying moders stuff like neovim and CoC/LSP too. And yes, nvim is perferctly suitable for Java and maven with ctags/ripgrep/fzf etc. plugins
- piekvorst 9mo agoI stopped listening to Vim users one day. I can’t prove it but I feel like they don’t really understand efficiency, just following the traditions.
- allarm 9mo agoWhat's your definition of efficiency? Is ci" inside "long text here" efficient enough for you, compared to the same thing in traditional editors?
- 6r17 9mo agoAm I the only crazy one that bound awsd to movement ?
- wpm 9mo agoNo, and it always should have been awsd or ijkl