   :init
   (setq woman-use-topic-at-point t                          ; man page on word at point if exists
         Man-notify-method 'aggressive)                      ; show&select man page in other window
+  :general
+    ("<f4> m" #'woman)
   :config
   (set-face-attribute 'Man-overstrike nil :inherit font-lock-type-face :bold t)
   (set-face-attribute 'Man-underline nil :inherit font-lock-keyword-face :underline t))

    (if (member "DejaVu Sans Mono" (font-family-list))
        (set-frame-font "DejaVu Sans Mono-11" t t))))

(tool-bar-mode 0)                                           ; no tool bar
(scroll-bar-mode 0)                                         ; no scroll bar
(menu-bar-mode 0)                                           ; no menu bar
(mouse-avoidance-mode 'animate)                             ; move mouse pointer out of way
(column-number-mode t)                                      ; display column/row of cursor in mode-line
(global-hl-line-mode t)                                     ; highlight current line
(global-eldoc-mode -1)                                      ; turn off annoying eldoc mode
(fset 'yes-or-no-p 'y-or-n-p)                               ; change stupid default y/n? y
(make-directory me:emacs-backup-directory t)                ; make sure backup dir exists
(global-auto-revert-mode t)                                 ; revert unchanged files automatically
(electric-indent-mode +1)                                   ; turn on electric mode globally
(global-visual-line-mode t)                                 ; wrap long lines
(savehist-mode t)                                           ; save minibuffer history
(winner-mode t)                                             ; enable winner mode
(minibuffer-depth-indicate-mode t)                          ; show recursive edit depth
(run-at-time "1 hour" 3600 #'clean-buffer-list)             ; clear out old buffers every hour

(global-unset-key (kbd "<f3>"))
(global-unset-key (kbd "<f4>"))
(global-unset-key (kbd "<f10>"))                            ; was menu-bar-open
(global-unset-key (kbd "<f11>"))                            ; was fullscreen mode

;; frequently used functions
(use-package utilities
  :ensure nil
  :commands (me:set-extra-font-attributes
             me:select-nth-other-buffer
             me:select-2nd-other-buffer
             me:select-3rd-other-buffer
             me:select-4th-other-buffer
             me:select-5th-other-buffer
             me:find-some-files
             me:save-dirty-buffers )
  :config
  :load-path "lisp/")


;; infrequently used functions
(use-package extras
  :ensure nil
  :commands (me:find-other-file
             me:rotate-fill-column
             me:ps-one-per-page
             me:ps-two-per-page
             me:next-powerline-separator)
  :config
  :load-path "lisp/")


;; keymappings
(use-package general
  :config
  (general-evil-setup t)
  ;; Top level keymaps
  (general-define-key
    "<f2>"       #'ivy-switch-buffer
    "<f3>"       #'me:find-some-files
    "C-x b"      #'ivy-switch-buffer
    "C-h b"      #'counsel-descbinds
    "M-x"        #'counsel-M-x
    "s-1"        #'me:find-other-file
    "s-2"        #'me:select-2nd-other-buffer
    "s-3"        #'me:select-3rd-other-buffer
    "s-4"        #'me:select-4th-other-buffer
    "s-5"        #'me:select-5th-other-buffer
    "s-c"        #'me:rotate-fill-column
    "s-d"        #'company-complete
    "s-f"        #'flyspell-auto-correct-previous-word
    "s-S-f"      #'flyspell-correct-previous-word-generic
    "s-h"        #'git-gutter+-next-hunk
    "s-S-h"      #'git-gutter+-previous-hunk
    "s-s"        #'git-gutter+-stage-hunks
    "s-o"        #'git-gutter+-show-hunk-inline-at-point
    "s-]"        #'winner-redo
    "s-["        #'winner-undo
    "s-;"        #'rtags-location-stack-forward
    "s-,"        #'rtags-location-stack-back
    "s-`"        #'previous-buffer
    "s-\\"       #'me:next-powerline-separator
    "s-j"        (kbd "C-u 1 C-x `")
    "s-k"        (kbd "C-u -1 C-x `")
    "s-w"        #'ace-window
    "s-<right>"  #'persp-next
    "s-<left>"   #'persp-prev
    "<s-return>" #'yas-expand
    "<s-tab>"    #'next-buffer)

  (general-define-key
   :states '(normal visual emacs)
   :prefix "<SPC>"
    "<SPC>"      #'me:switch-to-previous-buffer
    ";"          #'evil-jump-forward
    ","          #'evil-jump-backward
    "a"          #'align
    "c"          #'me:use-evil-clipboard-register
    "e"          #'pp-eval-last-sexp
    "f"          #'evil-avy-goto-word-1
    "g"          #'evil-avy-goto-char-2
    "l"          #'evil-avy-goto-char-in-line
    "m"          #'projectile-compile-project
    "o"          #'me:switch-to-compile-buffer
    "r"          #'recompile
    "s"          #'me:use-evil-selection-register
    "v"          '(:ignore t :which-key "Multiple Cursors")
    "va"         #'evil-mc-make-all-cursors
    "vv"         #'evil-mc-make-and-goto-next-match
    "vs"         #'evil-mc-skip-and-goto-next-match
    "vx"         #'evil-mc-undo-all-cursors
    "v."         #'evil-mc-make-cursor-here
    "vp"         #'evil-mc-pause-cursors
    "vr"         #'evil-mc-resume-cursors
    "w"          #'save-buffer
    "x"          #'exchange-point-and-mark
    "<DEL>"      #'kill-this-buffer)

  ;; F4
  (general-define-key
   :prefix "<f4>"
    "a"     #'counsel-apropos
    "b"     #'counsel-mark-ring
    "d"     #'dired-jump
    "f"     #'counsel-git-grep
    "g"     #'general-describe-keybindings
    "i"     #'counsel-info-lookup-symbol
    "j"     #'counsel-bookmark
    "k"     #'counsel-descbinds
    "l"     #'counsel-locate
    "n"     #'deft
    "m"     #'woman
    "p"     #'paradox-list-packages
    "r"     #'counsel-recentf
    "s"     #'counsel-ag
    "t"     #'shell-pop
    "u"     #'counsel-unicode-char
    "v"     #'undo-tree-visualize
    "y"     #'counsel-yank-pop
    "/"     #'treemacs-toggle
    "<f4>"  #'ivy-resume)

  ;; F5
  (general-define-key
   :prefix "<f5>"
    "t"      #'counsel-load-theme
    "f"      #'toggle-frame-fullscreen
    "h"      #'global-hl-line-mode
    "l"      #'linum-relative-mode
    "m"      #'menu-bar-mode
    "r"      #'ruler-mode
    "-"      #'text-scale-adjust
    "="      #'text-scale-adjust
    "<f5>"   #'menu-bar-open)

  ;; F6
  (general-define-key
   :prefix "<f6>"
    "c"     #'rtags-rename-symbol
    "d"     #'me:tags-find-symbol
    "f"     #'me:tags-find-file
    "i"     #'rtags-find-functions-called-by-this-function
    "m"     #'counsel-imenu
    "r"     #'me:tags-find-references-at-point
    "v"     #'rtags-find-virtuals-at-point
    "<RET>"  #'rtags-create-doxygen-comment
    "<f6>"  #'me:tags-find-symbol-at-point)

  ;; F7
  (general-define-key
   :prefix "<f7>"
    "f"     #'counsel-projectile-find-file
    "k"     #'projectile-kill-buffers
    "o"     #'projectile-multi-occur
    "r"     #'persp-rename
    "u"     #'projectile-invalidate-cache
    "/"     #'treemacs-projectile
    "<f7>"  #'projectile-persp-switch-project)

  ;; F8
  (general-define-key
   :prefix "<f8>"
   "v"      #'evil-window-split
   "h"      #'evil-window-vsplit
   "o"      #'delete-other-windows
   "x"      #'evil-window-delete
   "d"      #'evil-window-rotate-downwards
   "u"      #'evil-window-rotate-upwards
   "r"      #'windresize
   "1"      #'me:ps-one-per-page
   "2"      #'me:ps-two-per-page
   "<f8>"  #'delete-other-windows)

  ;; F9
  (general-define-key
   :prefix "<f9>"
    "b"     #'magit-blame
    "B"     #'magit-run-git-gui-blame
    "c"     #'magit-commit
    "a"     #'magit-commit-amend
    "i"     #'git-gutter+-show-hunk
    "l"     #'magit-log-current
    "<f9>"  #'magit-status)

  ;; Minibuffer keybindings
  (general-define-key
   :keymap minibuffer-local-map
   :prefix "C-c"
   "e" #'miniedit)

  :demand)

(use-package emacs-lisp-mode
  :ensure nil
  :init

  :init
  (setq avy-all-windows 'all-frames))

(use-package evil
  :commands evil-mode
  :init
