News for hackers. Stuff that matters.
Re:Vim Croquet by nathan_long on Tuesday January 28, 2014 @04:01PM (#7139688)
Awesome! I'd love to see something like this as a standalone project. "Vim Critic" or "Vim Coach" - something to say "these are the inefficient things you personally do."

Probably some low-hanging fruit would be "any keystroke in Normal mode that's repeated." Eg, if I'm doing 'jjjj' to move down or even 'wwww' to hop from word to word, I could be searching or using a movement combo like '4j'.

Re:Vim Croquet by sdegutis on Tuesday January 28, 2014 @05:33PM (#7140284)
Personally, the main reason I moved from vim to emacs is because I don't want to have to think about my editor, I want it to be pure muscle memory. I'm okay with hitting "jjjjk" to go 3 lines down rather than trying to guess that it's exactly 3 down and typing "3j". Emacs-style navigating/editing is great for this kind of error-tolerant navigation/editing. It leaves my brain mostly free to focus on whatever I'm actually coding at the time.
Re:Vim Croquet by vectorpush on Tuesday January 28, 2014 @07:07PM (#7140788)
I think most experienced vim users will tell you that it is pure muscle memory for them. Also, vim supports jjjjk as well as 3j. Anyway, I just realized I am debating vim vs emacs so I'll stop here.
Re:Vim Croquet by sdegutis on Tuesday January 28, 2014 @07:37PM (#7140938)
We all know the one true editor is the Chrome console anyway.
Re:Vim Croquet by pycassa on Thursday January 30, 2014 @04:57AM (#7149828)
ewww
Re:Vim Croquet by pekk on Tuesday January 28, 2014 @07:34PM (#7140929)
Nothing about vim forces you not to type jjjjk, or better yet use motions or whatever fits your brain. But keep up the good emacs-vs-vim-troll fight
Re:Vim Croquet by DennisP on Wednesday January 29, 2014 @08:52AM (#7143769)
I go with a hybrid approach: I hit the number row somewhere in the loose vicinity of the number of rows I want to move, and then hit "j" a couple times to get exactly there. If it's more than a single-digit number of rows away, I might do the first step more than once.
Re:Vim Croquet by jff on Tuesday January 28, 2014 @06:04PM (#7140479)
I think it's better to repeatedly hit j rather than count "ah, 5 lines" and type 5j. Even better, you're already looking at where you want to go, it may be faster to hit / and start typing from that point to jump there.

Or, and this is a wild one, grab the mouse and click the point where you want the cursor, rather than giving some sort of treasure map to Vim: "Starting at the typedef, take 5 steps right, then 10 steps down, and 2 more steps right"

Re:Vim Croquet by r00k on Tuesday January 28, 2014 @06:15PM (#7140538)
A little tweak that got me in the habit of using things like 5j and 6dd: :set relativenumber.

It numbers your current line as 0, and counts up and down from there. It makes it very easy to see that you need to delete the next 5 lines, or move up 10 lines without doing any math.

As for your mouse comment, I don't think you can compare the speed with which an experienced vim user gets their cursor where they want it to the catastrophic cache miss of removing your hand from the comfort of the home row, grabbing the mouse, moving it where you want, clicking it, and moving your hand back to the keyboard. The mere thought makes me shudder :)

Re:Vim Croquet by vectorpush on Tuesday January 28, 2014 @07:14PM (#7140816)
catastrophic cache miss

haha, great prose.

+1 for relative line numbers. I scripted up ctr+n so I can toggle between relative and absolute as needed, though, there are even plugins capable of intelligently switching when necessary (like http://www.vim.org/scripts/script.php?script_id=4212).

Re:Vim Croquet by AlexSolution on Tuesday January 28, 2014 @08:09PM (#7141099)
I prefer hybrid line numbering. This way, you can see the true number of the line you are on, while all the other lines on the screen are numbered relative to your position.

http://jeffkreeftmeijer.com/2013/vims-new-hybrid-line-number...

Re:Vim Croquet by solutionyogi on Tuesday January 28, 2014 @10:11PM (#7141589)
Now this is perfection. Get both relative line numbering and absolute line numbers.

However, I use the vim-powerline plugin which displays the current line number/total lines at the bottom which is enough for me.

Re:Vim Croquet by jff on Tuesday January 28, 2014 @07:35PM (#7140933)
As someone who watches a lot of people use Vim, I think many would be better off with a little judicious mouse use. Yes, you very busily slam keys, but it seems to take a pretty damn long time and a lot of keystrokes to actually accomplish the monumentally complex task of shifting the cursor 30 lines down and 10 characters over.

My trackball is all of 4 inches from my right hand, and I always know where it is because it doesn't move around. Now, you can try and overplay the difficulty of grabbing the pointer ("I have to instruct my arm muscles to tense and pivot at both the elbow and shoulder while causing my fingers to curl into the appropriate shape" and so on) but I'd wager I could get the cursor to a given semi-distant point on a screen of code faster than even the most frantic of vim key-pounders.

Re:Vim Croquet by daf- on Wednesday January 29, 2014 @11:24AM (#7144811)
Yes, yes, yes. As someone who used to buy into keyboard fascism, I wholeheartedly agree with this. I consider myself proficient with Vim (and Emacs) in terms of keyboard controls, and know all of the fancy Vim motions and text objects.

However, even when editor keyboard commands become "muscle memory", there's still a little part of your brain that has to make a decision regarding how you're going to navigate/select/change/delete from point A to point B. With the mouse, you don't have to think up an algorithm for editing. You just think about the code at hand. I've found that the fraction-of-a-second decision making regarding _how_ to edit can be enough to interrupt my train of thought. Reading this article ( http://www.asktog.com/TOI/toi06KeyboardVMouse1.html ), while it may be quite old, helped me realize this fact.

That being said, I still think Vim is a great editor, and I don't mean to make any blanket statements about it's effectiveness. I just also believe that the obsession with "efficiency" is totally blown up with regards to editing text. Shouldn't we strive for efficiency in translating algorithmic thought to programming language? I think the keyboard crowd (myself included) tends to get caught up in the little details.

Re:Vim Croquet by gasda on Wednesday January 29, 2014 @12:45AM (#7142171)
:set mouse=a enables mouse pointer in vim