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 9v00668c77cf0000000002a0

Change LaTex itemizations formats

Inspired by the way my professor formats their LaTeX assignments.

Start file
\documentclass{minimal}

\begin{document}

\begin{itemize}

\item[1.] Item 1
\subitem a
\subitem b
\subitem c
\item[2.] Item 2
\subitem a
\subitem b
\item[3.] Item 3
\subitem b
\subitem c
\item[4.] Item 4
\subitem b
\subitem c
\item[5.] Item 5
\subitem b
\subitem c

\end{itemize}

\end{document}
End file
\documentclass{minimal}

\begin{document}

\begin{enumerate}

\item Item 1
\begin{enumerate}
	\item a
	\item b
	\item c
\end{enumerate}
\item Item 2
\begin{enumerate}
	\item a
	\item b
\end{enumerate}
\item Item 3
\begin{enumerate}
	\item b
	\item c
\end{enumerate}
\item Item 4
\begin{enumerate}
	\item b
	\item c
\end{enumerate}
\item Item 5
\begin{enumerate}
	\item b
	\item c
\end{enumerate}

\end{enumerate}

\end{document}

View Diff

5c5
< \begin{itemize}
---
> \begin{enumerate}
7,22c7,32
< \item[1.] Item 1
< \subitem a
< \subitem b
< \subitem c
< \item[2.] Item 2
< \subitem a
< \subitem b
< \item[3.] Item 3
< \subitem b
< \subitem c
< \item[4.] Item 4
< \subitem b
< \subitem c
< \item[5.] Item 5
< \subitem b
< \subitem c
---
> \item Item 1
> \begin{enumerate}
> 	\item a
> 	\item b
> 	\item c
> \end{enumerate}
> \item Item 2
> \begin{enumerate}
> 	\item a
> 	\item b
> \end{enumerate}
> \item Item 3
> \begin{enumerate}
> 	\item b
> 	\item c
> \end{enumerate}
> \item Item 4
> \begin{enumerate}
> 	\item b
> 	\item c
> \end{enumerate}
> \item Item 5
> \begin{enumerate}
> 	\item b
> 	\item c
> \end{enumerate}
24c34
< \end{itemize}
---
> \end{enumerate}

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 16 remaining solutions by signing in and submitting your own entry
#17 Josh Pius / @josh-pius - Score: 142 - 07/09/24 @ 16:53
:%s/itemize/enumerate<CR>:%s/\[\d.\]//<CR>:g/sub/norm >><CR>8ggqqO<BS>\begin{enumerate}<Esc>jjo<BS>\end{enumerate}<Esc>qkjjddkPjjj@q2j@@2j@@2j@@:s/sub//<Left><Left><Left><Left><Left><Left><Left>%<CR>:wq<CR>

0 comments


Created by: @dsoto1219

17 active golfers, 103 entries

Leaderboard (lowest score wins):
43
#1 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

07/29/2024 at 11:48AM

43
#2 - Peppa Pig / @PeppaPigSg

07/30/2024 at 02:08AM

43
#3 - nickGPT / @nickandbro

08/20/2024 at 11:31PM

45
#4 - John Braxler / @braxler

07/23/2024 at 04:57PM

45
#5 - Alex Lewin / @_AlexLewin

07/23/2024 at 10:43PM

65
#6 - penguinwithpants / @penguinwithpants

08/30/2024 at 08:14PM

72
#7 - Felix / @ne0phyte

07/17/2024 at 09:49PM

75
#8 - jinx balotchnik / @balotchnik

07/13/2024 at 07:06AM

75
#9 - rhasarub / @rhasarub

09/05/2024 at 10:05PM

76
#10 - Giacomo Sansone / @pcineverdies

07/09/2024 at 07:25PM

78
#11 - Judah / @jsczek

07/09/2024 at 01:27PM

78
#12 - Janusz Spatz / @janusz-anue

09/14/2024 at 11:42PM

85
#13 - Pablo Cárdenas / @pablo_cardenasb

07/09/2024 at 09:35AM

90
#14 - pajamaman7 aka tommyBuckets / @pajamaman7

09/09/2024 at 08:55PM

116
#15 - danielbonkowsky / @danielbonkowsky

08/23/2024 at 10:26PM

123
#16 - Marcos Almeida / @maurelio1234

07/19/2024 at 09:35AM

142
#17 - Josh Pius / @josh-pius

07/09/2024 at 04:53PM