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 50ef5caf767623000200004b

Execute immediate SQL

Sql string tranformation ...

Start file
insert into tabtmp
(no_part,
deptname,
firtname,
lastname
)
select
no_part,
deptname,
firtname,
lastname
from
emp e,dept d
where e.no_part=10
and d.no_part=10
and e.deptno=d.deptno;
End file
c_part:=10;
execute immediate
" insert into tabtmp"||
" (no_part,"||
" deptname,"||
" firtname,"||
" lastname"||
" )"||
" select"||
" no_part,"||
" deptname,"||
" firtname,"||
" lastname"||
" from"||
" emp e,dept d"||
" where e.no_part="||c_part||
" and d.no_part="||c_part||
" and e.deptno=d.deptno";

View Diff

1,16c1,18
< insert into tabtmp
< (no_part,
< deptname,
< firtname,
< lastname
< )
< select
< no_part,
< deptname,
< firtname,
< lastname
< from
< emp e,dept d
< where e.no_part=10
< and d.no_part=10
< and e.deptno=d.deptno;
---
> c_part:=10;
> execute immediate
> " insert into tabtmp"||
> " (no_part,"||
> " deptname,"||
> " firtname,"||
> " lastname"||
> " )"||
> " select"||
> " no_part,"||
> " deptname,"||
> " firtname,"||
> " lastname"||
> " from"||
> " emp e,dept d"||
> " where e.no_part="||c_part||
> " and d.no_part="||c_part||
> " and e.deptno=d.deptno";

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 talineo / talineo_ - Score: 77 - 01/29/13 @ 00:22
:%s/.*/" &"||<CR>:s/;.*/";<CR>:%s/10"/"||c_part<CR>ggOc_part:=10;<CR>execute immediate<Esc>ZZ

0 comments

#22 KeuZ / Fl4t - Score: 82 - 01/20/13 @ 02:33
:%s/10/"||c_part||/<CR>jf;i"<Esc>0<C-V>GGggI" <Esc>Oc_part:=10;<CR>execute immediate<Esc>qajA"||<Esc>q12@aZZ

0 comments

#23 CY / wongcy0 - Score: 84 - 01/27/13 @ 09:01
:g/./no<S-Tab> i" <CR>:v/;/no<S-Tab> A"||<CR>j$i"<Esc>:%s/10"/"||c_part<CR>HOc_part:=10;<CR>execute immediate<Esc>ZZ

0 comments

#24 Christopher Harrison / Xophmeister - Score: 85 - 01/28/13 @ 11:23
:%s/10/"||c_part||<CR>:%s/.*/" &"||<CR>:14,$s/"||$/<CR>$i"<C-O>ggc_part:=10;<CR>execute immediate<CR><Esc>ZZ

0 comments

#25 Jason Imison / JasonImison - Score: 86 - 01/14/13 @ 00:51
Oc_part:=10;<CR>execute immediate<Esc>jqq0i" <Esc>A"||<Esc>qjVG:norm @q<CR>:%s/10"/"||c_part/g<CR>jf;C";<Esc>ZZ

0 comments

#26 Tom Duijf / tomduijf - Score: 92 - 01/28/13 @ 18:02
:%s/^/" /g<CR>:%s/$/"||/g<CR>$xx<Left>x;a;<Esc><Up><Left><Left><Left><Left>xx<Up><Right><Right>xxAc_part||<Esc><Down>.ggic_part:=10;<CR>execute immediate<CR><Esc>ZZ

0 comments

Created by: zulolosi

26 active golfers, 72 entries

Leaderboard (lowest score wins):
60
#1 - Urtica dioica / udioica

01/11/2013 at 06:42PM

60
#2 - John Braxler / braxler

08/21/2014 at 03:24PM

63
#3 - Kerson Hsiao / KersonHsiao

01/11/2013 at 04:51PM

67
#4 - Marco Hinz / _mhinz_

01/11/2013 at 04:43PM

68
#5 - Petro Тrouq / zulolosi

04/21/2013 at 01:25PM

68
#6 - Booberius / booberius

05/29/2013 at 02:52PM

70
#7 - Asmund Liseth / Asmund_L

01/11/2013 at 05:10PM

70
#8 - Yann Moisan / YannMoisan

01/12/2013 at 04:10PM

70
#9 - Woojung Kim 김우중 / _kimwz

07/17/2013 at 11:42AM

70
#10 - François Marais / maraisf

07/30/2014 at 05:24PM

72
#11 - Trevor Powell / DoomedBunnies

01/21/2013 at 02:07AM

72
#12 - Niels Madan / nielsmadan

01/31/2013 at 08:21AM

72
#13 - Joel Elkins / dice_tea

03/02/2013 at 07:36PM

72
#14 - Rudolfs Sohn / rudolf_son

08/28/2015 at 01:46PM

73
#15 - Steve Tjoa / stevetjoa

02/03/2013 at 05:07AM

73
#16 - David Yan / david_yan

04/18/2013 at 07:57PM

74
#17 - Édouard M'tou / DouardM

01/11/2013 at 01:42PM

75
#18 - martha / hellomartha

01/16/2013 at 02:59PM

76
#19 - Vestrobaa / Vestrobaa

07/21/2013 at 08:25PM

77
#20 - Runar / runarfu

01/11/2013 at 07:29AM

77
#21 - talineo / talineo_

01/29/2013 at 12:22AM

82
#22 - KeuZ / Fl4t

01/20/2013 at 02:33AM

84
#23 - CY / wongcy0

01/27/2013 at 09:01AM

85
#24 - Christopher Harrison / Xophmeister

01/28/2013 at 11:23AM

86
#25 - Jason Imison / JasonImison

01/14/2013 at 12:51AM

92
#26 - Tom Duijf / tomduijf

01/28/2013 at 06:02PM