9 ms·
Show HN: Emacs Configuration Generator
- bloopernova 4y agoArgh! Of course something cool like this gets shared on the day I'm super busy. Can't wait to mess with this. For extra nerd cred, output a .org file that can use babel to generate init.el ;)
- the_only_law 4y agoNeat, maybe I’ll finally get started with emacs. (Also I love when my phone attempts to autocorrect it to eMacs)
- dmortin 4y agoInteresting, but you know what might even be better? If it could be done directly from emacs. E.g. if you start with a brand new emacs then you could paste a line into scratch, eval it, and then these question would come up, you give answers and then an emacs file is generated, written, evalled and you get your configured emacs instantly. But of course a web interface also has its advantages, it's prettier than barebones emacs,so it's more appealing to config there.
- daptaq 4y agoAs there are currently no Javascript dependencies, it is possible to use the site using EWW: M-x eww https://emacs.amodernist.com/ https://emacs.amodernist.com/ RET. That being said, the screenshots get in the way so it isn't that great (ironically emacs -nw appears to work better). But a long term goal is to find a way in which the configuration options could be detached from the configuration generator, as mentioned in the last section here: http://amodernist.com/texts/ecg.html http://amodernist.com/texts/ecg.html. An alternative could also be to have the configuration generator generate an Elisp script, that could be evaluated and used in Emacs itself. The reason that I decided to implement this for the browser first, is that the interface is probably more familiar, especially if someone has had no experience with Emacs before.
- bachmeier 4y ago> Interesting, but you know what might even be better? If it could be done directly from emacs. First, Emacs should have sensible defaults like Ctrl-c for copying and Ctrl-v for pasting. Second, there should be a menu item to choose among particular setups. A new user shouldn't have to go through the less-than-fun process of installing a bunch of stuff to get a common sense setup.
- cyberbanjo 4y agocua-mode exists and it's been argued that it should be default.
- bachmeier 4y agoI'm aware. But it's not the default.
- nocman 4y agoNor should it be, in my opinion. Emacs has a loyal user base, and changing to having cua-mode as the default would likely anger most, if not all of them. I highly doubt that the number of long-term users gained by the change would be even remotely significant.
- bachmeier 4y ago> I highly doubt that the number of long-term users gained by the change would be even remotely significant. This sums up well the gigantic hurdles Emacs faces as it attempts to stay relevant over the next 20 years. We're talking about a single keyboard shortcut to switch back to legacy mode.
- natrys 4y agoEmacs is more widely used today than ever before. There are more high quality packages being produced by the community today than I ever remember it being the case. It's only when you stop looking at growing absolute user numbers and instead get into percentage, is when you reach a conclusion like Emacs is struggling to stay relevant. That's like saying Lamborghini is struggling to stay relevant because of Toyota or something.
- catern 4y agoThe customize interface built into Emacs already provides this. Though it supports customizing far more things, so it might be overwhelming. Maybe a new user customization group would be good.
- southerntofu 4y agoExactly. A settings panel does not fit the same usecase as an onboarding configuration panel. Having both would be amazing.
- jimbokun 4y agoThis looks like it solves a very real pain point for anyone getting started with Emacs, and likely many people who have been using Emacs for a long time sub-optimally. Could save hours or days of learning about how to configure Emacs. Reminds me of a Spring Initializr, as a way to quickly get started with a new tech tool.
- michaelanckaert 4y agoFor me, configuration a tool or system is actually a likeable experience. It's almost a hobby to keep tinkering with my various configs. Of course, that doesn't mean every tool should require massive amounts of time invested in configuring sensible defaults. Not everyone wants to do this.
- taude 4y agoI think people will eventually do this. But giving them a sane, simple starting point is probably a good idea. (Though I awhile ago threw all mine out and went with basic Doom setup, but everyone's journey will be different)
- Kaze404 4y agoThis is really cool. I'd recommend it for people who are into customization but want a solid foundation to start. For people who are looking for a more batteries included experience I'd recommend Doom Emacs.
- chipotle_coyote 4y agoI can see that distinction. I think this might get me to poke at Emacs again because the starter kits I've tried feel like they just include too many damn batteries. :)
- czernobog 4y agoThis is cool!
- globular-toast 4y agoSomething like this built directly into emacs that launches when people run it for the first time with no config (and no file opened) would be great.
- rmnull 4y agoNeat. I like the fact that it is opinionated providing a decent setup to get things done. Here are some of the things i was confused about, or thought could be improved. 1. The label of checkbox don't seem to respond to clicks. 2. On Font Input, There's no description or selections on what inputs are acceptable. 3. There is no mention of Javascript in programming language support section. iirc typescript package can handle js mode apart from the default builtin support for js. A mention of js would have be nice.
- daptaq 4y agoAs you might have noticed, I am not a web developer, but I will try and look into resolvi g the issues you brought up. I have an idea of how to solve the font issue (https://git.sr.ht/~pkal/ecg/tree/master/item/ecg.lisp#L342 https://git.sr.ht/~pkal/ecg/tree/master/item/ecg.lisp#L342), but on my systems this never gives me all the fonts. The programming language section is also difficult, content-wise, because I don't use most of those languages, and am thus not familiar with their options. My hope is to gather feedback from other users or the package maintainers on what would be interesting.
- rmnull 4y agoAs an alternative solution, you can ask if the user would like to setup their font on start of emacs and invoke `menu-set-font`. But i think this won't work for people who want to run their emacs in console, another problem i see with this solution is, it would prompt every time emacs starts, which would lead to more confusion. > I have an idea of how to solve the font issue (https://git.sr.ht/~pkal/ecg/tree/master/item/ecg.lisp#L342 https://git.sr.ht/~pkal/ecg/tree/master/item/ecg.lisp#L342), but on my systems this never gives me all the fonts. if i read it correctly `document.fonts` reads like "get all the fonts used on this web page" rather than "get me all the fonts installed on this computer".
- daptaq 4y ago> As an alternative solution, you can ask if the user would like to setup their font on start of emacs and invoke `menu-set-font`. But i think this won't work for people who want to run their emacs in console, another problem i see with this solution is, it would prompt every time emacs starts, which would lead to more confusion. Interesting idea. It might be possible to generate a snippet that will remove itself after the first initialization, but if that doesn't work at least a comment could be inserted. > if i read it correctly `document.fonts` reads like "get all the fonts used on this web page" rather than "get me all the fonts installed on this computer". Ok, I see. Another possibility would be to use https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet to check for the avaliablility fixed set of popular fonts.
- buster 4y agoOh, this is really good. Just started it and it looks like i got a decent starting point for emacs (again).
- jcadam 4y agoUsed to maintain my emacs.d in github. These days, I just use spacemacs because I'm getting lazy.
- larusso 4y agoI like it. I installed Doom Emacs a few weeks back but had to give it up. I personally don’t like to bring in a huge config set in the beginning. I like this idea and will try to give it a spin.
- asciimov 4y agoThe worst thing about emacs is there is no good newbie init.el that has no more than 10 packages to fix the very common starter pain points. I don't recommend first time emacs users start with Doom. Everybody should get their feet wet with plain vanilla emacs, with evil mode turned on if they are coming from vim. Then after a while, they should try Doom. Just to get a sense of what it can do.
- larusso 4y agoYes and I would say that is the same for any bigger editor or configurable piece of software. I just tried doom cause the last time I tried emacs it didn’t klick either so I tried it from the other side. I will give it another go because I have issues with VSCode which I use for semi big projects at the moment.
- wara23arish 4y agoVery neat tool. Ive been getting more and more into using emacs. I like the options you provide like disabling the tool bar, line numbers etc. these are quality of life changes that probably everybody goes through. The most difficult part for me was setting up a LSP with golang. I would say it was difficult because I was trying to rush through by copying random bits from everywhere to make it work. I did eventually get it to work but then noticed I have no idea modify or tinker with anything without fear of bricking my setup. So i started fresh and actually made a point to try to understand what each lisp snippet is used for and did my best to just get default packages without any extra flavor or config all while keeping track of it in git. Its been fun learning lisp.
- tephra 4y agoIf you haven't yet I'd recommend going through the tutorial and looking at the elisp manual. Both are accessible if you press `C-h i` (there's a lot of other goodies in the list of manuals you get there, the calc one is great).
- Jtsummers 4y agoExcept on Debian and Debian-derived systems. Apparently there's an issue with license compatibility, on those you may need to install this package: emacs-common-non-dfsg. But on pretty much every other system with a standard emacs install, yes, `C-h i` is all you need to get to the documentation.
- wara23arish 4y agoIll definitely give that a go. I feel like I NEED to learn Lisp. My college data structures prof had his own book where all the java examples had a lisp counterpart. He wouldn’t allow us to use normal Java data structures for assignments rather a lisp data structure called “cons”. Not sure how different elisp and lisp is but syntax wise they look identical to me.
- Jtsummers 4y agoIf you know some Common Lisp, Emacs Lisp isn't hard to learn (and they're even closer than when I learned elisp 15-20 years ago). Some minor gotchas with literal syntax (literal arrays/vectors and chars are represented differently in each) and some differences in their standard libraries. A more major gotcha is elisp's dynamic scope, which comes up if you're used to lexical scope. https://www.gnu.org/software/emacs/manual/html_node/elisp/Dynamic-Binding.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Dy... In practice, I've never been bitten by this except when I tried to do some fancier functional programming things in elisp that I normally would use another language for. And you can specify that you want lexical scope: https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Le... The whole section those two come from: https://www.gnu.org/software/emacs/manual/html_node/elisp/Variable-Scoping.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Va...
- r-zip 4y agoI gave it a shot and several things were broken. It's a nice idea, but definitely needs more polishing.
- daptaq 4y agoThis is certainly a prototype, there is a lot that can be added (both option and UI-wise). If you could find the time to report the issues you found (either here or per mail), I would be glad to try and fix them.
- deleted 4y ago[deleted]
- jonnycomputer 4y agoQuick question; I was a little confused by the fact that after asking for LSP support, and answering affirmatively, I went through a list of programming language modes to install. Shouldn't the LSP be handling that? Or what am I missing? I don't have much experience with LSP--it's something I've been wanting to get to trying out, but haven't yet.
- binarybytes 4y agoThe short answer is that LSP doesn't mean universal LSP. You still need to pick and choose which LSP servers you want to install, because they are language specific. There are dozens of them and there is no point to downloading a C++ LSP if you work in Typescript.
- jonnycomputer 4y agoThank you. That makes sense.
- daptaq 4y agoThat and LSP just provides the intelligence for Emacs. The rest (syntax highlighting, navigation, ...) is implemented via so called "major modes" [0], that integrate various generic functionality for a specific language, and may often go beyond what LSP can provide, e.g. implementing REPL support. [0] https://www.gnu.org/software/emacs/manual/html_node/emacs/Major-Modes.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Ma...
- karmajunkie 4y agothis is definitely a useful tool, thank you for putting the work into it! from the evil camp, it works be really useful if it also included an option to generate doom/spacemacs style mnemonic keybindings, as those are a central facet of why those like us start using them. i’d be interested in switching but for the enormous amount of effort it would take to add those! and if i were coming in as a newer user of emacs, having examples of how to create those kind of layered bindings would be hugely helpful.
- daptaq 4y agoI have no experience with Evil or that entire space. I would be interested to look into how the situation can be improved, but then again, I do believe that evil-mode is fundamentally just an emulation layer, and shouldn't be regarded as an equal to the regular keybindings.
- karmajunkie 4y ago> I do believe that evil-mode is fundamentally just an emulation layer, and shouldn't be regarded as an equal to the regular keybindings. With all due respect, that's rather condescending and an example of the kind of myopia that religious adherents of both emacs and vi get accused of. fundamentally both emacs' native keybindings and vi keybindings are methods of connecting keyboard events to elisp functions. That's the boring truth, and there's nothing inherently better about one versus the other. Pretending otherwise is just an attempt at gatekeeping.
- daptaq 4y agoI understand your point, but I am not convinced. Nit because I belive in some inherent superiority of some or another set of keybindings, but rather because on the one hand evil isn't a perfect emulation (any somewhat experienced Vim user can always name me a few faults), and on the other the very need for evil-collections to bridge the gap between Emacsy conventions that packages conventionally use and Vims keys (e.g. Dired becomes practically useless if it were to overwritten by Evil keys).
- mplanchard 4y agoFor rust, it might be nice to add the option to use either rust-mode (basic) or rustic-mode (more fully featured, depends on rust-mode). Rustic-mode is mentioned as the go to option for more features even in the rust-mode readme.
- macintux 4y agoI discovered this project recently via some random HN post, and I've been contemplating using it to start over with my very chaotic Emacs configuration. https://github.com/bbatsov/prelude https://github.com/bbatsov/prelude The list of features: * Improved UX, that's still in line with Emacs traditions * Sane defaults of baseline Emacs functionality * Automatic installation of many major programming modes on demand * A curated set of 3rd party packages to enhance the base functionality * Simple modular architecture * Easy customization
- michaelsbradley 4y agobbatsov/prelude is great stuff! I've been using it since 2012 and the base system has only gotten better over the years (I've also customized it over time).
- vjust 4y agoGood utility.
- sph 4y agoLooks pretty good, I'll give it a spin soon as I'm trying to migrate from Doom to a vanilla config. One thing's that seems to be missing is that option to disable those pesky backup~ files.
- daptaq 4y agoGood point. I will add backup file configuration. Tough disabling them all together is rarely worth it, moving them to some other directory is usually preferable.
- cbsmith 4y agoI'm not getting why you wouldn't just use Emacs's customize to do the job?
- daptaq 4y agoThe intended audience are people who haven't yet got into Emacs, and are therefore not familiar with Elisp, the packages and the options. Of course if you have a basic understanding of Emacs and an overview of the package space (and perhaps the time + motivation), you don't need anything like this.
- cbsmith 4y agoIsn't that Customize's intended audience as well?
- daptaq 4y agoI wouldn't say so, customize is a useful interface to get an overview of all the options a package or feature might provide, but without any order or structure beyond the group hierarchy.
- gnufx 4y agoI don't know what's the basis for denying it, but the parent is correct about the intention when it was developed. I don't understand why it should be thought to imply Lisp knowledge. It is useful to lay out the customization possibilities, but that's a bonus.
- daptaq 4y agoOk, I might have misread the comment. But to clarify my own position, I it doesn't necessarily have to be the lack of Experience with Elisp, but with the way you use Emacs and how it behaves (managing buffers and windows, how scrolling works, the little differences in how GUI features behave, etc.). To make use of the easy customization interface, and not get frustrated by it, it help to have some basic experience with Emacs. My intention is to provide a guided tour of what someone might want to have in Emacs, before they begin using it. That way they can get common annoyances out of the way before starting, and have less friction when dealing with whatever remains.
- ancientsofmumu 4y agoHello, I think you have a bug disabling the splash screen: https://git.sr.ht/~pkal/ecg/tree/master/item/ecg.lisp#L372 https://git.sr.ht/~pkal/ecg/tree/master/item/ecg.lisp#L372 According to the internet (I don't use emacs) it's supposed to be "inhibit-splash-screen t" - looks like a copypasta induced mistake is all.
- daptaq 4y agoThanks for the hint, I have fixed the code: https://git.sr.ht/~pkal/ecg/commit/4abf496e89cc93ca4c7fec049a8be2de6ccf3f83 https://git.sr.ht/~pkal/ecg/commit/4abf496e89cc93ca4c7fec049...
- lvass 4y agoNeat tool. I tried generating a config similar to mine, and it was surprisingly close, although it looks quite different without use-package. Did you not add use-package because it's not in the repositories you're using, or something else? Great choice adding Modus themes! I feel like making something similar just for hydras. A few mostly minor things I think could improve: * undo-tree. * y-or-n-p. Typing yes or no is annoying. * Smooth scroll. * Emacs server or daemon support. * Magit keybind seems redundant as the package itself adds them, and it's swapped. * Some comments are misplaced. "Enable LSP support" is followed by (vertico-mode t) in my case. * I think eglot enables flymake itself. * I think evil isn't being enabled. * Selecting auto-save and backup-dir.
- daptaq 4y agoThanks for noticing the issues, I will fix the issues and add the other features. > Did you not add use-package because it's not in the repositories you're using, or something else? Mainly that, but also I am not too fond of use-package. If I add support, it would be with my own package (setup) as an alternative. > Great choice adding Modus themes! Well they are bundled in by default. > * undo-tree. Not sure about this, I have heard people having issues with undo-tree due to the way it is implemented. Vundo seems to be an interesting alternative, but that is Emacs 28+ only. > * Magit keybind seems redundant as the package itself adds them, and it's swapped. True, but it binds to the C-x prefix which I think is a mistake (especially because it is one automatically).
- chimprich 4y ago> I am not too fond of use-package. What do you dislike about it? It seems like almost a standard now. Even if you don't personally like it, it might be useful to beginner Emacs users to use the tools that everyone else is using. I could say the same about helm.
- daptaq 4y agoI believe it to have had issues that lead to inconsistencies and unnecessary complications. More details can be read out of my comparison between the package I wrote and use-package: https://www.emacswiki.org/emacs/SetupEl#h5o-20 https://www.emacswiki.org/emacs/SetupEl#h5o-20. Yet in principle I do agree that it would be nice to have the option. The issue is how to explain this to someone who doesn't know anything yet about Emacs. Talking about the advantages or disadvantages of using a configuration macro requires some basic understanding of what the issue even is.
- CraigJPerry 4y agoThis is really cool - the generated config turned out shorter than just my .spacemacs config file which makes it feel accessible. I like it.
- jhoechtl 4y agoWhat are the opinions eglot vs. lsp-mode? Which one has a better backend-communication approach, is communicationg eg. async?
- daptaq 4y agoI cannot comment on the differences, all I can say that I chose Eglot because it is more in line with my understanding of an ideomatic Emacs package, and it is available via GNU ELPA.
- WhatIsDukkha 4y agoThis looks interesting but would be much better if it just went with use-package across the board. You also have not enabled many of the modes that you install which will be a not fun experience for the newbies you are targeting. Use-package could actually help a lot in your backend generation code I think (ie because consistent data model). evil-collection would be a good add as well as quite a few evil quality of life items.
- daptaq 4y ago> You also have not enabled many of the modes that you install which will be a not fun experience for the newbies you are targeting. That is unintentional, I will review the packages I have missed. > Use-package could actually help a lot in your backend generation code I think (ie because consistent data model). Theoretically yes, but that would require some restructuring in the backend. It is a goal though, at least as an option next to no configuration macro and Setup. > evil-collection would be a good add as well as quite a few evil quality of life items. Will look into this, I don't use Evil so it is hard for me to judge.
- hcarvalhoalves 4y agoThe Emacs built-in “Customize” tool is very close to that, and there’s also the built-in package manager. I guess this kind of generator could be implemented inside Emacs itself as a “starter package” instead of a web page, would be pretty cool.
- jasau 4y agoCool tool! Would be interesting to integrate it straight to Emacs itself. But I think it is cool to be able to copy and paste it to one's own init.el https://github.com/SystemCrafters/rational-emacs https://github.com/SystemCrafters/rational-emacs is also a great starting point for new (and why not old) Emacs users who would like to start with at least somewhat preconfigured setup but thinks that doom emacs or spacemacs is a little too much.
- trop 4y agoExciting! One typo, I think: > Org Mode can be used for anything from managing apartments, writing manuals, literate programs or executing code like a programming notebook. Is that "apartments" or "appointments"? I suppose some people manage their apartments with org-mode, maybe via TODO lists and calc spreadsheets.
- daptaq 4y agoSadly, you are right. Fixed it here: https://git.sr.ht/~pkal/ecg/commit/c3522dfe01e0479d01869bf4eb5b41da63da7e78 https://git.sr.ht/~pkal/ecg/commit/c3522dfe01e0479d01869bf4e...
- nocman 4y ago> I suppose some people manage their apartments with org-mode I thought I heard someone say "that sounds like a challenge!", but that was probably just my imagination.
- ggm 4y agoVim Emulation The child of the beast, Vim, another popular editor is often mistakenly used instead of Emacs. Some have sadly gotten used to the sinful ways, and prefer the modal approach to Emacs default bindings. If you too are affected by this curse, this package might help.
- memco 4y agoI’m a VSCode user interested in exploring eMacs as a Python IDE: does anyone have any recommendations for things I would need beyond a basic config? I am a frequent user of the debugger over remote connections so the more seamlessly I can use eMacs in a similar way the more likely I can use it instead of VSCode.
- galactus 4y agoVery cool
- ravar 4y agoMaybe i am alone with my kloc+ .emacs.d with multiple patched functions but this website seems to miss the whole point of configuring emacs to me.
- daptaq 4y agoCould you elaborate on what you mean? The intention is not to have a finished configuration that requires no more work, but to provide a template on which further customizations can be made.
- deleted 4y ago[deleted]
- ricktdotorg 4y agowow, i wish this tool had been around in the 90s! i was lucky enough to have had a shell account on the GNU gnu.ai.mit.edu servers back in the 90s and found elisp inspiration from poking around in the $HOMEs of GNU hackers/legends like roland mcgrath and noah friedman and of course rms. i nearly wrote a book back about emacs then with a uni lecturer but he resigned/was fired in some kind of scandal and well, that was that. amazingly i still have that shell account, though its of course moved a few times and has been for a while a gnu.org box. i learned a lot about bash and how to structure things properly from ~roland's init scripts. hah! just ssh'd in to fencepost.gnu.org and all his init scripts are still there[1]! [1] https://i.imgur.com/a5gp5kl.png https://i.imgur.com/a5gp5kl.png