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):
31
#31 - Sammit / @somemeatjain

02/05/2022 at 12:32PM

31
#32 - Luoyb / @Luoyb

10/27/2023 at 05:34AM

33
#33 - jrddp / @jrddp0

02/13/2020 at 03:17AM

33
#34 - Xor547 / @Xor547

02/16/2020 at 12:17PM

33
#35 - howanto / @ho_wan_

02/16/2020 at 10:44PM

33
#36 - yhetsugiHMC / @yhetsugi

02/19/2020 at 02:48AM

33
#37 - Bspammer / @Bspammer

05/07/2020 at 11:52AM

34
#38 - Smylers / @Smylers2

01/30/2020 at 10:22AM

34
#39 - Tefe / @tefetic

01/30/2020 at 08:58PM

34
#40 - Oskar Fridell / @rax0m

02/04/2020 at 09:45AM

34
#41 - Kyle X. Clark / @KyXr_Clark

02/07/2020 at 08:58PM

34
#42 - Alexander Bessonov / @nonsleepr

02/13/2020 at 07:17PM

34
#43 - Adam Hartz / @awareofnow

03/06/2020 at 03:54AM

34
#44 - BnnGolfer / @BnnGolfer

03/21/2020 at 12:12AM

34
#45 - Leland Paul Kusmer / @lelandpaul

10/27/2020 at 04:11PM

34
#46 - hepebexè / @hepebexe

11/15/2020 at 06:48PM

35
#47 - Robber Toe / @robbertoe

02/06/2020 at 03:38AM

36
#48 - Golfer9001 / @golfer9001

01/31/2020 at 01:01AM

36
#49 - Moatvald / @moatvald

04/14/2020 at 02:15PM

37
#50 - A A A / @37fatos

01/09/2021 at 08:28PM

37
#51 - dorianm / @dorianm

05/08/2022 at 03:46AM

38
#52 - nico S / @der_nico_93

01/30/2020 at 02:30PM

38
#53 - majo senf / @majo_senf

01/30/2020 at 03:50PM

39
#54 - vimRunnerUp3000 / @VUp3000

01/30/2020 at 05:31PM

39
#55 - Xiangzhuo Meng / @MengXiangzhuo

02/01/2020 at 06:42AM

39
#56 - Jason Neylon / @jasonneylon

02/01/2020 at 03:47PM

39
#57 - Kris Ezra / @kris_ezra

02/05/2020 at 07:14AM

39
#58 - xiote / @xiote2

02/06/2020 at 09:24PM

39
#59 - xer0.5ive / @Bibekshah

03/13/2020 at 03:35PM

40
#60 - KingYames / @JamesZeHunter

02/17/2020 at 03:38AM