Live data from Hacker News

From Vim to Emacs

juanjoalvarez.net

71–80 of 123 posts

Re: From Vim to Emacs

#71

If you want to use emacs as if it was vim why change? Personaly: I try to use my console editors as vanila as posible so that I can feel right at home directly. Kind of the exact opposite of this :)

"If you want to use emacs as if it was vim why change?"

-- to get all that juicy goodness that is the emacs environment, that's why. Emacs is far from perfect, but there are a lot of things to like about it -- especially if you want to interface with Lisp or Lisp-like environments (Common Lisp, Scheme, Clojure, etc). Emacs does a better job of interacting asynchronously with other processes -- which is one of the reasons it is better for use with Lisp-like environments.

I've used vim for over 15 years, and I still use it daily, but I prefer the emacs/evil environment for anything where I want to interact with a repl from inside my text editor.

Re: From Vim to Emacs

#72
post #62
post #61

I'm a vim (loser[1]) and terminal (power) user for 7+ years. Two things comes to my mind when we talk about emacs and other editors. The Terminal! In particular iterm.app Basically with iterm and vim, I'm on osx close to a i3 on linux. Vim works perfectly inside a terminal (no need to remap meta). We have terminals on android, ipad etc... I love working in a terminal because... well, is where I spend most of the time…

It's not quite the same but since Emacs is primarily an OS it has window managements build in, so by running it fullscreen and making a bunch of horizontal and vertical splits you get pretty close to i3[1] as well. The only problem is terminals. You can run them inside of Emacs, but there's always issues. You can run eshell[2] which is wonderful. Myself, I prefer to use terminals outside of Emacs. [1] my development…

But Vim has window management built in too, with splits, tabs, buffers, etc.

Re: From Vim to Emacs

#73
The "problem" with vi is that you'll outgrow it very fast. People tend to work around this by installing a dozen of plugins but I think you should use Emacs for that.

I'm quite proficient in both editors and while I resort to Emacs for 95% of my coding (and mail, and notes, and agenda, and...) sometimes nothing beats the simplicity of firing up vi for a quick edit in a remote server.

Using vanilla vi with a minimal to non existent .vimrc can be liberating.

Re: From Vim to Emacs

#74
post #49

Earlier quoted context omitted.

> it was the best career decision I've ever made I hear this a lot, and I'm not debating whether it's true or not since ymmv. I'm curious if anyone here has gone the other way. I used vi in my teens then switched to emacs, which I used for over a decade. A couple years ago I switched to JetBrains IDEs and have never been happier. I hadn't used an IDE since Borland Turbo C, and forgot what I was missing. Are there any…

Power vim user for 7+ years, then started using org-mode in emacs and eventually got sucked in and did everything in emacs for a while... then needed to do Android dev, ended up really liking Android Studio, realized all the JetBrains IDEs are amazing. Now I'm spending my days with Android Studio, AppCode, RubyMine, but still using org-mode in emacs. Never felt right with evil mode, but the vim bindings in all the Je…

I went from RubyMine to emacs, for working with rails / coffeescript projects. Having an editor I could trivially extend was key; M-x eval-region (I have it bound to a shortcut) dramatically lowers the barrier to altering functionality.

I'll only use an IDE for languages that rely heavily on code completion, and have good support for it through static typing and libraries that include symbol tables. In practice, that means Java and C#.

Re: From Vim to Emacs

#75
post #28
post #8

I began using Vim about a month ago and it has been totally revelatory to me, and believe quite honestly that it was the best career decision I've ever made. The one thing, however, is its speed. MacVim gets very slow sometimes, particularly with buffers. So my question: How does Emacs and Vim compare speed-wise? I come from a Sublime Text background and really miss the ability to quickly navigate between tabs (buffe…

In Vim, a single badly-written plugin can make the entire editor feel sluggish. I'd recommend disabling your plugins one-by-one, until you find the culprit.

Another way to find the culprit is using vim' built-in profiler:

run :profile start filename, then :profile func * Then do the slow thing, and close vim. This will write your profile data to filename.

Re: From Vim to Emacs

#76
post #8

I began using Vim about a month ago and it has been totally revelatory to me, and believe quite honestly that it was the best career decision I've ever made. The one thing, however, is its speed. MacVim gets very slow sometimes, particularly with buffers. So my question: How does Emacs and Vim compare speed-wise? I come from a Sublime Text background and really miss the ability to quickly navigate between tabs (buffe…

> it was the best career decision I've ever made I hear this a lot, and I'm not debating whether it's true or not since ymmv. I'm curious if anyone here has gone the other way. I used vi in my teens then switched to emacs, which I used for over a decade. A couple years ago I switched to JetBrains IDEs and have never been happier. I hadn't used an IDE since Borland Turbo C, and forgot what I was missing. Are there any…

I use the vim plugin ("IdeaVim") in JetBrains PHPStorm & PyCharm.

Re: From Vim to Emacs

#77
"With Vim I had defined a keybinding that selected the last pasted text. It was useful when you wanted to reformat or indent text that you've pasted from somewhere. At the moment I've been unable to reproduce this in Emacs."

- in non-evil-mode at least, C-x C-x will reselect what you last pasted if you haven't moved. What really happens is that when you paste, the "mark" is set there (equivalent to doing C-SPC), and C-x C-x will switch point (your cursor) and the mark.

However, if you want a function that works even after you've moved around a bit you could do e.g.

    (defadvice yank (around advice-yank-set-vars activate)
      (setq yank-last-start (point))
      ad-do-it
      (setq yank-last-end (point)))
    
    (global-set-key (kbd "C-c C-y")
    		(defun select-last-yank ()
    		  (interactive)
    		  (push-mark yank-last-start)
    		  (goto-char yank-last-end)
    		  (activate-mark)))
although this'll fail if you've inserted text before the yanked text (I suppose you could do it more correctly by setting text-properties, but that's getting rather advanced)

Re: From Vim to Emacs

#78
post #55
post #43

Bravo man, I tried to make the switch from vim to emacs evil and failed horribly. I would eventually throw emacs into a state where it wasn't in any of the evil modes, then bash my keyboard with C-X C-C. Is it possible to use emacs+evil without knowing emacs inside and out? Emacs with evil, without a doubt, runs so much smoother while editing large projects. The biggest point is that asynchronous operations are a lot…

>> I would eventually throw emacs into a state where >> it wasn't in any of the evil modes, then >> bash my keyboard with C-X C-C. I think the snippet of code in linked article in section 'Escape . . . escapes things' fixes most of the situations where you'd get stuck in a non-Evil mode in Emacs. It's a must have for me, otherwise I too got frustrated with getting stuck in Emacs minibuffer/command line and not gettin…

I think the main problem is that in vim everything works like a buffer. When I browse files or any sort of search results, I can use the standard vim key bindings to navigate through or even dismiss the window.

With emacs, it seems like I have to learn the system to even use some plugins like projectile effectively.

Re: From Vim to Emacs

#80

As someone who has always used vim, what are the benefits of this system over a standard vim installation?

You get access to things like org mode and magit and deep REPL integration and an integrated package manager. You get the ability to configure absolutely everything in elisp. Many experienced Emacsers routinely write small snippets of elisp to automate some task. This goes well beyond adding a key bindings here and there, or the odd macro, and is really amazingly powerful.

Can't you do the same thing with vimscript (or python, if you're using +python builds)?
Post reply on HN