Monday, November 23, 2009

Indent From Insert

In the comments of my last post, graywh left a great tip that I didn't know about. If you're working in insert mode, you can change the indent level of the current line using <C-t> and <C-d>. These commands work no matter where your cursor is positioned on the current line and adjust the indent level based on your shiftwidth setting.

4 comments:

Douglas said...

Also, if you want to ditch all indent and just start at the beginning of the line again, type Ctrl-U (delete to start of line). Before you've typed anything valuable, obviously.

Steven said...

Ctrl-T and Ctrl-D have been around since old-skool "vi" days, before "vim" was even a twinkle in Bram's eye.

It's good to see that people sometimes (re-)discover the ancient incantations; still makes me feel old, but a little less out of touch ;-)

Chic said...

Say what you want, Steve, but this mere fact that i keep discovering vim and it still surprises me with things i had no idea they exist makes using it really fantastic.

btw, few days ago i went for VimMPC as a replacement for (kranky) gui players (rhythmbox etc).. i tweaked script a little.. and it's really great :). it's not exactly a vim feature, but certainly shows it's not just an editor :)

monclerjacket said...

I think the above men had given you helpful advice.
モンクレール ダウン レディース