Live data from Hacker News

Emacs and Vim

martinklepsch.org

161–170 of 277 posts

Re: Emacs and Vim

#161

Gah, the tutorial keybindings! They are mad. I've been using emacs for a very long time, and I can't imagine using those to navigate. Emacs has perfectly reasonable default keybindings these days, they just aren't the ones mentioned in the tutorial. Command: move down one line What vi uses: j What the emacs tutorial suggests: C-n What I use in emacs: the down arrow

> ... the down arrow

Why? Isn't that more inefficient because you have to move your hand off to the side. I can type 3 C-n before moving my to the right to do a single down arrow. Maybe I am just used to it by now, and forgot how hard it was when I started, but it makes complete sense to me.

Re: Emacs and Vim

#162
emacs-prelude is a nice way to get started with emacs if you are a vim user: https://github.com/bbatsov/prelude

You can enable the prelude-evil.el module and start out with a nice set of bindings. It would be sweet if there were some more pull requests to make the evil-mode bindings in prelude more closely match vim.

Re: Emacs and Vim

#163
post #158

> I completely do not understand how anyone can use Emacs’ default keybindings. I completely do not understand how switching modes is a good idea in an editor. It just doesn't fit in my brain somehow. I start typing and randomly end up pasting and cutting. I want to paste and cut it randomly types my commands in insert mode. Emacs cords are pretty intuitive to me. I don't know many: just moving, saving, creating 2 wi…

I can't find it now, but the guy running http://www.viemu.com/blog/ has a good explanation for this problem. Basically, while there are modes, you don't work like that. You are always in command mode, and you slip briefly into e.g. insert mode, before popping back out to the 'default' command mode. This perfectly described how I work in Vim, and when I passed it around my office, several people had 'ahah!' moments. YMMV.

Re: Emacs and Vim

#164
post #158

> I completely do not understand how anyone can use Emacs’ default keybindings. I completely do not understand how switching modes is a good idea in an editor. It just doesn't fit in my brain somehow. I start typing and randomly end up pasting and cutting. I want to paste and cut it randomly types my commands in insert mode. Emacs cords are pretty intuitive to me. I don't know many: just moving, saving, creating 2 wi…

I know both well, and emacs are essential to navigating Mac OSX UI. If someone ever catches you typing in gmail they will ask how you are moving around so fast.

I tried emacs until my pinky hurt so bad I switched to vim.

http://en.wikipedia.org/wiki/Emacs#.22Emacs_pinky.22

Re: Emacs and Vim

#165
post #143

Earlier quoted context omitted.

Well, yes. That's what makes Unix OSes so great. Programs all the way down to the command line are separate from the OS. Modules and drivers are also semantically separate from the core.

So how would you envision that the Emacs OS should be structured/used?

Something like this:

  sudo aptitude purge emacs
  sudo apt-get install vim gvim
  gvim
Edit: Clearly I'm joking. If you wanted a serious answer, Emacs is just a large, easily extensible program. It's not really an OS. That's like saying Google Chrome (contains a package manager, web browser, text editor, scripting language, and much more) is an OS.

Re: Emacs and Vim

#166
post #144

Is anybody besides me still having the problem with Emacs on Mavericks where the OS X distnoted process gradually eats up gigabytes of RAM? It seems to have to do with running multiple instances of Emacs.

Yes. Problem goes away after manually compiling the the latest HEAD, which is admittedly not the best solution.

Re: Emacs and Vim

#167
post #110

Earlier quoted context omitted.

Emacs does a great job at that, too. (In fact, it contains a complete Javascript parser, which is invaluable to me since that's the language around which my professional life revolves.) It also does a great job managing child processes and SSHing. (Or FTPing, or speaking whatever other protocol you need to use to access remote files.) I can't speak to it as a visual Git interface, but I don't doubt it's at least reas…

It's great to aspire to more, and that's why my system has more than one binary in $PATH. If a project wants to release an awesome $thing_doer in addition to their main tool's function, it should be a separate tool. That way I can use esshhelper and egitbrowser and eftp separately from emacs (yes, I know the names are contrived).

That's how Emacs works though! There's a bunch of TeX junk in Emacs but since I never use TeX, Emacs never loads that lisp. It's just sitting around in a directory waiting in case I do need it at some point.

And Emacs has a command line for its stuff: "M-x".

And if you really want to have separate executables you can do that with small 'emacs --eval' wrappers.

Re: Emacs and Vim

#168
post #122

Earlier quoted context omitted.

> understanding my code Both Vim and Emacs have a horrible time trying to syntax highlight Perl, but I find Vim's flaws to be more tolerable. Emacs isn't some sort of panacea.

I have written a good amount of perl in both Vim and Emacs and can't recall noticing bad syntax highlighting in either. Do you have an example?

I find Emacs's default Perl mode isn't so good. Luckily Emacs also comes bundled with cperl, which works much better in my experience. So much so that I have this in my .emacs:

    (defalias 'perl-mode 'cperl-mode) ; perl-mode sucks; use cperl-mode

Re: Emacs and Vim

#169

Earlier quoted context omitted.

Vim defenders will also tell you to use search. Also, why would even Emacs fans recommended corded combos over single keypresses? Give my pinky a break man!

Because it means you don't have to jump in and out of different modes. The biggest thing that kept me from using vim was _constantly_ typing in normal mode and trying to issue commands in insert mode. Is constantly hitting the Escape key (even remapped to Caps Lock, or using ^[) really any better on your pinky?

I use ^[, and I use my pinky a lot less than I would in emacs, because I do a lot more in command mode than I do in a single emacs chord. I view "insert some text" as its own command. Vim's commands are structured so you can combine orthogonal pieces, where emacs has a separate chord for everything.

Re: Emacs and Vim

#170
post #80
post #56

Earlier quoted context omitted.

I use vim because it's bindings correspond with my thought process. My thought is: "Let's change the next 2 words", my fingers type c2w (change word). The bindings take quite a while to learn, I started using vi mode in komodo edit, but once I realized that bindings like ci" didn't work I switched over to macvim. I haven't used any other editor since then (4 years ago). The other reason is that I mainly "develop" (ho…

I love this explanation of why you like vim, because it's very honest, and one where I can disagree with your preference while having no problem with your argument. My brain does not work like vim at all. I do not count words. I do not think about whether I want to change, jump or delete. Therefore, I've never been able to use any vi flavor even semi competently: I can technically work in it, and I have read about al…

Vim has buffers too. Evil + emacs is definitely the best for me though.
Post reply on HN