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):
11/04/2015 at 09:58PM
10/15/2016 at 09:51PM
#123 - Mohammad-Javad Izadi / @mjizadi
01/05/2011 at 01:38PM
03/31/2011 at 10:17AM
12/31/2010 at 11:04PM
#126 - Ujjwol Lamichhane / @Ujjwol
01/01/2011 at 02:48AM
01/02/2011 at 03:47AM
07/10/2011 at 11:11AM
07/13/2011 at 09:40PM
09/22/2011 at 09:13AM
05/13/2012 at 11:46AM
08/15/2012 at 04:47PM
05/30/2013 at 11:52AM
02/03/2014 at 11:31PM
12/31/2010 at 06:37PM
12/31/2010 at 07:10PM
01/01/2011 at 08:41PM
01/02/2011 at 02:50AM
01/02/2011 at 02:56AM
01/02/2011 at 03:07AM
01/03/2011 at 10:40AM
01/03/2011 at 09:48PM
01/08/2011 at 07:07PM
01/10/2011 at 09:16PM
01/11/2011 at 01:32PM
01/19/2011 at 07:46PM
11/28/2011 at 08:34AM
12/02/2011 at 11:39AM
12/14/2011 at 04:31PM
12/30/2011 at 03:46PM