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

Reverse even lines

Reverse only the even lines without altering the odd lines.

Start file
:s%.*%\=getline('.').nr2char(113)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x71]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|smile|9sl|se key=|x
:s%.*%\=getline('.').nr2char(119)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x77]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|X|se key=vim|x
:s%.*%\=getline('.').nr2char(111)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x6f]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|h!|x
:s%.*%\=getline('.').nr2char(112)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x70]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|smile|sl|se key=|x


# vim:key=vim
End file
:s%.*%\=getline('.').nr2char(113)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x71]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|smile|9sl|se key=|x
x|miv=yek es|X|d@|d d|<>>..>s<$|*]|^[<s|g-|)1\\3\\2\\))\\*.2\\(\\)\\+\\]77x\\[(\\)\\.(\\)s-.-s-|(&&($.(s|.t|%)911(rahc2rn.)'.'(enilteg=\%*.%s:
:s%.*%\=getline('.').nr2char(111)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x6f]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|h!|x
x|=yek es|ls|elims|d@|d d|<>>..>s<$|*]|^[<s|g-|)1\\3\\2\\))\\*.2\\(\\)\\+\\]07x\\[(\\)\\.(\\)s-.-s-|(&&($.(s|.t|%)211(rahc2rn.)'.'(enilteg=\%*.%s:


# vim:key=vim

View Diff

2c2
< :s%.*%\=getline('.').nr2char(119)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x77]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|X|se key=vim|x
---
> x|miv=yek es|X|d@|d d|<>>..>s<$|*]|^[<s|g-|)1\\3\\2\\))\\*.2\\(\\)\\+\\]77x\\[(\\)\\.(\\)s-.-s-|(&&($.(s|.t|%)911(rahc2rn.)'.'(enilteg=\%*.%s:
4c4
< :s%.*%\=getline('.').nr2char(112)%|t.|s(.$(&&(|-s-.-s)\\(.\\)\\([\\x70]\\+\\)\\(\\2.*\\))\\2\\3\\1)|-g|s<[^|]*|$<s>..>><|d d|@d|smile|sl|se key=|x
---
> x|=yek es|ls|elims|d@|d d|<>>..>s<$|*]|^[<s|g-|)1\\3\\2\\))\\*.2\\(\\)\\+\\]07x\\[(\\)\\.(\\)s-.-s-|(&&($.(s|.t|%)211(rahc2rn.)'.'(enilteg=\%*.%s:

Solutions by @maharba6:

Unlock 1 remaining solutions by signing in and submitting your own entry
Created by: @maharba6

12 active golfers, 33 entries

Solutions by @maharba6:
16
#8 - maharba6 / @maharba6

07/04/2024 at 09:41AM