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 5d00ed30cb4b5c000627f371

Tables, Functions, Sprocs

In order to load some scripts into my database in the correct order I need to load tables first (t_), then functions (fn_), then stored procedures (sp_). The order of the t_ lines and the order of the sp_ lines should also match. Reorder the lines so they will load correctly.

Start file
sp_zebra
t_orangutan
t_buffalo
sp_walrus
fn_weight
fn_food
sp_lion
t_lion
sp_buffalo
t_walrus
fn_sleep
t_zebra
sp_orangutan
End file
t_buffalo
t_lion
t_orangutan
t_walrus
t_zebra
fn_food
fn_sleep
fn_weight
sp_buffalo
sp_lion
sp_orangutan
sp_walrus
sp_zebra

View Diff

1,2d0
< sp_zebra
< t_orangutan
4,7d1
< sp_walrus
< fn_weight
< fn_food
< sp_lion
9c3
< sp_buffalo
---
> t_orangutan
11d4
< fn_sleep
12a6,10
> fn_food
> fn_sleep
> fn_weight
> sp_buffalo
> sp_lion
13a12,13
> sp_walrus
> sp_zebra

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 20 remaining solutions by signing in and submitting your own entry
#21 Paul Inc / @hiniol1982 - Score: 17 - 06/26/19 @ 19:19
:%sort<CR>:9,13m0<CR>ZZ

0 comments


Created by: @I_am_JustThat

21 active golfers, 55 entries

Leaderboard (lowest score wins):
10
#1 - Alexey Vyskubov / @avysk

06/12/2019 at 01:39PM

10
#2 - Saki Gw / @Sakigw

06/12/2019 at 02:43PM

10
#3 - Tinko Minko / @tandikula

06/12/2019 at 02:48PM

10
#4 - John Braxler / @braxler

06/12/2019 at 03:25PM

10
#5 - Jon Krause / @jkrause314

06/12/2019 at 03:46PM

10
#6 - james_bunch / @james_bunch

06/12/2019 at 05:26PM

10
#7 - Smylers / @Smylers2

06/12/2019 at 10:28PM

10
#8 - Paul Yates / @PYates77

06/17/2019 at 06:18PM

10
#9 - hodenkobold66 / @hodenkobold66

06/25/2019 at 01:15PM

10
#10 - Foo Bar / @foobar01123

07/07/2019 at 01:06PM

11
#11 - tPenguinLTG / @tpenguinltg

06/13/2019 at 05:32AM

11
#12 - albalitz / @_albalitz

06/13/2019 at 11:00AM

11
#13 - James Whitlock / @Keitarusm

06/14/2019 at 02:20PM

11
#14 - JonasS / @jonas42s

06/14/2019 at 08:18PM

11
#15 - ささ / @nick11033

06/19/2019 at 12:10PM

12
#16 - Damian Rodriguez / @damianrr

06/12/2019 at 02:35PM

12
#17 - Mac Goever / @MacGoever

06/12/2019 at 07:39PM

12
#18 - Valacar / @valacar

06/12/2019 at 11:32PM

12
#19 - majo senf / @majo_senf

06/14/2019 at 09:11AM

12
#20 - seul / @seul15987381

06/21/2019 at 04:41AM

17
#21 - Paul Inc / @hiniol1982

06/26/2019 at 07:19PM