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):
12/31/2010 at 04:56PM
12/31/2010 at 07:41PM
#93 - clint tseng / @cxlt
12/31/2010 at 09:38PM
12/31/2010 at 10:17PM
01/01/2011 at 01:58AM
01/01/2011 at 02:16AM
01/02/2011 at 01:09AM
01/02/2011 at 01:52PM
01/02/2011 at 05:49PM
01/03/2011 at 02:34PM
03/27/2011 at 07:58PM
09/05/2011 at 08:19PM
09/30/2015 at 12:36PM
04/05/2017 at 02:33PM
04/13/2020 at 04:15PM
12/31/2010 at 04:50PM
12/31/2010 at 05:19PM
12/31/2010 at 06:45PM
01/02/2011 at 04:29PM
11/24/2012 at 11:20PM
12/24/2012 at 06:50PM
12/31/2010 at 06:42PM
12/31/2010 at 09:52PM
01/03/2011 at 12:09AM
01/03/2011 at 09:42AM
02/14/2012 at 06:03AM
08/25/2012 at 09:09AM
11/06/2014 at 06:03AM
06/01/2015 at 05:07PM
01/07/2011 at 02:28AM