8 ms·
Emacs user here, it's been my go-to editor for about 40 years. I have a few customizations, not many. My .emacs file is 63 lines long, doesn't include any othe
by kabdib 7y ago
Emacs user here, it's been my go-to editor for about 40 years.
I have a few customizations, not many. My .emacs file is 63 lines long, doesn't include any other files, and mostly just tweaks some key bindings and turns off features that I don't like. The only modes I use are built-in ones (e.g., C-mode, auto-wrapping text mode, etc.). I can't write elisp without a reference manual, and I think that's okay.
I suggest:
- not installing a bunch of random stuff until you're comfortable with the core experience or you simply have to adjust or disable something that bugs you
- just using Emacs, and not customizing the crap out of it, ditto
If you haven't gone through the Emacs tutorial, it's how I learned it (at 300 baud, uphill both ways and in the snow -- not kidding about the 300 baud thing, though).
- jimhefferon 7y agoForgive the noise, but I second this. I haven't committed a hundred key combinations to memory. I find that knowing the twenty things I need to know (which are different for everyone), and having another twenty in my back pocket for once or twice a year has lasted me since 1992, and left me very satisfied indeed with emacs.
- downerending 7y agoAlso seconding. Vanilla emacs is already extremely powerful, and if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs. Beyond that, add language modes for anything you need that's not already included. If you use 'git', 'magit' is very nice. Beyond that, helm is interesting, though very large and kind of mind-blowing. Recommend these in your ~/.emacs.d/init.el, to avoid being that guy: (setq-default show-trailing-whitespace 't) (setq-default indicate-empty-lines 't) ; try not to use tab characters ever when formatting code (setq-default indent-tabs-mode nil) (setq-default require-final-newline 'ask) (setq-default mode-require-final-newline 'ask)
- philsnow 7y ago> if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs. If you're talking about production hosts, they shouldn't really have vanilla emacs installed either. Not having your creature comforts present on production machines is a feature, like the red shell prompt / terminal background some people use, a reminder to get you to think twice and try to not do things directly in production. If you really must, just use TRAMP, it's amazing. If, on the other hand, you're talking about using somebody else's laptop to do anything, that doesn't make sense to optimize for, at least in my experience. I prefer not to even touch other peoples' laptops/keyboards.
- downerending 7y agoI'm fine with not installing emacs, as long as no one ever asks me to fix their crap on those hosts. In practice, their stuff will always break, and they always will ask me to fix it. Production hosts should never be neutered. At a bare minimum, emacs-nox, strace, nmap, tcpdump, lsof. No exceptions. Tramp is great, but not all such hosts are reachable that way. > I prefer not to even touch other peoples' laptops/keyboards. Me too, but that's why they call it work.
- mbrock 7y agoHopefully the Emacs is also configured to not leave tilde backup files everywhere!
- User23 7y ago> Also seconding. Vanilla emacs is already extremely powerful, and if you're doing real work, you'll end up having to use hosts that don't have all of your wonderful enhancements installed. It's good to know vanilla emacs. I wonder if I'm weird, but I use a highly customized Emacs on my dev machine, but if I have to ssh into a host and edit something I just use vi there. The correct answer to vi or emacs has always been "both" for me.
- 7y ago
- xemdetia 7y agoI started this way and my next step was taking advantage of the current package manager. The fact you can inject new functionality so quickly made me really fall in love with emacs. Adding additional programming modes/file format modes without any headaches has been a boon to my usage of Emacs. I'm rarely tuning settings in elisp anymore and instead just adding a feature so the file has colourization and tab stops working properly. If I do actually want to customize something since customize-mode works well enough now I can usually find the modest setting I do want to change without much hassle.
- h91wka 7y agoThere is another positive side effect of limiting customization to reasonable levels. Default Emacs shortcuts are hidden everywhere. Most importantly, bash understands them, as well as many other REPLs (erlang, ghci, julia, ...). Developing muscle memory for the default Emacs allows one to use many tools much more efficiently.
- zozbot234 7y agoDefault Emacs shortcuts are bad for RSI. Even the original author of Emacs has had to cut down pretty dramatically on their coding activity, due to getting "Emacs pinky" and other RSI problems.
- alexhutcheson 7y agoMapping Caps Lock to be "Control" helps a lot with this. Reaching down to the bottom row for Control all the time is terrible and should definitely be avoided. Using Alt as Meta has been less of an issue for me since I can easily hit it with my thumb without moving too much. evil is also great, and it might actually be the most popular option for new users at this point, thanks to Spacemacs and Doom.
- __d 7y agoSecond this: the key to the left of 'A' (for QWERTY) should be control for regular Emacs use.
- donio 7y agoThat's true for traditional keyboards and layouts. A keyboard with a thumb cluster that puts ctrl and meta under your thumbs makes all the difference.
- smitty1e 7y agoI had to go to Spacemacs[1] for a few reasons: - Using the spacebar to invoke functionality is a massive physical boon to usage. Stock emacs wrecks me from fingers to neck for an real amounts of usage. This is a purely subjective weakness. - Spacemacs vi emulation. I drank the modal Kook-aid. Especially if one has to SSH into headless instances in the cloud. vi is part of the POSIX standard, so you know it's there and it's robust. - Spacemacs engineering. Great package integration in the form of layers. [1] https://www.spacemacs.org/ https://www.spacemacs.org/
- kalium_xyz 7y agoYou can also just run evil mode for the vi emulation (its what spacemacs does), spacemacs is the best emacs IDE though IMHO.
- weaksauce 7y agoyou definitely can use evil mode but you will find a lot of edge cases where you have to configure something in some modes to behave sanely whereas with spacemacs they have usually done all that legwork of anything you want to use.
- michaelmrose 7y agoYou can get a lot of help with evil-collection https://github.com/emacs-evil/evil-collection https://github.com/emacs-evil/evil-collection Which provides evil bindings for a lot of modes
- kalium_xyz 7y agoYou also have doom which is just evil and not space centric AFAIK
- smitty1e 7y agoDoom has good reviews AFAICT
- boulos 7y agoWhat’s emacs --version say for you? My main complaint from using a Mac laptop for so long is that I often had to download some .el packages, that are basically unnecessary with more recent emacs updates. Other than that, I’ve also got a fairly simple .emacs file modulo a few project specific “let me make this a macro for this terrible manual process I need to do”.
- alexhutcheson 7y agoFYI - the Emacs binary that's bundled with pre-Catalina versions of macOS (as /usr/bin/emacs) is 22.1, which is an ancient version from 2007. Apple kept that version because it's the last one that was released as GPLv2, and they've avoided bundling anything that's licensed GPLv3. This is the same reason that macOS includes an ancient version of Bash, and why they're switching to zsh as the default login shell. Because it's so old, no one bothers to maintain compatibility with it anymore, and almost all modern elisp will break in some way if it's loaded in 22.1. Somewhat fortunately, it seems like Apple has removed this emacs binary from Catalina, so it won't be an issue on future versions of macOS. To get a modern Emacs: https://emacsformacosx.com/ https://emacsformacosx.com/ has binary builds of the official Emacs releases, with some additional scripts that let you launch it from Launchpad, etc.
- squirrelmaker 7y agoWas it an acoustic modem? Just adds to the joy.
- kabdib 7y agoYup, a Novation Cat. I still have it, not that it's useful other than as a conversation piece.
- dhosek 7y agoI'm in this school of emacs usage. I use Aquamacs on my Mac and while I've been using Emacs for almost as long as kabdib, I've barely scratched the surface of what Emacs can do. For me, the biggest thing that'll get me to drop out of IntelliJ (I was so happy to learn that there were Emacs keybindings hidden in one of IntelliJ's Mac keymaps) and into Emacs is to do ctrl-x(...ctrl-x) to record a macro, then ctrl-x NUMBER ctrl-x e (I'm hoping I'm translating muscle memory correctly) to do a repeated complex edit on a block of text. It's always fun to see junior devs (and occasional seniors) watch me do this and ask, How did you DO that?
- kabdib 7y agoIt's fun to see someone's jaw drop when you show them what you can do with a keyboard macro, some regular expressions and a little shell integration. More than simple fun; I've saved people from hours and sometimes days of drudgery with just a few minutes of mucking about in Emacs. Teaching someone simple automation is pretty rewarding. Even if they are not technically capable of repeating your solution, at least they go away with a problem solved AND the knowledge that there are usually better options available than drudgery.
- acomjean 7y agoI work the same way. Drop out of phpStorm or inteliJ into emacs to do some Marco recording. I tend to use f3 to record and f4 to run said macro. That and white space mode for examining files..
- scns 7y agoYou can use Vim style macros in Intellij with the Vim plugin
- drfuchs 7y agoMy advice (and experience) is exactly the same as kabdib's (though his .emacs file is longer, and his baud rate lower, than mine). Literally the only advanced feature I use is Keyboard Macros (as dhosek mentions), but just that one feature is so useful, every other editor I've tried feels hobbled (even vi, which I used professionally for years). And no, multiple IPs doesn't do the trick at all. On the other hand, my pinky hurts.
- jwr 7y agoThis advice is fine for the first year or so, but afterwards I would start trying out various packages and customizations. There are packages that can make your experience much better (projectile, swiper, ace-window, ace-jump, move-border, eyebrowse, winner, color-identifier-mode, off the top of my init.el). And, of course, if you do any programming at all, you should install magit immediately. It is the best git experience anywhere, on any platform, period. It is an unbelievable productivity booster, and people who haven't used it do not even appreciate what it can do (ever wanted to quickly apply a single diff from one of your stashes to your current code tree? it's two keystrokes). Approach emacs like you would a musical instrument: you are not expected to play the piano on your first day, and the first year will require some patience and training, but eventually you'll start playing those sonatas. [context: my Emacs init file has lines that are 27 years old]
- b3n 7y agoIn case you weren't aware, winner-mode is now part of Emacs, and as far as I can tell the Emacs 27 tab-bar-mode makes eyebrowse redundant. For me project.el that ships with Emacs is enough for my project needs.
- jwr 7y agoHmm. Do you mean that tab-bar-mode lets me have a full-screen Emacs (no UI elements whatsoever, as one does) and switch between window configs like if they were workspaces (which is what eyebrowse does)? If so, I might want to try it.
- b3n 7y agoYes exactly, by default it has a tab-bar UI element, but you just have to set tab-bar-show to nil and you can use it to switch between window configs without the UI.
- cjauvin 7y agoTypical Emacs user experience: sees a list of packages some other user likes, picks one with a name he finds intriguing (in my case eyebrowse), checks it, finds it cool, adopts it (possibly for a long time).