init-el/init.el

138 lines
4.3 KiB
EmacsLisp

;;; init.el --- knit's emacs config
;;;
;;; commentary:
;;; this is the entry point of my Emacs config.
;;; first, strings are defined for quick editing when
;;; im on a different machine.
;;;
;;; then i initialize my packages
;;; then i set some global variables :3c
;;; todo: user-emacs-directory is a var to look at :3c
;;; todo:
;;; code:
(defun ehome (s)
"Append string S to the Emacs config directory."
(concat "~/.config/emacs/" s))
(defvar my-config-dir (ehome "config"))
(defvar my-custom-el (ehome "config/custom.el"))
(defvar my-backups (ehome ".backups"))
(defvar my-mbox "~/.local/share/mail/inbox")
(defvar my-mbox-folder "~/.local/share/mail")
(defvar my-sent-mail "~/.local/share/mail/sent")
(defvar my-trash "~/.local/trash")
;;; GENERAL SETUP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'load-path my-config-dir)
;;; VARIABLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package use-package
:custom
(use-package-always-defer t)) ; Possibly
(use-package epa
:custom
(epa-armor t)
(epg-pinentry-mode 'loopback))
(use-package emacs
:custom
(delete-by-moving-to-trash t)
(trash-directory my-trash)
(use-short-answers t)
(inhibit-startup-screen t)
(show-paren-delay 0.040)
(blink-cursor-delay 10)
(ring-bell-function 'ignore)
(delete-old-versions t)
(custom-file my-custom-el)
(frame-title-format "Emacs - %b")
(backup-directory-alist `(("." . ,my-backups)))
(scroll-bar-mode nil)
(tool-bar-mode nil)
(tooltip-mode nil)
(menu-bar-mode nil)
(custom-safe-themes t)
(ido-mode t) ; find-file completions
(initial-scratch-message
"C-c followed by:
i - ibuffer s - eshell
m - rmail w - eww
d - dired n - gnus
e - emoji b - bookmarks
M - mpc I - rcirc
a - agenda o - capture\n")
:config ; In the config/ folder
(require 'personal-conf) ; Personal strings that are gitignored
(require 'eww-conf) ; Also Elpher
(require 'dired-conf) ; File browser
(require 'ibuffer-conf) ; Buffer manager
(require 'mpc-conf) ; Music player
(require 'org-conf) ; Orgmode customizations
(require 'feed-conf) ; Reading RSS/Atom feeds.
(require 'misc-conf) ; Random small / noconf addons
(require 'gnus-conf) ; Mail / NNTP
(require 'eshell-conf) ; Shell scripting
(require 'langs-conf) ; Language specific features
(require 'irc-conf) ; rcirc
(require 'bookmark-conf) ; Extending the deault bookmark facility
(require 'rmail-conf) ; Email
(require 'theme)
(delete-selection-mode t)
(global-visual-line-mode t)
(hide-border))
;;; OTHER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (cd "~/") ; on Windows i guess?
(load custom-file)
(use-package flymake
:bind (:map flymake-mode-map
("M-c M-n" . 'flymake-goto-next-error)
("M-c M-p" . 'flymake-goto-prev-error)))
;; Better than keymap-global-set
(use-package emacs
:bind (("C-<backspace>" . 'whitespace-cleanup)
("C-c e" . 'emoji-insert)
("C-c E" . 'emoji-search)
("C-c B" . 'bmark-add)
("C-c b" . 'bmark-open)
("C-c t" . 'my-modus-themes-toggle)
("C-i" . 'god-mode) ; TAB
("s-g" . 'god-mode) ; In case TAB is bound.
("C-c -" . 'split-window-horizontally)
("C-c /" . 'split-window-vertically)
("C-c X" . 'delete-other-windows)
("C-c x" . 'delete-window)
("C-x C-o" . 'other-window)
("<up>" . 'windmove-up)
("<down>" . 'windmove-down)
("<left>" . 'windmove-left)
("<right>" . 'windmove-right)
;; Meta-C
("M-c p" . 'paredit-mode)
("M-c" . nil)
("M-c f" . 'flymake-mode)
("M-c i" . 'ido-mode)))
(use-package lin
:bind (("C-c h" . lin-mode))
:ensure
:config
(lin-global-mode)
;; lin-mac lin-magenta lin-red lin-blue lin-green
:custom (lin-face 'lin-yellow-override-fg))
(set-fontset-font t 'emoji "Segoe UI Emoji")
(set-language-environment 'utf-8)
(set-default-coding-systems 'utf-8)
;;; init.el ends here