News for hackers. Stuff that matters.
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by obiterdictum on Thursday September 15, 2011 @09:21AM (#3000177)
I apologize in advance for this ode to Vim, but I feel I should get it off my chest.

I admit, the main reason for me to develop in Vim these days is to simply minimize the number of keystrokes I have to press (and the number of times I have to reach for the mouse), because, due to RSI, I experience a mild, but constant, and noticeable discomfort in my wrists (...and triceps, and shoulder) whenever I type (I distinctly remember I developed it in Eclipse during my Symbian C++ development internship). I honestly tried Emacs a few times because of superior Lisp editing, but it just didn't stick, I just can't bring myself to press more keys than I use to in Vim. Force of habit? Maybe.

I have never expected to be "hooked up" on Vim, but I was. In my first job out of the university I was writing Linux-based embedded software almost exclusively. I could never get used to Linux GUI editors after Visual Studio: the lack of any built-in IDE features and constant switching from the editor to the shell made me switch away to something closer to the shell. The initial discomfort of modal editing was less annoying than the lack of features and the accessibility of shell in Linux GUI editors (Eclipse CDT was a pain to set up and use back in these days). Then the discovery of split windows, regex replacement, folds, macros, ex-mode commands, and extensions made my experience what I then thought tolerable.

The mechanical memory had set in, and, upon moving on to my next job, I discovered that I could no longer use Visual Studio with as much comfort as I used Vim! It was curious, since I've "grown up" as a programmer with Visual Studio in the 4 years at the university.

It has snowballed further since then: remapping ';' to ':', ZQ and ZZ shortcuts, quickfix window, copy-paste registers, more motions with text objects ("delete between {}", "move to next ','", replace "()" with "[]", indent 4 line with "4>>"), sorting selected lines, coming up simple with ad-hoc refactoring functions and macros on the fly, marks, buffer greps, jumping between files with LustyExplorer an NERDTree, plugins (VimScript must die, but while it's there, it does the job), and falling back to the shell where Vim falls short. A few vimgolf (there is a site for this) challenges also added some tricks into my toolbox.

Right now I use Vim whenever I can. It does show its age, especially in areas like REPL, IDE features and code completion (it'll get there, eventually, I hope), but I just don't feel at home using anything else at the moment. I'm always on the lookout on the future of Vim or its next successor.

PS: Disclaimer: I don't necessarily advocate for everyone to learn Vim, it really requires a non-trivial investment of time to establish the necessary mechanical memory, but it was worth it for me personally (I do C, C++ and Python almost exclusively). Depending on your domain and the technology you use, you may be better off using Emacs (Lisp) or VS with Resharper (C#).

Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by palish on Thursday September 15, 2011 @10:02AM (#3000357)
Then you'll love http://www.viemu.com/ .... There are so many good things to say about ViEmu that it's hard to know where to begin. I've been a happy ViEmu customer for about three years now. Best $99 I've ever spent, hands-down.

Maybe it will suffice to say: "VisualAssist + ViEmu = <3". They synergize so incredibly well together.

Someday I should record a video of me coding C++ in Visual Studio. In the last 4 days alone, I've written 8,700 lines of C++. No way could I have done that without my precious ViEmu / VAX templates / custom hotkeys. (It's rare to ever need to touch the mouse, which is pretty fabulous.)

At this point, I write systems as fast as I can think, not type.

Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by 127 on Thursday September 15, 2011 @12:17PM (#3000920)
>Someday I should record a video of me coding C++ in Visual Studio.

Please do. It's should not be that difficult to just switch on the recording software and upload it into Youtube. If you could also verbally describe what you're doing and how, would be appreciated.

Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by nuclear_eclipse on Thursday September 15, 2011 @01:04PM (#3001121)
Another vote for ViEmu. They offer a discount for students if you ask them, and I've been using my copy since senior year. It does lack a few of the subtle details; most annoyingly to me is the lack of leader key mapping to automate common commands. But it's an extremely good replacement for those times when you need to use VS.
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by loevborg on Thursday September 15, 2011 @01:22PM (#3001187)
I just saw that you can use viemu for Word as well. Does anyone have experience with that?
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by drats on Thursday September 15, 2011 @09:37AM (#3000239)
Another great addition is: http://vim.wikia.com/wiki/Avoid_the_escape_key

Getting out of insert mode with a double j instead of moving your hand (esc) or doing the slightly awkward ctrl+[ is a godsend.

Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by qwertyboy on Thursday September 15, 2011 @09:45AM (#3000281)
Actually, Ctrl-c is the fastest way to get back to normal mode. Unlike Ctrl-[ and <Esc>, it does not check for abbreviations and does not trigger InsertLeave. And on most keyboards it's even easier to type.
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by pyre on Thursday September 15, 2011 @11:19AM (#3000686)
Ctrl-c is not always equivalent to <Esc>. For example, if you hit q: to get the command history editor, Ctrl-c will close that buffer, but <Esc> won't.
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by eridius on Thursday September 15, 2011 @03:00PM (#3001638)
Is not triggering InsertLeave a good thing or a bad thing?
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by sunkencity on Thursday September 15, 2011 @10:18AM (#3000425)
Wow. Thanks! That is fantastic. great tip.
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by obiterdictum on Thursday September 15, 2011 @09:43AM (#3000272)
Another good alternative is to remap the infrequently used Caps-Lock key to Esc (what Emacs users remapped to Control for ages). http://c2.com/cgi/wiki?RemapCapsLock
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by irahul on Thursday September 15, 2011 @10:49AM (#3000571)
I am an avid vimmer, but I sometimes use Emacs. I have capslock mapped to ESC, and it works well in emacs. I am pretty comfortable with C-{some_key}. It's the M-C-{some_key} that are a pain. ESC-C-{some_key} is what I use and since I have my capslock mapped, it's convenient.
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by Nick_C on Saturday September 17, 2011 @01:03AM (#3007294)
I write a lot of shell scripts and C where $UPPER_CASE variables are common. Is it still worth remapping Caps-Lock? (The problem is it would be remapped system-wide, not just in Vim.)
Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by stephenhalter on Thursday September 15, 2011 @10:36AM (#3000503)
VsVim is a free open source Visual Studio plugin that provides decent Vim bindings: http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-...

It's not perfect, but in my opinion it is certainly the best free option available. I have never used ViEmu, so I can't compare it to that.

Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by lukeschlather on Thursday September 15, 2011 @11:29AM (#3000727)
Seriously, I think Vim is more dangerous than Emacs for RSI in some respects. Emacs forces you to change your hands' positions as you alternate modifiers. This means that your hands do move more, but they on the balance do given actions less.

At least that's my impression. Obviously there's a lot of posture issues, and you can mitigate RSI to some degree simply by getting up and stretching your hands every 30 minutes. But it's not a simple matter of moving less -> less RSI. If you don't dramatically reduce the number of actions, moving less can be a problem.

Re:Heretical Confessions of an Emacs Addict – Joy of the Vim... by ajross on Thursday September 15, 2011 @11:51AM (#3000812)
Bit your tongue. You only have to change your hand position if you have the modifiers mapped wrong. Ctrl goes next to "A", Meta is below slash (some keyboards have this as an Alt already, sometimes you have to remap it). The modifiers are on opposite pinkies.