Live data from Hacker News

Why GNU Emacs?

elephly.net

151–160 of 317 posts

Re: Why GNU Emacs?

#151
post #25

Emacs is a fine editor to use until you write your own. It's the only way to make your primary interactive tool work exactly the way that you think it should.

That's a hefty endeavor. Care to share more about your experience writing your own?

Live coding environments typically include a text editor. Sometimes as in the case of Praxis, its possible to change the behaviour of the text editor while you use it.

https://github.com/createuniverses/praxis

I wrote it for myself mainly, so a lot of the features are undocumented and hidden away. But you can have a look at fnkeys.lua, editor.lua and keymap.lua to get a general idea. These are in prods/syntax2015continued. You can bring these up in praxis and make whatever changes you like to the live system.

I like the idea of making it keyboard and buffer driven to an extreme, like the Commodore 64. For example, one simple technique I like is to "inject" code into the current buffer to place objects:

  function makeCamPosSaver()
    local x,y,z = getCamPos()
    x = math.floor(x)
    y = math.floor(y)
    z = math.floor(z)
    local s = "setCamPos("..x..","..y..","..z..")"
    print2(s)
  end
Then calling makeCamPosSaver injects a bit of code that will move the camera back where it was when you called it.

Another example: pressing F3 creates a new buffer where you are supposed to fill in a string with what you are searching for. When you run that buffer, it will switch to the old one that spawned it, and move the cursor to the next occurrence of the search string.

There are more creative ways to use this that others could come up with I'm sure.

Re: Why GNU Emacs?

#152

Earlier quoted context omitted.

The best way to run emacs IMO is to use "emacs --daemon" to spawn a single daemon process, and then connect to it using emacsclient. Then, startup time is instant!

then you have to maintain/monitor that daemon, seems like too much work.

The first line of my ~/.emacs is (start-server). /usr/bin/emacs is launched once and runs forever. I spend nearly all my time in emacs, so there is nothing to maintain/monitor. If emacs dies, it is rather obvious.

Re: Why GNU Emacs?

#153
post #45

Once, I used Emacs. All I did with it was play in the land of elisp. I never got any real work done. Then, a passionate friend converted me to Vim. I only ever used it to do battle with my .vimrc. I never got any real work done. Now, I use Atom. Click a button, install a feature. No more distractions. I wish it were faster though; I can never get any real work done.

This doesn't make sense. You used to be someone easily distracted by yak shaving, is what it reads like. Installing features in Emacs is not exactly tough, either. I do think you can get distracted by the sea of things you can install. Probably no different from the new toys in the realm.

Makes sense to me. I love both emacs and vim, but I agree there are too many yaks to be shaved to get them in a usable state.

Re: Why GNU Emacs?

#154
post #127

Earlier quoted context omitted.

I think both built-in completing read and helm/ivy have their uses. ido is best for when you know what you want and want to get it to it with minimal number of keystrokes. helm seems better for when you want to review many (but not too many) options before deciding on what you want. I find ido unusable for find-file, because of how it splits up directory from filename. So I use the builtin completion. But I rarely op…

I love ido's find-file, but I think that's because I've made it behave much differently than the defaults. The ability to use backspace to go up one full directory, jump to home with ~/ at any point, jump to / with // at any point, and navigate folders quickly with fuzzy matching and RET is really, really nice. To be fair, most of my file opening is done with projectile, which, when you exclude the right files and us…

Do find-file. Now I see current directory as the default suggestion. Can C-a, C-b, Backspace, etc. within it.

Do ido-find-file. Now I see current directory as part of the prompt. Cannot C-a, C-b, Backspace, etc. within it.

Re: Why GNU Emacs?

#156
I just recently moved from Vim to Spacemacs.

I was looking for a TODO list application that would work on plain text. This led me to org-mode. Fortunately, I discovered Spacemacs when trying to find a plugin that would emulate Vim keybindings in Emacs.

All I can say is WOW!.

I get to keep all the modal editing goodness of Vim while getting the excellent, well documented functions of Emacs. I also like it that the commands are Vim-like(doing a sequence of keys using a leader key instead of key chords).

Re: Why GNU Emacs?

#157
post #130

I try Emacs around once per year. The problem is it's so slow under OSX. It's much faster on my 2007 iMac running Linux than 2013 mbp. I even tried to run it under X-Quartz but still performed poorly. What can I do?

Turn up the limit on garbage collection made a big difference for me. I'll post my .emacs.d on github and reply here. I'd only make a personal recommendation for emacs if you were doing Clojure development. Emacs+Cider+clj-refactor puts everything else to shame. Otherwise I'd just say use atom or sublime or whatever ide.

repository, as promised.

https://github.com/scottstackelhouse/emacsd.git

Re: Why GNU Emacs?

#158
Calling Vim my "editor" is really doing the rest of the programs that actually make up my development environment a huge disservice. Vim might be what I use to edit text, but the rest of "Unix" is my IDE of choice. Being able to tab between an IRC/chat client, my email client, a shell, and an open instance of Vim is a huge advantage for me. So up until recently, I never had a need for Emacs...looking at it as too much of an investment into re-building all the features that are in my shell configuration. That's when I discovered Org Mode.

I love Org Mode. It's become my primary note-taker, todo list, and general idea dump. I've used it to plan out projects for work, tours for my band, and to write down essential things I need to get done each week. Syncing to MobileOrg over Dropbox, and keeping my Org files in a synced documents folder, means that all of my computers have access to the same information at all times. I tried using vim-orgmode for a long time but most of the features that seemed the most useful to me just weren't supported. Why screw around with VimL when I could just download Spacemacs, configure Solarized and Monaco to at least get it looking like Vim, and then use that just for Org Mode? That's what I've been doing, and I have to say I've fallen in love with how fast I could get packages up and running and with how many great features seemed just "built in".

Re: Why GNU Emacs?

#159
post #127

Earlier quoted context omitted.

I think both built-in completing read and helm/ivy have their uses. ido is best for when you know what you want and want to get it to it with minimal number of keystrokes. helm seems better for when you want to review many (but not too many) options before deciding on what you want. I find ido unusable for find-file, because of how it splits up directory from filename. So I use the builtin completion. But I rarely op…

I love ido's find-file, but I think that's because I've made it behave much differently than the defaults. The ability to use backspace to go up one full directory, jump to home with ~/ at any point, jump to / with // at any point, and navigate folders quickly with fuzzy matching and RET is really, really nice. To be fair, most of my file opening is done with projectile, which, when you exclude the right files and us…

I can't reply to gleb's comment below, so I will respond here.

After ido-find-file you can do C-f and edit the line like find-file does.

Re: Why GNU Emacs?

#160
Why should people use emacs to run applications when the shell already does that just fine? Just use the shell and you can run applications in any language you want rather than having to stick with elisp. If you want to constantly switch between applications, you can use tmux or simply your terminal emulator's tabbing functionality. You can even switch between GUI applications instaneously if you use a tiling window manager like XMonad.
Post reply on HN