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

119 active golfers, 575 entries

Leaderboard (lowest score wins):
36
#31 - Moatvald / @moatvald

04/14/2020 at 02:15PM

38
#32 - nico S / @der_nico_93

01/30/2020 at 02:30PM

38
#33 - majo senf / @majo_senf

01/30/2020 at 03:50PM

39
#34 - vimRunnerUp3000 / @VUp3000

01/30/2020 at 05:31PM

39
#35 - Xiangzhuo Meng / @MengXiangzhuo

02/01/2020 at 06:42AM

39
#36 - Jason Neylon / @jasonneylon

02/01/2020 at 03:47PM

39
#37 - Kris Ezra / @kris_ezra

02/05/2020 at 07:14AM

39
#38 - xiote / @xiote2

02/06/2020 at 09:24PM

39
#39 - xer0.5ive / @Bibekshah

03/13/2020 at 03:35PM

40
#40 - KingYames / @JamesZeHunter

02/17/2020 at 03:38AM

41
#41 - Bachelor / @bachelorwang

02/03/2020 at 08:21AM

41
#42 - GenericHardwareGamer / @GnrikHrdwrGamer

08/21/2020 at 12:40PM

43
#43 - Sushrut Shirole / @sushrutshirole

01/31/2020 at 12:11AM

43
#44 - 廖彥智 / @JeffYenchih

04/15/2020 at 09:27AM

43
#45 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 08:23PM

44
#46 - Michał / @MichalPiotrK

02/03/2020 at 11:29AM

45
#47 - golferN / @golferN3

02/27/2020 at 08:10PM

45
#48 - bluemartian / @bluemartianz59

03/24/2020 at 05:20PM

45
#49 - Victor Ramirez / @virako

04/01/2020 at 11:08AM

45
#50 - Nathan Hartman / @hnathan918

04/02/2020 at 02:28PM

45
#51 - Martin Bielik / @mabielik

08/10/2020 at 08:15PM

46
#52 - Moye_ / @moye_

02/26/2020 at 03:43AM

46
#53 - Viktor Styrud / @ViktorStyrud

03/13/2020 at 11:55AM

46
#54 - Marco / @Marco24456514

03/21/2020 at 10:03PM

46
#55 - Robberechts Arne / @ArneRobberechts

03/22/2020 at 10:04PM

46
#56 - zaid emad / @zaid_emad97

03/26/2020 at 12:01AM

46
#57 - Jeff Cui / @jeffacce

05/12/2020 at 10:10AM

46
#58 - 于吉星 / @fishermryn

05/23/2020 at 01:10PM

46
#59 - Bob / @Bob37174065

06/01/2020 at 05:57PM

46
#60 - mocihan / @mocihan

07/02/2020 at 12:11PM