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 by @SanderHestvik:

Unlock 5 remaining solutions by signing in and submitting your own entry
Created by: @igrigorik

816 active golfers, 3795 entries

Solutions by @SanderHestvik:
22
#341 - SanderHestvik / @SanderHestvik

06/09/2024 at 09:35PM

23
#>374 - SanderHestvik / @SanderHestvik

06/09/2024 at 09:35PM

24
#>394 - SanderHestvik / @SanderHestvik

06/09/2024 at 09:22PM

26
#>447 - SanderHestvik / @SanderHestvik

06/09/2024 at 09:14PM

27
#>476 - SanderHestvik / @SanderHestvik

06/09/2024 at 09:12PM