11 ms·
Emfy: Emacs for You – Quickly set up vanilla Emacs for editing
- catern 5y agoIt's a bit more modern and neat to use .emacs.d/init.el, one less file cluttering your home directory.
- eddieh 5y agoOr the even newer XDG-compatible ~/.config/emacs/init.el
- genpfault 5y ago...what is vanilla Emacs set up for by default then, if not editing?
- susam 5y agoI published this project a few minutes ago and I was about to do a "Show HN" for this project here. As soon as I submitted my "Show HN" post, my submission got redirected to this post and I realized that todsacerdoti beat me to it by a few seconds! In any case, thank you, todsacerdoti, for posting this here!
- uncletaco 5y agoCould you not inhibit the startup screen? I get wanting to have a "clean" setup but if anyone is using this there is a good chance they don't know emacs all that well already and links to the tutorial are good for them.
- susam 5y agoSure! This is addressed in the line-by-line explanation where it mentions: > (setq inhibit-startup-screen t) > If you are a beginner to Emacs, you might find the startup screen helpful. It contains links to tutorial, manuals, common tasks, etc. If you want to retain the startup screen, comment this line out.
- daptaq 5y agoI think the point of a template is that you can change everything yourself, it is not a library you install with a package manager and are expected to leave alone. Given the good explanation of what is going on, I think disabling the about page is a fair decision.
- tptacek 5y agoYou can also (use-package dashboard :ensure t :config (dashboard-setup-startup-hook)) To replace the startup screen with a list of recent files, bookmarks, and Projectile projects you've recently visited. Remember, though, that just like this document describes, a big part of Emacs is not running it repeatedly, but rather starting it just once and keeping it alive basically forever; you're only rarely going to see the startup screen if you're doing orthodox Emacs.
- uncletaco 5y agoAssuming a person already has use-package or projectile installed is part of a larger problem tbh.
- tptacek 5y agoIn the sense that use-package should pretty clearly be bundled with Emacs by now, sure. You don't need Projectile installed to use dashboard (I barely use Projectile, and have it turned off in my dashboard thingy).
- sokoloff 5y agoThank you for the line-by-line explanation! That’s incredibly helpful for new users and helpful even to moderately experienced users.
- ashton314 5y agoThis. I learned a bunch from the why of a lot of the settings. Very nice!
- lovelyviking 5y agoDo you have advice about installing emacs without package manager/ compilation tools into the linux system that currently cannot have those and probably will not have those. I am looking for the easiest and safest way to do it . I do not want to break or brick the running arm based linux system. I do not want to interfere with it's main function but still want to be able to try emacs there. What is the best way to achieve minimal dependency setup? I am still relatively new to gnu/linux and I understand that I can unpack package let's say debian package and install each lib. manually but it seems like a big headache, is there any easier way? I am looking for something like copy everything into one directory without a need to register each lib in the system?
- stevekemp 5y agoIf you're experienced you'd download and install all the dependencies, perhaps via "/opt", where a local package-manager would not interfere. But honestly? If you're new to using Linux then you should use the supported approach by your system. If you're running Debian, for example, "apt install emacs". If you're running CentOS "yum install emacs". Trying to do things outside the confines of the package-manager seems like an odd-constraint. I can appreciate it might make some sense, but when there are so many dependencies installed - fetching/building/installing them all one at a time is going to be very fiddly and annoying, even for a somewhat-experienced user.
- lovelyviking 5y ago>But honestly? If you're new to using Linux then you should use the supported approach by your system. If you're running Debian, for example, "apt install emacs". If you're running CentOS "yum install emacs". Thank you for your advice. The system doesn't have package manager and installing one doesn't seem like safe option at least until I'll be fluent with what exactly package manager does. On debian machine I did what you've suggested. This is not debian nor CentOS. It's embedded solution. In such case it seems like easier to install only emacs. I've already installed some custom application with libs and it was a headache. I wrote my own custom application for it and there I just link statically everything I need to have less trouble with installing.
- pfortuny 5y agoHi! Thanks a lot for this. I have an issue (on MacOS, not Linux) with trying to read pdf files from Firefox, as it only lets me set packed apps (.app) as commands to run for specific downloads. I have tried and tried and no solution is completely satisfactory (unlike linux, where I just set emacsclient and it works). Do you have any configuration for this on MacOS? Just in case. Thanks again!
- yeetaccount4 5y ago
- xcambar 5y agoThis is pollution by comment. It is neither informative nor constructive nor actionable. Please refrain.
- yeetaccount4 5y agoOh come on, you can’t tell me you’ve seen an emacs or vi thread that hasn’t included this. It’d be like shipping an OS without a text editor…
- chrsig 5y agobut my nvim is already an alias to emacs. please advise
- arminiusreturns 5y agoI tend to use sane emacs when Im on a new system and just need to be up and running real fast and dont have my current dotfiles, but this looks like it is pretty awesome! Good stuff and well done!
- actually_a_dog 5y agoThis is a pretty good start. I'm fairly sure I have at least 3/4 of those lines in my personal ~/.emacs.d/init.el file.
- 2pEXgD0fZ5cF 5y agoThis looks nice! One thing I always like to note when it comes to the topic of emacs configurations: Mine has steadily gotten smaller and smaller the longer I used emacs. I'm a relatively new user. I started with Spacemacs, switched to doom emacs, and more recently finally crafted my own config. The evolution of my .emacs.d was a constant "Do I really need a plugin/preconfiguration for this?" and for me the answer was "no" most of the time once I researched it, so I removed it and either switched to the default, or emacs builtin functionality. Nowadays my config is ~130 lines as well, which includes a few lines of documentation and notes since my config is an org file. If I had to trim it down further (or set up a config from scratch to get to work as fast as possible) I'd say that I could trim it down to only a few lines.
- sidkshatriya 5y ago> I'm a relatively new user. I started with Spacemacs, switched to doom emacs, and more recently finally crafted my own config. I use Spacemacs (and I like it). For people who switched over to Doom Emacs, I like asking them why did they switch over? What were your reasons?
- Tehchops 5y agoFor me Doom Emacs was much faster and just seemed to have saner default configurations. The developer is also incredibly responsive and helpful. I'm coming from Vim, so having evil-mode as a first-class integration is nice too.
- mcbuilder 5y agoI rolled my own emacs config when I started out, for the first 3 years or so. When I saw spacemacs I liked the entire kitchen sink approach, it opened my brain up to a lot of the functionality of emacs/packages that I wasn't touching. When I saw Doom Emacs though I was kind of skeptical at first (this was about 5 years ago), it seemed to have a lot less batteries included, but I gave it chance anyway, longing after the understanding I got when I wrote my own config. I've been entirely happy daily driving it since. Doom Emacs just seems to have a different philosophy than Spacemacs, it's more like a really well designed configuration framework for emacs on which there are nice layers on top instead of the more monolithic Spacemacs approach. I can easily configure it to my needs, write my own custom modules, and hack on it. It really does a sane job updating and managing the packages, something I would waste too much time on with Spacemacs. So to me is that it seems lower level and better software, yet I still get the preconfigured functionality that allows me to quickly go take an emacs install from zero to hero in a matter of minutes. And did I mention? It's fast.
- ljm 5y agoLooks nice as a simple zero-dep setup. That said, I would recommend one of the modus themes[0] as an alternative when Emacs 28 comes out, since they're built in to that version. They're amazingly thorough and accessible. [0] https://protesilaos.com/emacs/modus-themes https://protesilaos.com/emacs/modus-themes
- masklinn 5y ago> Looks nice as a simple zero-dep setup. Though with `use-package`, it has become incredibly easy to make even complex setups self-booting (assuming you have an internet connection available anyway). It adds all of 5 lines (or 8 if you need melpa) which is rather incredible for the value it provides.
- ljm 5y agoI use straight combined with use-package and it's great. I don't really need to since I rarely hack on packages in the way that straight imagines you would, but I like the middle ground it introduces. (defalias 'sup 'straight-use-package) (sup 'somepackage) (require 'somepackage) ;; sometimes (setq somepackage-config-thing) (add-hook 'some-mode-hook #'some-package-hook) I know with use-package you'd do all this in the macro with config and init, but especially when it comes to dependent packages I prefer having things flat as opposed to nesting them. My config is apparently 333 lines but a lot of that is whitespace and comments for grouping, plus the bootstrap code which I incidentally use for publishing my blog.
- masklinn 5y ago> I know with use-package you'd do all this in the macro with config and init, but especially when it comes to dependent packages I prefer having things flat as opposed to nesting them. > > My config is apparently 333 lines but a lot of that is whitespace and comments for grouping The reason I like `use-package` even for global concerns (I actually have a `(use-package emacs)` e even though that's pretty much entirely global setqs) is it provides some grouping structure and encourages keeping each item in the proper place. `:ensure` is also pretty much essential as that's what does the bringing-up (ensuring the package being enabled and configured is actually installed locally).
- taeric 5y agoI thought by the time you get to .emacs in current versions, the package manager is already initialized? Also curious on the benefits of single space for sentences. I confess I don't use abbreviations that need periods often; but I also don't use many commands that work on sentences. (And, I do still use two spaces for sentences.)
- thom 5y agoYou can (setq package-enable-at-startup nil) in early-init.el to stop package loading before you get to init.el.
- taeric 5y agoHow does that fit in with .emacs? I'll dive on documentation tonight. Could use some cleaning of my files.
- thom 5y agoI have both an early-init.el and init.el in my .emacs. In the former I turn off package loading on startup, but also set most UI variables so menus etc are turned off before the frame is shown (stuff you might once have done with Xresources). This is also where you might do more extreme performance related tweaks (e.g. to the GC) if you really care about startup time. My init.el then does package-initialise and is mostly use-package calls.
- taeric 5y agoThat is your.emacs.d, I presume? I am still mostly carrying around a .emacs and not using init.el. That said, played with this some today and I see that I can get my startup down to about 5 seconds on my old netbook. Not too bad, all told. (This computer is hilariously slow.)
- thom 5y agoesup is a great way to see where the time is going. It's not really a big deal in the grand scheme of things but it's also a good way to learn about autoloads etc.
- eddieh 5y agoMay I suggest (unless window-system (menu-bar-mode 0)) That way the menu is only disabled in the terminal. Beginners might find the menu useful when running a GUI on Windows or Linux—I certainly don't mind the menu on macOS as it is always there for Emacs.app (regardless of the value of menu-bar-mode).
- daptaq 5y agoNote that `window-system' is deprecated in favor of `(display-graphic-p)'.
- eddieh 5y agoI guess I didn't get the memo. I don't see what was wrong with `window-system' as it allowed stuff like `(eq window-system 'mac)' and `(memq window-system '(mac ns x))' which is nice if you're using different OSs/environments and need tailor your config.
- natrys 5y agoUse of this variable as a boolean is deprecated. Not sure why, but what you are doing is perfectly fine.
- profsnuggles 5y agoIf you are trying to check what OS you are running wouldn't system-type be better? (eq system-type 'darwin) You could be running X on multiple different systems. Although I checked the output on netbsd and openbsd, both return berkeley-unix as the system-type... which isn't quite as helpful. At least I know if I'm on gnu/linux vs a BSD I guess. The docstring helpfully lets me know that a value of gnu means I'm running on Hurd. It also recognizes gnu/kfreebsd apparently because you can't throw a rock without hitting one of those.
- eddieh 5y agoBut I sometimes run X on Mac and I find it helpful to change a few things for Emacs compiled for X vs Emacs.app
- sillysaurusx 5y agoAhh, I finally get to flex. With our powers combined, me and a random unknown dev successfully set up a Python REPL that has access to emacs. I.e. you can program emacs via python: https://twitter.com/theshawwn/status/1472371143000707075 https://twitter.com/theshawwn/status/1472371143000707075 https://github.com/zielmicha/emacspy/issues/1 https://github.com/zielmicha/emacspy/issues/1 Setup guide: https://gist.github.com/shawwn/64e17ac3f7b272ce0ce16eb6a593b107 https://gist.github.com/shawwn/64e17ac3f7b272ce0ce16eb6a593b... Maybe this'll be the boost you lurkers need to get your butts into one of the coolest editors. "Not your dad's editor" -- new emacs slogan, probably. /s Bonus screenshot of compiling emacs on a 96 core TPU: https://i.imgur.com/YtJ8jF7.png https://i.imgur.com/YtJ8jF7.png It launches emacs, then uses the (relatively) new dynamic modules feature to start a Python runtime, which can then import a library that accesses emacs. But to my surprise, Python can also import whatever you already have `pip3 install`'ed. I imported jax and did some high speed calculations in lisp. Just kidding, I really did import jax, but it'll take a bit more work to be able to pass numpy arrays to emacs. :) But it's "just" a matter of making some kind of RPC system so that (+ a b) ends up calling back into python to do the addition. Then the circle will be complete -- elisp from python (already done), and python from elisp ("exercise for the reader"). For real though, go throw that fella a star on his github repo. The most surprising thing was that this project has been quietly on github for like two years already. It was sitting at zero stars when it popped up in one of my random google searches.
- daptaq 5y agoI don't get what this has to do with OP?
- sillysaurusx 5y agoI'm sorry, I didn't realize that this was a de facto Show HN: https://news.ycombinator.com/item?id=29726481 https://news.ycombinator.com/item?id=29726481 You're right in this case. Apologies to susam. The answer, though, is that I'm not going to bother making a repo and a website and packaging this up in a nice way, so it's always going to seem unrelated to whatever emacs thread I happen to post it on. Or I could just not talk about it, which has worked well for me in the past. It seemed semi-related, because the goal of the OP and the goal of this is the same: to get new people into emacs. Old emacs veterans have no need for an ~/.emacs. But I really didn't intend to steal susam's thunder -- sorry -- it just wasn't marked as a Show HN. /me slinks back to his cave of machine learning.
- daptaq 5y agoI think you should be able to replace the "disown" with "nohup", thus making the startup script POSIX compliant. A general question would be what version of Emacs you are targeting. As even Debian stable distributes 27.1, you could make use of newer features such as fido-mode (instead of ido and ido-everywhere). Then the package configuration doesn't need the package-initalize either (On that topic adding NonGNU ELPA would also be nice). Also, what it the point of just displaying the current time for two seconds?
- daptaq 5y agoPerhaps of interest, I wrote something similar a few years ago for my university in German: https://wwwcip.cs.fau.de/~oj14ozun/src+etc/init.el https://wwwcip.cs.fau.de/~oj14ozun/src+etc/init.el (here a HTML version https://wwwcip.cs.fau.de/~oj14ozun/src+etc/init.el.html https://wwwcip.cs.fau.de/~oj14ozun/src+etc/init.el.html). My intention was to demonstrate different configuration patterns. It even tries to configure Gnus to work OOTB for our university mail accounts. I should probably update it for Emacs 27.1 and change a few things where my tastes have changed.
- susam 5y agoUsing "nohup" was my first choice too. Unfortunately, it does not prevent the Emacs process from dying when we kill the shell from which we launched Emacs. If the shell is killed, Emacs dies too. I have confirmed this behaviour on macOS 10.15.7 + Zsh 5.7.1 as well as Debian 10.0 + Xfce 4.12 + Bash 5.0.3. As a result, I was forced to use "disown" to ensure that the Emacs process continues to run even when the shell dies. By the way, fido-mode is something I am going to add to this configuration in future, so thank you for the suggestion. I do use fido-mode myself in my personal Emacs configuration. However while publishing this project today, I could not make up my mind today whether I should still keep ido-mode around while suggesting fido-mode to beginners. In my personal config, I have both ido-mode and fido-mode enabled in my configuration. For file searches, ido-mode seems to be superior. For example, ido-mode can search deeply nested subdirectories recursively for a match, something I have not been able to do with fido-mode yet.
- susam 5y ago
- rg111 5y agoI have been a vim user all my programming life which is not very long. Can you please provide me straight-to-the-point, opinionated, no words twisted, maybe personal reasoning why I should use Emacs over vim? This is a very honest question. EDIT: This question is more- what motivates you to be an Emacs-er? Why do you use it? I would love to hear your reasoning behind choosing and sticking with an editor. Thanks to umanwizard for the answer. Someone else said that it is best to experience it yourself. But you have to understand that mastering a new editor is a non-trivial time commitment. I am willing to put the time and effort given it is worth it. That is what I am trying to find out. Someone on HN said just some days ago- you cannot simply be a tourist in Emacs and hope to get everything that is good with it. I guess I will learn both.
- wglb 5y ago> This question is more- what motivates you to be an Emacs-er? Why do you use it? I did a bunch of quality time with TECO on the PDP-10. I started using emacs-like editors back in 1985 under Coherent or so when DGC wrote MicroEMACS, which is now MG on most systems. EDIT: this was a replacement for good old ed. Later, under Dec Unix I used emacs . I have stuck with emacs ever since as it does what i need it to and is easy to add functionality and automation for many tasks.
- hall0ween 5y agoLike many things in life, the only way to truly know is by experience.
- CyberShadow 5y agoWhen I was choosing the next editor to settle on and invest into, what convincingly swayed me towards Emacs was the number of reports of vim users who later moved to Emacs, vs. the number of reports of users who moved in the other direction.
- johnchristopher 5y agoAnd what are the numbers ?
- 5y ago
- trabant00 5y agoEmacs is complex enough that learning it and elisp si comparable to learning linux and bash. I mean it has package and process management, logs and everything. As a new emacs convert after 20 years of vim I will try one day to start from scratch for learning purposes. But just like I would not use LFS for work I would not use vanila emacs either. I use debian distro for linux and doom for emacs.
- tptacek 5y agoYou can get a long, long, long way into Emacs without even a faint understanding of elisp. Lots of people get into Emacs because they want an extremely programmable editor, but most people get into it because they can draft off the programming that other people do.
- jacobsenscott 5y agoI'm sure doom and spacemacs are great, but the idea that vanilla emacs is just too hard to use isn't true. Doom and spacemacs are just layers of complexity on top of a very simple concept - install and configure some packages. Using this template you can see there is no black magic there and how easy it is to add packages. You don't need to know any elisp for that. I've been using emacs for years and probably couldn't write a "hello world" in elisp. Configuring packages can be done in the configuration GUI, or else it is just setting some variables - I think I've only ever used 3 eslip functions - (setq), (add-to-list) and (add-hook). Honestly the hardest part of emacs is finding which packages are quality and worth installing. This is where I find doom/spacemacs/prelude emacs useful. I browse their repos every now and then to see what packages are worth trying out - and install them with the built in `package-install` command.
- ilammy 5y agoArch and Ubuntu are just layers of complexity on top of a very simple concept – install and configure some packages. apt and nix are just layers of complexity on top of a very simple concept – copy and edit some files. Files and directories are just layers of complexity on top of a very simple concept – bytes arranged in blocks for persistent storage. You get the idea. One needs choose where to draw their own personal abstraction layer line.
- tptacek 5y agoThis is well written, and I learned stuff (the trailing spaces and end-of-buffer indicators). Modern Emacs configurations tend to revolve around use-package, which wraps up the package installer logic at the end of this configuration and makes it somewhat declarative. Just going by the standards of r/emacs or places like that, it'd be unusual to see a .emacs that didn't ultimately boil down to a bunch of use-package clauses configuring stuff like LSP, Magit, company, ivy, and yasnippet. If I was going to add just one thing to this starter configuration, it'd be a single example of use-package, to make it clear how to add and configure a package the user just read about online --- it's just such a big part of how Emacs is used now.
- NeutralForest 5y agoIf I may, my conf https://github.com/Nathan-Furnal/dotemacs https://github.com/Nathan-Furnal/dotemacs uses use-package quite extensively with lots of things I learned along the way. It's a bit large since I have anything from programming to writing in there but it's mine =)
- ashton314 5y ago+1 for use-package being the only thing that's missing. I'm delighted at how nice this guy makes Emacs look and work with only built-ins (ido in Emacs 27, and fido-veritcal in Emacs 28 go a long way to increasing Emacs' ergonomics imo) but since they're reaching for some installed packages, might as well throw use-package in there to foster further growth. (If I'm not mistaken, use-package almost made it into upstream Emacs, but they're blocked because one company won't give away the copyright for one contributor to use-package to enable it to be added to Emacs. For the larger Emacs community, I hope that happens soon!)
- Mk2000 5y agoThat problem is solved now, it's going to be added to emacs. See: https://github.com/jwiegley/use-package/issues/282 https://github.com/jwiegley/use-package/issues/282
- 5y ago
- kamaal 5y agoI recently went back to emacs to try working out some problems in SICP. And the first goal I set for myself is not to go down into emacs config hell. I went for the simplest thing I could set up: paredit, aggressive-indent, parens-mode, chez(inferior lisp) So far so good, but one thing I noticed, I had forgotten paredit commands, and emacs isn't very pleasant if you don't have things in your muscle memory. By and large emacs is best system you can use if you are writing lisp.
- susam 5y agoWhen I began using Paredit for the first time, several years ago, I could never remember which key sequences slurp and which ones barf. Then I made up some mnemonics. C-( and C-) have parentheses that look nice and round. They expand the current s-exp to consume other expressions. Nom nom nom! C-{ and C-} don’t look nice and round. They have braces which look a bit wiggly. They shrink the current s-exp and barf expressions. These mnemonics have served me and others I have shared this with very well.
- kamaal 5y agoThanks for these :) Cool way to remember things.
- lvass 5y agoThat's cool, vanilla Emacs can be great depending on your needs, specially for getting used to Emacs. I wonder if there are similarly clean configs that includes more important packages, besides Witchmacs. This config is notably missing conservative-scroll, which I consider essential. A light theme option would be nice too (whiteboard is great). Other important configurable builtins are electric pairs, y-or-n-p, ispell and mouse-yank-at-point. If you're using this, beware default redo is very unintuitive, and installing undo-tree is a probably a great idea. And it enables emacs server, you might prefer daemonizing instead.
- akkartik 5y agoI eagerly tried this out, and unfortunately it doesn't fix the biggest stumbling block for me: Emacs's tab behavior. Coming from Vim, I never. ever. want to hit Tab and see nothing happen. Regardless of how strongly my editor thinks it knows best, hitting Tab should insert some spaces. I'll even accept indenting the current line the first time I hit Tab. But if I hit Tab a second time, follow my other preferences and insert some character(s). And in 5 years I can't for the life of me configure this! No solution transparently sets this default for all time. Every new fucking file type I try to edit needs me to go around in circles fixing this stupid behavior. Sigh. Back to Vim, I guess. I don't understand why this doesn't come up more often in all the blog posts about transitioning to/from Emacs.
- tomcam 5y agoI too am interested in the Tab question
- lvass 5y agoHave you tried hooking self-insert-command to the modes you'd use it on? Like prog mode and fundamental. The only corner case I can think of is if you'd like to tab-insert in org-mode and also expand headings using tab. Edit: Try this: (defun indent-for-tab-command () (interactive) (insert-char #x20 4))
- alex_smart 5y ago>I don't understand why this doesn't come up more often in all the blog posts about transitioning to/from Emacs. Because most people who use Emacs like this behaviour. Also considering that this post promises a relatively vanilla editing experience, you shouldn't expect a solution to your particular problem. > And in 5 years I can't for the life of me configure this! It is not that hard to solve this. It is extremely easy to map any key in Emacs. You can just map Tab key to insert a tab if that is what you want. It will be like two lines of elisp. Edit: The reason most Emacs users don't find the tab behaviour a problem is: a, Emacs indents correctly more often than not and b, you can insert a literal tab character when you want using 'C-q Tab'.
- 5y ago
- haolez 5y agoI used Emacs for everything, until I got chronic pain in my left pinky and went back to "traditional" editors. I've been willing to give it a go again in cua-mode, but couldn't find the time yet. And yes, I have tried to replace left-ctrl with capslock, but it was annoying as well.
- tomcam 5y agoI am very interested in this particular use case. What turned out to be annoying about it?
- haolez 5y agoWell, it wasn't that much annoying, but I would sometimes have to use other people's (customer's) computers and I kept pressing Capslock hoping it would be Ctrl like an idiot :) Besides that, can't remember if it was on Linux or Windows, but there was an input lag when using Capslock as Ctrl. I had to wait like 1s for it to register. Mostly unusable, and I used both systems a lot at the time.
- tomcam 5y agoYeah, relying on that when you use foreign keyboards makes life difficult. I take an in-between approach and redefine just a couple of keys such that I can get away with just few lines of config.
- lvass 5y agoDo you use a laptop keyboard? Pressing control with the left side of the left palm is just so natural I don't understand why people even use their pinkies, I think I started doing that even before using emacs.
- b3morales 5y agoCurling the pinkie and using the knuckle instead of the tip also works well for me. In fact I do this for both M and C.
- deleted 5y ago[deleted]
- tkdc926 5y agoSo I see configurations in: .emacs .emacs.d/init.el .config/emacs/init.el Which is preferred?
- isaiahg 5y agoPick whichever, it wouldn't be emacs if there wasn't at least 3 ways to do something. read this for a complete answer https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html https://www.gnu.org/software/emacs/manual/html_node/emacs/In...
- Topgamer7 5y agoI was trying to switch to emacs, but one thing that drove me nuts was the start up time. I had installed spacemacs, and I prefer my text editor to start up immediately. I could not find the setting to disable checks against the internet on every start up.
- FemmeAndroid 5y agoThis is really nice, but for me there's one thing that keeps me away from emacs, and its good multi cursor support. Very frequently, I'll want to perform this kind of process: 1. I search for some frequently occurring string or regex in a file. 2. Get a series of cursors for every result of that search. 3. I'll know that it's possible to do a manipulation of all these lines, but frequently it's not immediately obvious how, so I experiment a bit at this point. Frequently I end up doing things like manipulating the cursor to delete sections of the line, and modify the shape and order of some elements. This requires I can select portions of text, cut them, and paste them in a different part of the line. So each cursor needs to have its own clipboard. I also tend to do things like add variables to the cursors. Sublime has a nice way to have incrementing integers so the first cursor inserts a 1, the second inserts a 2, etc. There are all sorts of little tricks like this. One appeal of something like emacs would be having a simple language to write stuff like this quickly myself. 4. After experimenting, I complete the manipulation. If I fail the first time, I undo, and do it again. This kind of thing takes less than 15 seconds for me, but it saves a ridiculous amount of time. It's really useful during this to actually be manipulating all lines at once, since it lets me see where assumptions I have about the data I'm manipulating is incorrect. I've tried every multi cursor package I've seen in emacs, and I've tried to figure out how to get this kind of thing down through macros, but the live editing of multiple lines seems invaluable and keeps me in Sublime/VS Code. I'd love to know if I'm doing something wrong with macros, there's a solution to what I'm trying to do, or if realistically my best bet is to stick to what I know.
- CyberShadow 5y agoI have not tried the multiple cursors package, but regarding the problem of manipulating several lines at once with instant preview, you could look at the visual-regexp package: https://github.com/benma/visual-regexp.el https://github.com/benma/visual-regexp.el
- hsbauauvhabzb 5y agoTry macro record / macro playback. While saying this I hate that I’ve never properly learned how to debug a recorded macro, or manage them better, but they largely suit my use cases.
- porcoda 5y agoAwesome. My .emacs very slowly accumulates little bits that I like every time I find pages like this. About once a year I find something new that I like and I add it. At this point, my .emacs is about 80 lines (not counting comments) accumulated over the years since the 1990s. The only packages it depends on are programming language modes that aren't distributed with emacs itself. My vimrc is similar - just around 50 lines accumulated over the same time period since the 90s.
- rjmorris 5y agoThanks for this, I found a few things to investigate adding to my own config. I have a question about the server/client mode: > Experienced Emacs users run a single instance of Emacs and do all their editing activities via this single instance. What's the motivation for running it this way? I think the repo should explain why, especially since it's targeted at newbies. Also because it looks like a lot of effort was put into explaining how and discussing the em script that makes it more convenient. For what it's worth, I'm an experienced Emacs user, and I don't run a single instance. Instead, I start lots of new instances. As best I can tell, the motivating factor for a single instance is startup speed. However, I'm satisfied with my startup speed and haven't felt the need to improve it with server/client mode.
- Jtsummers 5y agoMy initial motivation for using daemon mode was start up speed as my config had ballooned. I got it under control later, but emacs also got faster later so it was mostly moot in the end. Speed is no longer a motivator for me. There are a few uses, for me, of daemon mode that have kept me using it. First, like tmux and mosh, emacs daemon is persistent. Should I accidentally close it but not really intend to close it, everything is still there. Useful if you use emacs for more than just editing (like an IRC client). In that instance, all my buffers are still present and anything that needs ongoing execution will continue to happen. Second, I never got used to using emacs as my shell. So I drop back to the shell for most of my filesystem navigation and running various CLI tools. With the daemon running in the background, this means I can close the client, navigate or run programs, and reload the client with everything in place or while opening a new file. Third, I often use multiple daemons, one for each project/language. I use the shell to go to the project root and launch a new (named) daemon. Then when navigating around the project in the shell, I can open a file for editing using the appropriate client incantation. This lets me keep a full emacs daemon running but with only the appropriate buffers and subprograms (useful when dealing with interactive languages like Lisp or Erlang, where I may also have a project-specific REPL running). Fourth, I use magit and tmux. So I usually split my window into two panes with editing/navigation/CLI activities on the left and magit on the right. The magit instance gets to share the same kill ring and buffers as the editing instances on the left. I know I could do the same by splitting the frame left and right the same way, but this has become my preferred interaction. Plus, since I don't use emacs' shell mode I often further subdivide the panes anyways, like editor in the top left, magit on the right, and shell in the lower left with fswatch running tests continuously. I suppose that if I just did everything in emacs (including the shell and file system navigation) then it would be less useful. But I don't, so it's very useful.
- MattyRad 5y agoI think this is a step in the right direction. It's definitely a better initial experience of emacs (including Doom/Space), but even after trying this out I experienced several (emacs-core) frustrations. Just now I experienced: weird keymaps (C-? C-? to do things, including exit... do I have to Google keymaps, read docs about keymaps, remap keys to my own preferences, or just memorize existing keymaps?), signaling EOF (normally Ctrl-d) doesn't quit (gives a weird error "mark not set"), not knowing which buffer I'm looking at or how to list/switch buffers, no (initial) mouse support, no idea how to search and replace, no idea if spawning multiple cursors is possible. All that in a span of ~5 minutes. I'm not trying to hate on emacs, just trying to list some pain points of the UX. I'd be willing to give another emacs dotfile a shot, but I think it'd have to be even simpler than this one.
- d4rkp4ttern 5y agoI used emacs ever since grad school days, and was reluctant to switch to an IDE (specifically JetBrains / Pycharm) but finally invested a few days to switch, and now I would never use emacs as an IDE. There are a couple scenarios where I still like using emacs: * for quickly opening and editing a file without using a bloated IDE, especially on remote Linux machines. * for magit (git tool inside emacs) which is honestly a super power for those who know it. As I switch jobs and machines I keep looking for a “quick” config , and I find doom emacs suits very well. https://github.com/hlissner/doom-emacs https://github.com/hlissner/doom-emacs