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 31 remaining solutions by signing in and submitting your own entry
#32 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

32 active golfers, 90 entries

Leaderboard (lowest score wins):
58
#1 - Peppa Pig / @PeppaPigSg

07/02/2024 at 12:54AM

60
#2 - Urtica dioica / @udioica

01/11/2013 at 06:42PM

60
#3 - John Braxler / @braxler

08/21/2014 at 03:24PM

61
#4 - RockerZZY / @rocker_zzy

05/29/2020 at 01:14AM

63
#5 - Kerson Hsiao / @KersonHsiao

01/11/2013 at 04:51PM

66
#6 - vimgolfer / @vimgolfer7

10/07/2019 at 01:26AM

67
#7 - Marco Hinz / @_mhinz_

01/11/2013 at 04:43PM

68
#8 - Petro Тrouq / @zulolosi

04/21/2013 at 01:25PM

68
#9 - Booberius / @booberius

05/29/2013 at 02:52PM

70
#10 - Asmund / @herrasbe

01/11/2013 at 05:10PM

70
#11 - Yann Moisan / @YannMoisan

01/12/2013 at 04:10PM

70
#12 - Woojung Kim 김우중 / @_kimwz

07/17/2013 at 11:42AM

70
#13 - Francois Marais / @maraisf

07/30/2014 at 05:24PM

72
#14 - Trevor Powell / @DoomedBunnies

01/21/2013 at 02:07AM

72
#15 - Niels Madan / @nielsmadan

01/31/2013 at 08:21AM

72
#16 - Joel Elkins / @dice_tea

03/02/2013 at 07:36PM

72
#17 - Rudolfs Sohn / @rudolf_son

08/28/2015 at 01:46PM

72
#18 - Иван / @wansmer

05/05/2023 at 05:22PM

73
#19 - Steve Tjoa / @stevetjoa

02/03/2013 at 05:07AM

73
#20 - David Yan / @david_yan

04/18/2013 at 07:57PM

74
#21 - Édouard M'tou / @DouardM

01/11/2013 at 01:42PM

75
#22 - martha / @hellomartha

01/16/2013 at 02:59PM

76
#23 - Vestrobaa / @Vestrobaa

07/21/2013 at 08:25PM

77
#24 - Runar / @runarfu

01/11/2013 at 07:29AM

77
#25 - talineo / @talineo_

01/29/2013 at 12:22AM

80
#26 - Sylvain Dangin / @Sylvaner03

03/01/2021 at 09:47PM

82
#27 - Fl4t / @Fl4t

01/20/2013 at 02:33AM

84
#28 - CY / @wongcy0

01/27/2013 at 09:01AM

85
#29 - Christopher Harrison / @Xophmeister

01/28/2013 at 11:23AM

85
#30 - nickGPT / @nickandbro

08/28/2024 at 06:56PM