git clone https://github.com/daedreth/UncleDavesEmacs ~/.emacs.d
Keep in mind that you should remove your own ~/.emacs and your ~/.emacs.d prior to cloning this configuration. The next time you launch Emacs (and I recommend launching emacs in the tty for the first time) it’s going to download a good amount of packages and configure them for you, you might see warnings and errors being displayed as well, those are safe to ignore as long as you relaunch emacs and see none.
The configuration, much like emacs is self documented, I highly recommend reading through my ramblings in their entirety.
You are free to pick out bits and pieces of this and apply them.
So long as you have a working use-package configuration (take a peek at my init.el),
there should be absolutely no issues.
I highly encourage you to read up on the prose around the packages you are interested in,
I do my absolute best to describe the configuration as well as I only can, this might help you on your emacs journey!
Have some fun with it, add your own keybindings, change parameters, it’s your editor in the end.
Since we are going to use emacs as our window manager, it would be nice to have some external software to make our life easier.
xorg-server, for obvious reasons. (there is no wayland support as of now)pulsemixer, available fromhttps://github.com/GeorgeFilipkin/pulsemixer.imagemagick, if you are going to be using emacs to take screenshots.ibus-daemon, if you need multiple keyboard input options (emacs handles them well on its own but ibus is nice).terminus-font, for it to work out of the box, if you don’t want terminus you need to edit yourinit.el.
- A browser (sadly, the built in xwidgets-webkit thingie is unreliable).
- A composite manager (highly recommended, I personally use
compton, the built in one does not work as intended.). noto-cjk, for all the fonts imaginable.slock, if you would like to lock the screen.
sudo, properly configured for your user.
mpd, since we are going to be using EMMS for music playback, I recommend setting up a working mpd server.mpv, for video playback.
clang, for c/c++ completion.sbcl, for clisp completion and repl.virtualenv, for python completion.lua, for obvious reasons.
pip install jedi flake8 autopep8, here, a one line install.
We utilize use-package to handle downloading and configuring other packages painlessly.
With init.el written the way it is, emacs checks for the presence of use-package
on launch and downloads it and installs if necessary.
el-Get is too old and not configurable enough.
As you may have noticed, as you scroll down my bit of prose, this is the configuration file itself.
This configuration is written in org-mode, which is a great emacs package and a great markup language.
On launch, this file is being sourced into ~/.emacs.d/init.el, the prose is being automatically
stripped (as to not affect performance) and the remaining config.el file is parsed.
This is also the reason why your org-mode configuration file is never called init.org.
This entire config is meant to be used as a full on desktop environment, it is tailored to sit on top of xorg and be awesome.
It is perfectly possible to use it without exwm and emms, as a regular emacs config, just make sure to delete the unwanted sections,
ex.g EXWM, Audio Control, EMMS and all the launchers.
There is barely any learning curve to using exwm, since it makes x-windows act as regular buffers as much as possible,
so chances are, as long as you know your way around emacs itself, you will instinctively know how to make use of its features.
I do my best to not pollute keymaps with my own keybindings. Most of the bindings I defined myself utilize the Super key (noted as s-).
This is the least used modifier key together with Shift (noted as S-), thus using those, chances are all the bindings you already know
and love are going to work flawlessly. For all the others, just keep on reading.
The most important part of every configuration.
My new favourite one I guess, really decent default values.
(use-package zerodark-theme
:ensure t
:init
(load-theme 'zerodark t))The theme is great, really, but some of the concepts just suck with powerline.
(let ((class '((class color) (min-colors 89)))
(default (if (true-color-p) "#abb2bf" "#afafaf"))
(light (if (true-color-p) "#ccd4e3" "#d7d7d7"))
(background (if (true-color-p) "#282c34" "#333333"))
(background-dark (if (true-color-p) "#24282f" "#222222"))
(background-darker (if (true-color-p) "#22252c" "#222222"))
(mode-line-inactive (if "#1c2129" "#222222"))
(mode-line-active (if (true-color-p) "#6f337e" "#875f87"))
(background-lighter (if (true-color-p) "#3a3f4b" "#5f5f5f"))
(background-red (if (true-color-p) "#4c3840" "#5f5f5f"))
(bright-background-red (if (true-color-p) "#744a5b" "#744a5b"))
(background-purple (if (true-color-p) "#48384c" "#5f5f5f"))
(background-blue (if (true-color-p) "#38394c" "#444444"))
(bright-background-blue (if (true-color-p) "#4e5079" "#4e5079"))
(background-green (if (true-color-p) "#3d4a41" "#5f5f5f"))
(bright-background-green (if (true-color-p) "#3f6d54" "#3f6d54"))
(background-orange (if (true-color-p) "#4a473d" "#5f5f5f"))
(hl-line (if (true-color-p) "#2c323b" "#333333"))
(grey (if (true-color-p) "#cccccc" "#cccccc"))
(grey-dark (if (true-color-p) "#666666" "#666666"))
(highlight (if (true-color-p) "#3e4451" "#5f5f5f"))
(comment (if (true-color-p) "#687080" "#707070"))
(orange (if (true-color-p) "#da8548" "#d7875f"))
(orange-light (if (true-color-p) "#ddbd78" "#d7af87"))
(red (if (true-color-p) "#ff6c6b" "#ff5f5f"))
(purple (if (true-color-p) "#c678dd" "#d787d7"))
(purple-dark (if (true-color-p) "#64446d" "#5f5f5f"))
(blue (if (true-color-p) "#61afef" "#5fafff"))
(blue-dark (if (true-color-p) "#1f5582" "#005f87"))
(green (if (true-color-p) "#98be65" "#87af5f"))
(green-light (if (true-color-p) "#9eac8c" "#afaf87"))
(peach "PeachPuff3")
(diff-added-background (if (true-color-p) "#284437" "#284437"))
(diff-added-refined-background (if (true-color-p) "#1e8967" "#1e8967"))
(diff-removed-background (if (true-color-p) "#583333" "#580000"))
(diff-removed-refined-background (if (true-color-p) "#b33c49" "#b33c49"))
(diff-current-background (if (true-color-p) "#29457b" "#29457b"))
(diff-current-refined-background (if (true-color-p) "#4174ae" "#4174ae")))
(custom-theme-set-faces
'zerodark
`(fancy-battery-charging ((,class (:background ,background-blue :height 1.0 :bold t))))
`(fancy-battery-discharging ((,class (:background ,background-blue :height 1.0))))
`(fancy-battery-critical ((,class (:background ,background-blue :height 1.0))))
;; mode line stuff
`(mode-line ((,class (:background ,background-blue :height 1.0 :foreground ,blue
:distant-foreground ,background-blue
:box ,(when zerodark-use-paddings-in-mode-line
(list :line-width 6 :color background-blue))))))
`(mode-line-inactive ((,class (:background ,background-blue :height 1.0 :foreground ,default
:distant-foreground ,background-blue
:box ,(when zerodark-use-paddings-in-mode-line
(list :line-width 6 :color background-blue))))))
`(header-line ((,class (:inherit mode-line-inactive))))
`(powerline-active0 ((,class (:height 1.0 :foreground ,blue :background ,background-blue
:distant-foreground ,background-blue))))
`(powerline-active1 ((,class (:height 1.0 :foreground ,blue :background ,background-blue
:distant-foreground ,background-blue))))
`(powerline-active2 ((,class (:height 1.0 :foreground ,blue :background ,background-blue
:distant-foreground ,background-blue))))
`(powerline-inactive0 ((,class (:height 1.0 :foreground ,blue :background ,background-blue
:distant-foreground ,background-blue))))
`(powerline-inactive1 ((,class (:height 1.0 :foreground ,blue :background ,background-blue
distant-foreground ,background-blue))))
`(powerline-inactive2 ((,class (:height 1.0 :foreground ,blue :background ,background-blue
:distant-foreground ,background-blue))))
`(dashboard-heading-face ((,class (:background ,background :foreground ,blue
:bold t :height 1.2))))
`(dashboard-banner-logo-title-face ((,class (:background ,background :foreground ,blue
:bold t :height 1.2))))
`(widget-button ((,class (:background ,background :foreground ,default :bold nil
:underline t :height 0.9))))
;; erc stuff
`(erc-nick-default-face ((,class :foreground ,blue :background ,background :weight bold)))
;; org stuff
`(outline-1 ((,class (:foreground ,blue :weight bold :height 1.8 :bold nil))))
`(outline-2 ((,class (:foreground ,purple :weight bold :height 1.7 :bold nil))))
`(outline-3 ((,class (:foreground ,peach :weight bold :height 1.6 :bold nil))))
`(outline-4 ((,class (:foreground ,green-light :weight bold :height 1.5 :bold nil))))
`(outline-5 ((,class (:foreground ,blue :weight bold :height 1.4 :bold nil))))
`(outline-6 ((,class (:foreground ,purple :weight bold :height 1.3 :bold nil))))
`(outline-7 ((,class (:foreground ,peach :weight bold :height 1.2 :bold nil))))
`(outline-8 ((,class (:foreground ,green-light :weight bold :height 1.1 :bold nil))))
`(org-block-begin-line ((,class (:background ,background-blue :foreground ,blue
:bold t :height 1.0))))
`(org-block-end-line ((,class (:background ,background-blue :foreground ,blue
:bold t :height 1.0))))))These are setting that do not depend on packages and are built-in enhancements to the UI.
We use an actual replacement for it, keep reading or head directly to dashboard.
(setq inhibit-startup-message t)If you like using any of those, change -1 to 1.
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)This is annoying, remove this line if you like being visually reminded of events.
(setq ring-bell-function 'ignore)(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)hl-line is awesome! It’s not very awesome in the terminal version of emacs though, so we don’t use that.
Besides, it’s only used for programming.
(when window-system (add-hook 'prog-mode-hook 'hl-line-mode))Changes lambda to an actual symbol and a few others as well, only in the GUI version though.
(when window-system
(use-package pretty-mode
:ensure t
:config
(global-pretty-mode t)))
评论