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

10 active golfers, 30 entries

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

07/22/2024 at 12:36PM

46
#2 - Peppa Pig / @PeppaPi95550250

07/22/2024 at 07:25AM

55
#3 - John Braxler / @braxler

07/12/2024 at 06:25PM

72
#4 - Felix / @ne0phyte

07/17/2024 at 09:49PM

75
#5 - jinx balotchnik / @balotchnik

07/13/2024 at 07:06AM

76
#6 - Giacomo Sansone / @pcineverdies

07/09/2024 at 07:25PM

78
#7 - Judah / @jsczek

07/09/2024 at 01:27PM

85
#8 - Pablo Cárdenas / @pablo_cardenasb

07/09/2024 at 09:35AM

123
#9 - Marcos Almeida / @maurelio1234

07/19/2024 at 09:35AM

142
#10 - josh-pius / @josh-pius

07/09/2024 at 04:53PM