;; -*- lexical-binding: t; -*- (use-package emacs :config ;; Set all unicode (set-charset-priority 'unicode) (setq locale-coding-system 'utf-8 coding-system-for-read 'utf-8 coding-system-for-write 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (prefer-coding-system 'utf-8) (setq default-process-coding-system '(utf-8-unix . utf-8-unix)) ;; indent (setq-default indent-tabs-mode nil) (setq-default tab-width 4) ;; Newline at the end of file (setq require-final-newline t) ;; delete the selection with a keypress (delete-selection-mode t) (global-auto-revert-mode t) (global-hl-line-mode 1) (global-subword-mode t) (add-hook 'prog-mode-hook (lambda () (modify-syntax-entry ?_ "_"))) ;; store all backup and autosave files in the tmp dir (setq backup-directory-alist `((".*" . ,temporary-file-directory))) (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))) ;; meaningful names for buffers with the same name (use-package uniquify :config (setq uniquify-buffer-name-style 'forward) (setq uniquify-separator "/") (setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified (setq uniquify-ignore-buffers-re "^\\*")) ; don't muck with special buffers ;; saveplace remembers your location in a file when saving files (setq save-place-file (expand-file-name "saveplace" savefile-dir)) ;; activate it for all buffers (save-place-mode 1) ;; savehist keeps track of some history (use-package savehist :config (setq savehist-additional-variables ;; search entries '(search-ring regexp-search-ring) ;; save every minute savehist-autosave-interval 60 ;; keep the home clean savehist-file (expand-file-name "savehist" savefile-dir)) (savehist-mode +1)) (use-package diminish :ensure t) (use-package smartparens :ensure t :defer nil :bind (:map smartparens-mode-map ("C-" . sp-forward-slurp-sexp) ("C-" . sp-forward-barf-sexp) ("C-M-" . sp-backward-slurp-sexp) ("C-M-" . sp-backward-barf-sexp)) :config (require 'smartparens-config) (smartparens-global-mode t) (show-smartparens-global-mode t) (setq sp-base-key-bindings 'paredit) (setq sp-autoskip-closing-pair 'always) (setq sp-hybrid-kill-entire-symbol nil) (setq blink-matching-paren nil)) (use-package easy-kill :ensure t :bind (([remap kill-ring-save] . easy-kill) ([remap mark-sexp] . easy-mark))) (use-package whitespace-cleanup-mode :ensure t :config (global-whitespace-cleanup-mode t)) (use-package whitespace :hook (text-mode prog-mode) :config (setq whitespace-line-column 80) ;; limit line length (setq whitespace-style '(face tabs empty trailing lines-tail))) (use-package super-save :ensure t :config (super-save-mode +1) (setq super-save-auto-save-when-idle t)) (use-package volatile-highlights :ensure t :diminish t :config (volatile-highlights-mode t)) (use-package crux :ensure t :bind (([remap move-beginning-of-line] . crux-move-beginning-of-line) ("C-c o" . crux-open-with) ("C-" . crux-kill-line-backwards) ([remap kill-whole-line] . crux-kill-whole-line)) :config (crux-with-region-or-line kill-region)) ;; nfkjbndfkb kdjbnkfjb (use-package flyspell :hook ((text-mode . flyspell-mode) (prog-mode . flyspell-prog-mode)) :config (setq ispell-program-name "aspell") (setq ispell-dictionary "british")) (use-package flycheck :ensure t :bind (("C-c C-e" . flycheck-list-errors)) :init (global-flycheck-mode)) (use-package midnight) (use-package diff-hl :ensure t :defer nil :diminish :hook ((dired-mode . diff-hl-dired-mode) (magit-post-refresh . diff-hl-magit-post-refresh)) :config (global-diff-hl-mode +1))