250 lines
7.4 KiB
EmacsLisp
250 lines
7.4 KiB
EmacsLisp
|
;;; package -- summary
|
||
|
;;; Commentary:
|
||
|
|
||
|
;;; Code:
|
||
|
|
||
|
;; This section is for boilerplate code.
|
||
|
|
||
|
; Hide the tool bar.
|
||
|
(tool-bar-mode 0)
|
||
|
|
||
|
; Set the default geometry of the Emacs frame.
|
||
|
(setq default-frame-alist
|
||
|
'((top . 200) (left . 400)
|
||
|
(width . 80) (height . 25)))
|
||
|
|
||
|
;; Include the golden-ratio package to keep things pleasing.
|
||
|
(use-package golden-ratio)
|
||
|
(golden-ratio-mode)
|
||
|
|
||
|
|
||
|
; Automatically compile ELisp when saving
|
||
|
(auto-compile-on-save-mode)
|
||
|
|
||
|
; Increase the garbage collector's threshold
|
||
|
(setq gc-cons-threshold 100000000)
|
||
|
(setq large-file-warning-threshold 1000000000)
|
||
|
|
||
|
; Store temporary files in the temp directory, where they belong
|
||
|
(setq backup-directory-alist
|
||
|
`((".*" . ,temporary-file-directory)))
|
||
|
(setq auto-save-file-name-transforms
|
||
|
`((".*" ,temporary-file-directory t)))
|
||
|
|
||
|
; 'y' or 'n' is fine
|
||
|
(fset 'yes-or-no-p 'y-or-n-p)
|
||
|
|
||
|
; Automatically reload files as needed
|
||
|
(global-auto-revert-mode t)
|
||
|
|
||
|
; Set tab width
|
||
|
;(setq-default tab-width 4
|
||
|
; indent-tabs-mode nil)
|
||
|
|
||
|
; Kill our current buffer
|
||
|
(global-set-key (kbd "C-x k") 'kill-this-buffer)
|
||
|
|
||
|
; Remove unneeded whitespace when exiting
|
||
|
;(add-hook 'before-save-hook 'whitespace-cleanup)
|
||
|
;Replace the above with butler
|
||
|
|
||
|
;(use-package smartparens
|
||
|
; :ensure t
|
||
|
; :config
|
||
|
; (progn
|
||
|
; (require 'smartparens-config)
|
||
|
; (smartparens-global-mode 1)
|
||
|
; (show-paren-mode t)))
|
||
|
|
||
|
; Set the Web Wowser as the default browser in EMACS
|
||
|
(setq
|
||
|
browse-url-browser-function 'eww-browse-url
|
||
|
shr-use-fonts nil
|
||
|
shr-use-colors nil
|
||
|
shr-indentation 2
|
||
|
eww-search-prefix "https://duckduckgo.com/html")
|
||
|
|
||
|
; Inhibit the GNU information startup dialog.
|
||
|
(setq inhibit-startup-message t)
|
||
|
|
||
|
|
||
|
|
||
|
;; This section is for managing packages
|
||
|
|
||
|
|
||
|
; Enable SLIME.
|
||
|
(use-package slime
|
||
|
:config
|
||
|
(setq inferior-lisp-program "sbcl"))
|
||
|
|
||
|
; Add auto-complete to SLIME.
|
||
|
(use-package ac-slime
|
||
|
:config
|
||
|
(add-hook 'slime-mode-hook 'set-up-slime'ac)
|
||
|
(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
|
||
|
(eval-after-load "auto-complete"
|
||
|
'(add-to-list 'ac-modes 'slime-repl-mode)))
|
||
|
; Enhance frame management
|
||
|
;(use-package cframe
|
||
|
; :demand
|
||
|
; :config
|
||
|
;)
|
||
|
|
||
|
|
||
|
; Add an SRFI browser
|
||
|
(use-package srfi)
|
||
|
|
||
|
|
||
|
; Automatically add spaces around mathematics operators
|
||
|
(use-package electric-operator)
|
||
|
|
||
|
; Add Conkeror-style operations to the web wowser
|
||
|
(use-package eww-lnum)
|
||
|
(eval-after-load "eww"
|
||
|
'(progn (define-key eww-mode-map "f" 'eww-lnum-follow)
|
||
|
(define-key eww-mode-map "F" 'eww-lnum-universal)))
|
||
|
|
||
|
;; Configure the fuzzy-pattern matching engine, Helm
|
||
|
(use-package helm
|
||
|
:ensure t
|
||
|
:bind
|
||
|
:config
|
||
|
(require 'helm-config)
|
||
|
(helm-mode 1)
|
||
|
(setq helm-split-window-inside-p t
|
||
|
helm-move-to-line-cycle-in-source t)
|
||
|
(setq helm-autoresize-max-height 0)
|
||
|
(setq helm-autoresize-min-height 20)
|
||
|
(helm-autoresize-mode 1)
|
||
|
(define-key helm-map (kbd "<tab>")
|
||
|
`helm-execute-persistent-action)
|
||
|
(define-key helm-map (kbd "C-i")
|
||
|
'helm-execute-persistent-action)
|
||
|
(define-key helm-map (kbd "C-z")
|
||
|
`helm-select-action))
|
||
|
|
||
|
;; Set Helm up to provide meta-x suggestions and others.
|
||
|
(global-set-key (kbd "M-x") 'helm-M-x)
|
||
|
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
|
||
|
(global-set-key (kbd "C-x b") 'helm-mini)
|
||
|
(setq helm-buffers-fuzzy-matching t
|
||
|
helm-recentf-fuzzy-match t)
|
||
|
(global-set-key (kbd "C-x C-f") 'helm-find-files)
|
||
|
|
||
|
;; Prevent golden-ratio from interfering with Helm
|
||
|
(defun pl/helm-alive-p ()
|
||
|
(if (boundp 'helm-alive-p)
|
||
|
(symbol-value 'helm-alive-p)))
|
||
|
(add-to-list 'golden-ratio-inhibit-functions 'pl/helm-alive-p)
|
||
|
|
||
|
|
||
|
;; Add Helm support to the web wowser
|
||
|
(use-package helm-eww)
|
||
|
|
||
|
; Add on-the-fly syntax linting
|
||
|
(use-package flycheck
|
||
|
:demand
|
||
|
:config
|
||
|
(add-hook 'after-init-hook #'global-flycheck-mode))
|
||
|
|
||
|
|
||
|
; Integrate Helm recommendations and Flycheck linting
|
||
|
(use-package helm-flycheck)
|
||
|
(eval-after-load 'flycheck
|
||
|
'(define-key flycheck-mode-map (kbd "C-c ! h") 'helm-flycheck))
|
||
|
|
||
|
; Make Helm responsible for providing mode recommendations
|
||
|
(use-package helm-mode-manager)
|
||
|
|
||
|
; Add Helm suggestion support to SLIME
|
||
|
(use-package helm-slime
|
||
|
:config
|
||
|
(global-helm-slime-mode 1))
|
||
|
|
||
|
;; This section is for UI elements.
|
||
|
|
||
|
; Set your default theme and changes to the UI here.
|
||
|
(load-theme `parchment t)
|
||
|
(set-fringe-mode `(0 . 0))
|
||
|
(scroll-bar-mode 0)
|
||
|
|
||
|
|
||
|
; Powerline is similar to Centaur Tabs, except it handles the mode line.
|
||
|
(use-package powerline
|
||
|
:demand
|
||
|
:config
|
||
|
(powerline-nano-theme))
|
||
|
|
||
|
; Stripes adds alternating stripes to buffers
|
||
|
(use-package stripes
|
||
|
:config
|
||
|
)
|
||
|
|
||
|
; Popwin forces informational, educational, fantasticational buffers into a temporary window. Thank god.
|
||
|
(use-package popwin
|
||
|
:demand
|
||
|
:config
|
||
|
; Meta commands
|
||
|
(setq anything-samewindow nil)
|
||
|
(push `("*anything*" :height 20) popwin:special-display-config)
|
||
|
(push `("*Completions*" :height 20) popwin:special-display-config)
|
||
|
(push `("*Messages*" :height 20) popwin:special-display-config)
|
||
|
(push `("*compilation*" :height 20) popwin:special-display-config)
|
||
|
(push `("*Help*" :height 20) popwin:special-display-config)
|
||
|
(push `("*Warnings*" :height 20) popwin:special-display-config)
|
||
|
(push `("*Backtrace*" :height 20) popwin:special-display-config)
|
||
|
(push `("*Buffer List*" :height 20) popwin:special-display-config)
|
||
|
; SLIME commands
|
||
|
(push "*slime-apropos*" popwin:special-display-config)
|
||
|
(push "*slime-macroexpansion*" popwin:special-display-config)
|
||
|
(push "*slime-description*" popwin:special-display-config)
|
||
|
(push '("*slime-compilation*" :noselect t)
|
||
|
popwin:special-display-config)
|
||
|
(push "*slime-xref*" popwin:special-display-config)
|
||
|
(push '(sldb-mode :stick t) popwin:special-display-config)
|
||
|
(push 'slime-repl-mode popwin:special-display-config)
|
||
|
(push 'slime-connection-list-mode popwin:special-display-config)
|
||
|
)
|
||
|
(popwin-mode 1)
|
||
|
|
||
|
; Enable frame dividers
|
||
|
(setq window-divider-default-places t)
|
||
|
(window-divider-mode 1)
|
||
|
|
||
|
; Enable absolute line numbers in selected modes
|
||
|
(defvar proghook-active 0)
|
||
|
(defun proghook () "Function for prog mode hook."
|
||
|
(display-line-numbers-mode `toggle)
|
||
|
(electric-pair-mode `toggle)
|
||
|
(electric-quote-mode `toggle)
|
||
|
(electric-indent-mode `toggle)
|
||
|
(flycheck-mode `toggle)
|
||
|
(ws-butler-mode `toggle)
|
||
|
(context-coloring-mode `toggle)
|
||
|
(semantic-mode `toggle))
|
||
|
|
||
|
(add-hook 'prog-mode-hook 'proghook)
|
||
|
|
||
|
(custom-set-variables
|
||
|
;; custom-set-variables was added by Custom.
|
||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||
|
;; Your init file should contain only one such instance.
|
||
|
;; If there is more than one, they won't work right.
|
||
|
'(custom-safe-themes
|
||
|
'("07a8ce87456258f259cc5cc824eddd0ad7b0e905a4a1e9331559b86254cd8166" default))
|
||
|
'(package-selected-packages
|
||
|
'(haskell-mode goggles ac-html ac-helm ac-haskell-process ac-etags ac-c-headers gnuplot smartparens smooth-scroll eww-lnum helm-mode-manager helm-flycheck helm-eww ac-slime helm-slime helm-core helm ws-butler clean-aindent-mode company-c-headers company pcache link context-coloring flyspell-lazy flyspell-correct-ivy auto-compile guru-mode good-scroll golden-ratio xpm use-package ten-hundred-mode stripes srfi speed-type slime sed-mode schrute popwin paren-face parchment-theme jammer flycheck electric-operator cframe))
|
||
|
'(show-paren-mode t))
|
||
|
(provide 'init)
|
||
|
;;; init.el ends here
|
||
|
(custom-set-faces
|
||
|
;; custom-set-faces was added by Custom.
|
||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||
|
;; Your init file should contain only one such instance.
|
||
|
;; If there is more than one, they won't work right.
|
||
|
'(default ((t (:family "Iosevka" :foundry "UKWN" :slant normal :weight normal :height 120 :width normal))))
|
||
|
'(centaur-tabs-default ((t (:background "white" :foreground "white")))))
|
||
|
|
||
|
|
||
|
;;Garbage
|