News for hackers. Stuff that matters.
Re:Efficient Editing With vim by Tihy on Friday September 25, 2009 @02:47PM (#844050)
Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.
Re:Efficient Editing With vim by tdavis on Friday September 25, 2009 @03:52PM (#844185)
It's gotten to the point now where the first thing I say about any editor is, "That's cool and all... but does it have vim key bindings?" If it doesn't.... :q

I don't care how many built-in debuggers your IDE has; if I can't navigate it like I can vim, it's infinitely less productive for me.

Re:Efficient Editing With vim by njharman on Friday September 25, 2009 @03:58PM (#844197)
I created this bash alias cause I was typing it so much at the the command line.

    alias :e=vim
Re:Efficient Editing With vim by chewbranca on Friday September 25, 2009 @06:11PM (#844540)
hahahaha same here!
Re:Efficient Editing With vim by scott_s on Friday September 25, 2009 @03:01PM (#844073)
By force of habit, when I wanted to close an IM window, I have typed

  :q
Instead of switching to the mouse and hitting the "x". Then I had to explain to the person that I wasn't sticking my tongue out at them.
Re:Efficient Editing With vim by nostrademons on Friday September 25, 2009 @03:40PM (#844163)
I once wrote ":tabnew something.js" in my IM window and sent it before I realized that the wrong window had focus. The person replied with, "bash: :tabnew: command not found." I told him, "I was hoping you were vim, actually".
Re:Efficient Editing With vim by GrandMasterBirt on Friday September 25, 2009 @04:45PM (#844315)
HA!

Also using vim will cause your escape key to be heavily hit constantly after typing anything especially if you are not sure what mode you are in, then only realizing you are not in vim period.

Re:Efficient Editing With vim by gurraman on Sunday September 27, 2009 @03:51PM (#847185)

  inoremap jj <Esc>
Re:Efficient Editing With vim by robotron on Friday September 25, 2009 @06:31PM (#844580)
Oh god I do this so much it's getting to be painful.
Re:Efficient Editing With vim by buugs on Saturday September 26, 2009 @12:57AM (#845035)
ctrl+c is much better than esc :) but I use emacs more than vi[m]
Re:Efficient Editing With vim by apotheon on Saturday September 26, 2009 @02:41PM (#845868)
Yeah -- more (keys) is always better!

Oh, wait . . .

Re:Efficient Editing With vim by buugs on Saturday September 26, 2009 @05:26PM (#846099)
I don't have esc bound to caps-lock so its a reach!
Re:Efficient Editing With vim by graywh on Saturday September 26, 2009 @12:20AM (#844977)
We see a lot of ":q" messages in #vim.
Re:Efficient Editing With vim by Pistos2 on Friday September 25, 2009 @04:45PM (#844318)
I've hit Ctrl-W to try to delete a word, and ended up closing an IRC window. It's not exclusive to vim. :)
Re:Efficient Editing With vim by chancho on Friday September 25, 2009 @10:36PM (#844897)
OS X:

Put the following in ~/Library/KeyBindings/DefaultKeyBindings.dict

{ "^w" = "deleteWordBackward:"; }

GTK:

echo 'gtk-key-theme-name = "Emacs"' >>~/.gtkrc-2.0

gconftool -t string --set /desktop/gnome/interface/gtk_key_theme Emacs

Windows:

... uh ...

Re:Efficient Editing With vim by apotheon on Friday September 25, 2009 @07:00PM (#844628)
I've found it easy to avoid misusing Ctrl-w because of the fact I use it so much to close tabs in Firefox. You just need to have two different uses for something, both of which you use very regularly, to get used to not accidentally misusing them, I've found.
Re:Efficient Editing With vim by greyfade on Friday September 25, 2009 @10:19PM (#844883)
Vimperator will break that habit, for sure.
Re:Efficient Editing With vim by apotheon on Saturday September 26, 2009 @01:06AM (#845051)
Alas, I think you may be right. I haven't been using it very long.

Once I actually buckled down and started learning how to use it, I was surprised by how quickly and easily a natural feeling of "this is how it should be" developed while using Vimperator. Of course, there's a lot of positive transference of knowledge from my heavy use of Vim itself, but still -- I didn't expect to find it this easy.

I think part of the reason may be that every single keyboard-driven browser I have ever used before (Lynx, W3m, Links, et cetera, ad infinitum) was so awful as a Web interface that I became convinced Web browsers were a uniquely GUI-suited type of application. Vimperator is definitely changing my mind.

Thank goodness.

Re:Efficient Editing With vim by jcw on Friday September 25, 2009 @05:00PM (#844368)
I've hit ctrl-w and closed a window while taking a test in class.
Re:Efficient Editing With vim by scott_s on Friday September 25, 2009 @05:39PM (#844467)
When I first switched to my Mac, when I'd switch between split windows (ctrl w w), I'd often accidentally close my Terminal session (command w). The Apple Command sat where I expected ctrl to be.
Re:Efficient Editing With vim by acg on Friday September 25, 2009 @04:56PM (#844355)
Have you tried vim like browsing?

http://vimperator.org/trac/wiki/Vimperator

For keyboard lovers.

Re:Efficient Editing With vim by chickamade on Saturday September 26, 2009 @02:30AM (#845167)
Can you explain why Vimperator is a good idea. As a vim user myself, I understand vim was designed first and foremost to input and edit text using the keyboard, is bringing those key bindings to browsing the web is a good idea?

For the best navigating experience, I feel Opera does really well. You keep one hand on the keyboard (nearing 1, 2 to switch tab; and z, x to move back & forth in history) and one hand on the mouse to click around & do gestures.

Re:Efficient Editing With vim by apotheon on Saturday September 26, 2009 @02:40PM (#845863)
You may not be aware of it, but the view command on (most?) Unix systems is basically a read-only way to execute vi. It has the same keybindings in general, of course, because it's actually the same program with the -R option, more useful than more or less. It's especially more useful because one can "break out" of the read-only limitations if necessary (and if one has the requisite permissions for the file in question), but one has to actively override those limitations.

Since the Web is, a lot of the time, basically a read-only medium with occasional need for limited editing -- and, when done well, it's a primarily textual medium -- the vi interface philosophy turns out to be quite appropriate. If you dislike having to switch interface contexts between keyboard and mouse because you're a touch-typist who has learned the efficiency and power of a keyboard driven interface for text editing, a browser that does the same thing is a very attractive idea.

Unfortunately, most people's experience of text user interface browsers is limited to the shite that has been available for more than a decade, such as the ubiquitous Lynx. While it's entirely keyboard driven, it's not a good TUI. It is, in fact, a crap TUI. Vimperator, however, has managed to improve on the failures of all other TUI Web browsers I've ever seen by importing vi idioms to the context of Web browsing -- improve on it so much that it blows away both TUI and GUI browsers, at least for me.

I also use a window manager with a keyboard driven interface, and I probably do more typing online than the vast majority of Web browser users. With all that in mind, keeping one hand on the keyboard and the other on the mouse would be broken up a lot by having to get my hands back to home row on the keyboard so I could do things like type in the browser, switch workspaces and do work there, and so on. At least 98% of the time, Vimperator obviates the need to keep one hand on the mouse the way you do it, which means there isn't any interface context switching going on in my brain at least 98% of the time for me, whereas without Vimperator I'd spend more like 60% of the time I'm using the Web browser also using a mouse and would have to switch back to home row every time I need to copy text to or from Vim in a terminal emulator (for instance).

Now, the only times I need a mouse in the browser is when I want to do something like click the upvote arrow here at HN or do something in a Flash object (such as start the Flash player, since I use Flashblock).

I used to believe that for the best browsing experience, a mouse was necessary for the majority of uses, because the Web is an inherently graphical medium. Even essentially pure-text pages seemed that way to me, because things like hyperlinks are location-specific. Vimperator has allowed me to learn the error of my reasoning in that regard.

Re:Efficient Editing With vim by tel on Saturday September 26, 2009 @01:04PM (#845710)
When I used Vimperator (I finally changed back just because I don't like how FF performs on OS X) I found I was strongly bimodal — surprise — where I'd spend the majority of my time just using the keyboard, both hands, and then if something demanded the mouse I shift to my trackpad.

The thing I want to point out is how loathe I became to switch to that trackpad. Vimperator makes you despise flash even more.

Re:Efficient Editing With vim by jey on Saturday September 26, 2009 @12:55PM (#845700)
Yes, vimperator is great. Try it, you'll see. Vimperator makes it so you barely use the mouse, and that's definitely an improvement imnsho.
Re:Efficient Editing With vim by shiranaihito on Saturday September 26, 2009 @11:54AM (#845614)
Why don't you use gestures for switching tabs and moving back and forward?
Re:Efficient Editing With vim by malditogeek on Saturday September 26, 2009 @12:10PM (#845636)
I've been using it for a long time and totally love it. I have the same mappings I have for Vim, for open and move between tabs and so on. It's an awesome tool.
Re:Efficient Editing With vim by apotheon on Friday September 25, 2009 @07:08PM (#844647)
I'm using it now, as a matter of fact.
Re:Efficient Editing With vim by hernan7 on Friday September 25, 2009 @03:10PM (#844093)
20-year user of vi here... yes, once you get used to vi, going back to an editor for humans is hard.
Re:Efficient Editing With vim by apotheon on Friday September 25, 2009 @07:05PM (#844642)
Yeah -- giving up my transhuman lifestyle would be difficult.
Re:Efficient Editing With vim by GrandMasterBirt on Friday September 25, 2009 @04:48PM (#844326)
I am still waiting for Vim FPS style (WSAD navigation keys, sniper scopes to skip words and all... sure it might need 3d graphics but hey, its the price you pay).
Re:Efficient Editing With vim by tetha on Friday September 25, 2009 @05:17PM (#844410)
I, however, am waiting for an FPS, vim-style!
Re:Efficient Editing With vim by LogicHoleFlaw on Friday September 25, 2009 @07:13PM (#844661)
I use hjkl in all my games. That, or asdf. Keeps me from getting wrist cramps.

True story.

Re:Efficient Editing With vim by apotheon on Friday September 25, 2009 @07:03PM (#844637)
Damned straight. I want World of Vimcraft, yesterday!

. . . or maybe Vim of Warcraft. I guess VoW is a better acronym than WoV.

Re:Efficient Editing With vim by wooby on Friday September 25, 2009 @08:13PM (#844751)
You can always get vim keys in any readline-enabled terminal program (like bash) by creating ~/.inputrc and putting this in it:

set editing-mode vi set keymap vi

http://vim.wikia.com/wiki/Use_vi_shortcuts_in_terminal

Re:Efficient Editing With vim by travisp on Saturday September 26, 2009 @10:50AM (#845538)
But, if something does have vim bindings, even in a limited manner, it suddenly gains extraordinary appeal (e.g. keyboard navigation in gmail)
Re:Efficient Editing With vim by joshuaxls on Friday September 25, 2009 @03:05PM (#844085)
I would kill for GMail to add vim-like text editing.
Re:Efficient Editing With vim by branden on Friday September 25, 2009 @03:29PM (#844132)
Have you heard of the "It's All Text" Firefox extension? It copies the content of any textarea to a tempfile and opens it up in an external editor of your choice. Writes to the tempfile are copied back to the textarea. It's not quite in-browser vim, but it's pretty close. https://addons.mozilla.org/en-US/firefox/addon/4125
Re:Efficient Editing With vim by old-gregg on Friday September 25, 2009 @10:08PM (#844877)
Man this is awesome! I've just written this comment in vim. Thanks a lot.

Ugh... I decided to edit some more.. Hm.... ughh... more....

Re:Efficient Editing With vim by anovaskulk on Friday September 25, 2009 @06:21PM (#844563)
of course, if you use vimperator you have ctrl-i for that
Re:Efficient Editing With vim by xtho on Saturday September 26, 2009 @12:35AM (#844997)
There is also ViewSourceWith which allows the use of different editors.
Re:Efficient Editing With vim by apotheon on Saturday September 26, 2009 @01:09AM (#845055)
. . . but Vimperator also Vimperates the entire browser, instead of just the text areas. Unless you're an Emacs zealot, I don't see the downside.
Re:Efficient Editing With vim by xtho on Saturday September 26, 2009 @01:17PM (#845727)
I think we got it by now. Unfortunately, vimperator has quite a few quirks and makes too many changes that cannot easily be undone, which is the reason why I uninstalled it and moved to VSW.
Re:Efficient Editing With vim by apotheon on Saturday September 26, 2009 @02:22PM (#845824)
I moved in the opposite direction, from VSW (which I used heavily for a while) to Vimperator.
Re:Efficient Editing With vim by greyfade on Friday September 25, 2009 @10:18PM (#844881)
Try Vimperator. <C-i> opens gvim for the currently-focused text box.
Re:Efficient Editing With vim by holygoat on Friday September 25, 2009 @11:42PM (#844947)
You have made my day.

To make this work with MacVim on a Mac:

    :set editor="/Applications/MacVim.app/Contents/MacOS/Vim -g -f"
Re:Efficient Editing With vim by apotheon on Saturday September 26, 2009 @01:07AM (#845053)
I had no idea this feature existed. I was still using the View Source With extension to open Vim in a terminal emulator window when editing text in a text area, even though I have Vimperator. Now I can do away with the extra extension.

Thank you.

Re:Efficient Editing With vim by apotheon on Friday September 25, 2009 @07:08PM (#844649)
Meh. I just use Mutt.
Re:Efficient Editing With vim by pyre on Friday September 25, 2009 @03:37PM (#844151)
Try the "it's all text!" Firefox extension.