refactor: Remove lots of deprecated/unused settings
* move all look-and-feel related settings into, you guessed it, look-and-feel.el * remove *lots* of old stuff and also re-evaluate what it's actually doing.
This commit is contained in:
parent
99d9981dd9
commit
0d5bdbd7ce
5 changed files with 9 additions and 193 deletions
4
init.el
4
init.el
|
@ -10,6 +10,7 @@
|
||||||
;; will have precedence.
|
;; will have precedence.
|
||||||
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
|
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
|
||||||
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
|
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
|
||||||
|
(package-initialize)
|
||||||
|
|
||||||
;; This variable controls all packages that should be installed.
|
;; This variable controls all packages that should be installed.
|
||||||
(setq-local desired-packages
|
(setq-local desired-packages
|
||||||
|
@ -35,7 +36,6 @@
|
||||||
helm
|
helm
|
||||||
hi2
|
hi2
|
||||||
idle-highlight-mode
|
idle-highlight-mode
|
||||||
iy-go-to-char
|
|
||||||
magit
|
magit
|
||||||
markdown-mode+
|
markdown-mode+
|
||||||
multi-term
|
multi-term
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
;; Emacs will automatically initialise all installed packages.
|
;; Emacs will automatically initialise all installed packages.
|
||||||
;; After initialisation, proceed to load configuration that requires packages:
|
;; After initialisation, proceed to load configuration that requires packages:
|
||||||
(defun load-other-settings ()
|
(defun load-other-settings ()
|
||||||
(mapc 'require '(theme
|
(mapc 'require '(look-and-feel
|
||||||
functions
|
functions
|
||||||
settings
|
settings
|
||||||
modes
|
modes
|
||||||
|
|
|
@ -12,16 +12,10 @@
|
||||||
(global-set-key (kbd "C-M-r") 'isearch-backward)
|
(global-set-key (kbd "C-M-r") 'isearch-backward)
|
||||||
(global-set-key (kbd "C-M-%") 'query-replace)
|
(global-set-key (kbd "C-M-%") 'query-replace)
|
||||||
|
|
||||||
;; Jump to a definition in the current file. (Protip: this is awesome.)
|
|
||||||
(global-set-key (kbd "C-x C-i") 'imenu)
|
|
||||||
|
|
||||||
;; Ace-jump-mode
|
;; Ace-jump-mode
|
||||||
(global-set-key (kbd "M-j") 'ace-jump-word-mode)
|
(global-set-key (kbd "M-j") 'ace-jump-word-mode)
|
||||||
(global-set-key (kbd "M-p") 'ace-jump-mode-pop-mark)
|
(global-set-key (kbd "M-p") 'ace-jump-mode-pop-mark)
|
||||||
|
|
||||||
;; Jump to next occurence of char
|
|
||||||
(global-set-key (kbd "C-c f") 'iy-go-to-char)
|
|
||||||
|
|
||||||
;; Window switching. (C-x o goes to the next window)
|
;; Window switching. (C-x o goes to the next window)
|
||||||
(windmove-default-keybindings) ;; Shift+direction
|
(windmove-default-keybindings) ;; Shift+direction
|
||||||
|
|
||||||
|
@ -31,13 +25,7 @@
|
||||||
;; Start a new eshell even if one is active.
|
;; Start a new eshell even if one is active.
|
||||||
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))
|
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))
|
||||||
|
|
||||||
;; Eval sexp and replace it with result
|
;; Magit!
|
||||||
(global-set-key (kbd "C-c e") 'replace-last-sexp)
|
|
||||||
|
|
||||||
;; Start a regular shell if you prefer that.
|
|
||||||
(global-set-key (kbd "C-x C-m") 'shell)
|
|
||||||
|
|
||||||
;; So good!
|
|
||||||
(global-set-key (kbd "C-c g") 'magit-status)
|
(global-set-key (kbd "C-c g") 'magit-status)
|
||||||
|
|
||||||
;; Replace standard goto-line with ace-jump-line-mode
|
;; Replace standard goto-line with ace-jump-line-mode
|
||||||
|
@ -53,15 +41,6 @@
|
||||||
(global-set-key (kbd "C-x r q") 'save-buffers-kill-terminal)
|
(global-set-key (kbd "C-x r q") 'save-buffers-kill-terminal)
|
||||||
(global-set-key (kbd "C-x C-c") 'delete-frame)
|
(global-set-key (kbd "C-x C-c") 'delete-frame)
|
||||||
|
|
||||||
;; Create new frame
|
|
||||||
(define-key global-map (kbd "C-x C-n") 'make-frame-command)
|
|
||||||
|
|
||||||
;; Recompile easily
|
|
||||||
(define-key prog-mode-map (kbd "C-c r") 'recompile)
|
|
||||||
|
|
||||||
;; Org-mode agenda keys
|
|
||||||
(global-set-key (kbd "C-c a") 'org-agenda)
|
|
||||||
|
|
||||||
;; Open Fefes Blog
|
;; Open Fefes Blog
|
||||||
(global-set-key (kbd "C-c C-f") 'fefes-blog)
|
(global-set-key (kbd "C-c C-f") 'fefes-blog)
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,7 @@
|
||||||
;; Hide banner message ...
|
;; Hide banner message ...
|
||||||
(setq eshell-banner-message "")
|
(setq eshell-banner-message "")
|
||||||
|
|
||||||
(defun eshell-mode-hook-setup ()
|
|
||||||
"Sets up EShell when it is loaded"
|
|
||||||
(setq eshell-path-env (concat
|
|
||||||
"/usr/local/bin:"
|
|
||||||
(concat home-dir "/bin:")
|
|
||||||
"/usr/local/share/python:"
|
|
||||||
"/opt/java/bin"
|
|
||||||
eshell-path-env))
|
|
||||||
|
|
||||||
(setenv "PATH" eshell-path-env))
|
|
||||||
|
|
||||||
(add-hook 'eshell-mode-hook 'eshell-mode-hook-setup)
|
|
||||||
|
|
||||||
;; Prompt configuration
|
;; Prompt configuration
|
||||||
|
|
||||||
(defun clean-pwd (path)
|
(defun clean-pwd (path)
|
||||||
"Turns a path of the form /foo/bar/baz into /f/b/baz
|
"Turns a path of the form /foo/bar/baz into /f/b/baz
|
||||||
(inspired by fish shell)"
|
(inspired by fish shell)"
|
||||||
|
@ -49,10 +35,9 @@
|
||||||
`(propertize ,str 'face (list ,@properties)))
|
`(propertize ,str 'face (list ,@properties)))
|
||||||
|
|
||||||
(defun prompt-f ()
|
(defun prompt-f ()
|
||||||
"My EShell prompt displaying VC info and such"
|
"EShell prompt displaying VC info and such"
|
||||||
(concat
|
(concat
|
||||||
(with-face (concat (clean-pwd (eshell/pwd)) " ") :foreground "#96a6c8")
|
(with-face (concat (clean-pwd (eshell/pwd)) " ") :foreground "#96a6c8")
|
||||||
;(with-face (vcprompt " -f \"(%s:%b%a%m) \"") :foreground "#5f627f")
|
|
||||||
(if (= 0 (user-uid))
|
(if (= 0 (user-uid))
|
||||||
(with-face "#" :foreground "#f43841")
|
(with-face "#" :foreground "#f43841")
|
||||||
(with-face "$" :foreground "#73c936"))
|
(with-face "$" :foreground "#73c936"))
|
||||||
|
@ -80,13 +65,4 @@
|
||||||
|
|
||||||
(setq eshell-directory-name "~/.config/eshell/")
|
(setq eshell-directory-name "~/.config/eshell/")
|
||||||
|
|
||||||
;; EShell functions that come in handy
|
|
||||||
|
|
||||||
;; clear in eshell
|
|
||||||
(defun eshell/clear ()
|
|
||||||
"clear the eshell buffer."
|
|
||||||
(interactive)
|
|
||||||
(let ((inhibit-read-only t))
|
|
||||||
(erase-buffer)))
|
|
||||||
|
|
||||||
(provide 'eshell-setup)
|
(provide 'eshell-setup)
|
||||||
|
|
143
init/settings.el
143
init/settings.el
|
@ -1,7 +1,5 @@
|
||||||
(require 'uniquify)
|
(require 'uniquify)
|
||||||
|
|
||||||
; ## Generic settings ##
|
|
||||||
|
|
||||||
;; Make Helm go!
|
;; Make Helm go!
|
||||||
(require 'helm-config)
|
(require 'helm-config)
|
||||||
|
|
||||||
|
@ -19,74 +17,27 @@
|
||||||
(global-set-key (kbd "C-x C-f") #'helm-find-files)
|
(global-set-key (kbd "C-x C-f") #'helm-find-files)
|
||||||
(helm-mode 1)
|
(helm-mode 1)
|
||||||
|
|
||||||
;; Hide those ugly tool bars
|
;; Move files to trash when deleting
|
||||||
(tool-bar-mode 0)
|
(setq delete-by-moving-to-trash t)
|
||||||
(scroll-bar-mode 0)
|
|
||||||
(menu-bar-mode 0)
|
|
||||||
|
|
||||||
;; Now that I have nice wallpapers, let me see them.
|
|
||||||
(set-frame-parameter (selected-frame) 'alpha '(97 . 95))
|
|
||||||
(add-to-list 'default-frame-alist '(alpha . (97 . 95)))
|
|
||||||
|
|
||||||
(defun disable-scroll-bar ()
|
|
||||||
(scroll-bar-mode 0))
|
|
||||||
|
|
||||||
; And remember to do it if I create a new frame.
|
|
||||||
(add-hook 'before-make-frame-hook 'disable-scroll-bar)
|
|
||||||
|
|
||||||
;; Don't make any noises, don't flash, just leave me alone
|
|
||||||
(setq ring-bell-function 'ignore)
|
|
||||||
|
|
||||||
;; Go away go away
|
|
||||||
(setq initial-scratch-message "")
|
|
||||||
|
|
||||||
|
;; We don't live in the 80s, but we're also not a shitty web app.
|
||||||
(setq gc-cons-threshold 20000000)
|
(setq gc-cons-threshold 20000000)
|
||||||
|
|
||||||
(setq uniquify-buffer-name-style 'forward)
|
(setq uniquify-buffer-name-style 'forward)
|
||||||
|
|
||||||
;; Give me column numbers
|
|
||||||
(column-number-mode t)
|
|
||||||
|
|
||||||
;; Bash is the reliable one here
|
|
||||||
(setq multi-term-program "/bin/bash")
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(add-to-list 'exec-path "/usr/local/bin")
|
|
||||||
(add-to-list 'exec-path (expand-file-name "~/bin"))
|
|
||||||
;; Stack installs here:
|
|
||||||
(add-to-list 'exec-path (expand-file-name "~/.local/bin"))
|
|
||||||
|
|
||||||
(when window-system
|
|
||||||
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
|
||||||
(tooltip-mode -1)
|
|
||||||
(mouse-wheel-mode t)
|
|
||||||
(blink-cursor-mode -1))
|
|
||||||
|
|
||||||
; Fix some defaults
|
; Fix some defaults
|
||||||
(setq visible-bell nil
|
(setq visible-bell nil
|
||||||
inhibit-startup-message t
|
inhibit-startup-message t
|
||||||
color-theme-is-global t
|
color-theme-is-global t
|
||||||
sentence-end-double-space nil
|
sentence-end-double-space nil
|
||||||
shift-select-mode nil
|
shift-select-mode nil
|
||||||
mouse-yank-at-point t
|
|
||||||
uniquify-buffer-name-style 'forward
|
uniquify-buffer-name-style 'forward
|
||||||
whitespace-style '(face trailing lines-tail tabs)
|
whitespace-style '(face trailing lines-tail tabs)
|
||||||
whitespace-line-column 80
|
whitespace-line-column 80
|
||||||
default-directory "~"
|
default-directory "~"
|
||||||
fill-column 80
|
fill-column 80
|
||||||
ediff-window-setup-function 'ediff-setup-windows-plain
|
|
||||||
ediff-diff-options "-w"
|
|
||||||
ediff-split-window-function 'split-window-horizontally
|
ediff-split-window-function 'split-window-horizontally
|
||||||
oddmuse-directory (concat user-emacs-directory "oddmuse")
|
backup-directory-alist `((,(concat user-emacs-directory "backups"))))
|
||||||
save-place-file (concat user-emacs-directory "places")
|
|
||||||
backup-directory-alist `((,(concat user-emacs-directory "backups")))
|
|
||||||
diff-switches "-u")
|
|
||||||
|
|
||||||
;; Fix keys on Linux
|
|
||||||
(if is-linux
|
|
||||||
(setq x-super-keysym 'meta
|
|
||||||
x-alt-keysym 'alt))
|
|
||||||
|
|
||||||
(add-to-list 'safe-local-variable-values '(lexical-binding . t))
|
(add-to-list 'safe-local-variable-values '(lexical-binding . t))
|
||||||
(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80))
|
(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80))
|
||||||
|
@ -100,97 +51,13 @@
|
||||||
(set-selection-coding-system 'utf-8) ; please
|
(set-selection-coding-system 'utf-8) ; please
|
||||||
(prefer-coding-system 'utf-8) ; with sugar on top
|
(prefer-coding-system 'utf-8) ; with sugar on top
|
||||||
|
|
||||||
(require 'ffap)
|
|
||||||
|
|
||||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
||||||
(defalias 'auto-tail-revert-mode 'tail-mode)
|
|
||||||
|
|
||||||
;; ## Look and feel ##
|
|
||||||
|
|
||||||
;; Themes!
|
|
||||||
(global-hl-line-mode -1)
|
|
||||||
|
|
||||||
(setq default-frame-alist '((font-backend . "xft")
|
|
||||||
(font . "Input Mono-12")))
|
|
||||||
|
|
||||||
(set-default-font "Input Mono 12")
|
|
||||||
|
|
||||||
;; Style line numbers (shown with M-g g)
|
|
||||||
(setq linum-format
|
|
||||||
(lambda (line)
|
|
||||||
(propertize
|
|
||||||
(format (concat " %"
|
|
||||||
(number-to-string
|
|
||||||
(length (number-to-string
|
|
||||||
(line-number-at-pos (point-max)))))
|
|
||||||
"d ")
|
|
||||||
line)
|
|
||||||
'face 'linum)))
|
|
||||||
|
|
||||||
;; Use clipboard properly
|
|
||||||
(setq x-select-enable-clipboard t)
|
|
||||||
|
|
||||||
;; Auto refresh buffers
|
|
||||||
(global-auto-revert-mode 1)
|
|
||||||
|
|
||||||
;; Also auto refresh dired, but be quiet about it
|
|
||||||
(setq global-auto-revert-non-file-buffers t)
|
|
||||||
(setq auto-revert-verbose nil)
|
|
||||||
|
|
||||||
;; Show keystrokes in progress
|
|
||||||
(setq echo-keystrokes 0.1)
|
|
||||||
|
|
||||||
;; Move files to trash when deleting
|
|
||||||
(setq delete-by-moving-to-trash t)
|
|
||||||
|
|
||||||
;; Make emacs behave sanely (overwrite selected text)
|
;; Make emacs behave sanely (overwrite selected text)
|
||||||
(delete-selection-mode 1)
|
(delete-selection-mode 1)
|
||||||
|
|
||||||
;; ## Navigation and key bindings ##
|
;; Keep your temporary files in tmp, emacs!
|
||||||
|
|
||||||
(setq windmove-wrap-around t)
|
|
||||||
|
|
||||||
;; Load ace-jump-mode
|
|
||||||
(autoload
|
|
||||||
'ace-jump-mode
|
|
||||||
"ace-jump-mode"
|
|
||||||
"Emacs quick move minor mode"
|
|
||||||
)
|
|
||||||
|
|
||||||
(define-key global-map [?] 'ace-jump-mode)
|
|
||||||
|
|
||||||
;; Quick jump back
|
|
||||||
(autoload
|
|
||||||
'ace-jump-mode-pop-mark
|
|
||||||
"ace-jump-mode"
|
|
||||||
"Ace jump back:-)"
|
|
||||||
)
|
|
||||||
|
|
||||||
(eval-after-load "ace-jump-mode"
|
|
||||||
'(ace-jump-mode-enable-mark-sync))
|
|
||||||
(define-key global-map (kbd "C-x ö") 'ace-jump-mode-pop-mark)
|
|
||||||
|
|
||||||
;; Keep your backup files in tmp, emacs!
|
|
||||||
(setq backup-directory-alist
|
|
||||||
`((".*" . ,temporary-file-directory)))
|
|
||||||
(setq auto-save-file-name-transforms
|
(setq auto-save-file-name-transforms
|
||||||
`((".*" ,temporary-file-directory t)))
|
`((".*" ,temporary-file-directory t)))
|
||||||
|
|
||||||
;; Eshell
|
|
||||||
;; Start/join
|
|
||||||
(global-set-key (kbd "C-x m") 'eshell)
|
|
||||||
;; Always start
|
|
||||||
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))
|
|
||||||
|
|
||||||
;; Git
|
|
||||||
(global-set-key (kbd "C-c g") 'magit-status)
|
|
||||||
|
|
||||||
(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
|
(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
|
||||||
|
|
||||||
;; Display tabs as 4 spaces
|
|
||||||
(setq default-tab-width 4)
|
|
||||||
|
|
||||||
;; Use CUPS
|
|
||||||
(setq lpr-command "xpp")
|
|
||||||
|
|
||||||
(provide 'settings)
|
(provide 'settings)
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
;;; theme.el --- Editor theming. -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;; Configure smart mode line
|
|
||||||
(sml/setup)
|
|
||||||
|
|
||||||
(provide 'theme)
|
|
Loading…
Reference in a new issue