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

803 active golfers, 3742 entries

Leaderboard (lowest score wins):
60
#781 - Norhan Abbas / @NorhanAbbas4

02/01/2020 at 12:31AM

61
#782 - David Hamlin / @dphamlin26

01/31/2020 at 09:53PM

62
#783 - Tom Marien 🇧🇪 ⚛️ / @Tom_Marien

08/31/2022 at 10:57AM

62
#784 - jfdg01 / @jfdg01

10/20/2024 at 09:04AM

63
#785 - Sheng Wu / @shenghis

08/25/2012 at 01:16AM

63
#786 - Craig Langford / @cllangfo

02/19/2017 at 10:16PM

63
#787 - Connor / @robotboy_69

01/31/2020 at 03:33AM

64
#788 - wilddog64 / @chengkai318

12/17/2013 at 07:12PM

70
#789 - Timothy Holland / @th0114nd

08/10/2012 at 06:04PM

70
#790 - nick / @nrehm

11/04/2013 at 09:08PM

72
#791 - Josh Pius / @JoshPius98

09/01/2023 at 06:00AM

73
#792 - Brooks Garrett / @brooksgarrett

12/29/2010 at 03:25PM

75
#793 - Mance Rayder / @AlexAckerlund

01/21/2020 at 08:16PM

92
#794 - firehaert_18 / @Firehaert1

01/31/2020 at 06:39AM

94
#795 - Stephen Paul Weber / @singpolyma

12/28/2010 at 11:48PM

94
#796 - alex ekstrom / @alexekstrom07

01/30/2020 at 08:12PM

96
#797 - Maurice Schmicking / @m_schmicking

03/26/2023 at 10:07PM

101
#798 - nickGPT / @nickandbro

08/29/2024 at 12:40AM

108
#799 - Conner / @Connconn7

01/31/2020 at 09:16PM

109
#800 - Ransom Bowman / @BowmanRansom

01/31/2020 at 07:18AM

123
#801 - Josh Gruber / @Jevitate

01/23/2020 at 02:26AM

123
#802 - Stanislav Ozeransky / @ozz-life

11/09/2024 at 03:25PM

125
#803 - Zac sliker / @Zacsliker

01/29/2020 at 04:29PM