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):
31
#571 - Ben Hill / @KaizenSoze70

05/09/2016 at 05:05PM

31
#572 - Brian Hall / @_bruab_

03/23/2017 at 02:58PM

31
#573 - Marius Jurgelenas / @MarenasLT

04/12/2018 at 12:29PM

31
#574 - Sachin Akula / @AkulaSachin

08/01/2018 at 05:11PM

31
#575 - Austin / @Austin57093958

01/23/2020 at 07:44PM

31
#576 - Sean Cahill / @ess_jay_kay

10/26/2021 at 08:31PM

31
#577 - rappenstein2 / @rappenstein2

01/18/2022 at 04:58PM

31
#578 - steve / @steve35773420

03/04/2023 at 06:43PM

32
#579 - Mirosław Boruta / @m1rk00

12/28/2010 at 10:11PM

32
#580 - Christopher Suter / @cgs1019

12/29/2010 at 04:14AM

32
#581 - Cleve Pasarell / @clevepasarell

12/29/2010 at 09:23PM

32
#582 - Roman Mašek / @romario333

01/02/2011 at 06:48PM

32
#583 - Masashi Iizuka / @uochan

04/03/2011 at 07:23AM

32
#584 - Craig H. Anderson / @CootCraig

04/18/2011 at 03:23PM

32
#585 - Hervo Manuel / @Azema31

05/18/2011 at 07:11PM

32
#586 - Mikhail Korepanov / @PanyaKor

06/13/2011 at 12:55PM

32
#587 - keikun / @funkaloo

06/27/2011 at 03:38AM

32
#588 - Devon Blandin / @dblandin

08/06/2012 at 12:13AM

32
#589 - Kerry Burke / @kurver

09/18/2012 at 09:32AM

32
#590 - Jason Wolf / @zephyr_wolf

11/08/2012 at 06:10PM

32
#591 - Simon Tost / @Someone_Busy

03/09/2013 at 08:55AM

32
#592 - Matt Adelman / @Xavierstein

03/20/2013 at 06:12PM

32
#593 - Josh Johnson / @jnjosh

04/01/2013 at 07:51AM

32
#594 - Joel Taylor / @joelteon_

07/23/2013 at 02:22AM

32
#595 - Kevin Etienne / @42__kevin

08/18/2013 at 08:03PM

32
#596 - Hachez Floran / @FloranHachez

09/02/2013 at 09:52PM

32
#597 - Devin V. / @enrual

12/15/2013 at 06:16AM

32
#598 - Arthur叔 / @Arthurljg

05/11/2014 at 08:43AM

32
#599 - Jake Eaton / @Jake__Eaton

06/01/2014 at 07:05AM

32
#600 - e1mnos / @e1mnos

08/10/2021 at 04:16PM