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 666 remaining solutions by signing in and submitting your own entry
#667 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

667 active golfers, 3009 entries

Leaderboard (lowest score wins):
92
#661 - firehaert_18 / @Firehaert1

01/31/2020 at 06:39AM

94
#662 - Stephen Paul Weber / @singpolyma

12/28/2010 at 11:48PM

94
#663 - alex ekstrom / @alexekstrom07

01/30/2020 at 08:12PM

108
#664 - Conner / @Connconn7

01/31/2020 at 09:16PM

109
#665 - Ransom Bowman / @BowmanRansom

01/31/2020 at 07:18AM

123
#666 - Josh Gruber / @Jevitate

01/23/2020 at 02:26AM

125
#667 - Zac sliker / @Zacsliker

01/29/2020 at 04:29PM