tftio / doom-nano-testing

This is some rough code that tries to get Nano Emacs (by Nicolas Rougier) and Doom Emacs (by Henrik Lissner) to play nice together.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doom-nano-testing

Notice:

I haven't used this in several months. Both Doom and Nano are actively maintained and this repository does not reflect the current state of either of those projects. If it works for you, that's great. Otherwise, it may be better to see this repository as historical. If I ever resurrect it, I'll remove this notice.


This is my attempt at adapting the gorgeous Nano Emacs by Nicolas Rougier to work with the powerhouse that is Doom Emacs.

I am a learning coder and did not write most of the code in this repo. What I've done is trimmed down the Nano codebase to just the files I need and wrote some code to get it working and looking the way I like.

Load this code by adding the cloned repo to the load path and requiring it in your private config. Like so for instance:

(add-to-list 'load-path "~/build/doom-nano-testing")
(require 'load-nano)

Files I wrote:

  • load-nano.el - This file loads Nano and attempts to fix some issues with cursor appearance. This file is something of a testbed for my attempts to understand/fix compatibility issues between doom and nano.
  • nano-face-override.el - This file is necessary for forcing faces to /not look so flipping crazy/. Doom's custom-set-faces! does not seem to work at all because of the way that Nano redefines faces. There is undoubtedly a better/easier way of accomplishing this which would likely involve lots of work on nano-faces.el or replacing the way that file works entirely with doom functionality. As it is now, I've been adding code to this file every time I come across a face that looks out of place. When you use this, you can possibly end up with errors about undefined faces. As I understand it, this is due to lazy loading. Solve it by wrapping the set-face-attribute in question with (after!). There are several examples of this in the file.

Files from Nano containing large scale changes by me:

  • nano-faces.el - I've changed the font from Roboto Mono to Hack Nerd Font. Find/Replace will let you set whatever your favorite font is. Hack doesn't have 20 weights like Roboto Mono, which is not a problem for me but do expect that using a different font than the Nano default will result in a very different look, especially if the chosen font doesn't have as many weights as Roboto Mono.
  • nano-theme-light.el - This has been completely changed to suit my aesthetic desire. I expect anyone who clones this repo will want to adapt this to their own preferred color scheme. Using the dark theme from the Nano repo should be easy enough; one could replace the contents of this file with those of the dark scheme, or one could edit nano-theme.el to load the dark theme file instead. The possibilities are endless.
  • nano-colors.el I've entirely replaced the contents of this file with my own list of colors. I attempted to keep most of the variable names consistent with the naming used in Nano, but there were only so many options. I find that enabling rainbow-mode while editing a file that contains such hex color strings makes it much easier to see what I'm doing; YMMV.

I've decided to upload this code for a few reasons:

  1. Doom Emacs needs a :ui nano module! I'm willing to contribute to that, once I have more time.
  2. My code, though likely not optimal, is usable as is (for me at least). I've discussed using it in a few internet communities and have had people ask me about it. Now there's a repo I can direct them to.
  3. I'm learning this stuff in a hobbyist fashion! I want to contribute to the open source community and this is something I can do with the knowledge I have right now. I really hope that someone with more knowledge than I sees this and, whether out of outrage at my bad code, or because they like this idea as much as I do, decides to write some better code that I can learn from and shamelessly use for myself.

Sources, and inspiration:

Nano Emacs

Doom Emacs

Screenshots: screenshot screenshot

About

This is some rough code that tries to get Nano Emacs (by Nicolas Rougier) and Doom Emacs (by Henrik Lissner) to play nice together.

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%