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
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 10 remaining solutions by signing in and submitting your own entry
#11 Aly Thobani / @alythobani - Score: 323 - 05/24/24 @ 22:12
:X<CR><CR><CR>jjjC<50-53>x|=yek es|ls|elims|d@|d d|<>>..>s<$|*]|^[<s|g-|)1\\3\\2\\))\\*.2\\(\\)\\+\\]07x\\[(\\)\\.(\\)s-.-s-|(&&($.(s|.t|%)211(rahc2rn.)'.'(enilteg=\%*.%s:<CR><Esc>[201~<BS><Esc>kkcc<50-53>x|miv=yek es|X|d@|d d|<>>..>s<$|*]|^[<s|g-|)1\\3\\2\\))\\*.2\\(\\)\\+\\]77x\\[(\\)\\.(\\)s-.-s-|(&&($.(s|.t|%)911(rahc2rn.)'.'(enilteg=\%*.%s:<CR><Esc>[201~<BS><Esc>ZZ
0 comments