This 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 :)
Most IDEs have a vim extension that gives you the basic vim editing behavior. It’s great to get into it without having to dive into plugins, buffers, windows etc.
Nice trial exercise on the front page. While trying it out, I wanted to use the backspace key, which in Vim moves to the last character on the previous line (when used on the beginning of a line, that is), but that didn't work - backspace on the start of the line doesn't seem to move the cursor at all.
I was pleasantly surprised that cw and D are implemented correctly though, so props on that!
> backspace on the start of the line doesn't seem to move the cursor at all.
AFAIK that's controlled by "set backspace=" and thus will vary based on one's .vimrc (or the system vimrc, installed by the package manager): https://stackoverflow.com/questions/18777705/vim-whats-the-d... One can see the current value of the backspace setting via
Actually, the 'backspace' setting only governs what the backspace key does in Insert mode. In Normal mode, which is what I was referring to in GP, has the behavior I describe regardless of how 'backspace' is configured.
Ah, my apologies; I had never considered using backspace as a navigation operation. I would guess vim does not offer customization over what the backspace key does for the same reason they don't allow changing how many spaces pressing Tab while in Normal mode moves the cursor forward, either
I was inspired by this newfound "using unexpected keys for navigation" discovery and found that (at least in my vim 8.2) holding down space in Normal mode similarly travels across the EOL boundary, just as backspace reverses that trend, so at least it's consistent
Does anybody have recommendations on how to go from "comfortable" to "expert"?
I've been using vim as my daily driver via the intellij plugin for a few years. I mostly just navigate and never do anything complicated, it gets the job done. For example I mostly use w, d, o, hjkl, y, p, w, b, t and recently discovered the `c+i` combo which is awesome. But I feel like there's still a side of vim I haven't conquered. Any tips?
I've been using Vim for many years and felt like there was constantly stuff to learn. So a partner and I started an email newsletter that sends tips twice a week:
https://vimtricks.com The idea was that by forcing myself to write about Vim consistently, I would learn and absorb more and boy has it worked.
As an aside, I love the vim keybinds with IntelliJ combo, vim makes it so easy to navigate and perform operations, eg. the one I use most being dt to delete until a char.
Never can seem to get vim selections and deletions right though, because it deletes the character after the cursor as well so the mouse comes clutch there.
yes! my path to "expert" was more in the lines of questioning my commonly used editing functions:
1. how to delete text inside a double quote and go to insert mode? - c+i+" 2. how to move to the end of line? - $ 3. how to delete everything before "x" character and go insert mode" - c+t+x ... EDIT: updated mistakes.
> 1. how to edit words inside a double quote? - "ciw"
ciw will change inner word,
ci" will change inside quotes > 2. how to move to the end of line? - "g_" $ is generally used as the noun object to represent "end of the current line" > 3. how to delete everything before "x" character" - "ctx" dtx would delete everything before the next x. ctx would delete and then put you in insert mode :)
I would recommend using vim in the console without the mouse because your editor will always give you a way out of learning. Every time you get stuck or feel inefficient, do a web search and learn one thing. Learn to use and love :help. I think a few plugins can really improve the experience such as coc, ultisnips, vim-surround. Also set some settings like relative number and highlighted yank. Some other stuff to investigate... zz and scrolling, folding, G, macros, registers, f, $ and ^ and 0, %, }, ctrl-o, ctrl-] and ctags, formatting gq = etc Edit: also remembered enable set hidden and use buffers and splits (eg :sbp). Use markers. Also I like the fzf plugin for quickly opening files etc.
I use vim as my main driver at work. Some things that helped me out personally:
- Playing some vimgolf and seeing what neat tricks people used. This is where I learned about “.” - Going into the deep-end of just using vim (or just vim in IntelliJ without the mouse) will make you notice all the issues that make you unproductive with only vim e.g getting around with only hjkl is really slow so you might investigate other ways to navigate or deleting a word always involves getting to the end of the word and using lots of backspace may make you wonder if there are more efficient ways to do the same thing - if you decide not to go into the deep-end, just being more picky about how much you’re spamming certain keys may help you gradually incorporate new commands into your flow
> For example I mostly use w, d, o, hjkl, y, p, w, b, t and recently discovered the `c+i` combo which is awesome.
In addition to these, I've found (my personal experience, ymmv): 1) f/F to jump to next/previous occurrence of character to help navigating within a line very effectively, in conjunction with ; and , to jump around within these occurences.
2) use relative line numbers in conjunction with your hjkl. E.g. jump up 5 lines and go to the start of a bracket is '5kf('. If it's a nested bracket you want, then '5kf(;'.
Read the user manual. I'm not trying to be snarky - the user manual is explicitly something that isn't the same as the reference and the user manual is called out as the next step after `vimtutor`.
Comments (280) 72 threads
Earlier commentsI was pleasantly surprised that cw and D are implemented correctly though, so props on that!
AFAIK that's controlled by "set backspace=" and thus will vary based on one's .vimrc (or the system vimrc, installed by the package manager): https://stackoverflow.com/questions/18777705/vim-whats-the-d...
One can see the current value of the backspace setting via
I was inspired by this newfound "using unexpected keys for navigation" discovery and found that (at least in my vim 8.2) holding down space in Normal mode similarly travels across the EOL boundary, just as backspace reverses that trend, so at least it's consistent
Continue this thread — 1 reply
I've been using vim as my daily driver via the intellij plugin for a few years. I mostly just navigate and never do anything complicated, it gets the job done.
For example I mostly use w, d, o, hjkl, y, p, w, b, t and recently discovered the `c+i` combo which is awesome.
But I feel like there's still a side of vim I haven't conquered.
Any tips?
https://vimtricks.com
The idea was that by forcing myself to write about Vim consistently, I would learn and absorb more and boy has it worked.
[1] https://vimtricks.com/p/undo-from-insert-mode/
Continue this thread — 3 replies
Never can seem to get vim selections and deletions right though, because it deletes the character after the cursor as well so the mouse comes clutch there.
1. how to delete text inside a double quote and go to insert mode? - c+i+"
2. how to move to the end of line? - $
3. how to delete everything before "x" character and go insert mode" - c+t+x
...
EDIT: updated mistakes.
ciw will change inner word, ci" will change inside quotes
> 2. how to move to the end of line? - "g_"
$ is generally used as the noun object to represent "end of the current line"
> 3. how to delete everything before "x" character" - "ctx"
dtx would delete everything before the next x. ctx would delete and then put you in insert mode :)
I would recommend using vim in the console without the mouse because your editor will always give you a way out of learning.
Every time you get stuck or feel inefficient, do a web search and learn one thing.
Learn to use and love :help.
I think a few plugins can really improve the experience such as coc, ultisnips, vim-surround. Also set some settings like relative number and highlighted yank.
Some other stuff to investigate... zz and scrolling, folding, G, macros, registers, f, $ and ^ and 0, %, }, ctrl-o, ctrl-] and ctags, formatting gq = etc
Edit: also remembered enable set hidden and use buffers and splits (eg :sbp). Use markers. Also I like the fzf plugin for quickly opening files etc.
- Playing some vimgolf and seeing what neat tricks people used. This is where I learned about “.”
- Going into the deep-end of just using vim (or just vim in IntelliJ without the mouse) will make you notice all the issues that make you unproductive with only vim e.g getting around with only hjkl is really slow so you might investigate other ways to navigate or deleting a word always involves getting to the end of the word and using lots of backspace may make you wonder if there are more efficient ways to do the same thing
- if you decide not to go into the deep-end, just being more picky about how much you’re spamming certain keys may help you gradually incorporate new commands into your flow
In addition to these, I've found (my personal experience, ymmv):
1) f/F to jump to next/previous occurrence of character to help navigating within a line very effectively, in conjunction with ; and , to jump around within these occurences. 2) use relative line numbers in conjunction with your hjkl.
E.g. jump up 5 lines and go to the start of a bracket is '5kf('. If it's a nested bracket you want, then '5kf(;'.
Start with `:h user-manual` and go from there!
All comments shown.
Couldn't load more comments. Check your connection and try again.