Skip to content

Simple Emacs configuration using Guix

Notifications You must be signed in to change notification settings

Mejiro-McQueen/Witchmacs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Witchmacs

The cutest Emacs distribution ./gnumarisa.png

Witchmacs

Introduction

Witchmacs is a simple configuration file for Emacs using packages installed by GNU Guix. This fork of Witchmacs is an overhaul of the original Witchmacs: https://github.com/snackon/Witchmacs.

Witchmacs Installation

If ~~/.emacs~ already exists, move it somewhere else.

Next,

git clone https://github.com/snackon/Witchmacs ~/.emacs.d

Package Installation

Config

Global

Guix

(use-package guix)

Start Full Screen

(setq inhibit-startup-message t)
(custom-set-variables
 '(initial-frame-alist (quote ((fullscreen . maximized)))))

Dashboard

Load nerd-icons

(use-package nerd-icons)

Setup dashboard

(use-package dashboard
  :preface
  (defun update-config ()
    "Update Witchmacs to the latest version."
    (interactive)
    (let ((dir (expand-file-name user-emacs-directory)))
      (if (file-exists-p dir)
          (progn
            (message "Witchmacs is updating!")
            (cd dir)
            (shell-command "git pull")
            (message "Update finished. Switch to the messages buffer to see changes and then restart Emacs"))
        (message "\"%s\" doesn't exist." dir))))

  (defun create-scratch-buffer ()
    "Create a scratch buffer"
    (interactive)
    (switch-to-buffer (get-buffer-create "*scratch*"))
    (lisp-interaction-mode))
  :config
  (dashboard-setup-startup-hook)
  (setq initial-buffer-choice (lambda () (get-buffer-create dashboard-buffer-name)))
  (setq dashboard-items '((recents   . 5)
                      (bookmarks . 5)
                      (projects  . 5)
                      (agenda    . 5)
                      (registers . 5)))
  (setq dashboard-banner-logo-title "W I T C H M A C S - The cutest Emacs distribution!")
  (setq dashboard-startup-banner "~/.emacs.d/marivector.png")
  (setq dashboard-center-content t)
  (setq dashboard-show-shortcuts nil)
  (setq dashboard-set-init-info t)
  (setq dashboard-init-info (format "%d packages loaded in %s"
                                    (length package-activated-list) (emacs-init-time)))
  (setq dashboard-set-footer nil)
  (setq dashboard-set-navigator t)
  (setq dashboard-navigator-buttons
        `(;; line1
          ((,nil
            "Witchmacs on github"
            "Open Witchmacs' github page on your browser"
            (lambda (&rest _) (browse-url "https://github.com/mejiro-mcqueen/witchmacs"))
            'default)
           (nil
            "Witchmacs crash course"
            "Open Witchmacs' introduction to Emacs"
            (lambda (&rest _) (find-file "~/.emacs.d/Witcheat.org"))
            'default)
           (nil
            "Update Witchmacs"
            "Get the latest Witchmacs update. Check out the github commits for changes!"
            (lambda (&rest _) (update-config))
            'default)
           )
          ;; line 2
          ((,nil
            "Open scratch buffer"
            "Switch to the scratch buffer"
            (lambda (&rest _) (create-scratch-buffer))
            'default)
           (nil
            "Open config.org"
            "Open Witchmacs' configuration file for easy editing"
            (lambda (&rest _) (find-file "~/.emacs.d/config.org"))
            'default)))))

prettify-symbols-mode

(global-prettify-symbols-mode t)

Highlight current line

(global-hl-line-mode t)

Beacon

Highlight cursor position when switching windows.

(use-package beacon
  :config
  (beacon-mode 1))

Avy

Avy is a very useful package; instead of having to move your cursor to a line that is very far away, just do M - s and type the character that you want to move to.

 (use-package avy
	:bind
	("M-s" . avy-goto-char))

Undo Tree

(use-package undo-tree
  :diminish undo-tree-mode)

Vertico

(use-package vertico)

(use-package savehist
  :init
  (savehist-mode))

(use-package orderless
  :init
  ;; Configure a custom style dispatcher (see the Consult wiki)
  ;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
  ;;       orderless-component-separator #'orderless-escapable-split-on-space)
  (setq completion-styles '(orderless basic)
	  completion-category-defaults nil
	  completion-category-overrides '((file (styles partial-completion)))))

(use-package marginalia
  :ensure t ;;;# TODO: guix package may be broken
  ;; Bind `marginalia-cycle' locally in the minibuffer.  To make the binding
  ;; available in the *Completions* buffer, add it to the
  ;; `completion-list-mode-map'.
  :bind (:map minibuffer-local-map
	   ("M-A" . marginalia-cycle))

  ;; The :init section is always executed.
  :init

  ;; Marginalia must be activated in the :init section of use-package such that
  ;; the mode gets enabled right away. Note that this forces loading the
  ;; package.
  (marginalia-mode))

(use-package embark
  :bind
  (("C-." . embark-act)         ;; pick some comfortable binding
   ("C-;" . embark-dwim)        ;; good alternative: M-.
   ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'

  :init

  ;; Optionally replace the key help with a completing-read interface
  (setq prefix-help-command #'embark-prefix-help-command)

  ;; Show the Embark target at point via Eldoc. You may adjust the
  ;; Eldoc strategy, if you want to see the documentation from
  ;; multiple providers. Beware that using this can be a little
  ;; jarring since the message shown in the minibuffer can be more
  ;; than one line, causing the modeline to move up and down:

  ;; (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
  ;; (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)

  :config

  ;; Hide the mode line of the Embark live/completions buffers
  (add-to-list 'display-buffer-alist
		 '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
		   nil
		   (window-parameters (mode-line-format . none)))))

;; Consult users will also want the embark-consult package.
(use-package embark-consult
  :hook
  (embark-collect-mode . consult-preview-at-point-mode))

Treemacs

(use-package treemacs)

(use-package treemacs-projectile
  :after (treemacs projectile))

(use-package treemacs-icons-dired
  :hook (dired-mode . treemacs-icons-dired-enable-once))

(use-package treemacs-magit
  :after (treemacs magit))

Set Face

(set-face-attribute 'default nil :height 160)

Perspective

(use-package perspective
  :bind
  ("C-x C-b" . persp-list-buffers)         ; or use a nicer switcher, see below
  :custom
  (persp-mode-prefix-key (kbd "C-c M-p"))  ; pick your own prefix key here
  :config
  (persp-mode))

Modeline

(use-package doom-modeline
  :after (nerd-icons)
  :hook (after-init . doom-modeline-mode))

Theme

(use-package modus-themes)

Disable Bell

(setq ring-bell-function 'ignore)

Org Mode

Org Config

Set hooks for:

  • Indentation
  • Spellcheck
  • Line wrapping
(use-package org
  :config
  (add-hook 'org-mode-hook
	      'org-indent-mode
	      'flyspell-mode)
  (add-hook 'org-mode-hook
	      '(lambda ()
		 (visual-line-mode 1))))

Extras

Exporting buffer and text to HTML

(use-package htmlize)

Programming

Magit

(use-package magit)

Lisp

Common Lisp
(use-package sly)
Scheme
(use-package geiser)
(use-package geiser-guile)
Paredit

http://danmidwood.com/content/2014/11/21/animated-paredit.html

(use-package paredit
  :config
  (autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
  (add-hook 'emacs-lisp-mode-hook       #'enable-paredit-mode)
  (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
  (add-hook 'ielm-mode-hook             #'enable-paredit-mode)
  (add-hook 'lisp-mode-hook             #'enable-paredit-mode)
  (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
  (add-hook 'scheme-mode-hook           #'enable-paredit-mode))

Terraform

(use-package terraform-mode)

Projectile

(use-package projectile
  :config
  (projectile-mode +1)
  ;; Recommended keymap prefix on macOS
  (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
  ;; Recommended keymap prefix on Windows/Linux
  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))

Python

(use-package elpy)

About

Simple Emacs configuration using Guix

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scheme 69.9%
  • Emacs Lisp 30.1%