Can someone please explain to me why I should learn vim? I've made several attempts in my lifetime because I thought there would be some magical "ah-ha" moment, but it never came. Separate modes for command & insert just feels inherently clumsy and slow to me. Is there some other killer feature that can't or hasn't been reproduced by modern editors?
Show HN: I built an online interactive course that helps you learn Vim faster
131–140 of 283 posts
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#132Can someone please explain to me why I should learn vim? I've made several attempts in my lifetime because I thought there would be some magical "ah-ha" moment, but it never came. Separate modes for command & insert just feels inherently clumsy and slow to me. Is there some other killer feature that can't or hasn't been reproduced by modern editors?
Interesting, I have the opposite experience. In normal mode, I can do a lot using very few keystrokes. In editors without modes, there's always a lot of keyboard shortcuts which are difficult to remember and hard to execute.
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#133Re: Show HN: I built an online interactive course that helps you learn Vim faster
#134This looks great! Do agree with others though, that you should expose the course sections. I don’t use vim as my main IDE but I still do use it for quick edits and commit messages, so I don’t know nothing about it. Would be great to see if the course is more/less/same as my current working knowledge. But also a one-time $15 isn’t bad at all, thank you for not trying to make this a subscription :)
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#135Can someone please explain to me why I should learn vim? I've made several attempts in my lifetime because I thought there would be some magical "ah-ha" moment, but it never came. Separate modes for command & insert just feels inherently clumsy and slow to me. Is there some other killer feature that can't or hasn't been reproduced by modern editors?
It's faster. I've been using vim motions for almost 9 years at this point, 8 years in vim, vi, ex-vi, neovim, etc. Most recently I've moved to Doom Emacs (Which feels like an editor I'll be using in whatever forms it takes, for the next 20+ years). The experience of when you get used to it is essentially that you are so practiced with the motions that they become sub-concsious, muscle-memory. I don't have to think about where to place the cursor, figure out where the mouse cursor is, deal with a bunch of weird pasting tricks. To delete a line I just have to will myself to delete it (using 'dd'), just like I don't have to think about the complex action of getting up off the bed, I just do it (At least, on days when Mr Depresso isn't visiting). Eventually, it feels like the editor is part of you. And at this point I can't give up vim motions. Editing in anything else is uncomfortable and painful because the ease and speed with which vim allows me to do complex motions and actions is so convenient.
I can't speak for your experience, but for me I had to struggle through it a bit until I found the 'ah-ha' -- that might not come for you, or maybe you haven't found it yet, unfortunately.
I would look into using more motions, don't see it as a replacement for Gedit, or Atom, or any of the mouse+keyboard text editors -- it's not. Trying to use it like those will lead nowhere.
The trick that worked for me is to find motions that are convenient, and move ESCAPE to a more palatable key -- I swapped it with CAPS LOCK, since I pretty much never, ever have to use that key (I can always highlight 2 words with `v2w` and press `~`, which will swap the case of it, anyway). The 'finding of the motions' is important. I spend 90% of my time in a text editor moving, and cutting text, rather than typing. A motion like `}` allows me to move the cursor down a paragraph, `d}` will delete said paragraph, `v}y` will copy it, etc. Often I find myself deleting `t`o a place. So I can do `dt#` to delete to the comment at the end of a line. ^O will go to my previous cursor position, etc.
I would also recommend looking up Practical Vim -- it's probably the best Vim handbook out there (Easily accessible via genlib if you want to try before you buy), and there are still things in there I haven't learned and integrated into my workflow yet (For example, `vi)` to fast-edit bracket sequences, that I haven't bothered with much).
---
Regardless of all of that you need to decide if that effort is worth it for you. I know an extremely skilled programmer who writes and deals with extremely complex code just using Gedit (previously Geany).
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#136Can someone please explain to me why I should learn vim? I've made several attempts in my lifetime because I thought there would be some magical "ah-ha" moment, but it never came. Separate modes for command & insert just feels inherently clumsy and slow to me. Is there some other killer feature that can't or hasn't been reproduced by modern editors?
Higher precision in intent for many standard operations. These aren't perfectly Vim commands, but from the Vim-like 'evil mode' for emacs, I have some examples of common idioms I use frequently: - 'I want to change the name of this variable. (Change Word)' - 'I want to copy the contents of this braced block. (Yank Inside Matching-braces)' - 'I want to surround this word in parentheses. (Visual-mode (region selection)…
Holy shit, thank you. I've been looking for something like this for half a decade and never found it (I don't even know how I missed it!)
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#137Can someone please explain to me why I should learn vim? I've made several attempts in my lifetime because I thought there would be some magical "ah-ha" moment, but it never came. Separate modes for command & insert just feels inherently clumsy and slow to me. Is there some other killer feature that can't or hasn't been reproduced by modern editors?
- gqip to format (gq) a paragraph (ip).
- g?g? to ROT13 a line (doubling the operator makes it operate on the current line — in this case, g?? also works).
- y2w to copy (y) the next two words (2w) — this requires you to be at the start of the word, but you could use y2aw if you were in the middle of a word.
- dj to delete (d) two lines (j); see ":h linewise".
- dt. to delete (d) until a period (t.), not including the period.
- y% to copy (y) until the matching parentheses (%). If you aren't already on one, vim searches until a "(", which means that you can use this to copy a C-like function call.
Additionally, a subset of these operators and motions are available in plain vi, which is available on any POSIX system (Linux, macOS, *BSD, ...)
It should be possible to do this with a "regular" type of editor, where you have a keyboard shortcut to, for instance, select to the matching parentheses; there just aren't any editors (that I know of) with the same range of motions and operators as vim.
Not moving to the arrow keys or using ctrl-, alt- far outweighs the cost of switching between insert and normal mode.
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#138Earlier quoted context omitted.
Higher precision in intent for many standard operations. These aren't perfectly Vim commands, but from the Vim-like 'evil mode' for emacs, I have some examples of common idioms I use frequently: - 'I want to change the name of this variable. (Change Word)' - 'I want to copy the contents of this braced block. (Yank Inside Matching-braces)' - 'I want to surround this word in parentheses. (Visual-mode (region selection)…
> - 'I want to surround this word in parentheses. (Visual-mode (region selection) Around Word Surround-with Matching-parens)' Holy shit, thank you. I've been looking for something like this for half a decade and never found it (I don't even know how I missed it!)
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#139Well I think the nice point of doing excercise in a web browser is that you can quickly switch to another tab and search for daring questions such as " by the way why on earth does this monstrosity want me to use hjkl? That don't make any sense!!!!" https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys For a mostly data/SQL guy wanting to learn more about coding it still don't make much sense but at least I know why a…
> " by the way why on earth does this monstrosity want me to use hjkl? That don't make any sense!!!!" Indeed, why? Using hjkl is about the worst way to move around in vim...
Re: Show HN: I built an online interactive course that helps you learn Vim faster
#140Can someone please explain to me why I should learn vim? I've made several attempts in my lifetime because I thought there would be some magical "ah-ha" moment, but it never came. Separate modes for command & insert just feels inherently clumsy and slow to me. Is there some other killer feature that can't or hasn't been reproduced by modern editors?
Aside from just decades of experience in efficient editing of plain text files over slow connections plus all the modern stuff on top, I'd say text objects, which is one of the first things you learn about vim. And it's not a web browser.