Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d1a4d82a860b7447200008d

Whitespace, empty lines and tabs

Convert tabs to spaces, strip empty lines and trailing whitespace.

Start file
	convert tabs to spaces

		strip all blank lines 

	and remove any trailing spaces   
End file
  convert tabs to spaces
    strip all blank lines
  and remove any trailing spaces

View Diff

1,5c1,3
< 	convert tabs to spaces
< 
< 		strip all blank lines 
< 
< 	and remove any trailing spaces   
---
>   convert tabs to spaces
>     strip all blank lines
>   and remove any trailing spaces

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 624 remaining solutions by signing in and submitting your own entry
#625 Zac sliker / @Zacsliker - Score: 125 - 01/29/20 @ 16:29
<Left>d5w<Down>dwd<Left><Left><Left><Left>d5w<Down>dw<Left>d6wi<Up><Up><50-53>  convert tabs to spaces<CR>    strip all blank lines<CR>  and remove any trailing spaces<Esc>[201~<Down><Down><BS><BS><Esc>:wq!<CR>

0 comments


Created by: @igrigorik

625 active golfers, 2728 entries

Leaderboard (lowest score wins):
34
#511 - khebbie / @khebbie

06/16/2011 at 07:04PM

34
#512 - Dave Bradford / @dbradf

06/17/2011 at 11:11PM

34
#513 - James Gary / @james_gary

06/22/2011 at 07:36PM

34
#514 - Øystein Walle / @oysteinwalle

07/04/2011 at 08:09AM

34
#515 - Gary Rennie / @TheGazler

08/04/2011 at 07:47PM

34
#516 - Stanley Wang / @stanleynwang

08/25/2011 at 11:54AM

34
#517 - cameron / @cameronaustgen

09/09/2011 at 05:13AM

34
#518 - yoshi / @yoshiiiine

10/22/2011 at 01:25AM

34
#519 - Yu-Hsuan Li / @Walker_tw

12/21/2011 at 06:47AM

34
#520 - Kieran / @kgleeson

02/08/2012 at 10:03PM

34
#521 - snuffling / @snuffling

02/12/2012 at 09:17PM

34
#522 - demon.mhm / @demonmhm

02/18/2012 at 09:33PM

34
#523 - jDeveloper / @jDevEE

04/21/2012 at 11:51PM

34
#524 - ⚡ DRJ ⚡ / @midgetjones

06/08/2013 at 05:24PM

34
#525 - Alexey / @kramar42

07/04/2013 at 04:10PM

34
#526 - Sami Niiranen / @saminiir

10/13/2013 at 02:51PM

34
#527 - Jay R Bolton / @the_swerve

01/29/2014 at 02:40AM

34
#528 - Omer Lachish / @rauchy

07/27/2014 at 01:49PM

34
#529 - daveseibert / @daveseibert

08/02/2014 at 03:54AM

34
#530 - Raj / @brshenoy

04/22/2015 at 03:19PM

34
#531 - Micheal Wells / @michealwwells

08/01/2018 at 04:37PM

34
#532 - Ben Guericke / @ben_guericke

01/22/2020 at 05:33PM

34
#533 - UserForVimGolfMSU / @UserMsu

01/27/2020 at 07:59PM

34
#534 - HungkaiSun / @HungkaiSun

02/01/2020 at 01:31AM

34
#535 - RockerZZY / @rocker_zzy

06/08/2020 at 01:07PM

35
#536 - lionel young / @lionelyoung

12/28/2010 at 09:15PM

35
#537 - foo bar / @whoever_foo

12/29/2010 at 08:06AM

35
#538 - Thomas Schönwälder / @Masei1988

01/15/2011 at 07:58PM

35
#539 - nicolas bo / @thevegeta

11/08/2011 at 02:58PM

35
#540 - Dj Vimgolf / @dj_vimgolf

12/31/2011 at 07:23PM