dotfiles/nix/hosts/dots/.emacs.d/init.el

95 lines
3.4 KiB
EmacsLisp
Executable file

; Setting default Emacs window dimensions
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(width . 75) default-frame-alist)
(push '(height . 30) default-frame-alist)
;; Setting default font
(set-frame-font
(cond
((member "Monocraft" (font-family-list)) "Monocraft")
((member "Miracode" (font-family-list)) "Miracode")
((member "Cascadia Mono-16" (font-family-list)) "Cascadia Mono")
(t nil)
)
t t
)
;; Set default tab width (in spaces)
(setq-default tab-width 2)
;; Store customizations in a separate file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;; Load it if the file exists
(when (file-exists-p custom-file)
(load custom-file))
;; Setup MELPA
(require 'package) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") ("elpa" . "https://elpa.gnu.org/packages/")))
;; Setup package.el
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)
(eval-when-compile
(unless (bound-and-true-p package--initialized)
(package-initialize))
(require 'use-package)))
(setq use-package-always-ensure t)
;; For up to date org mode.
(use-package org)
;; Enable Org mode
(require 'org)
;; Enable Babel for specific languages
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t) ;; Elisp support
(scheme . t) ;; Scheme Lisp support
(lisp . t) ;; Common Lisp support
(lua . t) ;; Lua support
(latex . t) ;; Latex support
(shell . t)) ;; Posix Shell support
)
;; Set the default export directory
(setq org-export-directory "~/org_exports/")
;; Show inline images in org documents
(setq org-startup-with-inline-images t)
;; Set default directory based on operating system
(cond
;; If using Windows
((eq system-type 'windows-nt)
(setq default-directory (format "C:\\Users\\%s\\Documents" (user-login-name))))
;; If using GNU/Linux
((eq system-type 'gnu/linux)
(setq default-directory (format "/home/%s" (user-login-name))))
;; If using macOS
((eq system-type 'darwin)
(setq default-directory (format "/Users/%s" (user-login-name))))
)
;; Themeing
(use-package gruvbox-theme) ;; Gruvbox is comfy
(load-theme 'gruvbox-dark-hard) ;; Dark because I'm a parasite
; For Unix-like operating systems only running the GUI.
(add-to-list 'default-frame-alist '(alpha-background . 80))
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1))
;; Technically useless but cute for fullscreen editing.
(use-package nyan-mode
:init
(nyan-mode))
;; Requires the JetBrains Mono font be installed on the system.
(add-to-list 'default-frame-alist '(font . "JetBrains Mono-12"))
;; I've been using Neovim a lot lately, so I'm using Evil mode for the
;; time being. I think XFK is technically better, but it messes with
;; my muscle memory a bit, and I need to be able to get stuff done,
;; frankly. I'm already wasting time configuring Emacs (*  ̄︿ ̄)
(use-package evil
:init ;; tweak evil's configuration before loading it
(setq evil-want-keybinding nil)
(setq evil-vsplit-window-right t)
(setq evil-split-window-below t)
(evil-mode)
)
;; MINIMALISM
(menu-bar-mode -1)
(tool-bar-mode -1)
;; Misc stuff
(defalias 'yes-or-no-p 'y-or-n-p)
(column-number-mode 1)
(setq make-backup-files nil)
(setq global-visual-line-mode t)