My Doom emacs dotfiles ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- ;; -- GENERAL SETTINGS --------------------------------------------------------- ;; identity (setq user-full-name "Benjamin Skinner" user-mail-address "btskinner@coe.ufl.edu") ;; fonts (setq doom-font (font-spec :family "iA Writer Mono S" :size 16.0 :weight 'semi-light) doom-variable-pitch-font (font-spec :family "iA Writer Duospace") doom-unicode-font (font-spec :family "iA Writer Mono S" :size 16.0) doom-big-font (font-spec :family "iA Writer Mono S" :size 24.0)) ;; theme (setq doom-theme 'doom-zenburn) ;; yes to line numbers (setq display-line-numbers-type t) ;; directory for org files (setq org-directory "~/org/") ;; remove doom dashboard items (remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu) (remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-footer) (remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-loaded) ;; default frame size (add-to-list 'default-frame-alist '(left . 300)) (add-to-list 'default-frame-alist '(top . 0)) (add-to-list 'default-frame-alist '(height . 60)) (add-to-list 'default-frame-alist '(width . 120)) ;; no audible or visual bell when emacs is mad (setq ring-bell-function 'ignore) ;; use the tab key to make 2 spaces (setq tab-width 2) (setq indent-tabs-mode nil) ;; no backup~ files (setq make-backup-files nil) ;; no #autosave# files (setq auto-save-default nil) ;; word wrap (global-visual-line-mode t) ;; -- GENERAL KEYBINDINGS ---------------------------------- ;; allow upcase (C-x C-u) and downcase (C-x C-l) region (put 'downcase-region 'disabled nil) (put 'upcase-region 'disabled nil) ;; jump to other window (split screen) (map! [C-tab] #'other-window) ;; jump to other frame (split window) (map! "C-\`" #'other-frame) ;; Mac option and command keys to meta (helps with non-Mac external keyboard) (setq mac-option-key-is-meta t mac-command-key-is-meta t mac-command-modifier 'meta mac-option-modifier 'meta) ;; -- MODES ------------------------------------------------ ;; -- STATA -------- ;; Stata name (setq inferior-STA-program-name "/Applications/Stata/StataMP.app/Contents/MacOS/stata-mp") ;; better Stata ado-mode (require 'ado-mode) ;; my comment style for Stata (defun my-Stata-comment-style () "Change comment style for ESS Stata" (if (string= mode-name "Ado") (progn (setq comment-start "// " comment-end "")))) ;; add my Stata comment style to hook (add-hook 'ado-mode-hook 'my-Stata-comment-style) ;; don't indent closing brace (setq ado-close-under-line-flag nil) ;; intent 4 spaces with continued line (not 2) (setq ado-continued-statement-indent-spaces 2) ;; -- R ------------ (require 'ess-site) (setq ess-style 'RStudio) '(ess-smart-S-assign-key nil) ;; functions for R pipes ;; (h/t https://emacs.stackexchange.com/a/8055) (defun then_R_pipe () "R - %>% operator or 'then' pipe operator" (interactive) (just-one-space 1) (insert "%>%") (just-one-space 1) ) (defun base_R_pipe () "R - |> operator or 'base' pipe operator" (interactive) (just-one-space 1) (insert "|>") (just-one-space 1) ) ;; remap ";" key: ;; ; --> "<-" ;; Control + ; --> "|>" ;; Control + Meta + ; --> "%>%" ;; NB: quick tap ; to get semicolon (dolist (map (list ess-mode-map inferior-ess-mode-map)) (define-key map (kbd ";") 'ess-insert-assign)) (dolist (map (list ess-mode-map inferior-ess-mode-map)) (define-key map (kbd "C-M-;") 'then_R_pipe)) (dolist (map (list ess-mode-map inferior-ess-mode-map)) (define-key map (kbd "C-;") 'base_R_pipe)) ;; -- Stan --------- (require 'stan-mode) ;; END config.el