diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-12-02 21:58:51 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-12-02 21:58:51 +0530 |
commit | d5bb417e2f327cd0496da2808a78eb0d0a4a19e6 (patch) | |
tree | de7238f6024034ea1a1b61844c4d57e6789437a1 | |
parent | 53ebbb7692fbaf4e64d04a85bc9da79dddcf3dca (diff) |
added new docs page: how to customize an emacs theme
-rw-r--r-- | content/docs/_index.md | 2 | ||||
-rw-r--r-- | content/docs/making-your-own-doom-emacs-theme/_index.md | 50 | ||||
-rw-r--r-- | content/image-ownership-notice.md | 2 |
3 files changed, 52 insertions, 2 deletions
diff --git a/content/docs/_index.md b/content/docs/_index.md index e71f51e..231c63a 100644 --- a/content/docs/_index.md +++ b/content/docs/_index.md @@ -1,5 +1,5 @@ --- title: Contents heading: Vidhu Kant's Docs -description: Here I aggregate and store the documentation of all the programs I've written +description: Here I aggregate and store the documentation of all the programs I've written along with some other tutorials --- diff --git a/content/docs/making-your-own-doom-emacs-theme/_index.md b/content/docs/making-your-own-doom-emacs-theme/_index.md new file mode 100644 index 0000000..31c9990 --- /dev/null +++ b/content/docs/making-your-own-doom-emacs-theme/_index.md @@ -0,0 +1,50 @@ +--- +title: "Customizing a Doom Emacs Theme" +description: "How to create your own Doom Emacs theme" +date: 2022-12-02T21:33:31+05:30 +--- + +Creating your theme/modifying an existing one, or overriding some faces (globally) in Emacs, especially Doom Emacs is +really easy once you understand how to do it... but it wasn't very easy to *understand* how to do it. Most likely +I was doing something wrong, or maybe it's just because I don't fully know how lisp or emacs works that's why it took me long +but I spent a good part of my evening trying to make even small changes to work. + +So, I have created this short tutorial to leave me (and others having problems) some notes on how to modify a Doom Emacs theme. +I'm using Doom Emacs which comes with the doom-themes packages doing some basic setup so we only need to define some variables and it +automatically applies other faces and stuff, and I'm pretty sure doom-themes can be installed on regular Emacs. + +## Overriding faces + +Each element in an emacs buffer has a "face" which defines its foreground/background color, font styling, etc. +You can do `M-x RET` `describe-char` or `describe-face` to get the face of the area under the cursor, or to get a +list of all the available faces (which is very long) + +The `custom-set-faces!` macro (or `custom-set-faces` for Emacs users) can be used to customize any face: + +``` lisp +(custom-set-faces! + '(default :background "#100b13") + '(cursor :background "#0ec685" :foreground) + '(line-number :slant normal :background "#100b13") + '(line-number-current-line :slant normal :background "#21242b")) +``` + +You can add something like this to your `~/.doom.d/config.el` + +## Using a doom theme as a template + +Another way to modify your Doom theme is to use an existing theme as a template (or, starting from bottom up!) +and modifying it. + +### How to modify an existing theme: + +1. Go to [this page](https://github.com/doomemacs/themes) and choose any theme you like, and download the raw file into +`~/.doom.d/themes/<theme-name>-theme.el`. The theme name can be anything, but make sure it ends with "-theme.el" +or Doom won't recognise it as a theme. + +2. Open the theme in your favourite text editor (I wonder which one it is) and edit the line that says `(def-doom-theme <theme-name>` +and replace `<theme-name>` with any name you like, make sure not to use the original name (or the name of any other theme that already exists on your system) or it would create a clash. +Now, edit the theme to your liking and you're good to go! + +3. Open a new Doom Emacs frame and enter `SPC h t t` and select your new theme! + diff --git a/content/image-ownership-notice.md b/content/image-ownership-notice.md index 3adb915..03963b0 100644 --- a/content/image-ownership-notice.md +++ b/content/image-ownership-notice.md @@ -33,7 +33,7 @@ license unless stated otherwise on this page or anywhere else. # I have permission to use all these images -To the best of my knowledge, I have the permission to host use these images/gifs on my website. +To the best of my knowledge, I have the permission to host and use these images/gifs on my website. If you think there is a mistake, please [contact](/contact/) me and state a reason why you think I should take these images down. The images listed on these page are NOT covered by the Creative Commons license like the rest of the content on this website. |