Live data from Hacker News

Vim tricks

hillelwayne.com

31–40 of 63 posts

Re: Vim tricks

#31
post #29
post #17

Earlier quoted context omitted.

You have to make a deliberate attempt to learn it. What i would do is when coding I would focus on a single command and do it 5 or 6 times until it was engrained, then I would go to the next one. I spent about 15 days straight fairly intensively learning vim .. taht was 8 years ago. Best decision I have ever made in my entire programmign career. Now I pick up new vim commands like I am multilingual in 20 languages. A…

At my billing rate "15 days straight" is approximately equal to a low end BMW. So I think tabdo/bufdo will have to do for now. At least until I get a salaried job and can learn the rest at my employer's expense. I do think there's Pareto principle at play with all this obscure stuff. Knowing 20% gets you 80% of the benefit, every additional percent gets you exponentially smaller fraction of the remaining 20%. That's…

It doesn’t take 100% of your time to learn vim. You just work 20% slower while you are intensely learning, then you work back at 100% for a while, then you work at 120% after you have internalized everything.

Re: Vim tricks

#32

"Exobrains, on the other hand, stuff Vim full of plugins, functions, and homebrew mappings in a vain attempt to pretend they’re using Emacs." This is disturbingly accurate from my point of view. I keep wondering if I should finally jump ship and stop tweaking vim with questionable results. Spacemacs? Pure emacs + evil? Suggestions welcome.

Spacemacs is peanut butter meets chocolate. Apps like Magit and org-mode with vi's modal editing are truly superior.

Re: Vim tricks

#33
Is it bad that I've used Vi/m since the early 80's, and I still don't know (or really feel like I need to know) a lot of tricks?

Sometimes efficiency is not about "tricks"

Re: Vim tricks

#34

Earlier quoted context omitted.

I write primarily Python. Pycharm+vim bindings has been quite a pleasure in my experience. I still primarily use straight up vim with little to no mods for editing one-offs and isolated scripts.

Interesting, I don't often use Python but recent project had few 3000+ lines .py files, which make Vim _very_ unresponsive when editing. Other languages weren't so problematic but Python code is what made me look at Emacs direction at the first place.

This surprises me. How does it make vim unresponsive? I frequently open multi-GB sql files without vim choking. Are you using some particular plugins?

Re: Vim tricks

#35
post #28

Earlier quoted context omitted.

Totally. But I will tell you, is a habit built around the other options too. So I just use on any completion (which I frequently use ). Here's a dumb example (dumb because there's other ways to do it that are better) Let's say I'm overloading a function. void foo(int a, int b) {} I could do v until I fill in the b, then type ", int c)". Now it'd be totally easier to do "v backspace , int c)", but that's a different p…

Dude! That is awesome... it makes sense now. I totally didn't even know bout either! Do you rebind your caps to control as well? That was another thing I did which is 10/10

Yeah I rebind keys and write my own functions. I have a preference for distilling things that I use out of plugins[0] and into just vanilla vim (I still use plugins). I'll share my configurations[1]. I don't document it well btw and there's frequently changes. But I find that looking at others rc files many times gives me ideas that I hadn't seen before. Also, if you have any suggestions I'd love to hear them.

[0]see my git rebindings instead of using tpope's plugin

[1]https://github.com/stevenwalton/.dotfiles

Re: Vim tricks

#36
post #29
post #17

Earlier quoted context omitted.

You have to make a deliberate attempt to learn it. What i would do is when coding I would focus on a single command and do it 5 or 6 times until it was engrained, then I would go to the next one. I spent about 15 days straight fairly intensively learning vim .. taht was 8 years ago. Best decision I have ever made in my entire programmign career. Now I pick up new vim commands like I am multilingual in 20 languages. A…

At my billing rate "15 days straight" is approximately equal to a low end BMW. So I think tabdo/bufdo will have to do for now. At least until I get a salaried job and can learn the rest at my employer's expense. I do think there's Pareto principle at play with all this obscure stuff. Knowing 20% gets you 80% of the benefit, every additional percent gets you exponentially smaller fraction of the remaining 20%. That's…

Uh ok, what a weird answer.

Regardless, the benefit cannot be overstated. I am not exaggerating that it was the single greatest decision I ever made.

Re: Vim tricks

#37
post #28

Earlier quoted context omitted.

Dude! That is awesome... it makes sense now. I totally didn't even know bout either! Do you rebind your caps to control as well? That was another thing I did which is 10/10

Yeah I rebind keys and write my own functions. I have a preference for distilling things that I use out of plugins[0] and into just vanilla vim (I still use plugins). I'll share my configurations[1]. I don't document it well btw and there's frequently changes. But I find that looking at others rc files many times gives me ideas that I hadn't seen before. Also, if you have any suggestions I'd love to hear them. [0]see…

Awesome! Here's mine. I am busy atm but I will circle back and tell you my favorite tricks.

Read my README for most of my favorite tricks.

https://github.com/9mm/dotfiles

Things that come to mind

- ZSH-autocomplete is probably by far my favorite thing ever - iterm3 full overlay with means that i have a full overlay terminal immediately available no matter what im doing. No messing with stupid windows - i made my own custom theme etc you can check out

Vim favorite things

- `gx` opens the current URL under the cursor in your browser - `gq` for word rewrapping comments on the fly - `Bda!` look in my .vimrc for Bda! which deletes all open buffers, useful when youre working and have 40 open buffers you forgot about and want to start fresh

I'll think of more later!

Re: Vim tricks

#38
post #27

"Exobrains, on the other hand, stuff Vim full of plugins, functions, and homebrew mappings in a vain attempt to pretend they’re using Emacs." This is disturbingly accurate from my point of view. I keep wondering if I should finally jump ship and stop tweaking vim with questionable results. Spacemacs? Pure emacs + evil? Suggestions welcome.

I've made this request before but I would pretty interested in learning emacs the emacs way (rather than trying to emulate vim in emacs). Maybe leveraging my experience with vim in the sense that I don't need to learn what an editor is or shall basics. Something that starts from bare(ish) emacs, includes emacs lisp, and gradually adds in plugins sort of like how this post does it but maybe more comprehensive and less…

Frankly, personally I don't see a particular reason to use Emacs bindings. Afaict it's mostly just “study this flight manual and then do what it says,” simply more hotkeys in the same old editing paradigm.

Meanwhile, there's every reason to use Vim's bindings, as they specifically sidestep the ‘move cursor and then type’ approach. Besides, with Evil you'll still have plenty of Emacs chords to do for stuff that's not in Vim.

Re: Vim tricks

#39
My ex ruined my credit due to his incessant extravagant spending spree, I found myself in a big mess. I talked to a credit repair company and I was told that it would take me non less than a year to fix my credit. I was devastated, that's a very long time which I can't cope with. I looked online and came across Neo's contact, took the bold step of messaging him even though I was skeptical about the whole thing and to my greatest surprise, my credit was repaired 3 working days, my credit was restored from 337 -710. Tbh I was shocked and it didn't cost me too much. I advise you to contact him on (neogonzalezhacks at g mail dot com )for all credit issues, he replies quickly and you can text him on +1 773 688 9662 .

Re: Vim tricks

#40
post #29
post #17

Earlier quoted context omitted.

You have to make a deliberate attempt to learn it. What i would do is when coding I would focus on a single command and do it 5 or 6 times until it was engrained, then I would go to the next one. I spent about 15 days straight fairly intensively learning vim .. taht was 8 years ago. Best decision I have ever made in my entire programmign career. Now I pick up new vim commands like I am multilingual in 20 languages. A…

At my billing rate "15 days straight" is approximately equal to a low end BMW. So I think tabdo/bufdo will have to do for now. At least until I get a salaried job and can learn the rest at my employer's expense. I do think there's Pareto principle at play with all this obscure stuff. Knowing 20% gets you 80% of the benefit, every additional percent gets you exponentially smaller fraction of the remaining 20%. That's…

>At my billing rate "15 days straight" is approximately equal to a low end BMW.

So, you’re saying you are making too much money to learn something new?

Post reply on HN