4 ms·
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.
by fokinsean 6y ago
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?
- blueagle7 6y agoMayte try learn vim the hard way? https://learnvimscriptthehardway.stevelosh.com/ https://learnvimscriptthehardway.stevelosh.com/
- fokinsean 6y agoThis looks great! Thank you!
- colinbartlett 6y agoI'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 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.
- fokinsean 6y agoLooks great, subscribed!
- clashmeifyoucan 6y agothanks for making this! The undo from insert mode¹ one sold it for me :) [1] https://vimtricks.com/p/undo-from-insert-mode/ https://vimtricks.com/p/undo-from-insert-mode/
- yjftsjthsd-h 6y agoUm. I think that's wrong, though. Pressing c-u just erases to the beginning of the line in insert mode, it's not an undo.
- colinbartlett 6y agoUpdated the post, thanks!
- clashmeifyoucan 6y agoAh, I guess should've tried before saying. Just excited there's a way.
- yjftsjthsd-h 6y agoOh, I was excited too:) So excited that I immediately tried it...
- clashmeifyoucan 6y agoAs 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<some char> 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.
- westoque 6y agoyes! 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.
- nsomaru 6y ago> 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 :)
- westoque 6y agothanks for correcting my mistakes :)
- jchook 6y agoMaybe try vim golf for fun. 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.
- brianvli 6y agoI 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
- phonebucket 6y ago> 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(;'.
- fokinsean 6y agonice, thanks for the tips
- RMPR 6y agoPractical Vim by Drew Neil is definitely a way to go. It teached me stuff I wouldn't have discovered otherwise.
- ttt0 6y agoRTFM. Seriously.
- ludston 6y agoI found that learning q has made coding without vim very annoying.
- windowojji 6y agoRead 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`. Start with `:h user-manual` and go from there!