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):
40
#61 - ややお / @yayaoh

01/07/2022 at 07:07AM

41
#62 - Bachelor / @bachelorwang

02/03/2020 at 08:21AM

41
#63 - GenericHardwareGamer / @GnrikHrdwrGamer

08/21/2020 at 12:40PM

41
#64 - Ray Dennis / @raysden

12/24/2020 at 09:29PM

42
#65 - RosaTryp / @RosaTryp

03/13/2023 at 07:50PM

43
#66 - Sushrut Shirole / @sushrutshirole

01/31/2020 at 12:11AM

43
#67 - 廖彥智 / @JeffYenchih

04/15/2020 at 09:27AM

43
#68 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 08:23PM

44
#69 - Michał / @MichalPiotrK

02/03/2020 at 11:29AM

44
#70 - 蔡徐坤真是爱吃屎 / @Hashub7

01/21/2021 at 01:27PM

45
#71 - golferN / @golferN3

02/27/2020 at 08:10PM

45
#72 - bluemartian / @bluemartianz59

03/24/2020 at 05:20PM

45
#73 - Victor Ramirez / @virako

04/01/2020 at 11:08AM

45
#74 - Nathan Hartman / @hnathan918

04/02/2020 at 02:28PM

45
#75 - Martin Bielik / @mabielik

08/10/2020 at 08:15PM

45
#76 - Gytis Vinclovas / @GytisVinclovas

10/08/2020 at 03:59PM

45
#77 - justinhj / @justinhj

01/02/2021 at 08:44PM

46
#78 - Moye_ / @moye_

02/26/2020 at 03:43AM

46
#79 - Viktor Styrud / @ViktorStyrud

03/13/2020 at 11:55AM

46
#80 - Marco / @Marco24456514

03/21/2020 at 10:03PM

46
#81 - Robberechts Arne / @ArneRobberechts

03/22/2020 at 10:04PM

46
#82 - zaid emad / @zaid_emad97

03/26/2020 at 12:01AM

46
#83 - Jeff Cui / @jeffacce

05/12/2020 at 10:10AM

46
#84 - 于吉星 / @fishermryn

05/23/2020 at 01:10PM

46
#85 - Bob / @Bob37174065

06/01/2020 at 05:57PM

46
#86 - mocihan / @mocihan

07/02/2020 at 12:11PM

46
#87 - igb43773@eoopy.com / @igb43773

08/06/2020 at 02:13PM

46
#88 - Ivan Kwong / @IvanKwong5

10/04/2020 at 08:14AM

46
#89 - zapakh / @zapakh

01/21/2021 at 05:07PM

47
#90 - Noah / @NoahRosenzweig

02/12/2020 at 11:39PM