Earlier quoted context omitted.
I often use jjj and don't plan to change that. Forty years ago, when working on slow terminals, it may have made sense to optimize movement but not today. For small movements, I tend to spam keys. For larger jumps, I use an easy-motion like plugin such as Svart. Counting lines and words simply makes no sense to me for frequent operations.
Start using macros for bulk editing. You'll slow down, reason about your next best move, which slowly helps mastering those optimizations. Not only because they are shorter, but because sometimes they work, as opposed to visual selection etc. An example: you might find doing jjjj easier when it's a one shot task, but for macros you mainly need "down to the end of the paragraph" (}) and so on.
Learn Vim (2021)
131–140 of 215 posts
Re: Learn Vim (2021)
#132Earlier quoted context omitted.
I don't understand this attitude. It's clearly more conducive to solving problems to be able to move around our environment more quickly. It's extremely useful (compared to a beginner who only knows insert and write quit) to understand the different vim modalities as well as a few commands to jump around a file or to perform regex or to call an external command. When you're not proficient with the necessary tools, yo…
I feel like at a certain point of efficiency there are diminishing returns. A good analogy is typing speed. You don't need to have 200 wpm to be productive. Everybody adapts to how efficient they need to be at what they do. Vim is not a requirement for being productive. If it was, it would be the most popular editor. I also don't think the person you are replying to is saying that it isn't important to "master" your…
On the other hand, tools like Vim, Kakoune and Helix shouldn't be treated like your average Java IDE, for example, which shifts the line of what I'd say is reasonable learning investment. What you're dealing with there is a programming language for text manipulation. If you're fluid enough in it, you open your mind for solutions you'd never have considered before. I'd say you'd need at least intermediate Vim skills and should know macros until that effect kicks in.
I have quite some anecdotes about e.g. creating integration tests where my colleagues wouldn't test something properly just because doing so would involve 10 minutes of drudge work in their simplistic editors, instead opting for "deploy & pray" when the task was totally doable in a couple of seconds with a Vim macro. I find that at least in this regard (as for all programming languages), Benjamin Lee Whorf's quote certainly holds true: "Language shapes the way we think and determines what we can think about."
That's why I also think GP had a point. I would probably be much more in your line of thought if we were only talking about the usual contestants like refactoring snippets etc. here, although even having them handy will already influence how many of us work with our code.
Edit: As another analogy, I feel that modal editing has about the same effect on thinking as switching from roman numerals to arabic ones. The reason why it hasn't completely caught on is just that it's less intuitive and text manipulation is not as fundamentally important as calculations for our civilization.
Re: Learn Vim (2021)
#133I dunno, I never sat down to learn vim, just used it every day for a couple years. I’m not one of those wizards who is, like, answering stack overflow questions or writing wiki articles, but I get the job done. Is it necessary to learn Vim? Seems like a chore. Is the text editor really a bottleneck for anyone? I find that no matter how slow I type, I need to spend more time thinking of what to type anyway, if I’m doi…
It true that thinking takes more time than typing/editing even you type slow and don't use any hotkeys for editing, but I have a feeling that the less time/effort I spent on typing/editing the less my thinking is interrupted.
With some practice one can use quite a few vim features relying on 'muscle memory' to spend less time/effort on editing and concentrate on what matters - thinking.
Re: Learn Vim (2021)
#134I can handle basic editing in vim and I have given real tries to use it as my main text editor but I just cannot find a way to get as comfortable in vim as I can in VS Code.
I have a vim config I have used for years, but I have just gone with it now and embraced VS code, it's a brilliant tool.
Re: Learn Vim (2021)
#135I'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else…
Re: Learn Vim (2021)
#136I dunno, I never sat down to learn vim, just used it every day for a couple years. I’m not one of those wizards who is, like, answering stack overflow questions or writing wiki articles, but I get the job done. Is it necessary to learn Vim? Seems like a chore. Is the text editor really a bottleneck for anyone? I find that no matter how slow I type, I need to spend more time thinking of what to type anyway, if I’m doi…
Re: Learn Vim (2021)
#137I've re-built my neovim config like 3 times this year as I have played with several 'distributions' and styles. SpaceVim, LunarVim, AstroVim, and NVChad to name a few. This last weekend I gave LazyVim a try and it is by far the most sane config setup I have used and I will now be sticking with it. There is a starter repo where you clone it, delete the .git directory and start customizing. https://github.com/LazyVim/L…
Re: Learn Vim (2021)
#138I defaulted to Nano when I picked up linux, and that unfortunate choice has bitten me in the butt.
Having only used Nano since picking up Linux 2 years ago, I’m not sure what I’m missing. Can you make a case for me to learn Vim?
I'll do a simple one then, as an example: In vim you can select a range of lines and indent or dedent those lines. With spaces or tabs as appropriate, set per filetype (or other ways of configuring). Can this be done in nano?
Re: Learn Vim (2021)
#139I dunno, I never sat down to learn vim, just used it every day for a couple years. I’m not one of those wizards who is, like, answering stack overflow questions or writing wiki articles, but I get the job done. Is it necessary to learn Vim? Seems like a chore. Is the text editor really a bottleneck for anyone? I find that no matter how slow I type, I need to spend more time thinking of what to type anyway, if I’m doi…
Do you think everything through and then implement it? I do most of my thinking as I type.
Re: Learn Vim (2021)
#140Earlier quoted context omitted.
I feel like at a certain point of efficiency there are diminishing returns. A good analogy is typing speed. You don't need to have 200 wpm to be productive. Everybody adapts to how efficient they need to be at what they do. Vim is not a requirement for being productive. If it was, it would be the most popular editor. I also don't think the person you are replying to is saying that it isn't important to "master" your…
VS Code with vim keybindings is extremely popular. If you don't know how to use vim, you just don't realize how much of a time/effort saver it is. I can't imagine not having wrist pain if I had to use the mouse every time I wanted to move my cursor around for more than a few characters/lines. Trying to not use vim feels like going back to the stone age whenever I can't use it. I like to use vim bindings even when I'm…
Ctrl+F + what you are looking for
PgUp PgDown plus visual scan
Home, End, arrows (plus potentially control) for pinpointing the exact spot. Shift for block marking.
Ctrl+C (or X), Ctrl+V for moving stuff around.
No reason to touch mouse or learn cryptic shortcuts.