7 ms·
> Not having a general text editor at your disposal for when you have to input/manage loads of text is like being a carpenter and only having a hammer in the to
by iLemming 7y ago
> Not having a general text editor at your disposal for when you have to input/manage loads of text is like being a carpenter and only having a hammer in the toolbox.
Once I learned Emacs to the sufficient level, I felt that. Today, I can't even imagine typing any text in anything else but Emacs. Having all the tools you need at your disposal - spellchecking, thesaurus, dictionary, word lookup, translation, etc., feels extremely empowering.
My work machine is a Mac. I have written this¹, mainly to integrate with Emacs. Whenever I need to type anything longer than four words, in any program, I use that. The idea is simple - to copy existing text, call emacsclient, it invokes a function that opens a buffer and pastes the text into it. Then you edit the text in Emacs, press dedicated key-sequence - it grabs the text, switches back to the program, pastes the text back in there. It works surprisingly well. I can for example, open Browser Dev Tools; invoke Emacs; switch to js-mode, have all the bells and whistles: syntax-highlighting, autocomplete, etc.; write some javascript; finish editing and it would paste the code back into the Dev Tools console.
Sometimes I use Linux with EXWM. When I first discovered it, I got very excited. Not because now I could manage all windows through Emacs, but mostly because EXWM can "translate" and "simulate" the keys. So, for example, you can use same key-sequences that you use on Mac, but they'd translate into Linux native keys. There's no "context switching", you don't need to re-adapt to the keys all the time. It took me a few hours to learn EXWM and configure it, next day I wrote exwm-edit² Emacs package.
Being able to write any kind of text in your favorite editor is truly liberating. I highly recommend trying. Be warned though - it's impossible to live without that later. The only reason I don't much use Windows these days - because I haven't yet figured out the way of doing this in Windows. Someday I will.
---
¹ https://github.com/agzam/spacehammer https://github.com/agzam/spacehammer
² https://github.com/agzam/exwm-edit https://github.com/agzam/exwm-edit
- _hardwaregeek 7y agoI legitimately don't know how people can code without using some emacs or vim commands. Even the simplest stuff like M-f/M-b or C-a/C-e are so ingrained in how I use a computer. Do people genuinely not use them? Do they just navigate with the mouse and arrow keys? I suppose there's alternatives like Cmd-<left> and Cmd-<right> or Alt-<left> and Alt-<right>.
- thiht 7y agoNot using emacs, I could answer, but I have no idea what "M-f/M-b or C-a/C-e" means
- groovy2shoes 7y agoM-f/M-b = Meta-f/Meta-b (the Meta key is usually mapped to the Alt key on typical PC keyboards): move forward/backward a word. In vim, the equivalent is normal mode w/b. C-a/C-e = Control-a/Control-e: move to beginning/end of line. In vim, normal mode 0/$.
- happyrock 7y agoI gave Emacs another good-faith effort recently, via Spacemacs. I really bought into it, wanted to make it work, and forced myself to use it for all text editing. But despite every intention of working through all of the quirks and oddities and endless customization, and with the stated goal of reaching Emacs enlightenment, I gave up after a month or so, deleted it from my machine and resolved never to try again. It feels silly saying this about a piece of time-tested software that many people love, but as someone who believes in the idea of Emacs, in my opinion the reality of Emacs is that it just doesn't work very well. It's slow, it's clunky, it gets in your way at every opportunity, it's documented in a very puzzling style, the add-on packages often interfere with each other in inscrutable ways, and the user experience is on the whole, terrible. At least that's how I felt coming back to Emacs after using modern IDEs the past few years.
- tra3 7y agoOverall, I think it's a pretty fair assessment. Emacs is dense, obscure and what is these days called "opinionated". You gotta remember though, that Emacs is from mid 70s. There's a lot of legacy there, but also a lot of refinement. Lots of brilliant people have spent a lot of time improving it over the years. You shouldn't think of Emacs as an editor; it's a text processing system. In other words it supports lots of workflows of which IDE is only one. I also use it as a knowledge management system (org-brain) and task tracker (org-mode). It helps me manage my days because it hooks into google calendar. I manage my bugs via a JIRA integration, read my mail through it and now I'm gonna check out the IM mode :)
- catblast 7y ago> "opinionated" I feel this term might need to be officially dead and buried. If something as customizable as emacs is deemed opinionated what does this even mean? For chrissakes there are people that consider emacs to be a better vi implementation than vim.
- AlbertoGP 7y agoWell, there are lots of customizations doable (I’m still rocking my .emacs from the 1990’s going through several platforms, Linux→MacOS→Linux, refined over the years with custom functions etc.) but to name a single example: my keyboard does have a Find key, and I tried mapping isearch-forward to it instead of the default CTRL+S. That’s trivial, but then, you know how you can press CTRL+S again to go to the next result? Well, that key combo is hardcoded in LISP. So yes, you technically can remap isearch-forward, but in a useless way.
- Koshkin 7y ago> simple - to copy existing text, call emacsclient, it invokes a function that opens a buffer and pastes the text into it ... press dedicated key-sequence Doesn't sound simple at all (compared to Notepad, anyway).
- iLemming 7y agoTroll me moar.... You think I was talking about doing all that manually?
- Arubis 7y agoClassic "support request via HN" move incoming! I've long struggled getting Emacs to interop with all things Mac, and so happily pulled down Spacehammer to give it a shot. It seems snappy and generally like a Good Idea, but whenever I try one of the configured Emacs-related commands, it briefly pops open a new Emacs GUI window and then immediately closes it. Nothing useful seems to come from Messages or Warnings. I don't suppose you've run into & dealt with this or similar, or have any ideas? I'd love to use Spacehammer.
- iLemming 7y agoI've been too busy with my work related duties. I need to update and improve the documentation. Sorry about that. Basically, both Hammerspoon and Emacs have to know about your activity of editing. Spacehammer handles Hammerspoon side, in order for that thing to work with Emacs, you have to import spacehammer.el package in Emacs. Let me know if any additional questions arise.
- Arubis 7y agoGreat; thanks! I'll poke at this some more. I'd been working under the assumption that the calls to `emacsclient` were somehow injecting `spacehammer.el` (and I don't really know how to debug elisp).