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

661 active golfers, 2970 entries

Leaderboard (lowest score wins):
45
#631 - Robert Xu / @RobertX97592288

11/29/2018 at 01:47AM

46
#632 - Michael Lustfield / @Profarius

12/29/2010 at 07:02AM

46
#633 - Shunichi Kanade / @shunkana

11/04/2018 at 01:35AM

47
#634 - drio / @drio

12/29/2010 at 12:22PM

47
#635 - Algor / @algor_1

10/06/2012 at 12:41PM

48
#636 - fff / @fff51460170

02/21/2021 at 06:29AM

50
#637 - aRkadeFR / @aRkadeFR

10/04/2013 at 11:19PM

50
#638 - Jakob Schöttl / @jschoettl

12/20/2015 at 05:14AM

53
#639 - Arnold / @Arnold59755

01/22/2020 at 06:35AM

56
#640 - Ivan Ćurković / @ivan_curkovic

11/25/2011 at 06:04PM

56
#641 - Patrick Pitoscia / @Patrick03960431

08/05/2014 at 01:55AM

57
#642 - Jenny Tsou / @TsouJenny

01/22/2020 at 09:55PM

58
#643 - Kajia Coziahr / @KajiaCoziahr

01/24/2020 at 11:37PM

58
#644 - Nicus / @NicusTM

01/30/2020 at 07:23PM

60
#645 - Norhan Abbas / @NorhanAbbas4

02/01/2020 at 12:31AM

61
#646 - David Hamlin / @dphamlin26

01/31/2020 at 09:53PM

63
#647 - Sheng Wu / @shenghis

08/25/2012 at 01:16AM

63
#648 - Craig Langford / @cllangfo

02/19/2017 at 10:16PM

63
#649 - Connor / @robotboy_69

01/31/2020 at 03:33AM

64
#650 - wilddog64 / @chengkai318

12/17/2013 at 07:12PM

70
#651 - Timothy Holland / @th0114nd

08/10/2012 at 06:04PM

70
#652 - nick / @nrehm

11/04/2013 at 09:08PM

73
#653 - Brooks Garrett / @brooksgarrett

12/29/2010 at 03:25PM

75
#654 - Mance Rayder / @AlexAckerlund

01/21/2020 at 08:16PM

92
#655 - firehaert_18 / @Firehaert1

01/31/2020 at 06:39AM

94
#656 - Stephen Paul Weber / @singpolyma

12/28/2010 at 11:48PM

94
#657 - alex ekstrom / @alexekstrom07

01/30/2020 at 08:12PM

108
#658 - Conner / @Connconn7

01/31/2020 at 09:16PM

109
#659 - Ransom Bowman / @BowmanRansom

01/31/2020 at 07:18AM

123
#660 - Josh Gruber / @Jevitate

01/23/2020 at 02:26AM