This post will give you minimal suggestions that you can apply in your daily work to immediately increase your productivity.
I’m writing this after watching the Steve Klabnik’s screencast where he is working “in a wild”.
I love this idea and have done videoing how I work on a little ios-checkboxes and knockout-rails.
The world would an awesome place if more people (yes, including you) would start sharing the way they work. Well done Steve!
But today I want to focus on just a few things that should dramatically improve productivity.
But let me suggest some of the things that keep myself more productive.
How? Follow this guide.
I blindly trusted the command given by Garry Bernhard in his DestroyAllSoftware – Some Vim Tips on this. Never regretted.
Don’t think about it. Just do it and I’m sure you won’t go back.
How?
How?
How?
How? One example is
Rule of thumb: if you do something more then twice in the terminal outside of Vim, map it using
How? Install it from the iterm2.com site (or even use tmux!).
Use
Use
Why? Because it repeats the previous command that you should have mapped in Vim but didn’t.
How? Just type
How? Create an inputrc file and add
Hope this post will help you to leverage your tools a bit better and will teach you a thing or two.
I’m writing this after watching the Steve Klabnik’s screencast where he is working “in a wild”.
I love this idea and have done videoing how I work on a little ios-checkboxes and knockout-rails.
The world would an awesome place if more people (yes, including you) would start sharing the way they work. Well done Steve!
But today I want to focus on just a few things that should dramatically improve productivity.
Vim productivity
Vim is one of a select bunch of tools for which I have no substitute.The power of vim is huge. Very small number of people actually do know how to use most of it. I’m certainly not one of them.
It is a brilliant piece of work!
But let me suggest some of the things that keep myself more productive.
Remap your CapsLock key to Control
Why? Because the Control key is located extremely inconveniently while CapsLock is right under your baby-finger. All the time.How? Follow this guide.
I blindly trusted the command given by Garry Bernhard in his DestroyAllSoftware – Some Vim Tips on this. Never regretted.
Don’t think about it. Just do it and I’m sure you won’t go back.
Use Vim jumps
Why? A lot of times you need to jump forth and back between 2 place or go to where you’ve been a minute ago. A log of people just find that line/file again. It’s a waste of time.How?
Ctrl-o
andCtrl-i
to go to the previous/next location you jumped to.``
(two backticks) – jump back to where you were.gi
– go to the last place you inserted a text.
Use appropriate Vim navigations
Why? Typingl
(move right one symbol) or similar multiple times is waste of time.How?
{
and}
– jump paragraph back and forth.Ctrl-F/B
– move one screen back and forth.Ctrl-E/Y
– scroll the screen.*
(star) – search for the word under cursor, thenn/p
to jump to next/previous.- add
imap jj <Esc>
to your.vimrc
and don’t useEsc
anymore.
Changing case and repeating a command
Why? Because a lot of things can be done much more efficiently.How?
~
(tilde) – toggle the casing of a letter/selection (upper-case/down-case)..
(dot) – repeat the last set of commands (use in a combination with search, such as*
, and jumps).
Temporarily map commands you run
Why? Because you don’t want to type the same command over and over again.How? One example is
nmap <leader>s :! bundle exec rspec % --colour --focus<cr>
. This will run the current spec file when you press ,s
(in my case).Rule of thumb: if you do something more then twice in the terminal outside of Vim, map it using
nmap
. Don’t switch windows, don’t lose your context.Use iTerm2
Why? At least because you can split window without losing the context.How? Install it from the iterm2.com site (or even use tmux!).
Use
Ctrl-D/Ctrl-Shift-D
(while in Vim or any iTerm tab/window) to split the current terminal window opening a new shell but still being able to see what you are currently working on.
Use !!
(double bang) or arrow up
Why? Because it repeats the previous command that you should have mapped in Vim but didn’t.How? Just type
!!
and it will execute last command. This is simple, but strangely enough I can see people are actually retyping commands.Enable Vim mode in bash
Why? Because you navigate in the terminal too. And Vim mode makes it seamless.How? Create an inputrc file and add
set editing-mode vi
to it.Useful links
- Vim anti-patterns – must-read if you want to be better at Vim.
- Smash into Vim – always awesome PeepCode series on Vim.
- Vim for Rails developers – nice overview of the plug-ins and more productive use of Vim.
- Meet the Command Line and Advanced Command Line – great screencasts if you want to get better with command line.
- DestroyAllSoftware screencasts – screencasts covering Vim, Unix, Ruby.
Hope this post will help you to leverage your tools a bit better and will teach you a thing or two.