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 585 remaining solutions by signing in and submitting your own entry
#586 Josh Gruber / @Jevitate - Score: 123 - 01/23/20 @ 02:26
i<BS><BS> <Down><Down><Right><Right><BS><BS>  <Up><BS><Down><Right><Right><BS><Down><Down><Right><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><Up><BS><Right><Right><Del><CR><Up> <Down><Left><Left><Left><Left><Right><Del><Left><Left><Up><Right><Right><Left><Left><Left><Up><Up><Down><Right><Right><Right><Down><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Del><BS><BS><BS><BS>s<Esc>:wq!<CR>

0 comments


Created by: @igrigorik

586 active golfers, 2631 entries

Leaderboard (lowest score wins):
50
#571 - aRkadeFR / @aRkadeFR

10/04/2013 at 11:19PM

50
#572 - Jakob Schöttl / @jschoettl

12/20/2015 at 05:14AM

53
#573 - Arnold / @Arnold59755

01/22/2020 at 06:35AM

56
#574 - Ivan Ćurković / @ivan_curkovic

11/25/2011 at 06:04PM

56
#575 - Patrick Pitoscia / @Patrick03960431

08/05/2014 at 01:55AM

57
#576 - Jenny Tsou / @TsouJenny

01/22/2020 at 09:55PM

58
#577 - Kajia Coziahr / @KajiaCoziahr

01/24/2020 at 11:37PM

63
#578 - Sheng Wu / @shenghis

08/25/2012 at 01:16AM

63
#579 - Craig Langford / @cllangfo

02/19/2017 at 10:16PM

64
#580 - wilddog64 / @chengkai318

12/17/2013 at 07:12PM

70
#581 - Timothy Holland / @th0114nd

08/10/2012 at 06:04PM

70
#582 - nick / @nrehm

11/04/2013 at 09:08PM

73
#583 - Brooks Garrett / @brooksgarrett

12/29/2010 at 03:25PM

75
#584 - Mance Rayder / @AlexAckerlund

01/21/2020 at 08:16PM

94
#585 - Stephen Paul Weber / @singpolyma

12/28/2010 at 11:48PM

123
#586 - Josh Gruber / @Jevitate

01/23/2020 at 02:26AM