Minor changes to Emacs init file.
This commit is contained in:
parent
47ffb289ea
commit
b10d534eb3
@ -26,6 +26,8 @@
|
||||
;; perhaps with support for ELisp scattered around the Internet instead of
|
||||
;; just package-archives. Could be trivial with a lookup table.
|
||||
;; Integrate ispell
|
||||
;; Replace flyspell with flycheck-aspell? I don't really want to do this, though,
|
||||
;; since it makes me more reliant on GNU...
|
||||
|
||||
;;; Index:
|
||||
;; Section Zero - Function Definitions
|
||||
@ -36,7 +38,7 @@
|
||||
|
||||
;; Section Zero - Function Definitions
|
||||
|
||||
(defun install-if-not-avail (x)
|
||||
(defun mpack-install-if-not-avail (x)
|
||||
"Install a package X if and only if it's not available."
|
||||
(if (not (package-installed-p x))
|
||||
(progn
|
||||
@ -102,44 +104,67 @@
|
||||
load-path (flatten-list
|
||||
(list load-path
|
||||
(mapcar 'directory-file-name
|
||||
'("/usr/share/emacs/site-lisp/quack.el")))))
|
||||
(list (concat (car (split-string user-init-file "init.el")) "local-lisp/"))))))
|
||||
|
||||
(mapc 'install-if-not-avail '(
|
||||
ac-c-headers
|
||||
ac-etags
|
||||
ac-geiser
|
||||
ac-haskell-process
|
||||
ac-html
|
||||
ac-ispell
|
||||
ace-link
|
||||
ace-window
|
||||
aggressive-indent
|
||||
beacon
|
||||
centered-cursor-mode
|
||||
crux
|
||||
dimmer
|
||||
disable-mouse
|
||||
focus
|
||||
geiser-mit
|
||||
goggles
|
||||
golden-ratio
|
||||
golden-ratio-scroll-screen
|
||||
helm-eww
|
||||
helm-flycheck
|
||||
helpful
|
||||
immortal-scratch
|
||||
indent-guide
|
||||
modus-themes
|
||||
paredit
|
||||
popwin
|
||||
powerline
|
||||
rainbow-blocks
|
||||
rainbow-mode
|
||||
rc-mode
|
||||
sly
|
||||
solaire-mode
|
||||
srfi
|
||||
zoom-window))
|
||||
;; user-init-file holds location of init.el - use this with split-string, flatten-list and concat
|
||||
|
||||
|
||||
(mapc 'mpack-install-if-not-avail '(
|
||||
ac-c-headers
|
||||
ac-etags
|
||||
ac-geiser
|
||||
ac-haskell-process
|
||||
ac-html
|
||||
ac-ispell
|
||||
ace-link
|
||||
ace-window
|
||||
aggressive-indent
|
||||
beacon
|
||||
centered-cursor-mode
|
||||
citre
|
||||
clhs
|
||||
column-enforce-mode
|
||||
comment-tags
|
||||
crux
|
||||
deft
|
||||
dimmer
|
||||
disable-mouse
|
||||
drag-stuff
|
||||
elforth
|
||||
elpl
|
||||
elsa
|
||||
erefactor
|
||||
flycheck-elsa
|
||||
flyspell-correct-helm
|
||||
flyspell-lazy
|
||||
focus
|
||||
folding
|
||||
forth-mode
|
||||
geiser-mit
|
||||
god-mode
|
||||
goggles
|
||||
golden-ratio
|
||||
golden-ratio-scroll-screen
|
||||
hardcore-mode
|
||||
helm-eww
|
||||
helm-flycheck
|
||||
helm-flyspell
|
||||
helpful
|
||||
immortal-scratch
|
||||
indent-guide
|
||||
modus-themes
|
||||
paredit
|
||||
popwin
|
||||
powerline
|
||||
rainbow-blocks
|
||||
rainbow-mode
|
||||
rc-mode
|
||||
schrute
|
||||
sly
|
||||
solaire-mode
|
||||
srfi
|
||||
undo-fu
|
||||
zoom-window))
|
||||
|
||||
;; Only require things you ABSOLUTELY NEED at init time (e.g for *scratch*).
|
||||
(mapc 'require '(
|
||||
@ -192,7 +217,7 @@
|
||||
(global-set-key (kbd "M-o") 'ace-window)))
|
||||
|
||||
("avy" . '(progn
|
||||
(keymap-global-set "C-c SPC" 'avy-goto-char)))
|
||||
(keymap-global-set "C-c SPC" 'avy-goto-char-2)))
|
||||
|
||||
("aggressive-indent" . '(progn
|
||||
))
|
||||
@ -258,9 +283,9 @@
|
||||
;; Interop with other libraries.
|
||||
(setq golden-ratio-extra-commands
|
||||
(flatten-list (list 'golden-ratio-extra-commands '(ace-window ace-jump-move))))
|
||||
(add-to-list
|
||||
'golden-ratio-inhibit-functions
|
||||
'pl/helm-alive-p)))
|
||||
(push
|
||||
'pl/helm-alive-p
|
||||
golden-ratio-inhibit-functions)))
|
||||
|
||||
("golden-ratio-scroll-screen" . '(progn
|
||||
(global-set-key (kbd "<prior>") 'golden-ratio-scroll-screen-down)
|
||||
@ -395,12 +420,13 @@
|
||||
(helm-mode 1)
|
||||
(helm-autoresize-mode 1)
|
||||
(flyspell-mode 1)
|
||||
(flyspell-lazy-mode 1)
|
||||
(auto-complete-mode 1)
|
||||
(ac-ispell-ac-setup)
|
||||
(solaire-mode 1)
|
||||
(goggles-mode 1)
|
||||
(focus-mode 1)
|
||||
(display-line-numbers 1))))
|
||||
(setq display-line-numbers 1))))
|
||||
|
||||
|
||||
|
||||
@ -442,7 +468,7 @@
|
||||
(add-hook 'common-lisp-mode-hook
|
||||
(lambda ()
|
||||
(progn
|
||||
())))
|
||||
)))
|
||||
|
||||
(add-hook 'c-mode-hook
|
||||
(lambda ()
|
||||
@ -454,7 +480,9 @@
|
||||
'(ac-source-etags
|
||||
ac-source-c-headers
|
||||
ac-source-c-header-symbols)))
|
||||
(c-set-style "whitesmith"))))
|
||||
(c-set-style "whitesmith")
|
||||
(defun filename () "Return filename current buffer is viewing." (replace-regexp-in-string ".c" "" buffer-file-name))
|
||||
(setq compile-command (concatenate 'string "cc -o " (filename) " " (concat (filename) ".c") ";" (filename))))))
|
||||
;; Section Four - Packageless Customizations and Custom.el
|
||||
|
||||
;; Suppress non-urgent warnings.
|
||||
@ -462,7 +490,9 @@
|
||||
|
||||
(set-face-attribute 'default nil :family "Clear Sans" :height 125)
|
||||
(set-face-attribute 'variable-pitch nil :family "FreeSerif" :height 1.0)
|
||||
(set-face-attribute 'fixed-pitch nil :family "Iosevka Mono" :height 1.0)
|
||||
(set-face-attribute 'fixed-pitch nil :family "Iosevka" :height 1.0)
|
||||
|
||||
|
||||
|
||||
;; y-or-no-p is fine
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
@ -490,20 +520,20 @@
|
||||
|
||||
|
||||
;;; Reset the GC threshold to something more reasonable.
|
||||
(setq gc-cons-threshold (* 1000 1000 1000))
|
||||
(setq gc-cons-threshold (* 1000 1000))
|
||||
(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.
|
||||
'(package-selected-packages
|
||||
'(esup dumb-jump zoom-window use-package srfi solaire-mode sly-macrostep rc-mode rainbow-mode rainbow-blocks powerline popwin paredit modus-themes macrostep-geiser indent-guide immortal-scratch helpful helm-pages helm-flycheck helm-eww golden-ratio-scroll-screen golden-ratio goggles geiser-mit focus disable-mouse dimmer crux column-enforce-mode centered-cursor-mode beacon aggressive-indent ace-window ace-link ace-jump-mode ac-sly ac-ispell ac-html ac-haskell-process ac-geiser ac-etags ac-c-headers)))
|
||||
'(hardcore-mode smartparens esup dumb-jump zoom-window use-package srfi solaire-mode sly-macrostep rc-mode rainbow-mode rainbow-blocks powerline popwin paredit modus-themes macrostep-geiser indent-guide immortal-scratch helpful helm-pages helm-flycheck helm-eww golden-ratio-scroll-screen golden-ratio goggles geiser-mit focus disable-mouse dimmer crux column-enforce-mode centered-cursor-mode beacon aggressive-indent ace-window ace-link ace-jump-mode ac-sly ac-ispell ac-html ac-haskell-process ac-geiser ac-etags ac-c-headers)))
|
||||
(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.
|
||||
)
|
||||
'(variable-pitch ((t (:height 1.0 :family "Iosevka")))))
|
||||
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
||||
|
@ -1,577 +0,0 @@
|
||||
;;;; package --- Summary
|
||||
|
||||
;;;; Commentary:
|
||||
|
||||
;;; TODO:
|
||||
|
||||
;; Figure out why clean-aindent doesn't show up in my default config's repos any more
|
||||
;; Integrate flyspell
|
||||
;; Work on setting up org-mode for publishing (using Muse, AuCTeX, gnuplot, etc)
|
||||
;; Set up ctxmenu to provide right-click menus
|
||||
;; Work on improving aggressive-indent's abilities and integrating with clean-aindent-mode, potentially
|
||||
;; Look into programming with the names libraries - adds namespaces.
|
||||
;; Configure jammer and schrute to prevent using inefficient tactics and teach
|
||||
;; Maybe configure paren-face and integrate it with rainbow-blocks?
|
||||
;; Look into powerline more.
|
||||
;; Integrate SLY and your extensions more.
|
||||
;; Replace the standard EWW functions with Helm ones. Also configure EWW more in general.
|
||||
;; Investigate buffer-manage, comment-tags, company, guru-mode, ivy.
|
||||
;; Integrate GDB?
|
||||
|
||||
|
||||
(setq-default package-native-compile t)
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives
|
||||
`("melpa-unstable" . "https://melpa.org/packages/"))
|
||||
|
||||
(if (fboundp `use-package)
|
||||
()
|
||||
(progn (package-refresh-contents) (package-install `use-package)))
|
||||
|
||||
;; Make startup faster by reducing the frequency of garbage
|
||||
;; collection. The default is 800 kilobytes. Measured in bytes.
|
||||
(setq gc-cons-threshold (* 1000 1000 1000))
|
||||
|
||||
|
||||
;;;; Index:
|
||||
|
||||
;;; Section One - Packageless Configurations
|
||||
;;; Subsection 1.1 - Basic includes
|
||||
;;; Subsection 1.2 - GUI
|
||||
;;; Subsection 1.3 - Functions and Bindings
|
||||
;;; Subsection 1.4 - Backend
|
||||
;;;
|
||||
;;; Section Two - Package-required Configurations
|
||||
;;; Subsection 2.1 - GUI
|
||||
;;; Subsection 2.2 - Functions and Bindings
|
||||
;;; Subsection 2.3 - Backend
|
||||
|
||||
;;;; Code:
|
||||
|
||||
;; Section One
|
||||
|
||||
;; Subsection 1.1
|
||||
|
||||
(setq-default load-path
|
||||
(flatten-list
|
||||
(list load-path
|
||||
(mapcar `directory-file-name `("/usr/share/emacs/site-lisp/quack.el")))))
|
||||
|
||||
(use-package eww
|
||||
:defer t
|
||||
:config
|
||||
(progn
|
||||
(define-key eww-mode-map (kbd "C-c f") 'ace-link)
|
||||
(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/lite")
|
||||
|
||||
;; Allow for multiple Wowsers.
|
||||
(defun eww-hook () "Reconfigure eww buffers on the fly."
|
||||
(progn (rename-buffer "eww" t)
|
||||
(variable-pitch-mode)))
|
||||
(add-hook 'eww-mode-hook 'eww-hook)))
|
||||
|
||||
(use-package help-mode
|
||||
:defer t
|
||||
:config
|
||||
(define-key help-mode-map (kbd "C-c f") 'ace-link))
|
||||
|
||||
(use-package woman
|
||||
:defer t
|
||||
:config
|
||||
(define-key woman-mode-map (kbd "C-c f") 'ace-link))
|
||||
|
||||
(use-package org
|
||||
:defer t
|
||||
:config
|
||||
(define-key org-mode-map (kbd "C-c f") 'ace-link))
|
||||
|
||||
;; Subsection 1.2
|
||||
|
||||
;; Default theme.
|
||||
(use-package modus-themes
|
||||
:ensure t
|
||||
:init
|
||||
;; Add all your customizations prior to loading the themes
|
||||
(setq-default modus-themes-success-deuteranopia t
|
||||
modus-themes-bold-constructs t
|
||||
modus-themes-syntax '(faint yellow-comments green-strings)
|
||||
modus-themes-mixed-fonts t ; available for 1.7
|
||||
modus-themes-links '(faint bold italic)
|
||||
modus-themes-prompts '(gray intense)
|
||||
modus-themes-mode-line '(3d accented)
|
||||
modus-themes-completions 'opinionated
|
||||
modus-themes-fringes 'intense
|
||||
modus-themes-lang-checkers '(text-also background intense)
|
||||
modus-themes-hl-line '(accented)
|
||||
modus-themes-paren-match '(bold intense)
|
||||
modus-themes-variable-pitch-ui t)
|
||||
(modus-themes-load-themes)
|
||||
:config
|
||||
(modus-themes-load-operandi))
|
||||
|
||||
|
||||
|
||||
(add-hook 'server-after-make-frame-hook `(lambda () (load-theme 'modus-operandi t))) ;This is a workaround for Solaire Mode.
|
||||
|
||||
;; Fonts and faces.
|
||||
|
||||
(set-face-attribute 'default nil :family "Clear Sans" :height 125)
|
||||
(set-face-attribute 'variable-pitch nil :family "FreeSerif" :height 1.0)
|
||||
(set-face-attribute 'fixed-pitch nil :family "Iosevka Light" :height 1.25)
|
||||
|
||||
;; y-or-no-p is fine
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
;; Override x-popup-menu
|
||||
(fset 'x-popup-menu 'ace-popup-menu)
|
||||
|
||||
;; Inhibit the GNU information startup dialog.
|
||||
(setq inhibit-startup-message t)
|
||||
|
||||
;; Set the default dimensions (but not geometry) of the frame in GUI mode.
|
||||
(setq default-frame-alist
|
||||
'(() ()
|
||||
(width . 80) (height . 25)))
|
||||
|
||||
;; Hide the toolbar in GUI mode.
|
||||
(tool-bar-mode 0)
|
||||
|
||||
;; Hide the scrollbar.
|
||||
(scroll-bar-mode 0)
|
||||
|
||||
;; Set fringe style.
|
||||
(set-fringe-mode '(0 . 0))
|
||||
|
||||
;; Enable frame dividers.
|
||||
(setq window-divider-default-places t)
|
||||
(window-divider-mode 1)
|
||||
|
||||
|
||||
;; Subsection 1.3
|
||||
|
||||
;; Set up our environment packages.
|
||||
(defun install-if-not-avail (x) "Check if X installed. if not, install."
|
||||
(if (package-installed-p x)
|
||||
(print (concat (symbol-name x) " is already installed."))
|
||||
(print (concat (symbol-name x) " is not installed, installing..."))))
|
||||
|
||||
(defun setup-packages (sequence) "Check if the packages in SEQUENCE are available. If not, install them."
|
||||
(mapc 'install-if-not-avail sequence))
|
||||
|
||||
(setup-packages '())
|
||||
|
||||
;; Simple functions to control modes."
|
||||
(defun set-on (mode) "Set MODE to on if it's off."
|
||||
(if (not (eval mode))
|
||||
(set mode 1)
|
||||
()))
|
||||
|
||||
(defun toggle (x) "If X is disabled, enable it. Otherwise disable it."
|
||||
(if (not (eval x))
|
||||
(set x 1)
|
||||
(set x nil)))
|
||||
|
||||
|
||||
;; Kill the current buffer.
|
||||
(global-set-key (kbd "C-x k") 'kill-this-buffer)
|
||||
|
||||
|
||||
;; Subsection 1.4
|
||||
|
||||
;; Give us stats during startup.
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda ()
|
||||
(message "Emacs ready in %s with %d garbage collections."
|
||||
(format "%.2f seconds"
|
||||
(float-time
|
||||
(time-subtract after-init-time before-init-time))) gcs-done)))
|
||||
|
||||
;; We want to treat documents as ASCII by default.
|
||||
(prefer-coding-system 'us-ascii-unix)
|
||||
|
||||
;; Disable TLS 1.3.
|
||||
(eval-after-load "gnutls" (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
|
||||
|
||||
;; Store temporary files in a backup directory.
|
||||
(progn
|
||||
(setq temporary-file-directory "~/.config/emacs/.backup/temp/")
|
||||
(setq auto-save-directory "~/.config/emacs/.backup/autosave/"))
|
||||
|
||||
(eval-after-load "tramp.el" (progn
|
||||
(setq tramp-auto-save-directory "~/.config/emacs/.backup/autosave/")
|
||||
(make-directory temporary-file-directory t)
|
||||
(make-directory auto-save-directory t)))
|
||||
|
||||
|
||||
;; Automatically reload files as needed.
|
||||
(global-auto-revert-mode t)
|
||||
|
||||
;; Remove unneeded whitespace when exiting.
|
||||
(add-hook 'before-save-hook 'whitespace-cleanup)
|
||||
|
||||
|
||||
;; Subsection 2.1
|
||||
(use-package xterm-color
|
||||
:ensure t
|
||||
:demand)
|
||||
|
||||
(use-package rainbow-blocks
|
||||
:ensure t
|
||||
:demand)
|
||||
(use-package rainbow-mode
|
||||
:ensure t
|
||||
:demand)
|
||||
|
||||
;; ;; Good-scroll improves Emacs' scrolling abilities.
|
||||
;; (use-package good-scroll
|
||||
;; :ensure t
|
||||
;; :demand
|
||||
;; :config
|
||||
;; (progn (good-scroll-mode 1)
|
||||
;; (global-set-key [next] #'good-scroll-up-full-screen)
|
||||
;; (global-set-key [prior] #'good-scroll-down-full-screen)
|
||||
;; (setq good-scroll-render-rate .16)))
|
||||
|
||||
;; Golden Ratio resizes the current buffer according to the golden ratio.
|
||||
;; TODO: Make it recenter on switch.
|
||||
(use-package golden-ratio
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(progn
|
||||
(golden-ratio-mode 1)
|
||||
;; Interop with other libraries.
|
||||
(setq golden-ratio-extra-commands
|
||||
(flatten-list (list 'golden-ratio-extra-commands '(ace-window ace-jump-move))))
|
||||
(setq golden-ratio-recenter 1)))
|
||||
|
||||
;; Golden Scroll forces scrolling to adhere to the golden ratio.
|
||||
;; TODO: Recenter on scroll.
|
||||
(use-package golden-ratio-scroll-screen
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(progn
|
||||
(global-set-key (kbd "<prior>") `golden-ratio-scroll-screen-down)
|
||||
(global-set-key (kbd "<next>") `golden-ratio-scroll-screen-up)
|
||||
(global-set-key (kbd "C-v") `golden-ratio-scroll-screen-up)
|
||||
(global-set-key (kbd "M-v") `golden-ratio-scroll-screen-down)
|
||||
|
||||
;; The built-in support for recentering seems broken...
|
||||
;; It would be trivial to write a wrapper function to achieve the same effect, though.
|
||||
;; Basically, just write your own scroll function that calls the golden-scroll function
|
||||
;; and then recenters the screen. It would be nice to combine this with centered-cursor-mode,
|
||||
;; too - only problem is that it stutters a bit at the end of buffers when using golden-scroll functions.
|
||||
(setq golden-ratio-scroll-recenter 1)))
|
||||
|
||||
;; zoom-window allows for temporarily "full-screening" a window.
|
||||
(use-package zoom-window
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(progn
|
||||
(global-set-key (kbd "C-z") `zoom-window-zoom)))
|
||||
|
||||
;; Dim inactive buffers.
|
||||
(use-package dimmer
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(progn
|
||||
(dimmer-mode 1)
|
||||
(dimmer-configure-helm)
|
||||
(setq-default
|
||||
dimmer-adjustment-mode :both
|
||||
dimmer-fraction .40)))
|
||||
|
||||
|
||||
;; Goggles adds pulsing effects to region edits.
|
||||
(use-package goggles
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(setq-default goggles-pulse t))
|
||||
|
||||
;; Focus dims non-relevant text.
|
||||
(use-package focus
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
'((prog-mode . defun) (text-mode . sentence)))
|
||||
|
||||
;; Solaire alters background colors to indicate "real" versus "unreal" buffers.
|
||||
(use-package solaire-mode
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(dolist (face '(mode-line mode-line-inactive))))
|
||||
|
||||
|
||||
;; Powerline allows for modeline tweaks.
|
||||
(use-package powerline
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(powerline-nano-theme))
|
||||
|
||||
;; Popwin forces informational, educational, fantasticational buffers into a temporary window. Thank god.
|
||||
(use-package popwin
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(progn (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)
|
||||
(push '("*Compile-Log*" :height 20) popwin:special-display-config)
|
||||
(push '("*Warnings*" :height 20) popwin:special-display-config)
|
||||
(push "*slime-apropos*" popwin:special-display-config) ; SLIME commands
|
||||
(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)))
|
||||
|
||||
;; Subsection 2.2
|
||||
|
||||
|
||||
;; Allow us to easily get around using the Avy and Ace packages.
|
||||
(use-package avy
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(global-set-key (kbd "C-c SPC") 'avy-goto-char))
|
||||
|
||||
(use-package ace-window
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(global-set-key (kbd "M-o") 'ace-window))
|
||||
|
||||
(use-package ace-link
|
||||
:defer t
|
||||
:ensure t
|
||||
:demand)
|
||||
|
||||
;;; Subsection 2.3
|
||||
|
||||
(use-package aggressive-indent
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
;; Add SLY, a Common Lisp REPL.
|
||||
(use-package sly
|
||||
:ensure t
|
||||
:defer t
|
||||
:config
|
||||
(setq inferior-lisp-program "sbcl"))
|
||||
|
||||
;; Add Geiser, a Scheme REPL.
|
||||
(use-package geiser
|
||||
:ensure t
|
||||
:defer t
|
||||
:config
|
||||
(setq-default inferior-lisp-program "mit-scheme-native"))
|
||||
|
||||
(use-package geiser-mit
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package ac-sly
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package ac-geiser
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package ac-html
|
||||
:ensure t)
|
||||
|
||||
(use-package ac-etags
|
||||
:ensure t)
|
||||
|
||||
(use-package ac-ispell
|
||||
:ensure t)
|
||||
|
||||
(use-package ac-c-headers
|
||||
:ensure t)
|
||||
|
||||
(use-package ac-ispell
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package auto-complete
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(progn
|
||||
(ac-config-default)
|
||||
(ac-set-trigger-key "TAB")
|
||||
;; Sources.
|
||||
(defun list-sources (SOURCES) "Produce a list containing the contents of SOURCES."
|
||||
(flatten-list
|
||||
(list (list SOURCES) ac-sources)))
|
||||
(add-hook 'c-mode-hook
|
||||
(lambda ()
|
||||
(progn
|
||||
(ac-etags-setup)
|
||||
(setq ac-sources
|
||||
(list-sources `(ac-source-etags ac-source-c-headers ac-source-c-header-symbols))))))
|
||||
(add-hook 'scheme-mode-hook
|
||||
(lambda ()
|
||||
(progn
|
||||
(setq ac-sources
|
||||
(list-sources `(ac-source-geiser))))))
|
||||
(add-hook 'geiser-mode-hook 'ac-geiser-setup)
|
||||
(add-hook 'geiser-repl-mode-hook 'ac-geiser-setup)))
|
||||
|
||||
;; Configure the fuzzy-pattern matching engine, Helm
|
||||
(use-package helm
|
||||
:ensure t
|
||||
:demand
|
||||
:bind
|
||||
:config
|
||||
(progn (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)
|
||||
(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) ; Set Helm up to provide meta-x suggestions and others.
|
||||
(defun pl/helm-alive-p () "Prevent golden-ratio from interefering with Helm."
|
||||
(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
|
||||
:defer t
|
||||
:ensure t
|
||||
:after eww helm
|
||||
:config
|
||||
(progn
|
||||
()))
|
||||
|
||||
|
||||
;; Flycheck provides on-the-fly syntax linting
|
||||
(use-package flycheck
|
||||
:defer t
|
||||
:ensure t
|
||||
:config
|
||||
(progn (global-flycheck-mode)))
|
||||
|
||||
|
||||
;; Integrate Helm recommendations and Flycheck linting
|
||||
(use-package helm-flycheck
|
||||
:defer t
|
||||
:after helm flycheck
|
||||
:ensure t
|
||||
:demand
|
||||
:config
|
||||
(define-key flycheck-mode-map (kbd "C-c ! h") 'helm-flycheck))
|
||||
|
||||
;; Add an SRFI browser.
|
||||
(use-package srfi
|
||||
:defer t
|
||||
:ensure t)
|
||||
|
||||
;; Enable development features in certain modes.
|
||||
(defvar proghook-active 0)
|
||||
(defun proghook () "Function for 'prog-mode' hook."
|
||||
(progn
|
||||
(aggressive-indent-mode)
|
||||
(global-ede-mode)
|
||||
(semantic-mode)
|
||||
(flycheck-mode)
|
||||
(electric-pair-mode)
|
||||
(electric-indent-mode)
|
||||
(solaire-mode)
|
||||
(rainbow-blocks-mode)
|
||||
(rainbow-mode)
|
||||
(goggles-mode)
|
||||
(focus-mode)
|
||||
(show-paren-mode)
|
||||
(mapcar 'set-on '(display-line-numbers))))
|
||||
|
||||
(add-hook 'prog-mode-hook 'proghook)
|
||||
|
||||
;; Add cwarn-mode to cc-mode later on
|
||||
|
||||
(defvar chook-active 0)
|
||||
(defun chook () "Function for 'c-mode' hook."
|
||||
(progn
|
||||
(c-set-style "whitesmith")))
|
||||
(add-hook 'c-mode-hook 'chook)
|
||||
|
||||
(defvar texthook-active 0)
|
||||
(add-hook 'text-mode-hook 'texthook)
|
||||
|
||||
(defun texthook () "Function for 'text-mode' hook."
|
||||
(progn
|
||||
(variable-pitch-mode 1)
|
||||
(solaire-mode 1)
|
||||
(goggles-mode 1)
|
||||
(focus-mode 1)))
|
||||
|
||||
(add-hook 'text-mode-hook 'texthook)
|
||||
|
||||
|
||||
;; The rest of the init file.
|
||||
;; Make gc pauses faster by decreasing the threshold.
|
||||
(setq gc-cons-threshold (* 2 1000 1000))
|
||||
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
||||
|
||||
(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.
|
||||
'(beacon-mode t)
|
||||
'(custom-safe-themes
|
||||
'("2f93ebb862a9d50fee9c1b3302d858e2d2c0bba9d4e1be9bb3b08b7373f1710c" default))
|
||||
'(helm-completion-style 'helm)
|
||||
'(package-selected-packages
|
||||
'(ac-geiser centered-cursor-mode golden-ratio-scroll-screen helpful indent-guide zoom-window dimmer god-mode paredit geiser-mit ctxmenu aggressive-indent-mode xpm ws-butler web-completion-data use-package srfi solarized-theme solaire-mode sly rainbow-mode rainbow-blocks powerline popwin paren-face parchment-theme names helm-slime helm-mode-manager helm-flycheck helm-eww good-scroll goggles gnuplot focus flyspell-correct-helm flymake-haskell-multi flymake flycheck-haskell flycheck-aspell eww-lnum electric-operator context-coloring clean-buffers aggressive-indent ace-window ace-link ace-jump-mode ac-slime ac-html ac-haskell-process ac-etags))
|
||||
'(quack-default-program "scheme")
|
||||
'(quack-newline-behavior 'newline)
|
||||
'(quack-programs
|
||||
'("s9" "bigloo" "csi" "csi -hygienic" "gosh" "gracket" "gsi" "gsi ~~/syntax-case.scm -" "guile" "kawa" "mit-scheme" "racket" "racket -il typed/racket" "rs" "scheme" "scheme48" "scsh" "sisc" "stklos" "sxi"))
|
||||
'(quack-run-scheme-always-prompts-p nil)
|
||||
'(quack-smart-open-paren-p nil)
|
||||
'(warning-suppress-log-types '((use-package) (comp)))
|
||||
'(warning-suppress-types '((emacs) (comp))))
|
||||
(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.
|
||||
)
|
Loading…
Reference in New Issue
Block a user