~edwargix/emacs.d

4cc885ddfea114116a3fe5f09a7fe406f3997642 — David Florness 7 years ago 3b5db0d
Cleanup lisp code
M init.el => init.el +27 -4
@@ 12,6 12,7 @@

(load-file "~/.emacs.d/lisp/setup-packages.el")


(require 'setup-keys)
(require 'setup-appearance)
(require 'setup-dev)


@@ 21,6 22,7 @@
(require 'setup-python)
(require 'setup-treemacs)


(use-package dashboard
  :init
  (add-hook 'after-init-hook 'dashboard-refresh-buffer)


@@ 33,18 35,21 @@
  (setq dashboard-startup-banner 'logo)
  (dashboard-setup-startup-hook))


;;; Winner mode: allows for undoing and redoing of windoow configurations
;;; C-c <left> : undo
;;; C-c <right>: redo
(winner-mode t)


;;; Allow easily switching windows with Shift-{left,right,up,down}
(windmove-default-keybindings)


;;; Don't make backup files
(setq make-backup-files nil)

;;; Markdown mode

(use-package markdown-mode
  :ensure t
  :commands (markdown-mode gfm-mode)


@@ 53,6 58,8 @@
         ("\\.markdown\\'" . markdown-mode))
  :init (setq markdown-command "multimarkdown"))


;;; a minor mode for dealing with pairs
(use-package smartparens
  :ensure t
  :config


@@ 60,14 67,16 @@
    (require 'smartparens-config)
    (smartparens-global-mode t)))

;;; Magit: a Git Porcelain inside Emacs

;;; magit: a Git Porcelain
(use-package magit
  :ensure t
  :bind
  (("C-x g" . magit-status)
   ("C-x M-g" . magit-dispatch-popup)))

;;; Syntax/error checking for GNU Emacs

;;; Syntax/error checking
(use-package flycheck
  :ensure t
  :init


@@ 76,6 85,7 @@
    (evil-define-key 'normal
      flycheck-error-list-mode-map (kbd "q") 'quit-window)))


;;; Quickhelp (documentation lookup) for company
(use-package company-quickhelp
  :ensure t


@@ 85,16 95,19 @@
    (setq company-quickhelp-idle-delay 1)
    (company-quickhelp-mode 1)))


;;; Yasnippet: yet another snippet extension
(use-package yasnippet
  :ensure t
  :config
  (yas-global-mode 1))


(use-package yasnippet-snippets
  :ensure t
  :after yasnippet)


;;; Setup duckduckgo search engine
(use-package engine-mode
  :ensure t


@@ 104,6 117,7 @@
    :keybinding "d")
  (engine-mode))


;;; Org mode for keeping notes, todo lists, planning, and fast
;;; documenting
(use-package org


@@ 142,6 156,7 @@
       (org . t)
       (gnuplot . t)))))


;;; UTF-8 bullets for org-mode
(use-package org-bullets
  :ensure t


@@ 150,6 165,7 @@
  (progn
    (add-hook 'org-mode-hook 'org-bullets-mode)))


(use-package org-contacts
  :after org
  :config


@@ 173,27 189,32 @@
  (which-key-mode))


;;; functions to manage packages on linux distros
(use-package system-packages
  :ensure t)


;;; mu4e email client
;;; setup the mu4e email client
(when (file-exists-p "~/scripts/setup-mu4e.el")
  (load-file "~/scripts/setup-mu4e.el"))


;;; statistics software and R-lang integration
(use-package ess
  :ensure t)


;;; TeX/LaTeX
(use-package tex
  :ensure auctex)


;;; ability to insert random text
(use-package lorem-ipsum
  :ensure t)


;;; number windows to easily switch between them
(use-package winum
  :ensure t
  :config


@@ 206,11 227,13 @@
  (add-to-list 'load-path d t))
(add-to-list 'Info-directory-list "~/.local/share/info/")


;;; Start Emacs Daemon
(require 'server)
(unless (server-running-p)
  (server-start))


(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.

M lisp/setup-appearance.el => lisp/setup-appearance.el +18 -0
@@ 6,9 6,11 @@

;;; Code:


;;; Change frame title
(setq frame-title-format "emacs")


;;; Font
(set-frame-font
 (font-spec


@@ 18,33 20,43 @@
  :width 'normal)
 nil t)


;;; Disable menu bar
(menu-bar-mode 0)


;;; Disable scroll bar
(scroll-bar-mode 0)


;;; Disable tool bar
(tool-bar-mode 0)


;;; Turn off cursor blinking
(blink-cursor-mode 0)


;;; Show column number next to line number in mode line
(column-number-mode)


;;; Highlight parentheses
(show-paren-mode)


;;; Highlight stuff with M-s h
(global-hi-lock-mode 1)


;;; Move mouse if it gets in the way of the cursor
(mouse-avoidance-mode 'animate)


;;; Spell check in comments and strings
(flyspell-prog-mode)


;;; Custom themes
;; Default theme
(unless (package-installed-p 'monokai-theme)


@@ 52,18 64,24 @@
(load-theme 'monokai t t)
(when (display-graphic-p)
  (enable-theme 'monokai))


;; Alternate theme (bright)
(unless (package-installed-p 'leuven-theme)
  (package-install 'leuven-theme))
(load-theme 'leuven t t)


;; Theme for late-at-night
(unless (package-installed-p 'solarized-theme)
  (package-install 'solarized-theme))
(load-theme 'solarized-dark t t)


(use-package pretty-mode
  :ensure t
  :hook ((emacs-lisp-mode python) . turn-on-pretty-mode))


(provide 'setup-appearance)
;;; setup-appearance.el ends here

M lisp/setup-defaults.el => lisp/setup-defaults.el +2 -0
@@ 6,7 6,9 @@

;;; Code:


(setq-default fill-column 80)


(provide 'setup-defaults)
;;; setup-defaults.el ends here

M lisp/setup-dev.el => lisp/setup-dev.el +0 -1
@@ 26,7 26,6 @@
(setq
 ;; use gdb-many-windows by default
 gdb-many-windows t

 ;; Non-nil means display source file contatining the main routine at startup
 gdb-show-main t)


M lisp/setup-helm.el => lisp/setup-helm.el +1 -0
@@ 91,6 91,7 @@
    (evil-define-key 'normal helm-gtags-mode-map (kbd "C-c >")
      'helm-gtags-next-history)))


;;; Helm extension for projectile
(use-package helm-projectile
  :ensure t

M lisp/setup-keys.el => lisp/setup-keys.el +1 -1
@@ 67,11 67,11 @@
;;; I don't always know where my frames are, and I want a way to kill
;;; Emacs 100% of the time
(global-set-key (kbd "C-x C-c") 'save-buffers-kill-emacs)

(global-set-key (kbd "<f9>") (lambda () (interactive)
                               (kill-buffer)
                               (delete-window)))


(use-package evil-matchit
  :ensure t
  :init

M lisp/setup-lisp.el => lisp/setup-lisp.el +3 -2
@@ 14,8 14,9 @@
    (dolist (map `(,emacs-lisp-mode-map
                   ;; ,ielm-map
                   ,lisp-interaction-mode-map))
      (evil-define-key 'normal map (kbd "M-.") 'elisp-slime-nav-find-elisp-thing-at-point)
      (evil-define-key 'normal map (kbd "M-,") 'pop-tag-mark))))
      (with-eval-after-load 'evil
        (evil-define-key 'normal map (kbd "M-.") 'elisp-slime-nav-find-elisp-thing-at-point)
        (evil-define-key 'normal map (kbd "M-,") 'pop-tag-mark)))))


(use-package auto-compile

M lisp/setup-packages.el => lisp/setup-packages.el +13 -7
@@ 6,33 6,39 @@

;;; Code:


(require 'package)
(require 'tls)


(setq tls-checktrust t)


(setq-default package-archives '(("gnu" . "https://elpa.gnu.org/packages/")))

;;; Add melpa archive

;;; Add org and melpa package archives
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                  (not (gnutls-available-p))))
       (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
  (add-to-list 'package-archives (cons "melpa" url) t))
                    (not (gnutls-available-p))))
       (melpa-url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))
       (org-url (concat (if no-ssl "http" "https") "://orgmode.org/elpa/")))
  (add-to-list 'package-archives (cons "melpa" melpa-url))
  (add-to-list 'package-archives (cons "org" org-url)))

;;; Add org archive
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)

;;; Load and activate lisp packages
(package-initialize)


;;; Fetch the list of available packages
(unless package-archive-contents
  (package-refresh-contents))


;;; Install use-package for easy package configuration
(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(require 'use-package)

(require 'use-package)
;;; setup-packages.el ends here