Live data from Hacker News

How to boost your Vim productivity

sheerun.net

91–100 of 130 posts

Re: How to boost your Vim productivity

#91
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

> and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines, tops.

I think this is terrible advice. While it is true that one should avoid getting lost down the plugin rabbit hole, for many of us, the whole point of Vim is that it is a configurable, composable editor.

As for being "cripped" without my vimrc, well, moving tiny text files around is pretty much a solved problem at this point. And as a developer, I'd prefer to optimize my 99.9% of the time environment, and not worry about the .1% of the time I'm away from it.

I do, however, recommend that your vimrc is something you should build up over time, understanding what you are putting into it, rather than grabbing some big off-the-shelf framework and using it without understanding what is going on.

Re: How to boost your Vim productivity

#92
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

+1 for the sentiment (which I share).

I've done major swaps between Emacs and (n)vi over the years (currently all vi all the time now, but if you caught me last year, I was ~6 years into my Emacs phase...) -- anyway: the fussing and portability is what kept me from developing custom elisp scripts that I couldn't be guaranteed to have sitting down at every computer, and what now keeps me in nvi, and my nvi usage pretty "vanilla". It's not clear to me if its only the fear of getting caught w/o a custom environment is what's keeping me from developing that environment, but regardless, my env is vanilla.

Edit: typos

Re: How to boost your Vim productivity

#93
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

Good advice, gramps!

I've also been using vim for 10 or 15 years. I typically use a couple of plugins (1-3) and that's it. I leave the key bindings alone. I've never liked vimscript and have only done a few things there. Luckily I started that way and stayed that way, so vim actually has saved me time.

Re: How to boost your Vim productivity

#94
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

I started feeling the same, about the configuration time sinks ... my solution was to create ansible-configurable docker images with everything setup ... so I can throw away and recreate the images once a month, when the plugins get screwed up (which they really do, about once a month or so!):

- Go version: https://github.com/samuell/devbox-golang

- Python version: https://github.com/samuell/devbox-python

I love being able to SSH in to a fresh docker (yes, I use fat SSH:able docker), and enjoy full auto-completion for python and Go! :)

But yeah, except for the auto-completion and a few minor tweaks, there's not too much extras there.

Re: How to boost your Vim productivity

#95
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

I keep my vimrc and .vim/ in Dropbox (and backed up other places) so I'm pretty much planning on using Vim for the rest of my life...

This also means when I had a computer outage and borrowed my wife's MBA without an dev tools aside from what came with OS X, I logged into dropbox, copied my .profile from dropbox and magically had a working, customized Vim on her computer. After a Git clone I was productive in maybe 20 minutes tops. Just imagine trying to do that with visual studio (i've tried, there goes a day).

Re: How to boost your Vim productivity

#96
post #95
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

I keep my vimrc and .vim/ in Dropbox (and backed up other places) so I'm pretty much planning on using Vim for the rest of my life... This also means when I had a computer outage and borrowed my wife's MBA without an dev tools aside from what came with OS X, I logged into dropbox, copied my .profile from dropbox and magically had a working, customized Vim on her computer. After a Git clone I was productive in maybe 2…

Er, I've done this with Visual Studio... just export your settings as an XML file, import them in the new install, and of course install VsVim[1], and you're good to go.

[1] https://github.com/jaredpar/VsVim

Re: How to boost your Vim productivity

#97
post #66

Earlier quoted context omitted.

"Why don't people seem to use the F keys?" Probably because that doesn't fit well with touch typing. A great thing about vim is that you can do everything as a touch typist, without reaching for the outlying districts of the keyboard (assuming you've remapped the escape key to capslock, or learned to use ^[, or mapped it).

Additionally, on many keyboards (specifically Apple keyboards), you have to hit a modifier key plus the function key. For example, you have to hit Fn + F1 to get F1 because otherwise it's the "Lower LCD Brightness" hotkey. This makes them even less useful.

Does Apple not offer Fn Lock? Most keyboards in the last many years seem to be going this way, but it's always easy to switch it off. I certainly press F5 more often than change brightness.

Re: How to boost your Vim productivity

#98
post #22
post #5

Earlier quoted context omitted.

Suppose a range of lines contains function calls in some programming language: i = foo(a, 42, 1) j = bar(b, c, 100, 2) # this is a comment (well, duh) bazbar(etc, 3) You want to edit the last parameter in each function call -- change it to 'hello'. I have two ways of approaching this: macros (interactive) or :norm (less interactive). 1. Put your cursor on the first byte in the first line, type qq to record a macro of…

care to suggest any resources that helped you reach wizard-like levels of usage? I very much wish to work towards that kind of ability in vi/vim.

I like http://learnvimscriptthehardway.stevelosh.com/ , which covers a different set of features.

Re: How to boost your Vim productivity

#99
post #96
post #95

Earlier quoted context omitted.

I keep my vimrc and .vim/ in Dropbox (and backed up other places) so I'm pretty much planning on using Vim for the rest of my life... This also means when I had a computer outage and borrowed my wife's MBA without an dev tools aside from what came with OS X, I logged into dropbox, copied my .profile from dropbox and magically had a working, customized Vim on her computer. After a Git clone I was productive in maybe 2…

Er, I've done this with Visual Studio... just export your settings as an XML file, import them in the new install, and of course install VsVim[1], and you're good to go. [1] https://github.com/jaredpar/VsVim

Big difference:

1. You have to import/export every time a change is made!

2. Visual Studio takes like 6 hours to install.

Re: How to boost your Vim productivity

#100
post #87

Step 1 for those who really want to boost productivity (but let's be honest, most of us don't!): forget about all those plugins that are time sinks to configure and integrate with each other, about obscure tweaks that take half a day to get right, and about elaborate .vimrc's that take you so far away from 'standard' that you're crippled without them. Stick to a fairly basic standard install and a .vimrc of 50 lines,…

It's definitely a pain to install those plugins. I spent a week customizing vim when I decided to move from WebStorm back to vim. I got 95% of the functionality I have in the IDE. If you have the time, I would definitely recommend spending it. The more time you invest in vim, the more it pays you back.

If I had to choose 1 plugin, I would choose Unite. It's great for development projects where you have lots of files. Especially when you set up key bindings. Having 3+ files open at the same time (model, view, controller, tests) is a pain to have to type the paths each time. Often times you need to open them have them open at the same time. Having quick keybindings to open new windows and navigate them are really a blessing. The default controls are too much of a pain for this workflow.

Post reply on HN