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 5598ef76c0132f45c9005238

Entries sort

It cames to my mind a weird idea : sorting parts of my .vimrc. Take few minutes to sort out this, it's easy !

Start file
set ai                                          " set auto-indenting on for programming
syntax on                                       "
turn syntax highlighting on by default
set undolevels=100
set backup backupdir=/tmp                       " swap files. (/tmp/file~)
                                               
" (see also 'set writebackup' and 'set backupskip')
iab _file <C-R>%                                "
filename (register %)
autocmd
! BufWritePost $MYVIMRC source $MYVIMRC  " auto-reload when ~/.vimrc is edited
                                                "
MYVIMRC is the platform-independent location
                                               
" of your .vimrc file
End file
autocmd! BufWritePost $MYVIMRC source $MYVIMRC  " auto-reload when ~/.vimrc is edited
                                                "
MYVIMRC is the platform-independent location
                                               
" of your .vimrc file
iab _file <C-R>%                                "
filename (register %)
set ai                                          " set auto-indenting on for programming
set backup backupdir=/tmp                       "
swap files. (/tmp/file~)
                                               
" (see also 'set writebackup' and 'set backupskip')
set undolevels=100
syntax on                                       "
turn syntax highlighting on by default

View Diff

1,6d0
< set ai                                          " set auto-indenting on for programming
< syntax on                                       "
turn syntax highlighting on by default
< set undolevels=100
< set backup backupdir=/tmp                       " swap files. (/tmp/file~)
<                                                 " (see also 'set writebackup' and 'set backupskip')
< iab _file <C-R>%                                "
filename (register %)
9a4,9
> iab _file <C-R>%                                " filename (register %)
> set ai                                          "
set auto-indenting on for programming
> set backup backupdir=/tmp                       " swap files. (/tmp/file~)
>                                                 " (see also 'set writebackup' and 'set backupskip')
> set undolevels=100
> syntax on                                       "
turn syntax highlighting on by default

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 40 remaining solutions by signing in and submitting your own entry
#41 Teemu Okkonen / @TeemuOkkonen - Score: 26 - 07/05/15 @ 15:28
:7,9d<CR>PdGggP5jddGp3kddjpZZ

0 comments


Created by: @mcr05

41 active golfers, 93 entries

Leaderboard (lowest score wins):
17
#31 - Matti Sairanen / @MattiSairanen

09/05/2017 at 12:39PM

18
#32 - Samuel Masuy / @samasuy

07/05/2015 at 07:24PM

18
#33 - 江裕诚 / @fatjyc

07/14/2015 at 02:59PM

18
#34 - Endre Galaczi / @galacziendre

08/04/2015 at 09:43AM

18
#35 - Joey / @joeyism101

09/11/2015 at 01:21AM

18
#36 - Carlos A Henríquez Q / @lagunex

03/15/2016 at 11:16PM

19
#37 - Lifepillar / @lifepillar

07/05/2015 at 02:35PM

19
#38 - James / @Dronak

11/16/2022 at 07:12PM

19
#39 - Ming / @x51ming

04/25/2025 at 12:57PM

21
#40 - Anton Davydov / @anton_davydov

07/05/2015 at 10:37AM

26
#41 - Teemu Okkonen / @TeemuOkkonen

07/05/2015 at 03:28PM