Last active
July 8, 2023 11:35
-
-
Save mikelove/b0f4eb15a21387ddb534 to your computer and use it in GitHub Desktop.
.emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; mike love's .emacs | |
; general stuff | |
(menu-bar-mode -1) | |
(tool-bar-mode -1) | |
(global-set-key "\C-x\C-b" 'electric-buffer-list) | |
(global-unset-key (kbd "\C-x DEL") ) | |
(global-unset-key (kbd "\C-t") ) | |
(setq inhibit-startup-screen t) | |
(setq backup-directory-alist '(("" . "~/emacs-backup"))) | |
(delete-selection-mode 1) | |
(setq scroll-conservatively 1000) | |
(require 'uniquify) | |
(setq uniquify-buffer-name-style 'reverse) | |
(setq ring-bell-function 'ignore) | |
(display-time-mode 1) | |
;(setq org-startup-folded nil) | |
;(global-linum-mode t) | |
; theme | |
;(load theme 'spacemacs-dark t) | |
; | |
;(add-to-list 'custom-theme-load-path "~/emacs/emacs-color-theme-solarized") | |
;(customize-set-variable 'frame-background-mode 'dark) | |
;(load-theme 'solarized t) | |
; | |
(add-to-list 'custom-theme-load-path "~/emacs/spacedust") | |
(load-theme 'spacedust t) | |
; powerline | |
; el files: powerline-separators, powerline-themes, powerline | |
(add-to-list 'load-path "~/emacs/powerline") | |
(require 'powerline) | |
(powerline-default-theme) | |
;; mouse stuff from http://www.emacswiki.org/emacs/SmoothScrolling | |
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time | |
(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling | |
(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse | |
; text mode hooks | |
(add-hook 'LaTeX-mode-hook 'turn-on-flyspell) | |
; (add-hook 'text-mode-hook 'turn-on-flyspell) ; this breaks Rnw editing with ess | |
(add-hook 'text-mode-hook 'turn-on-auto-fill) | |
; ESS (Emacs Speaks Statistics) stuff | |
(require 'ess) | |
(ess-toggle-underscore nil) | |
(setq ess-default-style 'DEFAULT) | |
(setq ess-indent-level 2) | |
;(setq ess-indent-with-fancy-comments nil) | |
(setq ess-history-file nil) | |
(setq ess-roxy-str "#'") | |
(setq ess-use-flymake nil) | |
(setq inferior-R-args "--no-restore --no-save") | |
(setq ess-ask-for-ess-directory nil) | |
(setq ess-startup-directory nil) | |
(defun then_R_operator () | |
"R - %>% operator or 'then' pipe operator" | |
(interactive) | |
(just-one-space 1) | |
(insert "%>%") | |
(reindent-then-newline-and-indent)) | |
(define-key ess-mode-map (kbd "C-l") 'then_R_operator) | |
; line numbers when markdown | |
(add-hook 'markdown-mode-hook 'display-line-numbers-mode) | |
; snake-mode | |
(add-to-list 'auto-mode-alist '("Snakefile" . python-mode)) | |
; auto-complete | |
(ac-config-default) | |
; markdown and polymode stuff (for using Rmd files) | |
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) | |
(add-to-list 'auto-mode-alist '("\\.Rmd\\'" . poly-markdown-mode)) | |
; version control | |
(setq version-control t ;; Use version numbers for backups. | |
kept-new-versions 10 ;; Number of newest versions to keep. | |
kept-old-versions 0 ;; Number of oldest versions to keep. | |
delete-old-versions t ;; Don't ask to delete excess backup versions. | |
backup-by-copying t) ;; Copy all files, don't rename them. | |
(setq vc-make-backup-files t) | |
; melpa | |
(require 'package) | |
;; If you want to use latest version | |
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) | |
; melpa packages: | |
; markdown-mode poly-R poly-markdown polymode ess auto-complete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment