Reverse and count
Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.
Start file
Sixth line
Fifth line
Fourth line
Third line
Second line
First line
End file
1. First line
2. Second line
3. Third line
4. Fourth line
5. Fifth line
6. Sixth line
1,6c1,6
< Sixth line
< Fifth line
< Fourth line
< Third line
< Second line
< First line
---
> 1. First line
> 2. Second line
> 3. Third line
> 4. Fourth line
> 5. Fifth line
> 6. Sixth line
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
177 remaining solutions by
signing in and submitting your own entry
#178
Zigmas Bitinas / @samgiz -
Score: 111 -
02/11/24 @ 20:46
:g/^/m 0<CR><Esc><Esc><Esc>qqq:for i in range(1,6)|execute i .'<BS> 's/!<BS>^/'. o<BS>i /<BS>,<BS>. \<BS>'. ' | endfore<CR>:<Up><BS><CR>i<Del>6<Up><Up><Up><Up><Up><BS><Del><Del><Esc>:qw<BS><BS>wq<CR>
0 comments
178 active golfers, 480 entries
Leaderboard (lowest score wins):
01/03/2011 at 12:34PM
01/03/2011 at 05:01PM
01/12/2011 at 11:35AM
01/17/2011 at 05:44PM
#65 - h_east (トロッコ6個) / @h_east
01/30/2011 at 07:23AM
02/12/2011 at 06:20PM
02/27/2011 at 09:24PM
03/19/2011 at 09:10AM
04/07/2011 at 09:56PM
07/22/2011 at 02:36PM
11/09/2011 at 03:29PM
01/09/2012 at 06:02AM
07/18/2012 at 01:52AM
05/21/2013 at 11:27PM
#75 - Woojung Kim 김우중 / @_kimwz
07/17/2013 at 10:17AM
01/08/2014 at 04:57PM
07/02/2014 at 01:49PM
12/14/2015 at 09:18AM
08/03/2017 at 12:22PM
02/04/2025 at 07:17AM
12/31/2010 at 06:23PM
#82 - Behnam Esfahbod / @zwnj
12/31/2010 at 06:53PM
01/07/2011 at 10:22PM
01/21/2011 at 07:07PM
01/24/2011 at 02:12PM
12/01/2011 at 05:53AM
03/13/2012 at 08:21AM
04/07/2013 at 05:23AM
#89 - Joonas Pihlajamaa / @jokkebk
02/21/2014 at 10:14AM
04/10/2015 at 01:47PM