My Emacs configuration

Table of Contents

1 M-x package-install

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

(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
   (quote
    ("d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
 '(package-selected-packages
   (quote
    (monokai-theme key-chord solarized-theme auto-complete which-key evil))))
(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.
 )

2 load-path

(add-to-list 'load-path "~/.emacs.d/load")

3 ace-jump

(autoload
  'ace-jump-mode
  "ace-jump-mode"
  "Emacs quick move minor mode"
  t)

4 evil-leader

(require 'evil-leader)
(global-evil-leader-mode)

5 key-chord

(key-chord-mode 1)

6 auto-complete

(ac-config-default)

7 which-key

(setq which-key-allow-evil-operators t
      which-key-show-operator-state-maps t)
(which-key-mode)

8 evil-mode

#+ENDSRC

(require 'evil)
(evil-mode 1)

9 Editing config file

(defun my/open-config-file ()
  "Opens my config file."
  (interactive)
  (find-file "~/.emacs.d/init.org"))

(defun my/build-config-file ()
  "Builds the init.org file into init.html and init.el files."
  (interactive)
  (org-babel-tangle))

10 Key bindings

10.1 key-chord

(key-chord-define evil-insert-state-map "fd" 'evil-normal-state)

10.2 evil-leader

(setq my/leader "<SPC>")
(evil-leader/set-leader my/leader)

(evil-leader/set-key "x" 'execute-extended-command)
(evil-leader/set-key "<SPC>" 'ace-jump-mode)
(evil-leader/set-key "q" 'save-buffers-kill-emacs)

(which-key-add-key-based-replacements (concat my/leader "f") "files and buffers")
(evil-leader/set-key "fo" 'find-file)
(evil-leader/set-key "fs" 'save-buffer)
(evil-leader/set-key "ff" 'switch-to-buffer)
(evil-leader/set-key "fd" 'kill-buffer)
(evil-leader/set-key "fc" 'my/open-config-file)
(evil-leader/set-key "fb" 'my/build-config-file)

(which-key-add-key-based-replacements (concat my/leader "w") "windows")
(evil-leader/set-key "wo" 'other-window)
(evil-leader/set-key "wh" 'evil-window-left)
(evil-leader/set-key "wj" 'evil-window-down)
(evil-leader/set-key "wk" 'evil-window-up)
(evil-leader/set-key "wl" 'evil-window-right)
(evil-leader/set-key "wd" 'delete-window)
(evil-leader/set-key "ww" 'delete-other-windows)

(which-key-add-key-based-replacements (concat my/leader "h") "help")
(evil-leader/set-key "hf" 'describe-function)
(evil-leader/set-key "hk" 'describe-key)
(evil-leader/set-key "hc" 'describe-key-briefly)

(which-key-add-key-based-replacements (concat my/leader "t") "folding")
(evil-leader/set-key "tt" 'hs-toggle-hiding)

11 GUI and dialogs

(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(defalias 'yes-or-no-p 'y-or-n-p)

12 Fonts

(set-face-attribute 'default nil :height 140)
(setq x-underline-at-descent-line t)

Author: Adam Bac

Emacs 25.3.1 (Org mode 8.2.10)

Validate