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

Aliases for cd

Create these beautiful aliases with as few strokes as possible. Are you up for the challenge?

Start file
alias c.='cd ..'
End file
alias c.='cd ..'
alias c..='cd ../..'
alias c...='cd ../../..'
alias c....='cd ../../../..'
alias c.....='cd ../../../../..'

alias c1='cd ..'
alias c2='cd ../..'
alias c3='cd ../../..'
alias c4='cd ../../../..'
alias c5='cd ../../../../..'

View Diff

1a2,11
> alias c..='cd ../..'
> alias c...='cd ../../..'
> alias c....='cd ../../../..'
> alias c.....='cd ../../../../..'
> 
> alias c1='cd ..'
> alias c2='cd ../..'
> alias c3='cd ../../..'
> alias c4='cd ../../../..'
> alias c5='cd ../../../../..'

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 154 remaining solutions by signing in and submitting your own entry
#155 Jack Hawley / @JackHawley - Score: 271 - 01/30/20 @ 03:45
$a<CR>alias c.='<BS><BS>.='cd.<BS> ../..'<CR>alias c...='cd ..'<BS>/../..'<CR>alias c....'<BS><BS>.='cd ../../../..'<CR>alias c <BS>.....='cd ../../../..///<BS><BS>..'<CR><CR>alias c1='cd ..'<CR>alias c2='cd ../..'<CR>c<BS>alias c2<BS>3 <BS>='cd ../..//<BS>..'<CR>asl<BS><BS>lias c4 <BS>='cd ../../../..'<CR>alias ct<BS>6<BS>5/<BS>='cd ../../../../..':<BS><Esc>:wq<CR>

0 comments


Created by: @rax0m

155 active golfers, 879 entries

Leaderboard (lowest score wins):
30
#1 - eshel / @EshelBM

02/27/2020 at 03:12AM

30
#2 - countime / @countime1

03/05/2020 at 01:34AM

30
#3 - Paul Parker / @PaulDesmoParker

03/08/2020 at 05:27AM

30
#4 - John Braxler / @braxler

03/10/2020 at 06:04PM

30
#5 - Wouter Horlings / @Achilleshiel

03/12/2020 at 10:23AM

30
#6 - Oleg / @colega

03/21/2020 at 08:00PM

30
#7 - nicosierra / @nicosierra84

03/22/2020 at 09:31PM

30
#8 - edvrds / @edvrds

04/13/2020 at 05:48PM

30
#9 - せいほう / @FICSQF

04/26/2020 at 12:29PM

30
#10 - Arthur Goodman / @ArthurGoodman3

04/29/2020 at 10:56PM

30
#11 - Jonáš Šerých / @serycjon

05/13/2020 at 02:35PM

30
#12 - lamtt77 / @lamtt77

10/10/2020 at 08:09AM

30
#13 - David Kutschke / @D4KU_

11/22/2020 at 06:45PM

30
#14 - Jon Krause / @jkrause314

12/18/2020 at 03:22AM

30
#15 - Jung Yeon Park / @park_jungy

01/04/2021 at 03:20PM

30
#16 - Andreas Siegrist / @andreaszwei

01/23/2021 at 10:24PM

30
#17 - Roman Privalov / @RomanPrivalov

09/18/2021 at 04:19PM

30
#18 - moh ayaya / @AyayaMoh

08/30/2023 at 05:08PM

30
#19 - naka / @nak38223985244

12/29/2023 at 02:03PM

30
#20 - Aly Thobani / @alythobani

05/30/2024 at 12:12AM

30
#21 - Peppa Pig / @PeppaPi95550250

07/17/2024 at 12:39AM

31
#22 - Saki Gw / @Sakigw

02/18/2020 at 08:36AM

31
#23 - Jonathan Stinson / @KnightdeadJohn

02/19/2020 at 09:15AM

31
#24 - floyd / @floyd10086

03/01/2020 at 01:53AM

31
#25 - mury liang / @muryliang

04/05/2020 at 04:47AM

31
#26 - speisz / @speiszc

08/31/2020 at 12:38PM

31
#27 - quemeraisc / @quemeraisc

11/25/2020 at 02:09PM

31
#28 - chocolate / @chocola81394123

12/01/2020 at 09:49AM

31
#29 - roudens / @roudens2

12/19/2020 at 05:32PM

31
#30 - 영훈 / @odjfnrtm

01/08/2021 at 08:44AM