2013-10-14 08:50:56 +02:00
|
|
|
|
(require 'uniquify)
|
2013-10-19 22:44:30 +02:00
|
|
|
|
|
2013-10-17 14:17:38 +02:00
|
|
|
|
; ## Generic settings ##
|
2013-07-08 01:15:05 +02:00
|
|
|
|
|
2013-10-17 14:17:38 +02:00
|
|
|
|
; Hide those ugly tool bars
|
2014-01-30 14:26:52 +01:00
|
|
|
|
(tool-bar-mode 0)
|
|
|
|
|
(scroll-bar-mode 0)
|
2017-07-30 18:30:04 +02:00
|
|
|
|
(menu-bar-mode 0)
|
2014-01-30 14:26:52 +01:00
|
|
|
|
|
2014-02-09 11:12:51 +01:00
|
|
|
|
(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)
|
|
|
|
|
|
2014-01-30 14:26:52 +01:00
|
|
|
|
;; Go away go away
|
|
|
|
|
(setq initial-scratch-message "")
|
2013-07-08 01:15:05 +02:00
|
|
|
|
|
2013-08-03 15:36:05 +02:00
|
|
|
|
(flx-ido-mode 1)
|
|
|
|
|
(setq ido-use-faces nil)
|
|
|
|
|
(setq gc-cons-threshold 20000000)
|
|
|
|
|
|
2013-10-14 08:50:56 +02:00
|
|
|
|
(setq uniquify-buffer-name-style 'forward)
|
|
|
|
|
|
2015-02-20 11:45:37 +01:00
|
|
|
|
;; Give me column numbers
|
|
|
|
|
(column-number-mode t)
|
|
|
|
|
|
2015-05-03 18:22:58 +02:00
|
|
|
|
;; Bash is the reliable one here
|
|
|
|
|
(setq multi-term-program "/bin/bash")
|
|
|
|
|
|
2015-05-21 12:03:46 +02:00
|
|
|
|
;; Use the GPG-provided SSH agent
|
|
|
|
|
(setenv "SSH_AUTH_SOCK" (concat (getenv "HOME") "/.gnupg/S.gpg-agent.ssh"))
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
2013-07-14 23:51:01 +02:00
|
|
|
|
(add-to-list 'exec-path "/usr/local/bin")
|
2013-07-21 01:23:03 +02:00
|
|
|
|
(add-to-list 'exec-path (expand-file-name "~/bin"))
|
2015-12-14 00:04:29 +01:00
|
|
|
|
;; Stack installs here:
|
|
|
|
|
(add-to-list 'exec-path (expand-file-name "~/.local/bin"))
|
2013-07-29 00:53:08 +02:00
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
(when window-system
|
|
|
|
|
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
|
|
|
|
(tooltip-mode -1)
|
|
|
|
|
(mouse-wheel-mode t)
|
|
|
|
|
(blink-cursor-mode -1))
|
|
|
|
|
|
2013-10-17 14:17:38 +02:00
|
|
|
|
; Fix some defaults
|
2014-02-01 21:20:10 +01:00
|
|
|
|
(setq visible-bell nil
|
2013-07-08 01:15:05 +02:00
|
|
|
|
inhibit-startup-message t
|
|
|
|
|
color-theme-is-global t
|
|
|
|
|
sentence-end-double-space nil
|
|
|
|
|
shift-select-mode nil
|
|
|
|
|
mouse-yank-at-point t
|
|
|
|
|
uniquify-buffer-name-style 'forward
|
|
|
|
|
whitespace-style '(face trailing lines-tail tabs)
|
|
|
|
|
whitespace-line-column 80
|
2013-10-20 20:05:13 +02:00
|
|
|
|
default-directory "~"
|
2013-08-05 16:18:56 +02:00
|
|
|
|
fill-column 80
|
2013-07-08 01:15:05 +02:00
|
|
|
|
ediff-window-setup-function 'ediff-setup-windows-plain
|
2013-08-05 16:18:56 +02:00
|
|
|
|
ediff-diff-options "-w"
|
|
|
|
|
ediff-split-window-function 'split-window-horizontally
|
2013-07-08 01:15:05 +02:00
|
|
|
|
oddmuse-directory (concat user-emacs-directory "oddmuse")
|
|
|
|
|
save-place-file (concat user-emacs-directory "places")
|
2014-02-09 11:12:51 +01:00
|
|
|
|
backup-directory-alist `((,(concat user-emacs-directory "backups")))
|
2013-07-08 01:15:05 +02:00
|
|
|
|
diff-switches "-u")
|
|
|
|
|
|
2014-01-30 14:26:52 +01:00
|
|
|
|
;; Fix keys on Linux
|
|
|
|
|
(if is-linux
|
|
|
|
|
(setq x-super-keysym 'meta
|
|
|
|
|
x-alt-keysym 'alt))
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
(setq smex-save-file (concat user-emacs-directory ".smex-items"))
|
2014-01-07 14:54:32 +01:00
|
|
|
|
(setq smex-key-advice-ignore-menu-bar t)
|
2013-07-08 01:15:05 +02:00
|
|
|
|
(smex-initialize)
|
|
|
|
|
(global-set-key (kbd "M-x") 'smex)
|
|
|
|
|
|
|
|
|
|
(add-to-list 'safe-local-variable-values '(lexical-binding . t))
|
|
|
|
|
(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80))
|
|
|
|
|
|
2013-08-07 00:49:20 +02:00
|
|
|
|
(set-default 'indent-tabs-mode nil)
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
;; ido-mode is like magic pixie dust!
|
|
|
|
|
(ido-mode t)
|
2017-07-30 18:28:03 +02:00
|
|
|
|
|
|
|
|
|
;; ido-completing-read+ enables ido everywhere, not just for buffers and files.
|
|
|
|
|
(require 'ido-completing-read+)
|
|
|
|
|
(ido-ubiquitous-mode 1)
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
(setq ido-enable-prefix nil
|
|
|
|
|
ido-enable-flex-matching t
|
|
|
|
|
ido-auto-merge-work-directories-length nil
|
|
|
|
|
ido-create-new-buffer 'always
|
|
|
|
|
ido-use-filename-at-point 'guess
|
|
|
|
|
ido-use-virtual-buffers t
|
|
|
|
|
ido-handle-duplicate-virtual-buffers 2
|
|
|
|
|
ido-max-prospects 10)
|
|
|
|
|
|
|
|
|
|
;; Swedish!
|
|
|
|
|
(set-language-environment 'Swedish)
|
|
|
|
|
|
2013-08-05 16:18:56 +02:00
|
|
|
|
;; UTF-8 please
|
|
|
|
|
(setq locale-coding-system 'utf-8) ; pretty
|
|
|
|
|
(set-terminal-coding-system 'utf-8) ; pretty
|
|
|
|
|
(set-keyboard-coding-system 'utf-8) ; pretty
|
|
|
|
|
(set-selection-coding-system 'utf-8) ; please
|
|
|
|
|
(prefer-coding-system 'utf-8) ; with sugar on top
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
(require 'ffap)
|
|
|
|
|
|
|
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
|
|
|
(defalias 'auto-tail-revert-mode 'tail-mode)
|
|
|
|
|
|
|
|
|
|
;; ## Look and feel ##
|
|
|
|
|
|
2017-07-30 18:30:04 +02:00
|
|
|
|
;; Themes!
|
2013-07-08 01:52:03 +02:00
|
|
|
|
(global-hl-line-mode -1)
|
|
|
|
|
|
2014-02-03 15:55:19 +01:00
|
|
|
|
(setq default-frame-alist '((font-backend . "xft")
|
|
|
|
|
(font . "Source Code Pro-12")))
|
|
|
|
|
|
|
|
|
|
(set-default-font "Source Code Pro 12")
|
2013-07-09 14:04:58 +02:00
|
|
|
|
|
2013-08-17 20:43:05 +02:00
|
|
|
|
;; Style line numbers (shown with M-g g)
|
2013-10-17 14:17:38 +02:00
|
|
|
|
(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)))
|
2013-07-08 01:15:05 +02:00
|
|
|
|
|
|
|
|
|
;; Use clipboard properly
|
|
|
|
|
(setq x-select-enable-clipboard t)
|
|
|
|
|
|
2013-08-05 16:18:56 +02:00
|
|
|
|
;; 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)
|
|
|
|
|
(delete-selection-mode 1)
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
;; ## Navigation and key bindings ##
|
|
|
|
|
|
|
|
|
|
(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)
|
|
|
|
|
|
2017-07-30 18:30:04 +02:00
|
|
|
|
;; Quick jump back
|
2013-07-08 01:15:05 +02:00
|
|
|
|
(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)
|
|
|
|
|
|
2013-07-29 00:53:08 +02:00
|
|
|
|
;; Keep your backup files in tmp, emacs!
|
|
|
|
|
(setq backup-directory-alist
|
|
|
|
|
`((".*" . ,temporary-file-directory)))
|
|
|
|
|
(setq auto-save-file-name-transforms
|
|
|
|
|
`((".*" ,temporary-file-directory t)))
|
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
|
;; 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)
|
2013-08-07 00:49:20 +02:00
|
|
|
|
|
2014-10-21 19:11:09 +02:00
|
|
|
|
;; Display tabs as 4 spaces
|
|
|
|
|
(setq default-tab-width 4)
|
|
|
|
|
|
2014-05-30 20:02:53 +02:00
|
|
|
|
;; Set up Java home & path
|
2014-10-21 19:11:09 +02:00
|
|
|
|
(setenv "JAVA_HOME" "/usr/lib/jvm/default")
|
|
|
|
|
|
|
|
|
|
;; Use CUPS
|
|
|
|
|
(setq lpr-command "xpp")
|
|
|
|
|
|
2015-12-14 00:04:29 +01:00
|
|
|
|
;; Allow same window in two frames
|
|
|
|
|
(setq ido-default-buffer-method 'selected-window)
|
2014-05-30 20:02:53 +02:00
|
|
|
|
|
2014-10-21 19:37:19 +02:00
|
|
|
|
(provide 'settings)
|