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):
58
#121 - Mack Hutsell / @sellshuts

05/24/2020 at 06:51PM

58
#122 - fff / @fff51460170

02/20/2021 at 07:02AM

59
#123 - Karnival K / @K4rnival

02/04/2020 at 08:12PM

59
#124 - {{ profile.name }} / @bytesonly

04/29/2020 at 08:41AM

59
#125 - Christophe Robillard / @krichtof

06/20/2020 at 09:55PM

61
#126 - malte0811 / @malte0811

04/03/2020 at 01:29PM

62
#127 - Marian Minar (jr.) / @majamin

01/29/2020 at 07:29PM

62
#128 - James Rayman / @jamsramen

03/13/2020 at 07:08PM

63
#129 - Ifeoluwa Lawal / @IfeLawl

10/27/2020 at 04:00PM

66
#130 - TheSemicolon / @the_semicolon_

02/25/2020 at 06:22PM

66
#131 - Jake Utley / @jakeutley

05/15/2020 at 07:21PM

68
#132 - LCY / @Chooneh

06/02/2020 at 08:51AM

69
#133 - Toby de Havilland / @tobydeh

04/19/2020 at 09:42AM

71
#134 - P37vo4WS / @p37vo4

12/30/2020 at 12:37PM

74
#135 - Victor Chen / @VictorC89422342

03/04/2020 at 08:31PM

74
#136 - drGsus / @drGsus

07/25/2020 at 01:50PM

75
#137 - vimgolf_throwaway / @vimgolfthrowaw1

05/07/2020 at 08:51PM

77
#138 - Jojolepro / @Jojoleprooo

02/01/2020 at 04:47PM

78
#139 - Enrique Gómez Cruz / @couscouscricket

01/31/2020 at 05:55AM

80
#140 - Matthew / @Burfield12

02/18/2020 at 05:14AM

82
#141 - perTheGolfer / @GolferPer

02/21/2020 at 07:27AM

83
#142 - Shalin Scupham / @shalin_scupham

04/21/2020 at 02:08AM

84
#143 - Jonathan Skeate / @jskeate

02/09/2020 at 07:54PM

84
#144 - lzh / @ly_zhng

06/14/2020 at 02:34AM

102
#145 - Andrei Popescu / @AndreiTheory

03/07/2020 at 12:54AM

122
#146 - Kiran Kumar Manku / @kirankumarmanku

03/29/2020 at 07:43PM

179
#147 - TimMcGuire / @mcguire

01/31/2020 at 09:51PM

184
#148 - Martin Huter / @marhat87

01/31/2020 at 09:50AM

195
#149 - 骑空士阿为 / @wuwe19

02/13/2020 at 05:29AM

199
#150 - Daniel H. Morgan / @danielhmorgan

05/02/2020 at 02:56PM