News for hackers. Stuff that matters.
Re:Just Use Sublime Text by jcoder on Thursday March 21, 2013 @12:44AM (#5412982)
"The Editor You Need To Read (At Least) Two Books On To Use Well"

Read :help. I haven't read any books on Vim so I'm not sure if there are any good ones, but you most definitely do not "need" to read one.

"The point of a mouse is to make arbitrary on screen jumps efficient, and it’s very good at doing that. Don’t you ever think you can beat a mouse. Only in very few edge cases will it even matter."

That's kind of ridiculous.

When you edit text, your "jumps" are not arbitrary—they have a structure to them, and Vim lets you express your movement within that structure very efficiently in terms of lines, words, sentences, search, etc.

With a mouse or trackpad, you have to move away from the keyboard, make a movement to the general area you are targeting, then fine-tune your target down to a space between two characters to insert the cursor.

"Pathogen, the first widely used, known, and celebrated path manager making plugin management possible, was released in 2008! Before that, you were encouraged to recursively copy the plugin’s directory into your Vim folder."

And before 2008, Sublime Text was nonexistent. What's your point?

I have used a plethora of plugin systems, and Vundle is the pinnacle of all of them. Simple to install, remove, and update.

"700 hand written lines in my .vimrc, and 45 plugins"

I may have found the problem. Learn to use the editor.

Re:Just Use Sublime Text by msutherl on Thursday March 21, 2013 @01:02AM (#5413041)
As somebody who recently switched from Vim to SublimeText, I agree and disagree with much in the article, but the point about the mouse is interesting.

For years I believed that eschewing the mouse was speeding me up. But I recently had the pleasure of working with a fine gentleman, and a SublimeText user, who is an absolute fiend with the mouse. He has considerably more development experience than I, so it is not an unbiased comparison, but I believe his raw editing speed was a bit faster.

This confirmed my suspicion, originally triggered by reading about the Acme[1][2] editor in Plan9, that such a workflow can be quite efficient.

[1] http://en.wikipedia.org/wiki/Acme_(text_editor) [2] http://www.youtube.com/watch?v=Pydckb9ZU8Y

Re:Just Use Sublime Text by catenate on Thursday March 21, 2013 @02:11AM (#5413258)
In my experience (11 years with Emacs, then 8 years with Wily/Acme-SAC/Acme) using the mouse is much more efficient than typing to move the cursor and select text. Acme takes it a step further by binding cut and paste to mouse chords. Guide files are the big win, though, since I edit and reissue commands (highlight and middle-click) instead of retyping them.
Re:Just Use Sublime Text by davorb on Thursday March 21, 2013 @04:16AM (#5413701)
Do you use C-r/C-s to move around? That's what I do and I think that using the keyboard is a bit faster.

The difference is probably negligible, though.

Re:Just Use Sublime Text by jeremiep on Thursday March 21, 2013 @07:57AM (#5414427)
There's also ace-jump-mode to quickly move the point in the visible area of the buffer. It can be a bit faster than C-r/C-s sometimes.
Re:Just Use Sublime Text by gnuvince on Thursday March 21, 2013 @12:00PM (#5415999)
I tried Acme, and though it had some good ideas, I found that the execution was sometimes poor. I especially disliked that so much emphasis was put on the mouse with no way to fall back to the keyboard.
Re:Just Use Sublime Text by catenate on Thursday March 21, 2013 @03:05PM (#5417941)
Extra ways to do the same thing is the enemy of simplicity and orthogonality. A major reason Plan 9 and Inferno are so small (the plan9port layer is 51.7MB source, the Inferno VM OS is 51.6MB source), and easier to grasp in one person's mind, is that the old Unix guys ruthlessly stripped out extra ways of getting things done, and made sure they ways that were left played well with each other. I keep a much smaller working set of unixy information in my head, while working daily with Acme and Inferno's userland, than I had to using Solaris or Linux and vi or Emacs.

The way I work in Acme, commands (whether built-in or my own) are presented in front of me for execution, so I edit and highlight and execute them. I don't take time out of thinking about code to think about the magical key combinations that do whatever. So it's more muscle memory to commands on the screen and sight recognition than remembering keystrokes. I do recall that many of my Emacs commands were muscle memory, but the more I wanted to use, the harder it was to remember them all. I lost them quickly when I stopped using emacs. Years from now the commands I used to manipulate files in a given directory will still be there in the guide file, waiting for me to run them without error. (I help this along by directory-specific logging of interesting commands.)

I was especially happy to get away from the hundreds of extra options in the GNU tools userland, which made entire other tools obsolete (e.g., sort -u obsoletes uniq, except when you need to uniq -c or uniq -d). All these options are the enemy of clarity in code, so you can more confidently write portable, straightforward scripts, go back to them later and actually read them.

Re:Just Use Sublime Text by gnuvince on Saturday March 23, 2013 @06:03AM (#5427697)
> Extra ways to do the same thing is the enemy of simplicity and orthogonality.

Adding support for moving the cursor with the arrow keys would not involve a very high amount of complexity. I found that Acme required me too much to just let Rob Pike dictate how I should work rather than providing a tool that I can customize to my habits and my needs.

Re:Just Use Sublime Text by catenate on Monday March 25, 2013 @05:23PM (#5439786)
Hey, don't get me wrong, I'm as turned off by Rob Pike's dismissal of everything not in his vision as the next 9fan or gonut. It took me forever to really efficiently use Acme, and no generics means no Go for me, since it's ridiculous to not have map, fold, and filter at your disposal once you've used it in other languages like Haskell, Python, even Perl or the shell. But what's great about his tools is that if you do let them creep into you, your daily practice gets much better because the weight of the environment doesn't slow you down so much.
Re:Just Use Sublime Text by johncoltrane on Thursday March 21, 2013 @12:53PM (#5416664)
The "problem" with the mouse is Fitt's Law. It is easy to use the mouse to hit large targets but, as the size of the target decreases, the duration and complexity of the task augments.

Since we, as programmers, deal with very small targets, using the mouse is not the most efficient way to go.

Some editors allow us to move very quickly to the next opening bracket on the line (Vim's f{ for example) while most editors can't help beyond a certain point (usually the OS's word-by-word jumps). If the only means you have to reach that opening bracket is a dozen presses on the right arrow or the mouse… well, the mouse may have its chances. When you can do f{ the mouse is simply useless.

Also, the motion of the mouse is non-linear: you have typically a fast startup followed by a progressive slowdown until you reach your target. That slowdown happens because the fast startup was done in the general direction of the target and must be adjusted a few times to hit the target accurately.

Another thing to factor is how often you use the mouse in your workflow.

When I do mouse-y tasks (Photoshop, browsing…), the mouse is my primary way too interact with my programs. My left hand is available for hitting modifiers or changing tools while my right hand is almost always on the mouse. In that context, I never loose the pointer and the mouse. Changing from task A to task B with the mouse is easy and costless.

When I do keyboard-y tasks, the keyboard is my primary means of interaction. I can spend a lot of time typing stuff, moving around… without touching the mouse. When I want to use the mouse I usually don't really know exactly where it is — that's a first problem — then, when I grab it, I don't know where the cursor is — second problem — which makes the initial targeting slow and error prone. Once the first steps are dealt with, the limitations in Fitt's law apply.

That's why the mouse is frowned upon among people who use primarily the keyboard.

Re:Just Use Sublime Text by Shorel on Friday March 22, 2013 @02:25PM (#5424663)
I do always set up my mouse to have no acceleration. You are right about it.

However, how many people who frowns mouse use knows that you can select a word by double clicking on it, or that you can extend a selection using shift+click, or that nothing scrolls a document as fast as the scrollbar or minimap?

Re:Just Use Sublime Text by johncoltrane on Friday March 22, 2013 @06:52PM (#5426284)
Those are part of the first things you learn in your first hour in front of a computer.

I think that my comment is clear on my position on that "mouse debate": the mouse is an effective interaction device in more than many contexts but there's at least one context where using the mouse is not the most effective thing to do.

Again, the problem is not the mouse itself but the cost of constently switching between it and the keyboard.

Re:Just Use Sublime Text by gnuvince on Thursday March 21, 2013 @09:52AM (#5414985)
I believe it depends on the kind of movement you need to do. If you need to go to an arbitrary point in the screen, I agree. However, if you are on a line and want to go to the end of the line, is it not easier to press the `End` key (or C-e for Emacs users, $ for Vim users) than take the mouse and aim it at the end of the current line? Depending on the task at hand, using the keyboard may or may not be faster.
Re:Just Use Sublime Text by crucialfelix on Thursday March 21, 2013 @09:54AM (#5414999)
The mouse and scroll wheel work just fine in my VIM in the terminal. I use whichever one is closest at hand (literally).

In any case we should soon have eyeball tracking to move around. and/or leap motion. also when can I simply shout at the screen and get it to do my bidding?

Re:Just Use Sublime Text by ths on Thursday March 21, 2013 @01:49AM (#5413186)
Even if the mouse were quicker on average for long jumps, the moving of the hand from mouse to keyboard feels like more of a combo breaker, more distracting. Speed is very important, but equally important is for the editing experience to have a low attention footprint to leave more space for the train of thought behind the changes being made.
Re:Just Use Sublime Text by SomeCallMeTim on Thursday March 21, 2013 @02:04AM (#5413231)
As someone who uses a keyboard 98% of the time, but who uses a GUI editor and the mouse when it makes sense, I'd say the mouse is useful for several things, and what it IS useful for WILL be faster than what someone can do with a keyboard.

The clear win is using a powerful GUI-based editor that has tons of keyboard commands. Bonus points for being on Windows or Linux (i.e., not Mac OS) so you can navigate/BROWSE the menus from the keyboard.

I don't know Sublime myself; I'll have to check it out. For some reason I thought it was Mac-only, but I see that it's cross-platform. My editor-of-choice for years has been Visual Slickedit, but I'm not married to it. I just haven't found anything half as good in years of searching. And I keep trying other editors, too, since there are things I find imperfect about it (the scripting language is usable, for instance, but has it's own syntax and quirks).

Re:Just Use Sublime Text by jussij on Thursday March 21, 2013 @02:14AM (#5413276)
> there are things I find imperfect about it (the scripting language is usable, for instance, but has it's own syntax and quirks).

In terms of scriptable editors, the Zeus editor is scriptable in Lua, Python, TCL or JavaScript, but it is native to Windows: http://www.zeusedit.com/

Jussi Jumppanen

Author: Zeus IDE

Re:Just Use Sublime Text by SomeCallMeTim on Thursday March 21, 2013 @01:46PM (#5417269)
Tried Zeus probably 4 years ago. I really have tried a lot of options, but I haven't been back to Zeus after the first try. I can't remember any specifics of what turned me away from it, though the thing that SlickEdit does better than almost everyone else is tagging. I use boost::shared_ptr (and now the C++11 version) a LOT, and so completion is useless in anything that doesn't know how to complete a template class. ctags and its ilk, last time I checked, were worthless in this regard, and I have a vague sense that Zeus relied on those for tagging? Yes, looking at the web site, you're using ctags. Will "shared_ptr<Foo> foo; foo->" autocomplete for members of Foo?

SlickEdit also Just Works with tagging. You put the files into a project, and everything is instantly cross-referenced. "Where is Foo::init() used? No, I don't want Blah::init(), just Foo::init()." SlickEdit, at least SOME of the time, can get that right, and with no configuration of external tools.

Aside from that, I think one of the greatest drawbacks of Slickedit is that it isn't open source, so when things go wrong I can't just fix it. Slickedit IS cross-platform, at least, with native Linux and Mac OS versions, and that ALSO is important to me.

Lua is the Right Answer for scripting, IMO. The rest of the options are actually a liability for me, since it means that if I'm editing someone else's script, I might have to deal with Python, TCL, or JavaScript.

I'm rambling now. I feel like I have an "Editor Manifesto" in my head that wants to get out, but I don't have time right now to do it justice. I'll take another look at Zeus when I get a chance, just as I'll take another look at Sublime and the rest. It's been years since I've looked, so I'll take another glance at it.

Re:Just Use Sublime Text by BSousa on Thursday March 21, 2013 @02:25AM (#5413308)
Just so you know, in Mac OS you can navigate the menu with keyboard. Try Ctrl+F2 to focus on the menu and then arrow keys
Re:Just Use Sublime Text by SomeCallMeTim on Thursday March 21, 2013 @02:00PM (#5417405)
I'll have to give that a try. I've had countless people tell me it COULD be done, but when I drilled down what they were really telling me was that there were keyboard shortcuts.

If you're telling me I can hit Ctrl-F2, then that's at least a step in the right direction. Thing is, it's several steps behind where I would be on Windows (or most Linux desktops), because I can just hit Alt-F and it opens the file menu, or Alt-T for the tools menu, or what-have-you.

Still, it's better than nothing. Thanks.

Re:Just Use Sublime Text by BSousa on Thursday March 21, 2013 @02:19PM (#5417572)
I don't use the menu much so I tend to use the trackpad for that. You could also try KeyCue [http://www.ergonis.com/products/keycue/ ]. You press the Command key for a while and all the options are shown in a popup.
Re:Just Use Sublime Text by SomeCallMeTim on Thursday March 21, 2013 @06:26PM (#5419641)
Nice! I'll check that out the next time I'm forced to work on a Mac (it happens when I do any iOS development...oh how I hate Apple...). KeyCue is a step in the right direction, UI-wise, regardless.
Re:Just Use Sublime Text by BSousa on Thursday March 21, 2013 @06:48PM (#5419836)
You can always outsource your iOS work to me :)
Re:Just Use Sublime Text by SilasX on Thursday March 21, 2013 @03:00AM (#5413426)
You mean Fn+Ctrl+F2, which requires repositioning both my hands, thus defeating the purpose.
Re:Just Use Sublime Text by BSousa on Thursday March 21, 2013 @02:21PM (#5417588)
I didn't say it was easy, just possible :P

In any case, I prefer to use the F keys as standard functions keys.

Re:Just Use Sublime Text by jamesjporter on Thursday March 21, 2013 @02:47AM (#5413378)
His point about touchpads is spot on though. I often find myself jumping around by clicking when I code with my laptop and no peripherals (there's no "combo breaker" since my hands are sitter so close to the trackpad anyway), but when I get home and plug in my mouse and external keyboard, it becomes much more of a hassle to click and I switch to a more keyboard-centric workflow.
Re:Just Use Sublime Text by Shorel on Friday March 22, 2013 @02:30PM (#5424688)
I tend to memorize the spatial location of keys (end, home, parenthesis, cursor keys) and of course, can touch type. Going back from using the mouse to touch typing is so immediate than I basically never notice it.

I think your last sentence supports Sublime Text even more than it supports Vi(m).

Re:Just Use Sublime Text by smalltalk on Thursday March 21, 2013 @11:32AM (#5415741)
In fact, it's the opposite. Using keyboard commands for movement is more distracting (and measurably slower) than using the mouse. It is precisely that the mouse is less distracting that tricks the mind into thinking the keyboard is faster. See AskTog:

http://www.asktog.com/TOI/toi06KeyboardVMouse1.html

http://www.asktog.com/TOI/toi22KeyboardVMouse2.html

http://www.asktog.com/SunWorldColumns/S02KeyboardVMouse3.htm...

[If you think this is incorrect, providing links to scientific evidence is more productive than downvoting or stating that your own subjective experience is different.]

Re:Just Use Sublime Text by npsimons on Thursday March 21, 2013 @01:14PM (#5416897)
You're not reading some of the most cogent arguments here: most vim/Emacs/etc power users couldn't even tell you what keyboard command to use precisely because they don't think about it. It's reflex, muscle memory, completely out of mind so that it doesn't get in the way of getting code from your mind to the machine. Maybe it's that way for some mousers as well, but given that code is text, it's kind of doubtful. There's also the fact that if you have to break your concentration to context switch to the mouse, you will lose your flow.

Try coding in an editor, any editor, for 8, 9, 12 hours a day and see if you don't start forgetting the keyboard shortcuts because they become reflexive. Vi and Emacs are just hyperdesigned to enhance this effect.

EDIT: And I don't care that you link to Bruce Tognazzini, a GUI designer, when millennia of musicians have known that they don't think about what combinations of fingers they press to get an F#, they just play a glissando with an F# in the middle.

Re:Just Use Sublime Text by smalltalk on Thursday March 21, 2013 @01:42PM (#5417234)
The thinking is subconscious: you don't know you're doing it and you "forget" how long it takes, which is why you perceive the keyboard as faster. If you bother to read the research I've linked to, it covers all of your objections. I know it's difficult to let go of subjective impressions, but the stopwatch is always right compared to our own internal sense of time.
Re:Just Use Sublime Text by jcoder on Thursday March 21, 2013 @11:52AM (#5415934)
We can each run that experiment 100 times in a few minutes. I did, keyboard movements were faster. https://yourlogicalfallacyis.com/appeal-to-authority

EDIT: not sure why the downvotes—should I have said "faster FOR ME"? Anyways, hi haters.

Re:Just Use Sublime Text by smalltalk on Thursday March 21, 2013 @12:43PM (#5416530)
It's not an appeal to authority: that would be if I were appealing to the authority for the authority's sake; but I am appealing to scientific research presented by the authority. I'm fairly certain you'd agree that appealing to scientific evidence is valid, as you've tried to present it to me as part of your argument. I think the downvotes are because you running some kind of "experiment" on your own is different from a human interface researcher's actual research.
Re:Just Use Sublime Text by jcoder on Thursday March 21, 2013 @01:18PM (#5416938)
Fair point, however the choice of editor/editing mode is a personal one. Are my personal results of my personal experiment not the only ones that matter to my personal choice?
Re:Just Use Sublime Text by derengel on Thursday March 21, 2013 @02:12AM (#5413261)
"700 hand written lines in my .vimrc, and 45 plugins" I may have found the problem. Learn to use the editor.

This ^^, say no more.

Re:Just Use Sublime Text by dlitz on Thursday March 21, 2013 @02:00AM (#5413218)
You don't even need to read :help right away. All you need to do is:

1. Start the graphical version, i.e. gvim, MacVim, or any version with drop-down menus.

2. Press 'i' to enter "Insert mode". Now just use it like any other text editor.

3. Use the menus. Note the equivalent commands (which are listed in the menus). When you want to use those commands, press ESC to switch to command mode, then enter the commands, then press 'i' again to go back to insert mode.

That's it. Modern vim has one of the smoothest learning curves of all software.

Re:Just Use Sublime Text by clhodapp on Thursday March 21, 2013 @03:50AM (#5413628)
If that's how someone is using Vim, they truly, seriously, should not be using Vim. Sublime really would be better for such a user.
Re:Just Use Sublime Text by ktf on Thursday March 21, 2013 @11:27AM (#5415688)
I think his point is that you start out using it that way. Training wheels, sort of, which eventually will come off.