Live data from Hacker News

Emacs and Vim

martinklepsch.org

261–270 of 277 posts

Re: Emacs and Vim

#261

Earlier quoted context omitted.

Do you mean use DrRacket to edit code? Mostly because I'm used to editing in my Vim and don't want to learn another editor/IDE just for Racket.

Yes, I know what you mean. But I had to make an exception for DrRacket. It was just so much better than any vim plugin I tried.

I think someone already mentioned, but Emacs has a plugin called Geiser. You should check it out it's amazing. I was hoping there's something similar for Vim but sadly there's not.

Re: Emacs and Vim

#262
post #9

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

Usually the strong defenders of emacs tell you that you must use c-n c-p c-b c-f to move because those are better and you will adapt in a short time. Then the strongest defenders of emacs tell you that you must use whatever you want because the purpose of emacs is that the editor must adapt to you and not the opposite.

I'm a fan of C-n and C-p; I often find myself using them even in Sublime Text or other editors (even in a text area on a web page). But for some reason I find C-f and C-b much more obtuse. Part of it is that in a QWERTY layout, "f" is to the left of "b", and yet "f" moves the cursor to the right. Also, assuming you press Ctrl with your left hand, "f" is more natural to use with your left hand, while "b" is a bit of an awkward reach, making it natural to use the right. This left-right switch is awkward, especially combined with the aforementioned direction reverse.

On the other hand, C-a and C-k (especially in combination with each other) and C-e are incredibly useful, and once I discovered them I immediately started using them everywhere.

Re: Emacs and Vim

#263
post #202

Earlier quoted context omitted.

I don't understand why people want to do this in Vim. To me, a text editor should be extremely good at text editing / analysis and nothing else. I use tmux, so all the advanced functionality of the terminal is only a single keypress away (to switch to another open terminal split).

I hope you do use vim splits, since you have the same (copy/paste) buffers then.

I do! I have both tmux and vim configured so that will navigate through both kinds of splits.

Re: Emacs and Vim

#264
post #100

Earlier quoted context omitted.

Do one thing well. My text editor shouldn't be managing child processes or SSHing or trying to be a visual Git interface, and Vim does a great job displaying my code so I can understand it.

Programs that "do one thing well" are utterly useless unless you can compose them. Emacs is a tool that composes programs that do one thing well, like Bash or X. Emacs, as has been said time and again, is not a text editor. It is, if anything, a development shell. It contains a text editing program (the default program), and that program does not manage child processes or SSH or Git. You could also take the stance th…

> Emacs is a tool that composes programs that do one thing well, like Bash or X.

or like Vim! (as in Evil)

Re: Emacs and Vim

#265
post #34

notepad and other modern solutions... they are ubiquitous for a reason. typing is such a tiny part of programmer productivity compared to thinking... ... do a little more thinking and never have this problem again, learn to adapt to whatever text editor is on the system etc.

I used to this like this but honestly once an editor like vim or emacs becomes second nature, typing and editing and moving text around the screen feels a lot smoother and make programming more enjoyable.

But I still don't think "you might have to use a machine that only has vim installed and not your preferred editor!" is a good reason to spend time mastering how to use it (which is what I often hear). If you prefer emacs or sublime or whatever, use it, and just put up with vim if you're on this hypothetical scenario where they're not available.

Re: Emacs and Vim

#266
post #257

Earlier quoted context omitted.

One of the things that has caught me is syntax checking. I use the syntastic plugin, set to check syntax on write, and I apparently save my changes pretty frequently. Some files can take 2-3 seconds to run an external syntax checker, during which time I can't edit the file. I guess the real problem is me saving too often. Others may be trying to run a long make from vim and wanting to continue editing or looking thro…

No, that sounds like a valid usecase (and/or a horribly slow syntax check -- I'm not familiar with syntactic... does it do some kind of heuristic grammar check?).

I think usually it just runs the compiler in a syntax-check mode. For instance, it runs gcc with -fsyntax-only. I think I have sometimes seen style warnings too, so maybe there is more than that. Maybe I could configure it better to be faster, but for now it doesn't bother me often enough.

Re: Emacs and Vim

#267
post #257

Earlier quoted context omitted.

No, that sounds like a valid usecase (and/or a horribly slow syntax check -- I'm not familiar with syntactic... does it do some kind of heuristic grammar check?).

I think usually it just runs the compiler in a syntax-check mode. For instance, it runs gcc with -fsyntax-only. I think I have sometimes seen style warnings too, so maybe there is more than that. Maybe I could configure it better to be faster, but for now it doesn't bother me often enough.

Is this for c++? You might benefit from moving to cmake with the ninja backend (ninja being the important part not cmake) -- depending on what kind of projects etc etc.

Re: Emacs and Vim

#268

Earlier quoted context omitted.

You have heard of Chromebooks, right? It wouldn't be a far stretch to imagine a developer laptop where Emacs was the entire interface.

Chrome OS runs on a Linux kernel. Linux is the core OS for Chromebooks. Similarly, an "Emacs OS" would need a real OS underneath it.

Emeacs is an OS. It just needs its own kernel.

Re: Emacs and Vim

#269
post #142

Earlier quoted context omitted.

Isn't Helm, sucessor of Anything, much more than CtrlP could ever be?

I tried using helm when I wanted to learn emacs and my problem is that helm is incredibly ugly, and customizing it would take a good amount of time.

Really? You should checkout my guide: http://tuhdo.github.io/helm-intro.html and see if Helm is ugly or not. Nothing like Helm (except itself) ever exists. Check "Why Helm is powerful" section: http://tuhdo.github.io/helm-intro.html#sec-28

Re: Emacs and Vim

#270

I like that he mentioned CtrlP. It's the single plugin that prevents me from switching to Emacs. There is currently nothing in Emacs (last I played with this was 3 months ago) that is 100% equivalent to CtrlP. There are some close approximations but they're not as good the real deal. I can understand how Emacs guys won't even notice this because they've not worked with something that's better than the best they have,…

Because something much better than CtrlP exists: http://tuhdo.github.io/helm-intro.html

Demo: I can search my desired file in linux kernel source with more than 40k files in an instant: http://tuhdo.github.io/helm-intro.html#sec-28

If you want to find the equivalent, use ido + flx + vertical-ido.

Post reply on HN