(doom! :completion
       (company
        +auto +tng)
       (ivy +fuzzy)

       :ui
       deft
       doom
       doom-quit
       fill-column
       hl-todo
       modeline
       nav-flash
       ophints
       (popup
        +all
        +defaults)
       vc-gutter
       vi-tilde-fringe
       window-select
       workspaces

       :editor
       (evil +everywhere)
       file-templates
       (format +onsave)
       rotate-text
       snippets

       :emacs
       (undo +tree)
       dired
       electric
       ibuffer
       vc

       :term
       eshell

       :checkers
       spell
       grammar

       :tools
       debugger
       (docker +lsp)
       editorconfig
       (eval +overlay)
       (lookup
        +docsets)
       (lsp +eglot)
       (magit +forge)
       make
       terraform
       biblio

       :lang
       (cc +lsp)
       (yaml +lsp)
       data
       emacs-lisp
       (go +lsp)
       latex
       markdown
       (org
        +roam
        +hugo
        +journal
        +gnuplot
        +pancoc
        +dragndrop
        +journal)
       plantuml
       (python +pyenv)
       rest
       rust
       (sh +lsp)

       :email
       (mu4e +gmail)

       :app
       (rss +org)

       :config
       (default +bindings +smartparens))

(doom! :completion
       (company
        +auto +tng)
       (ivy +fuzzy)

       :ui
       deft
       doom
       doom-quit
       fill-column
       hl-todo
       modeline
       nav-flash
       ophints
       (popup
        +all
        +defaults)
       vc-gutter
       vi-tilde-fringe
       window-select
       workspaces

       :editor
       (evil +everywhere)
       file-templates
       (format +onsave)
       rotate-text
       snippets

       :emacs
       (undo +tree)
       dired
       electric
       ibuffer
       vc

       :term
       eshell

       :checkers
       spell
       grammar

       :tools
       debugger
       (docker +lsp)
       editorconfig
       (eval +overlay)
       (lookup
        +docsets)
       (lsp +eglot)
       (magit +forge)
       make
       terraform
       biblio

       :lang
       (cc +lsp)
       (yaml +lsp)
       data
       emacs-lisp
       (go +lsp)
       latex
       markdown
       (org
        +roam
        +hugo
        +journal
        +gnuplot
        +pancoc
        +dragndrop
        +journal)
       plantuml
       (python +pyenv)
       rest
       (rust +eglot)
       (sh +lsp)

       :email
       (mu4e +gmail)

       :app
       (rss +org)

       :config
       (default +bindings +smartparens))

Enable eglot for Rust mode

Emacs: Enable eglot for Rust mode


((emacs-lisp-mode . ((no-byte-compile t))))

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((emacs-lisp-mode
  (no-byte-compile . t)))

Make Directory Local Variables conform to standard specifications


;; -*- lexical-binding: t -*-

(defconst my-pass-packages '(auth-source-pass password-store))

(defun my-pass/init-auth-source-pass ()
  (use-package auth-source-pass
    :after (auth-source)
    :config (auth-source-pass-enable)))

(defun my-pass/post-init-password-store ()
  (advice-add 'password-store--save-field-in-kill-ring :around
              #'my-pass//no-copy-to-clipboard))

;; -*- lexical-binding: t -*-

(defconst my-pass-packages '(password-store))

(defun my-pass/post-init-password-store ()
  (advice-add 'password-store--save-field-in-kill-ring :around
              #'my-pass//no-copy-to-clipboard))

Remove redundant configuration of auth-source-pass

Spacemacs implements this now, we don't need to do it ourselves any more.


;;; init-elm.el --- Support for the Elm language -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(when (maybe-require-package 'elm-mode)
  (after-load 'elm-mode
    (diminish 'elm-indent-mode)
    (after-load 'company
      (push 'company-elm company-backends))
    (when (executable-find "elm-format")
      (setq-default elm-format-on-save t)))
  (maybe-require-package 'elm-test-runner)
  (when (maybe-require-package 'flycheck-elm)
    (after-load 'elm-mode
      (flycheck-elm-setup))))

(provide 'init-elm)
;;; init-elm.el ends here

;;; init-elm.el --- Support for the Elm language -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(when (maybe-require-package 'elm-mode)
  (after-load 'elm-mode
    (diminish 'elm-indent-mode)
    (after-load 'company
      (push 'company-elm company-backends))
    (when (executable-find "elm-format")
      (setq-default elm-format-on-save t)))
  (maybe-require-package 'elm-test-runner)
  (when (maybe-require-package 'flycheck-elm)
    (after-load 'elm-mode
      (flycheck-elm-setup)))
  (when (maybe-require-package 'add-node-modules-path)
    (add-hook 'elm-mode-hook 'add-node-modules-path)))

(provide 'init-elm)
;;; init-elm.el ends here

Use add-node-modules-path in Elm, for tooling installed with npm


;;; lk/ruby --- ruby related customizations
;;;; Commentary:
;;; Code:
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Vagrantfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Guardfile" . ruby-mode))

(custom-set-variables
 '(inf-ruby-default-implementation "foreman")
 '(inf-ruby-implementations
   (quote
    (("ruby" . "irb --prompt default --noreadline -r irb/completion")
     ("foreman" . "bundle exec foreman run rails c")
     ("pry" . "pry")))))

(add-hook 'ruby-mode-hook #'linum-mode)
(add-hook 'ruby-mode-hook #'inf-ruby-minor-mode)

(setq-default ruby-indent-level 2)

(provide 'lk/ruby)
;;; ruby.el ends here

;;; lk/ruby --- ruby related customizations
;;;; Commentary:
;;; Code:
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Vagrantfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Guardfile" . ruby-mode))

(add-hook 'ruby-mode-hook (lambda ()
                            (linum-mode)
                            (in-ruby-minor-mode)
                            (local-set-key (kbd "C-c r")
                                           'rubocop-autocorrect-current-file)))

(setq-default ruby-indent-level 2)

(provide 'lk/ruby)
;;; ruby.el ends here

Add a shortcut for rubocop's autocorrect


;;; project-conf.el -- Settings for `project' -*- lexical-binding: t -*-
;;
;;; Commentary:
;;
;;; Code:

(require 'project)
(require 'projectile)

;; Port this function to project.el:
(declare-function pjones:projectile-compile-project "./projectile-conf")

(defun pjones:project-shell-command nil
  "Run a shell command in the project's root directory."
  (interactive)
  (let ((default-directory (project-root (project-current t))))
    (call-interactively #'shell-command)))

(defun pjones:project-async-shell-command nil
  "Run an asynchronous shell command in the project's root directory."
  (interactive)
  (let ((default-directory (project-root (project-current t))))
    (call-interactively #'async-shell-command)))

(let ((map project-prefix-map))
  (define-key map (kbd "!") #'pjones:project-shell-command)
  (define-key map (kbd "1") #'pjones:project-shell-command)
  (define-key map (kbd "&") #'pjones:project-async-shell-command)
  (define-key map (kbd "7") #'pjones:project-async-shell-command)
  (define-key map (kbd "c") #'pjones:projectile-compile-project)
  (define-key map (kbd "f") #'projectile-find-file)
  (define-key map (kbd "t") #'projectile-test-project))

;;; project-conf.el ends here

;;; project-conf.el -- Settings for `project' -*- lexical-binding: t -*-
;;
;;; Commentary:
;;
;;; Code:

(require 'project)
(require 'projectile)

;; Port this function to project.el:
(declare-function pjones:projectile-compile-project "./projectile-conf")

(let ((map project-prefix-map))
  (define-key map (kbd "c") #'pjones:projectile-compile-project)
  (define-key map (kbd "d") #'project-dired)
  (define-key map (kbd "D") #'project-find-dir)
  (define-key map (kbd "f") #'projectile-find-file)
  (define-key map (kbd "r") #'projectile-run-project)
  (define-key map (kbd "s") #'projectile-run-vterm)
  (define-key map (kbd "t") #'projectile-test-project))

;;; project-conf.el ends here

project: Update bindings, remove workaround code that exists upstream

Upstream project.el now includes the functions I had written, so they
can be removed.  However, upstream changed the `C-x p d` binding so
I'm changing it back.

Also added bindings to start a terminal, and to run the project.


;;; init-python.el --- Python editing -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

;; See the following note about how I set up python + virtualenv to
;; work seamlessly with Emacs:
;; https://gist.github.com/purcell/81f76c50a42eee710dcfc9a14bfc7240

(setq auto-mode-alist
      (append '(("SConstruct\\'" . python-mode)
                ("SConscript\\'" . python-mode))
              auto-mode-alist))

(setq python-shell-interpreter "python3")

(require-package 'pip-requirements)

(when (maybe-require-package 'anaconda-mode)
  (after-load 'python
    ;; Anaconda doesn't work on remote servers without some work, so
    ;; by default we enable it only when working locally.
    (add-hook 'python-mode-hook
              (lambda () (unless (file-remote-p default-directory)
                      (anaconda-mode 1))))
    (add-hook 'anaconda-mode-hook 'anaconda-eldoc-mode))
  (after-load 'anaconda-mode
    (define-key anaconda-mode-map (kbd "M-?") nil))
  (when (maybe-require-package 'company-anaconda)
    (after-load 'company
      (after-load 'python
        (push 'company-anaconda company-backends)))))

(provide 'init-python)
;;; init-python.el ends here

;;; init-python.el --- Python editing -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

;; See the following note about how I set up python + virtualenv to
;; work seamlessly with Emacs:
;; https://gist.github.com/purcell/81f76c50a42eee710dcfc9a14bfc7240

(setq auto-mode-alist
      (append '(("SConstruct\\'" . python-mode)
                ("SConscript\\'" . python-mode))
              auto-mode-alist))

(setq python-shell-interpreter "python3")

(require-package 'pip-requirements)

(when (maybe-require-package 'anaconda-mode)
  (after-load 'python
    ;; Anaconda doesn't work on remote servers without some work, so
    ;; by default we enable it only when working locally.
    (add-hook 'python-mode-hook
              (lambda () (unless (file-remote-p default-directory)
                      (anaconda-mode 1))))
    (add-hook 'anaconda-mode-hook 'anaconda-eldoc-mode))
  (after-load 'anaconda-mode
    (define-key anaconda-mode-map (kbd "M-?") nil))
  (when (maybe-require-package 'company-anaconda)
    (after-load 'company
      (after-load 'python
        (push 'company-anaconda company-backends)))))

(when (maybe-require-package 'toml-mode)
  (add-to-list 'auto-mode-alist '("poetry\\.lock\\'" . toml-mode)))

(provide 'init-python)
;;; init-python.el ends here

Add toml-mode for poetry lockfiles

Add toml-mode for poetry lockfiles


(setq osx-packages
  '(
    pbcopy
    ))

(defun osx/init-pbcopy ()
  (use-package pbcopy
    :if (not (display-graphic-p))
    :init (turn-on-pbcopy)))

(setq osx-packages
  '(
    pbcopy
    ))

(if (executable-find "gls")
    ; maybe absolute or relative name of the `ls' program used by `insert-directory'.
    ; brew info coreutils
    (setq insert-directory-program "gls"
          dired-listing-switches "-aBhl --group-directories-first")
  (setq dired-use-ls-dired nil))

(defun osx/init-pbcopy ()
  (use-package pbcopy
    :if (not (display-graphic-p))
    :init (turn-on-pbcopy)))

Make dired use coreutils' gls, if installed


(use-package popwin
  :init
  (progn
    (popwin-mode 1)
    (push '("*grep*"                     :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config)
    (push '("^\*Flycheck.+\*$" :regexp t :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config)
    (push '("^\*helm.+\*$"     :regexp t              :position bottom) popwin:special-display-config)
    (push '("^\*helm-.+\*$"    :regexp t              :position bottom) popwin:special-display-config)))

(use-package popwin
  :init
  (progn
    (popwin-mode 1)
    (push '("*grep*"                     :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config)
    (push '("*nosetests*"                :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config)
    (push '("^\*Flycheck.+\*$" :regexp t :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config)
    (push '("^\*helm.+\*$"     :regexp t              :position bottom                     ) popwin:special-display-config)
    (push '("^\*helm-.+\*$"    :regexp t              :position bottom                     ) popwin:special-display-config)))

Add popwin properties for nosetests window


;; -*- lexical-binding: t -*-

(defconst mfa-lisp-packages '(expand-region))

(defun mfa-lisp/post-init-expand-region ()
  (with-eval-after-load 'expand-region
    (er/enable-mode-expansions 'emacs-lisp-mode
                               #'mfa-lisp//add-emacs-lisp-mode-expansions)))

;; -*- lexical-binding: t -*-

(defconst mfa-lisp-packages '((emacs-lisp :location built-in)
                              expand-region))

(defun mfa-lisp/post-init-emacs-lisp ()
  (when (configuration-layer/package-used-p 'aggressive-indent)
    (add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode)))

(defun mfa-lisp/post-init-expand-region ()
  (with-eval-after-load 'expand-region
    (er/enable-mode-expansions 'emacs-lisp-mode
                               #'mfa-lisp//add-emacs-lisp-mode-expansions)))

Enable `aggressive-indent-mode` in Emacs lisp buffers


;; -*- no-byte-compile: t; -*-
;;; emacs/undo/packages.el

(if (not (featurep! +tree))
    (package! undo-tree :pin "5b6df03781")
  (package! undo-fu :pin "0c34b6747e")
  (package! undo-fu-session :pin "b808ef0cdc"))

;; -*- no-byte-compile: t; -*-
;;; emacs/undo/packages.el

(if (featurep! +tree)
    (package! undo-tree :pin "5b6df03781")
  (package! undo-fu :pin "0c34b6747e")
  (package! undo-fu-session :pin "b808ef0cdc"))

Fix inverted condition on +tree for undo module


(require 'cc-mode)
(add-hook 'c-mode-hook '(lambda () (c-toggle-auto-state t)))
(add-hook 'c++-mode-hook '(lambda () (c-toggle-auto-state t)))

;; From http://xugx2007.blogspot.ca/2007/06/benjamin-rutts-emacs-c-development-tips.html
(setq compilation-finish-function
   (lambda (buf str)

     (if (string-match "exited abnormally" str)

         ;;there were errors
         (message "compilation errors, press C-x ` to visit")

       ;;no errors, make the compilation window go away in 0.5 seconds
       (run-at-time 0.5 nil 'delete-windows-on buf)
       (message "No compilation errors."))))

(require 'cc-mode)
(add-hook 'c-mode-hook '(lambda () (c-toggle-auto-state t)))
(add-hook 'c++-mode-hook '(lambda () (c-toggle-auto-state t)))

;; From http://xugx2007.blogspot.ca/2007/06/benjamin-rutts-emacs-c-development-tips.html
(setq compilation-finish-function
   (lambda (buf str)

     (if (or (string-match "exited abnormally" str)
            (string-match "FAILED" (buffer-string)))

         ;;there were errors
         (message "There were errors. SPC-e-n to visit.")

       ;;no errors, make the compilation window go away in 0.5 seconds
       (run-at-time 1.0 nil 'delete-windows-on buf)
       (message "Ok."))))

Tweak auto-closing of compilation window


;;; init-recentf.el --- Settings for tracking recent files -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(add-hook 'after-init-hook 'recentf-mode)
(setq-default
 recentf-max-saved-items 1000
 recentf-exclude '("/tmp/" "/ssh:"))

(provide 'init-recentf)
;;; init-recentf.el ends here

;;; init-recentf.el --- Settings for tracking recent files -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(add-hook 'after-init-hook 'recentf-mode)
(setq-default
 recentf-max-saved-items 1000
 recentf-exclude `("/tmp/" "/ssh:" ,(concat package-user-dir "/.*-autoloads\\.el\\'")))

(provide 'init-recentf)
;;; init-recentf.el ends here

Exclude elpa package autoloads in recentf


;;; Uncomment the modules you'd like to use and restart Prelude afterwards

(require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
;; (require 'prelude-helm) ;; Interface for narrowing and search

(require 'prelude-c)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erc) ;; Emacs IRC client
;; (require 'prelude-erlang)
;; (require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-mediawiki)
(require 'prelude-org) ;; Org-mode helps you keep TODO lists, notes and more
(require 'prelude-perl)
;; (require 'prelude-python)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
(require 'prelude-scheme)
;; (require 'prelude-scss)
;; (require 'prelude-web) ;; Emacs mode for web templates
(require 'prelude-xml)

;;; Uncomment the modules you'd like to use and restart Prelude afterwards

(require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
;; (require 'prelude-helm) ;; Interface for narrowing and search

(require 'prelude-c)
;; (require 'prelude-clojure)
(require 'prelude-coffee)
;; (require 'prelude-common-lisp)
(require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erc) ;; Emacs IRC client
;; (require 'prelude-erlang)
(require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
;; (require 'prelude-latex)
; (require 'prelude-lisp)
;; (require 'prelude-mediawiki)
(require 'prelude-org) ;; Org-mode helps you keep TODO lists, notes and more
; (require 'prelude-perl)
;; (require 'prelude-python)
(require 'prelude-ruby)
(require 'prelude-scala)
; (require 'prelude-scheme)
(require 'prelude-scss)
(require 'prelude-web) ;; Emacs mode for web templates
(require 'prelude-xml)

Load more packages on Emacs startup

Load more packages on Emacs startup


(defmacro aspk/advice-add (func-name pos action)
  "Add a acvice `action' to `func-name' at `pos'. Currently `pos' can only be `before' and `after'."
  (message "Add advice. Function:%S, pos:%S, action:%S" func-name pos action)
  `(progn
     (defadvice ,func-name (,pos aspk-add-trace)
       (let ((args (ad-get-args 0)))
         (apply ',action ',func-name ad-return-value args))
       ;; (message "Return value: %S" ad-return-value)
       )
     (ad-activate ',func-name)))

(defun aspk/advice-add-multi (func-name-list pos action)
  (dolist (func-name func-name-list)
    (eval `(aspk/advice-add ,func-name ,pos ,action))))

(provide 'aspk-advice)

(defmacro aspk/advice-add (func-name pos action)
  "Add a advice `action' to `func-name' at `pos'. Currently `pos' can only be `before' and `after'."
  (message "Add advice. Function:%S, pos:%S, action:%S" func-name pos action)
  `(progn
     (defadvice ,func-name (,pos aspk-add-trace)
       (let ((args (ad-get-args 0)))
         (apply ',action ',func-name ad-return-value args)))
     (ad-activate ',func-name)))

(defun aspk/advice-add-multi (func-name-list pos action)
  "Add a advice `action' to `func-name-list' at `pos'. Currently `pos' can only be `before' and `after'."
  (dolist (func-name func-name-list)
    (eval `(aspk/advice-add ,func-name ,pos ,action))))

(provide 'aspk-advice)

Add doc string. Fix some typo.

Add doc string. Fix some typo.


(require-package 'haskell-mode)

(dolist (hook '(haskell-mode-hook inferior-haskell-mode-hook))
  (add-hook hook 'turn-on-haskell-doc-mode))

(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)

(eval-after-load 'haskell-mode
  '(progn
     (define-key haskell-mode-map (kbd "C-c h") 'hoogle)
     (define-key haskell-mode-map (kbd "RET") 'newline)))

(require-package 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)

(require-package 'flymake-haskell-multi)
(add-hook 'haskell-mode-hook #'flymake-haskell-multi-load)

;; Make compilation-mode understand "at blah.hs:11:34-50" lines output by GHC
(eval-after-load 'compile
  '(progn
     (let ((alias 'ghc-at-regexp))
       (add-to-list
        'compilation-error-regexp-alist-alist
        (list alias " at \\(.*l?hs\\):\\([0-9]+\\):\\([0-9]+\\)-[0-9]+$" 1 2 3 0 1))
       (add-to-list
        'compilation-error-regexp-alist alias))))

(provide 'init-haskell)

(require-package 'haskell-mode)

(dolist (hook '(haskell-mode-hook inferior-haskell-mode-hook))
  (add-hook hook 'turn-on-haskell-doc-mode))

(add-auto-mode 'haskell-mode "\\.ghci\\'")

(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)

(eval-after-load 'haskell-mode
  '(progn
     (define-key haskell-mode-map (kbd "C-c h") 'hoogle)
     (define-key haskell-mode-map (kbd "RET") 'newline)))

(require-package 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)

(require-package 'flymake-haskell-multi)
(add-hook 'haskell-mode-hook #'flymake-haskell-multi-load)

;; Make compilation-mode understand "at blah.hs:11:34-50" lines output by GHC
(eval-after-load 'compile
  '(progn
     (let ((alias 'ghc-at-regexp))
       (add-to-list
        'compilation-error-regexp-alist-alist
        (list alias " at \\(.*l?hs\\):\\([0-9]+\\):\\([0-9]+\\)-[0-9]+$" 1 2 3 0 1))
       (add-to-list
        'compilation-error-regexp-alist alias))))

(provide 'init-haskell)

Use haskell-mode for .ghci files

Use haskell-mode for .ghci files


(deftheme angel-dark
  "A dark theme based on solarized dark.")

;; [todo] - Derive angel-dark from solarized
;; [todo] - Disable solarized with angel-dark
(load-theme 'solarized-dark t)

(custom-theme-set-variables
 'angel-dark
 '(magit-use-overlays t)
 '(fci-rule-width 1)
 '(cursor-type (quote (bar . 2)))
 '(solarized-height-plus-1 1)
 '(solarized-height-plus-2 1)
 '(solarized-height-plus-3 1)
 '(solarized-height-plus-4 1)
 '(solarized-use-less-bold t)
 '(solarized-use-more-italic t)
 '(solarized-use-variable-pitch nil))

(custom-theme-set-faces
 'angel-dark
 '(magit-item-highdark ((t nil))))

(provide-theme 'angel-dark)

(deftheme angel-dark
  "A dark theme based on solarized dark.")

(custom-theme-set-variables
 'angel-dark
 '(magit-use-overlays t)
 '(fci-rule-width 1)
 '(cursor-type (quote (bar . 2))))

(custom-theme-set-faces
 'angel-dark
 '(magit-item-highdark ((t nil))))

(setq solarized-height-plus-1 1.1
      solarized-height-plus-2 1.1
      solarized-height-plus-3 1.1
      solarized-height-plus-4 1.1
      solarized-use-less-bold t
      solarized-use-more-italic t
      solarized-use-variable-pitch nil)

;; [todo] - Derive angel-dark from solarized
;; [todo] - Disable solarized with angel-dark
(load-theme 'solarized-dark t)

(provide-theme 'angel-dark)

Fix solarized config vars load order

Fix solarized config vars load order


(setq extra-langs-packages
  '(
    arduino-mode
    julia-mode
    matlab-mode
    qml-mode
    scad-mode
    stan-mode
    thrift
    wolfram-mode
    ))

(defun extra-langs/init-arduino-mode ()
  (use-package arduino-mode :defer t))

(defun extra-langs/init-scad-mode ()
  (use-package scad-mode :defer t))

(defun extra-langs/init-qml-mode ()
  (use-package qml-mode :defer t :mode "\\.qml\\'"))

(defun extra-langs/init-julia-mode ()
  (use-package julia-mode :defer t))

(defun extra-langs/init-matlab-mode ()
  (use-package matlab-mode :defer t))

(defun extra-langs/init-stan-mode ()
  (use-package stan-mode :defer t))

(defun extra-langs/init-thrift ()
  (use-package thrift :defer t :mode ("\\.thrift\\'" . thrift-mode)))

;; no associated extension because conflicts with more common Objective-C, manually invoke for .m files.
(defun extra-langs/init-wolfram-mode ()
  (use-package wolfram-mode
    :defer t
    :interpreter "\\(Wolfram\\|Mathematica\\)Script\\( -script\\)?"))

(setq extra-langs-packages
  '(
    arduino-mode
    julia-mode
    matlab-mode
    qml-mode
    scad-mode
    stan-mode
    thrift
    wolfram-mode
    ))

(defun extra-langs/init-arduino-mode ()
  (use-package arduino-mode :defer t))

(defun extra-langs/init-scad-mode ()
  (use-package scad-mode :defer t))

(defun extra-langs/init-qml-mode ()
  (use-package qml-mode :defer t :mode "\\.qml\\'"))

(defun extra-langs/init-julia-mode ()
  (use-package julia-mode :defer t))

(defun extra-langs/init-matlab-mode ()
  (use-package matlab-mode :defer t))

(defun extra-langs/init-stan-mode ()
  (use-package stan-mode :defer t))

(defun extra-langs/init-thrift ()
  (use-package thrift :defer t))

;; no associated extension because conflicts with more common Objective-C, manually invoke for .m files.
(defun extra-langs/init-wolfram-mode ()
  (use-package wolfram-mode
    :defer t
    :interpreter "\\(Wolfram\\|Mathematica\\)Script\\( -script\\)?"))

Remove unnecessary :mode for thrift

Remove unnecessary :mode for thrift


;;; feature/snippets/autoload/settings.el -*- lexical-binding: t; -*-

;;;###autodef
(defun set-yas-minor-mode! (mode)
  "Register a minor MODE with yasnippet so it can have its own snippets
category, if the folder exists."
  (after! yasnippet
    (let ((fn (intern (format "+snippets|register-%s" mode))))
      (fset fn (lambda () (+snippets|enable-project-modes mode)))
      (add-hook (intern (format "%s-hook" mode)) fn))))

;;;###autoload
(def-setting! :yas-minor-mode (mode)
  :obsolete set-yas-minor-mode!
  `(set-yas-minor-mode! ,mode))

;;; feature/snippets/autoload/settings.el -*- lexical-binding: t; -*-

;;;###autodef
(defun set-yas-minor-mode! (modes)
  "Register minor MODES (one mode symbol or a list of them) with yasnippet so it
can have its own snippets category, if the folder exists."
  (let ((fn (intern (format "+snippets|register-%s" mode))))
    (fset fn (lambda ()
               (make-local-variable 'yas--extra-modes)
               (dolist (mode (doom-enlist modes))
                 (add-to-list 'yas--extra-modes mode nil #'eq))
               (yas--load-pending-jits)))
    (add-hook (intern (format "%s-hook" mode)) fn)))

;;;###autoload
(def-setting! :yas-minor-mode (mode)
  :obsolete set-yas-minor-mode!
  `(set-yas-minor-mode! ,mode))

Allow set-yas-minor-mode! to accept multiple modes


(add-to-list 'custom-theme-load-path "~/.emacs.d/el-get/emacs-theme-gruvbox")
(load-theme 'gruvbox t)

(add-to-list 'custom-theme-load-path default-directory)
(load-theme 'gruvbox t)

Revert to using 'default-directory' vs hard coded path

This requires latest upstream el-get as of this commit


(use-package evil
  :ensure t

  :config
  (require 'evil)
  (evil-mode 1)

  )

(provide 'pkg-evil)

(use-package evil
  :ensure t

  :bind (
    ;; bind ctrl-j/k to just move
    ("C-j" . evil-next-line)
    ("C-k" . evil-previous-line)
    )

  :config
  (require 'evil)
  (evil-mode 1)

  ;; command alias
  (evil-ex-define-cmd "W" "w")
  (evil-ex-define-cmd "Wq" "wq")
  (evil-ex-define-cmd "WQ" "wq")
  (evil-ex-define-cmd "Q" "q")
  )

(provide 'pkg-evil)

Add some helpful settings to evil

Add some helpful settings to evil


;;; editor/word-wrap/config.el -*- lexical-binding: t; -*-

(defvar +word-wrap-extra-indent 'double
  "The amount of extra indentation for wrapped code lines.

When 'double, indent by twice the major-mode indentation.
When 'single, indent by the major-mode indentation.
When a positive integer, indent by this fixed amount.
When a negative integer, dedent by this fixed amount.

Otherwise no extra indentation will be used.")

(defvar +word-wrap-disabled-modes
  '(fundamental-mode so-long-mode)
  "Major-modes where `+global-word-wrap-mode' should not enable
`+word-wrap-mode'.")

(defvar +word-wrap-visual-modes
  '(org-mode)
  "Major-modes where `+word-wrap-mode' should not use
`adaptive-wrap-prefix-mode'.")

(defvar +word-wrap-text-modes
  '(text-mode markdown-mode markdown-view-mode gfm-mode gfm-view-mode rst-mode
    latex-mode LaTeX-mode)
  "Major-modes where `+word-wrap-mode' should not provide extra indentation.")

(when (memq 'visual-line-mode text-mode-hook)
  (remove-hook 'text-mode-hook #'visual-line-mode)
  (add-hook 'text-mode-hook #'+word-wrap-mode))

Use +word-wrap-mode instead of visual-line-mode default

If the word-wrap module is enabled.


(require 'init-git)

(maybe-require-package 'yagist)
(require-package 'bug-reference-github)
(add-hook 'prog-mode-hook 'bug-reference-prog-mode)

(maybe-require-package 'github-clone)
(maybe-require-package 'magithub)

(provide 'init-github)

(require 'init-git)

(maybe-require-package 'yagist)
(require-package 'bug-reference-github)
(add-hook 'prog-mode-hook 'bug-reference-prog-mode)

(maybe-require-package 'github-clone)
(when (maybe-require-package 'magithub)
  (defun magithub-issues-completion-at-point ()
    (when (magithub-enabled-p)
      (when (looking-back "#\\([0-9]*\\)")
        (let ((start (match-beginning 1))
              (end (match-end 0))
              (prefix (match-string 1))
              completions)
          (dolist (i (magithub--issue-list))
            (let-alist i
              (let ((n (number-to-string .number)))
                (when (string-prefix-p prefix n)
                  (set-text-properties 0 (length n) (list :issue i) n)
                  (push n completions)))))
          (list start end completions
                :exclusive 'no
                :company-docsig (lambda (c)
                                  (let-alist (get-text-property 0 :issue c)
                                    .title))
                :company-location (lambda (c)
                                    (magithub-issue-browse (get-text-property 0 :issue c)))
                :annotation-function (lambda (c)
                                       (let-alist (get-text-property 0 :issue c)
                                         .title))
                :company-doc-buffer (lambda (c)
                                      (save-window-excursion
                                        (magithub-issue-visit (get-text-property 0 :issue c))))
                )))))

  (add-hook 'git-commit-setup-hook
            (lambda () (add-to-list 'completion-at-point-functions 'magithub-issues-completion-at-point))))

(provide 'init-github)

Add a completion function for issues in github commit messages


(require 'god-mode)

;; Change the cursor in god mode
(defun personal/god-mode-cursor ()
  (setq cursor-type (if (or god-local-mode buffer-read-only)
                        'box
                      'bar)))

(add-hook 'god-mode-enabled-hook 'personal/god-mode-cursor)
(add-hook 'god-mode-disabled-hook 'personal/god-mode-cursor)

;; Use C-i to enter god-mode
(personal/bind-key "C-l" "i" 'god-mode-all)
(global-set-key (kbd "<escape>") 'god-mode-all)

;; Use i to leave god mode
(define-key god-local-mode-map (kbd "i") 'god-mode-all)
(define-key god-local-mode-map (kbd ".") 'repeat)

;; Disable smartparens mode while god-mode is enabled (smartparens mode rebinds
;; many keys to do its magic, including "n" which interferes with the use of
;; god-mode)
(add-hook 'god-mode-enabled-hook (lambda ()
                                   (interactive)
                                   (smartparens-mode -1)))

(add-hook 'god-mode-disabled-hook (lambda ()
                                    (interactive)
                                    (smartparens-mode +1)))

Disable smartparens mode in god mode

Disable smartparens mode in god mode


;;; init-projectile.el -- projetile setup

;;; Commentary:
;;; load projectile and customizations

;;; Code:
(require-package 'projectile)

(require 'projectile)

(projectile-global-mode 1)

(diminish 'projectile-mode " ℗ ")

(provide 'init-projectile)
;;; init-projectile.el ends here

;;; init-projectile.el -- projetile setup

;;; Commentary:
;;; load projectile and customizations

;;; Code:
(require-package 'projectile)

(require 'projectile)

(projectile-global-mode 1)

(setq projectile-completion-system 'helm
      projectile-switch-project-action 'helm-projectile)

(diminish 'projectile-mode " ℗ ")

(provide 'init-projectile)
;;; init-projectile.el ends here

Use helm as the projectile completion system


;; -*- lexical-binding: t -*-

(defconst my-dtrt-indent-packages '(dtrt-indent))

(defun my-dtrt-indent/init-dtrt-indent ()
  (use-package dtrt-indent
    :diminish
    :defer t
    :init
    (dolist (mode dtrt-indent-mode-whitelist)
      (add-hook (intern (concat (symbol-name mode) "-hook"))
                #'dtrt-indent//maybe-enable))))

;; -*- lexical-binding: t -*-

(defconst my-dtrt-indent-packages '(dtrt-indent))

(defun my-dtrt-indent/init-dtrt-indent ()
  (use-package dtrt-indent
    :diminish
    :defer t
    :init
    (dolist (mode dtrt-indent-mode-whitelist)
      (add-hook (intern (concat (symbol-name mode) "-hook"))
                #'dtrt-indent//maybe-enable))
    :config
    (setq dtrt-indent-verbosity 0)))

Make dtrt-indent mode less noisy

Make dtrt-indent mode less noisy


;;; init-java.el -- Java setup

;;; Commentary:
;;; Java and eclim setup

;;; Code:
(require 'use-package)

(use-package emacs-eclim
  :commands (global-eclim-mode)
  :config
  (global-eclim-mode 1)
  (company-emacs-eclim-setup)
  (setq eclim-eclipse-dirs "/opt/eclipse")
  (setq eclim-executable "/opt/eclipse/eclim")
  (setq eclimd-default-workspace "~/eclipse_workspace")
  (setq eclimd-executable "/opt/eclipse/eclimd")
  (setq company-emacs-eclim-ignore-case t)
  :init
  (add-hook 'java-mode-hook #'global-eclim-mode))

(add-hook 'java-mode-hook (lambda ()
                            (setq c-basic-offset 2
                                  tab-width 2)))

(provide 'init-java)
;;; init-java.el ends here

;;; init-java.el -- Java setup

;;; Commentary:
;;; Java and eclim setup

;;; Code:
(require 'use-package)

(use-package eclim
  :commands (global-eclim-mode)
  :config
  (global-eclim-mode 1)
  (company-emacs-eclim-setup)
  (setq eclim-eclipse-dirs "/opt/eclipse")
  (setq eclim-executable "/opt/eclipse/eclim")
  (setq eclimd-default-workspace "~/eclipse_workspace")
  (setq eclimd-executable "/opt/eclipse/eclimd")
  (setq company-emacs-eclim-ignore-case t)
  :init
  (add-hook 'java-mode-hook #'global-eclim-mode))

(add-hook 'java-mode-hook (lambda ()
                            (setq c-basic-offset 2
                                  tab-width 2)))

(provide 'init-java)
;;; init-java.el ends here

Fix eclim package name for Emacs

Fix eclim package name for Emacs


(require 'smex)
(smex-initialize)

(global-set-key "\M-x" 'smex)
(global-set-key "\M-X" 'smex-major-mode-commands)

Add some more smex goodness

Add some more smex goodness


;;; -*- lexical-binding: t -*-
;;; my-ansible.el --- Ansible mode settings.

;; Copyright (C) 2016  Sergey Timanin

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;;     http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:

;;; Code:

(require 'my-completion)

(use-package ansible
  :init
  ;; Auto-enable for yaml files
  (add-hook 'yaml-mode-hook '(lambda () (ansible 1)))
  ;; Enable company backend for completion
  (add-to-list 'company-backends 'company-ansible))

(provide 'my-ansible)

;;; my-ansible.el ends here

;;; -*- lexical-binding: t -*-
;;; my-ansible.el --- Ansible mode settings.

;; Copyright (C) 2016  Sergey Timanin

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;;     http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:

;;; Code:

(require 'my-completion)

(use-package ansible
  :init
  ;; Auto-enable for yaml files
  (add-hook 'yaml-mode-hook '(lambda () (ansible 1)))
  ;; Enable company backend for completion
  (add-to-list 'company-backends 'company-ansible))

(use-package ansible-doc
  :init
  (add-hook 'yaml-mode-hook #'ansible-doc-mode))

(provide 'my-ansible)

;;; my-ansible.el ends here

Add ansible-doc mode (C-c ?).

Add ansible-doc mode (C-c ?).


;; Time-stamp: <2015-04-01 08:59:07 kmodi>

;; Key Chord Mode
;; http://www.emacswiki.org/emacs/key-chord.el

(use-package key-chord
  :config
  (progn
    (key-chord-mode 1)))

(provide 'setup-key-chord)

;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/
;; provides a list of rare bi-grams that would work great for key-chords
;;      bf bg bq bx bz
;;      cj cv
;;      dx dz
;;      fb fj fq fv fz
;;      gb gj gp gq gv gx gz
;;      hj hq hv
;;  jj  jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz
;;  kk  kj kq kv kx kz
;;      lj lq
;;      mj mq mv mx mz
;;      pg pj pq pv pz
;;  qq  qb qf qg qh qj qk ql qm qp qt qv qw qx qy qz
;;      sj sx sz
;;      tj tq
;;  vv  vc vf vg vh vj vk vm vp vq vw vz
;;  ww  wj wq wv wx wz
;;      xb xd xg xj xk xm xq xs xw xz
;;  yy  yj yq
;;      zb zd zf zg zj zk zm zp zq zs zv zw zx

;; Time-stamp: <2015-04-01 09:10:33 kmodi>

;; Key Chord Mode
;; http://www.emacswiki.org/emacs/key-chord.el

(use-package key-chord
  :config
  (progn
    (key-chord-mode 1)))

(provide 'setup-key-chord)

;; John Cook's post http://www.johndcook.com/blog/2015/02/01/rare-bigrams/
;; provides a list of rare bi-grams that would work great for key-chords.

;; Below list is based off that after removing all the key-chord duplicates
;; like `xs' and `sx'.

;;      fb
;;      gb gp
;;  jj  jc jf jg jh jk jl jm jp jq js jt jv jw jx jy jz
;;  kk
;;  qq  qb qf qg qh qk ql qm qp qt qv qw qx qy qz
;;  vv  vc vf vg vh vk vm vp vw vz
;;  ww
;;      xb xd xg xk xm xs xw
;;  yy
;;      zb zd zf zg zk zm zp zs zw zx

Remove key-chord duplicates from list

Minor: Remove key-chord duplicates from list


(require-package 'evil)
(require-package 'evil-leader)
(require-package 'evil-nerd-commenter)

; Setup evil leader
(global-evil-leader-mode)
(setq evil-leader/in-all-states t)
(evil-leader/set-leader ",")
(evil-leader/set-key
  "f" 'fuzzy-finder
  "b" 'switch-to-buffer
  "k" 'kill-buffer
  "s" 'save-buffer
  "q" 'quit-window
  "n" 'new-buffer
  "i" 'imenu
)
; Enable evil-nerd-commenter
(evilnc-default-hotkeys)
; Enable evil mode
(evil-mode t)

(provide 'init-evil-mode)

(require-package 'evil)
(require-package 'evil-leader)
(require-package 'evil-nerd-commenter)

(setq evil-leader/in-all-states t)
(setq evil-leader/no-prefix-mode-rx '(".*-mode"))
; Setup evil leader
(global-evil-leader-mode)
(evil-leader/set-leader ",")
(evil-leader/set-key
  "f" 'fuzzy-finder
  "b" 'switch-to-buffer
  "k" 'kill-buffer
  "s" 'save-buffer
  "q" 'quit-window
  "n" 'new-buffer
  "i" 'imenu
)
; Enable evil-nerd-commenter
(evilnc-default-hotkeys)
; Enable evil mode
(evil-mode t)

(provide 'init-evil-mode)

Fix evil-leader in Insert mode

Emacs: Fix evil-leader in Insert mode


(defun rebuild-ripper-tags ()
  (start-process "ripper-tags" nil "ripper-tags" "-R" "-e"))

(add-hook
 'ruby-mode-hook
 (lambda ()
   ;; Check spelling.
   (flyspell-prog-mode)
   ;; Don't autofill
   (auto-fill-mode 0)
   ;; Make enter indent.
   (local-set-key (kbd "C-m") 'reindent-then-newline-and-indent)
   ;; Make smart-tab always indent
   (defvar smart-tab-always-indent nil)
   (setq-local smart-tab-always-indent t)
   ;; Clean up whitespace on save.
   (add-hook 'before-save-hook 'whitespace-cleanup nil t)
   ;; Rebuild tags on save.
   (add-hook (make-local-variable 'after-save-hook) 'rebuild-ripper-tags nil t)
   ;; Disable rubocop
   (defvar flycheck-disabled-checkers "flycheck.el")
   (setq flycheck-disabled-checkers
         (cons 'ruby-rubocop flycheck-disabled-checkers))
   ;; Turn on subword-mode
   (require 'diminish)
   (subword-mode 1)
   (diminish 'subword-mode)
   ;; Make do/end less prominent.
   (defvar paren-face-regexp)
   (setq-local paren-face-regexp
               (rx symbol-start (or "do" "end") symbol-end))))

(defun rebuild-ripper-tags ()
  (start-process "rebuild-ripper-tags" nil "rebuild-ripper-tags"))

(add-hook
 'ruby-mode-hook
 (lambda ()
   ;; Check spelling.
   (flyspell-prog-mode)
   ;; Don't autofill
   (auto-fill-mode 0)
   ;; Make enter indent.
   (local-set-key (kbd "C-m") 'reindent-then-newline-and-indent)
   ;; Make smart-tab always indent
   (defvar smart-tab-always-indent nil)
   (setq-local smart-tab-always-indent t)
   ;; Clean up whitespace on save.
   (add-hook 'before-save-hook 'whitespace-cleanup nil t)
   ;; Rebuild tags on save.
   (add-hook (make-local-variable 'after-save-hook) 'rebuild-ripper-tags nil t)
   ;; Disable rubocop
   (defvar flycheck-disabled-checkers "flycheck.el")
   (setq flycheck-disabled-checkers
         (cons 'ruby-rubocop flycheck-disabled-checkers))
   ;; Turn on subword-mode
   (require 'diminish)
   (subword-mode 1)
   (diminish 'subword-mode)
   ;; Make do/end less prominent.
   (defvar paren-face-regexp)
   (setq-local paren-face-regexp
               (rx symbol-start (or "do" "end") symbol-end))))

Split ripper-tags logic into a shell script


;;; appearance.el --- Settings related to Emacs appearance

;;; Commentary:

;; Settings related to Emacs appearance

;;; Code:

;; hide the menu bar
(menu-bar-mode 0)

;; hide the scrollbars
(scroll-bar-mode -1)

;; disable the splash screen
(setq inhibit-splash-screen t)

;; load theme
(load-theme 'gruvbox t)

;; Speed up the performance of the display engine.
;; See http://www.masteringemacs.org/article/improving-performance-emacs-display-engine
(setq redisplay-dont-pause t)

(set-face-attribute 'default nil
                    :family "Inconsolata" :height 160 :weight 'regular)

;;; appearance.el ends here

;;; appearance.el --- Settings related to Emacs appearance

;;; Commentary:

;; Settings related to Emacs appearance

;;; Code:

;; hide the menu bar
(menu-bar-mode 0)

;; hide the scrollbars
(scroll-bar-mode -1)

;; disable the splash screen
(setq inhibit-splash-screen t)

;; load theme
(if (daemonp)
    (add-hook 'after-make-frame-functions
              (lambda (frame)
                (select-frame frame)
                (load-theme 'gruvbox t)
                (personal/reset-mode-line)))
  (load-theme 'gruvbox t)
  (personal/reset-mode-line))

;; Speed up the performance of the display engine.
;; See http://www.masteringemacs.org/article/improving-performance-emacs-display-engine
(setq redisplay-dont-pause t)

(set-face-attribute 'default nil
                    :family "Inconsolata" :height 160 :weight 'regular)

;;; appearance.el ends here

Make the theme apply when running emacsclient in gui mode


;;; grains-test.el --- Test for Grains (exercism)

;;; Commentary:

;;; Code:

(load-file "grains.el")

(ert-deftest square-1 ()
  (should (equal 1 (square 1))))

(ert-deftest square-2 ()
  (should (equal 2 (square 2))))

(ert-deftest square-3 ()
  (should (equal 4 (square 3))))

(ert-deftest square-4 ()
  (should (equal 8 (square 4))))

(ert-deftest square-16 ()
  (should (equal 32768
                 (square 16))))

(ert-deftest square-32 ()
  (should (equal 2147483648
                 (square 32))))

(ert-deftest square-64 ()
  (should (equal 9223372036854775808
                 (square 64))))

(ert-deftest total-grains ()
  (should (equal 18446744073709551615
                 (total))))

(provide 'grains-test.el)
;;; grains-test.el ends here.

;;; grains-test.el --- Test for Grains (exercism)

;;; Commentary:

;;; Code:

(load-file "grains.el")

(ert-deftest square-1 ()
  (should (= 1 (square 1))))

(ert-deftest square-2 ()
  (should (= 2 (square 2))))

(ert-deftest square-3 ()
  (should (= 4 (square 3))))

(ert-deftest square-4 ()
  (should (= 8 (square 4))))

(ert-deftest square-16 ()
  (should (= 32768
             (square 16))))

(ert-deftest square-32 ()
  (should (= 2147483648
             (square 32))))

(ert-deftest square-64 ()
  (should (= 9223372036854775808
             (square 64))))

(ert-deftest total-grains ()
  (should (= 18446744073709551615
             (total))))

(provide 'grains-test.el)
;;; grains-test.el ends here.

Use = for comparing numbers

Use = for comparing numbers


(autoload 'markdown-mode "markdown-mode" "Mode for editing Markdown documents" t)
(setq auto-mode-alist
      (cons '("\\.\\(md\\|markdown\\)\\'" . markdown-mode) auto-mode-alist))

(provide 'init-markdown)

Remove redundant autoload for markdown-mode


;; -*- no-byte-compile: t; -*-
;;; ~/.doom.d/packages.el

;;; Examples:
;; (package! some-package)
;; (package! another-package :recipe (:fetcher github :repo "username/repo"))
;; (package! builtin-package :disable t)

(package! gruvbox-theme)

(package! eglot)
;; (package! lsp-mode)
;; (package! lsp-ui)
;; (package! company-lsp)
(package! yasnippet-snippets)

(package! evil-snipe :disable t)

;; -*- no-byte-compile: t; -*-
;;; ~/.doom.d/packages.el

;;; Examples:
;; (package! some-package)
;; (package! another-package :recipe (:fetcher github :repo "username/repo"))
;; (package! builtin-package :disable t)

(package! gruvbox-theme)
(package! base16-theme)

(package! eglot)
;; (package! lsp-mode)
;; (package! lsp-ui)
;; (package! company-lsp)
(package! yasnippet-snippets)

(package! evil-snipe :disable t)

Add base16 themes to emacs

Add base16 themes to emacs


;; Time-stamp: <2016-05-19 22:15:18 kmodi>

;; Smart Compile

(use-package smart-compile
  :defer t
  :config
  (progn
    ;; http://stackoverflow.com/a/15724162/1219634
    (defun do-execute (exe)
      (with-current-buffer "*eshell*"
        (goto-char (point-max))
        (insert exe)
        (eshell-send-input))
      (switch-to-buffer-other-window "*eshell*")
      (end-of-buffer))

    (defun save-compile-execute ()
      (interactive)
      (lexical-let ((exe (smart-compile-string "./%n"))
                    finish-callback)
        ;; When compilation is done, execute the program and remove the
        ;; callback from `compilation-finish-functions'
        (setq finish-callback
              (lambda (buf msg)
                (do-execute exe)
                (setq compilation-finish-functions
                      (delq finish-callback compilation-finish-functions))))
        (push finish-callback compilation-finish-functions))
      (smart-compile 1))))

(provide 'setup-smart-compile)

;; Time-stamp: <2016-12-04 12:33:25 kmodi>

;; Smart Compile

(use-package smart-compile
  :commands (modi/save-compile-execute)
  :init
  (progn
    (bind-keys
     :map modi-mode-map
     :filter (not (or (derived-mode-p 'emacs-lisp-mode)
                      (derived-mode-p 'verilog-mode)))
      ("<f9>" . modi/save-compile-execute)))
  :config
  (progn
    ;; Always use C99 standard for compilation
    (setcdr (assoc "\\.c\\'" smart-compile-alist) "gcc -O2 %f -lm -o %n -std=gnu99")

    ;; http://stackoverflow.com/a/15724162/1219634
    (defun modi/do-execute (exe)
      "Run EXE in eshell."
      (eshell) ; Start eshell or switch to an existing eshell session
      (goto-char (point-max))
      (insert exe)
      (eshell-send-input))

    (defun modi/save-compile-execute ()
      "Save, compile and execute"
      (interactive)
      (lexical-let ((code-buf (buffer-name))
                    (exe (smart-compile-string "./%n"))
                    finish-callback)
        (setq finish-callback
              (lambda (buf msg)
                ;; Bury the compilation buffer
                (with-selected-window (get-buffer-window "*compilation*")
                  (bury-buffer))
                (modi/do-execute exe)
                ;; When compilation is done, execute the program and remove the
                ;; callback from `compilation-finish-functions'
                (setq compilation-finish-functions
                      (delq finish-callback compilation-finish-functions))))
        (push finish-callback compilation-finish-functions))
      (smart-compile 1))))

(provide 'setup-smart-compile)

Update how C code is compiled using `smart-compile`


;;; Local settings based on host name

(defun pmade-local-settings ()
  (cond
   ((string= "skinny.local" system-name) (pmade-local:skinny))
   ((string= "beefy.local"  system-name) (pmade-local:beefy))))

(defun pmade-local:skinny ()
  "Settings for my MacBook Pro"
  (set-frame-position (selected-frame) 674 22)
  (set-frame-size (selected-frame) 106 56))

(defun pmade-local:beefy ()
  "Settings for my Mac Pro")

;; These settings only take affect if we're running the GUI.
(if window-system
    (add-hook 'window-setup-hook 'pmade-local-settings t))

;;; Local settings based on host name
;;
;; Some helpful functions:
;;
;;   (frame-parameter (selected-frame) 'top)
;;   (frame-parameter (selected-frame) 'left)

(defun pmade-local-settings ()
  (cond
   ((string= "skinny.local" system-name) (pmade-local:skinny))
   ((string= "beefy.local"  system-name) (pmade-local:beefy))))

(defun pmade-local:skinny ()
  "Settings for my MacBook Pro"
  (set-frame-position (selected-frame) 674 22)
  (set-frame-size (selected-frame) 106 56))

(defun pmade-local:beefy ()
  "Settings for my Mac Pro"
  (set-frame-position (selected-frame) 874 38)
  (set-frame-size (selected-frame) 126 75))

;; These settings only take affect if we're running the GUI.
(if window-system
    (add-hook 'window-setup-hook 'pmade-local-settings t))

Configure Emacs windows for my desktop computer


;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.

((emacs-lisp-mode
  (sentence-end-double-space . t)
  (eval flycheck-mode)
  (eval checkdoc-minor-mode)))

;; Local Variables:
;; mode: fundamental
;; End:

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((emacs-lisp-mode
  (colon-double-space . t)
  (sentence-end-double-space . t)
  (eval flycheck-mode)
  (eval checkdoc-minor-mode)))

;; Local Variables:
;; mode: fundamental
;; End:

Make sure sentences in comments end with 2 spaces


;; get rid of everything other than the title at the top.
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

;; get rid of the annoying GNU Emacs buffer
(setq inhibit-startup-screen t)

;; load the latest theme.
(load-theme 'avk-darkblue-white t)

(use-package spaceline
  :ensure t
  :demand
  :config
  (require 'spaceline-config)
  (spaceline-spacemacs-theme))

;; been using frames lately, so let's make a keybinding for that
(global-set-key (kbd "C-c F") 'make-frame)

;; no DING!
(setq visible-bell 1)

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

;; get rid of everything other than the title at the top.
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

;; get rid of the annoying GNU Emacs buffer
(setq inhibit-startup-screen t)

;; load the latest theme.
(load-theme 'avk-darkblue-white t)

(use-package spaceline
  :ensure t
  :demand
  :config
  (require 'spaceline-config)
  (spaceline-spacemacs-theme))

;; Frame commands
(global-set-key (kbd "C-c F") 'make-frame)
(global-set-key (kbd "C-c K") 'delete-frame)

;; no DING!
(setq visible-bell 1)

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

Add delete frame key binding

Add delete frame key binding


;;; my-git.el --- Git settings -*- lexical-binding: t -*-

;; Copyright (C) 2016  Sergey Timanin

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;;     http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:

;;; Code:

(use-package magit
  :config
  (setq vc-handled-backends (delq 'Git vc-handled-backends))
  :bind
  ("C-x g" . magit-status))

(provide 'my-git)

;;; my-git.el ends here

;;; my-git.el --- Git settings -*- lexical-binding: t -*-

;; Copyright (C) 2016  Sergey Timanin

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;;     http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:

;;; Code:

(use-package magit
  :config
  (setq vc-handled-backends (delq 'Git vc-handled-backends))
  :bind
  ("C-x g" . magit-status))

;; full screen magit-status
;; from http://whattheemacsd.com/setup-magit.el-01.html

(defadvice magit-status (around magit-fullscreen activate)
  "Open magit status as a fullscreen buffer."
  (window-configuration-to-register :magit-fullscreen)
  ad-do-it
  (delete-other-windows))

(defun magit-quit-session ()
  "Restore the previous window configuration and kill the magit buffer."
  (interactive)
  (kill-buffer)
  (jump-to-register :magit-fullscreen))

(define-key magit-status-mode-map (kbd "q") 'magit-quit-session)

(provide 'my-git)

;;; my-git.el ends here

Make magit buffer fullscreen to minimise window-jumping


;; -*- lexical-binding: t -*-

(defvar lsp-ccls-library-directories '("/usr/include/" "/usr/local/include/")
  "List of directories which will considered to be libraries.")

;; Use `c++-mode' for Qt4/5 headers. These mode can not be chosen based on file
;; extension, because these files have no extension.
(add-to-list 'auto-mode-alist '("/qt[45]/Q[^/]+/Q[^/]+\\'" . c++-mode))

;; Auto-indent after paste in C++ makes life very difficult.
(add-to-list 'spacemacs-indent-sensitive-modes 'c++-mode)

Disable auto-indent after paste in C++ mode


;; Compile packages in the background.
(async-bytecomp-package-mode 1)

;; Allow copying in the background.
(autoload 'dired-async-mode "dired-async.el" nil t)
(dired-async-mode 1)

Add async abilities to dired

Add async abilities to dired

This means that you can now copy/move large files around and emacs will
do it in the background!


;;; packages.el -- Emacs package management
(require 'package)

(defvar pjones:package-archives
  '(("org"       . "http://orgmode.org/elpa/")
    ("melpa"     . "http://melpa.milkbox.net/packages/")
    ("marmalade" . "http://marmalade-repo.org/packages/"))
  "List of package archives to use with Emacs.")

(defvar pjones:packages
  '(magit ruby-end inf-ruby htmlize yaml-mode bm gist
          haskell-mode ace-window markdown-mode org bbdb nix-mode
          nodejs-repl hydra flycheck dictionary multicolumn)
  "A list of packages to ensure are installed at launch.")

(dolist (archive pjones:package-archives)
  (add-to-list 'package-archives archive t))

;; Prepare package management
(package-initialize)
(when (not package-archive-contents)
  (package-refresh-contents))

;; Make sure all the packages are installed
(defun pjones:install-packages ()
  (dolist (p pjones:packages)
    (when (not (package-installed-p p))
      (package-install p))))

;;; packages.el -- Emacs package management
(require 'package)

(defvar pjones:package-archives
  '(("org"       . "http://orgmode.org/elpa/")
    ("melpa"     . "http://melpa.org/packages/")
    ("marmalade" . "http://marmalade-repo.org/packages/"))
  "List of package archives to use with Emacs.")

(defvar pjones:packages
  '( ace-window
     bbdb
     bm
     dictionary
     flycheck
     gist
     haskell-mode
     htmlize
     http
     hydra
     inf-ruby
     magit
     markdown-mode
     nix-mode
     nodejs-repl
     org
     ruby-end
     yaml-mode )
  "A list of packages to ensure are installed at launch.")

(dolist (archive pjones:package-archives)
  (add-to-list 'package-archives archive t))

;; Prepare package management
(package-initialize)
(when (not package-archive-contents)
  (package-refresh-contents))

;; Make sure all the packages are installed
(defun pjones:install-packages ()
  (dolist (p pjones:packages)
    (when (not (package-installed-p p))
      (package-install p))))

Clean up the Emacs package list

Clean up the Emacs package list


;;; init-projectile.el -- projetile setup

;;; Commentary:
;;; load projectile and customizations

;;; Code:
(use-package projectile
  :config
  (projectile-global-mode 1)
  (define-key projectile-mode-map (kbd "C-c p R") 'my/projectile-regenerate-tags)
  (key-seq-define evil-normal-state-map ",t" 'projectile-swith-project-or-find-file)
  :diminish projectile-mode)

(defun my/projectile-regenerate-tags ()
  "Regenerate projectile tags using git ctags."
  (interactive)
  (progn
    (start-process-shell-command
     "tags" nil (format "cd %s; git ctags"
                        (projectile-project-root)))
    (message "Generating tags file")))

(defun projectile-swith-project-or-find-file ()
  "Find a file in current (if any) or all projectile projects."
  (interactive)
  (if (projectile-project-p)
      (helm-projectile-find-file)
    (helm-projectile-switch-project)))

(provide 'init-projectile)
;;; init-projectile.el ends here

;;; init-projectile.el -- projetile setup

;;; Commentary:
;;; load projectile and customizations

;;; Code:
(use-package projectile
  :config
  (projectile-global-mode 1)
  (define-key projectile-mode-map (kbd "C-c p R") 'my/projectile-regenerate-tags)
  (key-seq-define evil-normal-state-map ",t" 'helm-projectile)
  :diminish projectile-mode)

(defun my/projectile-regenerate-tags ()
  "Regenerate projectile tags using git ctags."
  (interactive)
  (progn
    (start-process-shell-command
     "tags" nil (format "cd %s; git ctags"
                        (projectile-project-root)))
    (message "Generating tags file")))

(provide 'init-projectile)
;;; init-projectile.el ends here

Change ,t binding to 'helm-projectile

Change ,t binding to 'helm-projectile


(defhydra hydra-file-shortcuts (:color teal
                                :columns 4)
  "files"
  ("s" (switch-to-buffer "*scratch*") "scratch" :exit t)
  ("e" (find-file "~/Library/Preferences/Aquamacs Emacs/Preferences.el") ".emacs" :exit t)
  ("b" (find-file "~/.bashrc") "bashrc" :exit t)
  ("D" (find-file "/d") "/d" :exit t)
  ("q" nil "quit" :color blue))
(global-set-key (kbd "A-/") 'hydra-file-shortcuts/body)

(provide 'shortcut-file)

(defhydra hydra-file-shortcuts (:color teal
                                :columns 4)
  "files"
  ("s" (switch-to-buffer "*scratch*") "scratch" :exit t)
  ("e" (find-file "~/Library/Preferences/Aquamacs Emacs/Preferences.el") ".emacs" :exit t)
  ("b" (find-file "~/.bashrc") "bashrc" :exit t)
  ("c" (find-file "~/.ssh/config") "SSH Config" :exit t)
  ("D" (find-file "/d") "/d" :exit t)
  ("q" nil "quit" :color blue))
(global-set-key (kbd "A-/") 'hydra-file-shortcuts/body)

(provide 'shortcut-file)

Add SSH config file shortcut

Add SSH config file shortcut


(setq package-selected-packages
      '(ace-jump-mode
        auto-complete
        auto-indent-mode
        diminish
        dired-details
        dropdown-list
        edit-server
        edit-server-htmlize
        edts
        erlang
        exec-path-from-shell
        fill-column-indicator
        flx-ido
        flycheck
        gitconfig-mode
        gitignore-mode
        god-mode
        haskell-mode
        ido-vertical-mode
        js2-mode
        ledger-mode
        magit
        markdown-mode
        paredit
        projectile
        rainbow-mode
        smex
        solarized-theme
        undo-tree
        use-package
        yaml-mode
        yasnippet))

(setq package-selected-packages
      '(ace-jump-mode
        auto-complete
        auto-indent-mode
        diminish
        dired-details
        dropdown-list
        edit-server
        edit-server-htmlize
        edts
        erlang
        exec-path-from-shell
        fill-column-indicator
        flx-ido
        flycheck
        gitconfig-mode
        gitignore-mode
        god-mode
        haskell-mode
        ido-vertical-mode
        js2-mode
        ledger-mode
        magit
        markdown-mode
        multiple-cursors
        paredit
        projectile
        rainbow-mode
        smex
        solarized-theme
        undo-tree
        use-package
        yaml-mode
        yasnippet))

Add back accidentally removed multiple-cursors


(require-package 'rinari)
(after-load 'rinari
  (diminish 'rinari-minor-mode "Rin"))
(global-rinari-mode)

(require-package 'haml-mode)

(defun update-rails-ctags ()
  (interactive)
  (let ((default-directory (or (rinari-root) default-directory)))
    (shell-command (concat "ctags -a -e -f " rinari-tags-file-name " --tag-relative -R app lib vendor test"))))

(provide 'init-rails)

(require-package 'rinari)
(after-load 'rinari
  (diminish 'rinari-minor-mode "Rin"))
(global-rinari-mode)

(defun update-rails-ctags ()
  (interactive)
  (let ((default-directory (or (rinari-root) default-directory)))
    (shell-command (concat "ctags -a -e -f " rinari-tags-file-name " --tag-relative -R app lib vendor test"))))

(provide 'init-rails)

Remove duplicated requirement of haml-mode


;; multiple selection
(global-set-key (kbd "M-n") 'mc/mark-next-like-this)
(global-set-key (kbd "M-p") 'mc/mark-previous-like-this)

;; move lines
(global-set-key (kbd "M-S-<up>") 'drag-stuff-up)
(global-set-key (kbd "M-S-<down>") 'drag-stuff-down)

;; move between windows
(global-set-key (kbd "M-<left>") 'windmove-left)
(global-set-key (kbd "M-<right>") 'windmove-right)
(global-set-key (kbd "M-<up>") 'windmove-up)
(global-set-key (kbd "M-<down>") 'windmove-down)

;; comment line or region
(global-set-key (kbd "s-/") 'comment-line)

;; project structure
(global-set-key [f8] 'neotree-toggle)

;; multiple selection
(global-set-key (kbd "M-n") 'mc/mark-next-like-this)
(global-set-key (kbd "M-p") 'mc/mark-previous-like-this)

;; move lines
(global-set-key (kbd "M-S-<up>") 'drag-stuff-up)
(global-set-key (kbd "M-S-<down>") 'drag-stuff-down)

;; move between windows
(global-set-key (kbd "M-<left>") 'windmove-left)
(global-set-key (kbd "M-<right>") 'windmove-right)
(global-set-key (kbd "M-<up>") 'windmove-up)
(global-set-key (kbd "M-<down>") 'windmove-down)

;; comment line or region
(global-set-key (kbd "s-/") 'comment-line)

;; project structure
(global-set-key [f3] 'neotree-toggle)

Use F3 to open neotree

Use F3 to open neotree


(require 'helm-config)
(helm-mode 1)

(define-key helm-map (kbd "<up>") 'previous-history-element)
(define-key helm-map (kbd "<down>") 'next-history-element)

(setq helm-ff-skip-boring-files t)
;; TODO: these don't work. Looks like having the '.' and '..' on top
;; of the list is by design.
(push "\\.\\.$" helm-boring-file-regexp-list)
(push "\\.$" helm-boring-file-regexp-list)

(require 'helm-config)
(helm-mode 1)

(setq helm-ff-skip-boring-files t)
;; TODO: these don't work. Looks like having the '.' and '..' on top
;; of the list is by design.
(push "\\.\\.$" helm-boring-file-regexp-list)
(push "\\.$" helm-boring-file-regexp-list)

Use <up> and <down> for element selection.

That is the standard binding for Helm.


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// Exclude below TL toggle coverage as these pins won't be changed in the comportable IPs
INSTANCE: tb.dut
Toggle tl_i.a_user.parity "logic tl_i.a_user.parity[7:0]"
Toggle tl_i.a_user.parity_en "logic tl_i.a_user.parity_en"
Toggle tl_i.a_user.rsvd1 "logic tl_i.a_user.rsvd1[6:0]"
Toggle tl_o.d_opcode [1] "logic tl_o.d_opcode[2:0]"
Toggle tl_o.d_opcode [2] "logic tl_o.d_opcode[2:0]"
Toggle tl_o.d_param "logic tl_o.d_param[2:0]"
Toggle tl_o.d_sink "logic tl_o.d_sink[0:0]"
Toggle tl_o.d_user "logic tl_o.d_user[15:0]"
Toggle tl_i.a_param "logic tl_i.a_param[2:0]"

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// Exclude below TL toggle coverage as these pins won't be changed in the comportable IPs
INSTANCE: tb.dut
Toggle tl_o.d_opcode [1] "logic tl_o.d_opcode[2:0]"
Toggle tl_o.d_opcode [2] "logic tl_o.d_opcode[2:0]"
Toggle tl_o.d_param "logic tl_o.d_param[2:0]"
Toggle tl_o.d_sink "logic tl_o.d_sink[0:0]"
Toggle tl_i.a_param "logic tl_i.a_param[2:0]"

[dv] Remove toggle coverage excl for a_user/d_user

these 2 fields should be fully verified

Signed-off-by: Weicai Yang <4fa8c7762ee4da95e3dee7dae2c3263ea16637f9@google.com>


;; Json mode
(use-package json-mode
  :ensure t
  :mode ("\\.json\\'" . json-mode)
  :init
  (require 'programming-init)
  (use-package json-snatcher
    :ensure t)
  (add-hook 'json-mode-hook
            (lambda ()
              (make-local-variable 'js-indent-level)
              (setq js-indent-level 2)))

  (defun js-mode-bindings ()
    "Sets a hotkey for using the json-snatcher plugin"
    (when (string-match  "\\.json$" (buffer-name))
      (local-set-key (kbd "C-c C-g") 'jsons-print-path)))
  (add-hook 'json-mode-hook 'smartparens-mode)
  (add-hook 'json-mode-hook 'js-mode-bindings))
(provide 'json-init)

;; Json mode
(use-package json-mode
  :ensure t
  :mode ("\\.json\\'" . json-mode)
  :init
  (require 'programming-init)
  (use-package json-snatcher
    :ensure t)
  (add-hook 'json-mode-hook
            (lambda ()
              (make-local-variable 'js-indent-level)
              (setq js-indent-level 4)))

  (defun js-mode-bindings ()
    "Sets a hotkey for using the json-snatcher plugin"
    (when (string-match  "\\.json$" (buffer-name))
      (local-set-key (kbd "C-c C-g") 'jsons-print-path)))
  (add-hook 'json-mode-hook 'smartparens-mode)
  (add-hook 'json-mode-hook 'js-mode-bindings))
(provide 'json-init)

Change indent level on json to 4

Change indent level on json to 4


(use-package zenburn-theme
  :ensure t
  :config
  (setq default-frame-alist nil)
  (load-theme 'zenburn t))

(provide 'setup-theme)

(use-package spacemacs-theme
  :defer t
  :init
  (setq default-frame-alist nil)
  (load-theme 'spacemacs-dark t)
  )

(use-package spaceline
  :defer t
  :init
  (setq powerline-default-separator 'arrow-fade)
  )

(use-package spaceline-config
  :demand t
  :ensure spaceline
  :config
  (spaceline-define-segment line-column
    "The current line and column numbers."
    "l:%l c:%2c")
  (spaceline-helm-mode 1)
  (spaceline-spacemacs-theme)
  )

(provide 'setup-theme)

Update theme from Zenburn to spacemacs theme


(require-package 'haskell-mode)

(dolist (hook '(haskell-mode-hook inferior-haskell-mode-hook))
  (add-hook hook 'turn-on-haskell-doc-mode))

(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)

(eval-after-load 'haskell-mode
  '(progn
     (define-key haskell-mode-map (kbd "C-c h") 'hoogle)
     (define-key haskell-mode-map (kbd "RET") 'newline)))

(require-package 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)

(require-package 'flymake-haskell-multi)
(add-hook 'haskell-mode-hook #'flymake-haskell-multi-load)

(provide 'init-haskell)

(require-package 'haskell-mode)

(dolist (hook '(haskell-mode-hook inferior-haskell-mode-hook))
  (add-hook hook 'turn-on-haskell-doc-mode))

(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)

(eval-after-load 'haskell-mode
  '(progn
     (define-key haskell-mode-map (kbd "C-c h") 'hoogle)
     (define-key haskell-mode-map (kbd "RET") 'newline)))

(require-package 'ghci-completion)
(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)

(require-package 'flymake-haskell-multi)
(add-hook 'haskell-mode-hook #'flymake-haskell-multi-load)

;; Make compilation-mode understand "at blah.hs:11:34-50" lines output by GHC
(add-to-list
 'compilation-error-regexp-alist-alist
 '(ghc-at-regexp " at \\(.*l?hs\\):\\([0-9]+\\):\\([0-9]+\\)-[0-9]+$" 1 2 3 0 1))

(provide 'init-haskell)

Make compilation-mode understand "at blah.hs" lines output by GHC


;;; funcs.el --- Better Emacs Defaults Layer key bindings File
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(global-set-key (kbd "C-w") 'spacemacs/backward-kill-word-or-region)

;;; keybindings.el --- Better Emacs Defaults Layer key bindings File
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(global-set-key (kbd "C-w") 'spacemacs/backward-kill-word-or-region)

Fix wrong filename in a layer file’s header comment

the header of `keybindings.el` in the `better-defaults` layer


;;; my-web.el --- Web settings -*- lexical-binding: t -*-

;; Copyright (C) 2016  Sergey Timanin

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;;     http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:

;;; Code:

;; Enable for the matching filenames
;;
(use-package web-mode
  :mode
  ("\\.phtml\\'" "\\.djhtml\\'" "\\.html\\'")
  ;; Marks the -*- engine: jinja -*- variable as safe
  :init
  (add-hook 'web-mode-hook
            (lambda ()
              (setq safe-local-variable-values
                    '((engine . jinja)))))
  :config
  (setq web-mode-enable-engine-detection t)
  (setq web-mode-enable-auto-closing t)
  (setq web-mode-enable-auto-quoting t))

(provide 'my-web)

;;; my-web.el ends here

;;; my-web.el --- Web settings -*- lexical-binding: t -*-

;; Copyright (C) 2016  Sergey Timanin

;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;;     http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

;;; Commentary:

;;; Code:

;; Enable for the matching filenames
;;
(use-package web-mode
  :mode
  ("\\.phtml\\'" "\\.djhtml\\'" "\\.html\\'")
  ;; Marks the -*- engine: jinja -*- variable as safe
  :init
  (add-hook 'web-mode-hook
            (lambda ()
              (setq safe-local-variable-values
                    '((engine . jinja)))))
  :config
  (setq web-mode-enable-engine-detection t)
  (setq web-mode-enable-auto-closing t)
  (setq web-mode-enable-auto-quoting t)
  (setq web-mode-content-types-alist
      '(("jsx" . "\\.js[x]?\\'"))))

(provide 'my-web)

;;; my-web.el ends here

Enable react features in web-mode

Enable react features in web-mode


;;; setup-evil.el --- Evil mode.
;;; Commentary:
;;; Code:

(use-package evil-leader
  :demand t
  :ensure t
  :commands (global-evil-leader-mode))

(use-package evil
  :commands (evil-mode evil-define-key)
  :ensure t
  :demand t
  :init
  (global-evil-leader-mode)
  :config
  (setq evil-leader/no-prefix-mode-rx '("magit-.*-mode" "gnus-.*-mode"))
  (evil-leader/set-leader "<SPC>")
  (evil-define-key 'normal global-map (kbd "C-p") 'counsel-projectile-find-file)
  (evil-leader/set-key
    "<SPC>" 'ivy-switch-buffer

    ;; buffers
    "k" 'kill-this-buffer
    "w" 'save-buffer
    "br" 'rename-buffer

    ;; rg
    "a" 'counsel-projectile-rg

    ;; projectile
    "pp" 'projectile-switch-project
    )
  (evil-mode 1))

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

;;; setup-evil.el --- Evil mode.
;;; Commentary:
;;; Code:

;; All evil variables that are going to be called by evil should go
;; here since evil already is loaded when the evil-leader use-package
;; sexp finishes interpreting
(setq-default evil-want-C-u-scroll t)
(setq-default evil-want-C-d-scroll t)
(setq-default evil-search-module 'evil-search)

(use-package evil-leader
  :demand t
  :ensure t
  :commands (global-evil-leader-mode))

(use-package evil
  :commands (evil-mode evil-define-key)
  :ensure t
  :demand t
  :init
  (global-evil-leader-mode)
  :config
  (setq evil-leader/no-prefix-mode-rx '("magit-.*-mode" "gnus-.*-mode"))
  (evil-leader/set-leader "<SPC>")
  (evil-define-key 'normal global-map (kbd "C-p") 'counsel-projectile-find-file)
  (evil-leader/set-key
    "<SPC>" 'ivy-switch-buffer

    ;; buffers
    "k" 'kill-this-buffer
    "w" 'save-buffer
    "br" 'rename-buffer

    ;; rg
    "a" 'counsel-projectile-rg

    ;; Dired
    "gj" 'dired-jump

    ;; projectile
    "pp" 'projectile-switch-project
    )
  (evil-mode 1))

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

Fix evil C-d and C-u bindings and add dired jump leader key


(require-package 'color-theme-sanityinc-solarized)
(require-package 'color-theme-sanityinc-tomorrow)

;; If you don't customize it, this is the theme you get.
(setq-default custom-enabled-themes '(sanityinc-solarized-light))

;; Ensure that themes will be applied even if they have not been customized
(defun reapply-themes ()
  "Forcibly load the themes listed in `custom-enabled-themes'."
  (dolist (theme custom-enabled-themes)
    (unless (custom-theme-p theme)
      (load-theme theme)))
  (custom-set-variables `(custom-enabled-themes (quote ,custom-enabled-themes))))

(add-hook 'after-init-hook 'reapply-themes)

;;------------------------------------------------------------------------------
;; Toggle between light and dark
;;------------------------------------------------------------------------------
(defun light ()
  "Activate a light color theme."
  (interactive)
  (color-theme-sanityinc-solarized-light))

(defun dark ()
  "Activate a dark color theme."
  (interactive)
  (color-theme-sanityinc-solarized-dark))

(provide 'init-themes)

(require-package 'color-theme-sanityinc-solarized)
(require-package 'color-theme-sanityinc-tomorrow)

;; If you don't customize it, this is the theme you get.
(setq-default custom-enabled-themes '(sanityinc-tomorrow-bright))

;; Ensure that themes will be applied even if they have not been customized
(defun reapply-themes ()
  "Forcibly load the themes listed in `custom-enabled-themes'."
  (dolist (theme custom-enabled-themes)
    (unless (custom-theme-p theme)
      (load-theme theme)))
  (custom-set-variables `(custom-enabled-themes (quote ,custom-enabled-themes))))

(add-hook 'after-init-hook 'reapply-themes)

;;------------------------------------------------------------------------------
;; Toggle between light and dark
;;------------------------------------------------------------------------------
(defun light ()
  "Activate a light color theme."
  (interactive)
  (setq custom-enabled-themes '(sanityinc-tomorrow-day))
  (reapply-themes))

(defun dark ()
  "Activate a dark color theme."
  (interactive)
  (setq custom-enabled-themes '(sanityinc-tomorrow-bright))
  (reapply-themes))

(provide 'init-themes)

Change default theme to my preferred dark theme

See #424


;;; magit-conf.el -- Customizations for magit.
(eval-when-compile
  (defvar magit-last-seen-setup-instructions)
  (setq magit-last-seen-setup-instructions "1.4.0")
  (require 'magit))

;; Shamelessly stolen from http://whattheemacsd.com/.
(defadvice magit-status (around magit-fullscreen activate)
  (window-configuration-to-register :magit-fullscreen)
  ad-do-it
  (delete-other-windows))

(defun pjones:magit-quit-session ()
  "Restore the previous window configuration and kill the magit
buffer."
  (interactive)
  (kill-buffer)
  (jump-to-register :magit-fullscreen))

(setq magit-push-always-verify nil)

(define-key magit-status-mode-map (kbd "q") 'pjones:magit-quit-session)

;;; magit-conf.el -- Customizations for magit.
(eval-when-compile
  (defvar magit-last-seen-setup-instructions)
  (setq magit-last-seen-setup-instructions "1.4.0")
  (require 'magit))

;; Shamelessly stolen from http://whattheemacsd.com/.
(defadvice magit-status (around magit-fullscreen activate)
  (window-configuration-to-register :magit-fullscreen)
  ad-do-it
  (delete-other-windows))

(defun pjones:magit-quit-session ()
  "Restore the previous window configuration and kill the magit
buffer."
  (interactive)
  (kill-buffer)
  (jump-to-register :magit-fullscreen))

(define-key magit-status-mode-map (kbd "q") 'pjones:magit-quit-session)

Remove an older obsolete variable for magit


(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.
 '(package-selected-packages
   (quote
    (typo org-bullets markdown-mode writegood-mode visual-fill-column use-package paredit magit helm-projectile helm-ag exwm cider better-defaults)))
 '(safe-local-variable-values
   (quote
    ((whitespace-line-column)
     (eval ignore-errors
           (require
            (quote whitespace))
           (whitespace-mode 0)
           (whitespace-mode 1))
     (clojure-test-ns-segment-position . 1)))))
(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.
 )

(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.
 '(exwm-layout-show-all-buffers t)
 '(exwm-workspace-show-all-buffers t)
 '(package-selected-packages
   (quote
    (typo org-bullets markdown-mode writegood-mode visual-fill-column use-package paredit magit helm-projectile helm-ag exwm cider better-defaults)))
 '(safe-local-variable-values
   (quote
    ((whitespace-line-column)
     (eval ignore-errors
           (require
            (quote whitespace))
           (whitespace-mode 0)
           (whitespace-mode 1))
     (clojure-test-ns-segment-position . 1)))))
(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.
 )

Allow exwm to switch to any buffer in any workspace.


;; test-helper.el --- Test helpers for cerbere

;; Copyright (C) Nicolas Lamirault <nicolas.lamirault@gmail.com>

;; Copyright (C) 2014  Nicolas Lamirault

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;;; Code:

(require 'f)

(setq debugger-batch-max-lines (+ 50 max-lisp-eval-depth)
      debug-on-error t)

(defconst cerbere-testsuite-dir (f-parent (f-this-file))
  "The testsuite directory for Cerbere.")

(defconst cerbere-source-dir (f-parent cerbere-testsuite-dir)
  "The cerbere source directory.")

(message "Running tests on Emacs %s" emacs-version)

(message "Load cerbere : %s" cerbere-source-dir)
(load (s-concat cerbere-source-dir "/cerbere.elc"))

;;; test-helper.el ends here

;; test-helper.el --- Test helpers for cerbere

;; Copyright (C) Nicolas Lamirault <nicolas.lamirault@gmail.com>

;; Copyright (C) 2014  Nicolas Lamirault

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;;; Code:

(defmacro cerbere-with-test-content (file-name &rest body)
  "Setup a buffer backing FILE-NAME with CONTENT and run BODY in it."
    (declare (indent 1))
    `(save-excursion
       (with-current-buffer (find-file-noselect
                             (concat cerbere-test-path "data/" ,file-name))
         (goto-char (point-min))
         ,@body
         (kill-buffer))))

(provide 'test-helper)
;;; test-helper.el ends here

Add method to setup fake buffer for testing.


(require 'prodigy)

(prodigy-define-tag :name 'rails
  :ready-message "Listening on 0\\.0\\.0\\.0:[0-9]+, CTRL\\+C to stop")

(prodigy-define-tag
  :name 'zeus
  :on-output
  (lambda (&rest args)
    (let ((service (plist-get args :service))
          (poll-zeus "ps aux | grep 'zeus slave' | grep -c environment"))
      (when (>= (string-to-number (shell-command-to-string poll-zeus)) 2)
        (prodigy-set-status service 'ready)))))

(prodigy-define-tag :name 'resque-pool
  :ready-message "Starting worker")

(provide 'clgc-prodigy)

(require 'prodigy)

(prodigy-define-tag :name 'rails
  :ready-message "Listening on 0\\.0\\.0\\.0:[0-9]+, CTRL\\+C to stop")

(prodigy-define-tag
  :name 'zeus
  :on-output
  (prodigy-callback (service)
    (let ((poll-zeus "ps aux | grep -c 'zeus slave:'"))
      (when (>= (string-to-number (shell-command-to-string poll-zeus)) 6)
        (prodigy-set-status service 'ready)))))

(prodigy-define-tag :name 'resque-pool
  :ready-message "Starting worker")

(provide 'clgc-prodigy)

Use prodigy-callback and just count zeus slaves for ready-state


;;; edit-server-conf.el --- Settings for edit-server
;;
;;; Commentary:
;;
;;; Code:
(require 'edit-server)

(custom-set-variables
 '(edit-server-new-frame nil)
 '(edit-server-default-major-mode 'markdown-mode))

;; Fix a really buggy issue with edit-server:
(define-key edit-server-edit-mode-map (kbd "C-x C-s") #'save-buffer)

;;; edit-server-conf.el ends here

;;; edit-server-conf.el --- Settings for edit-server
;;
;;; Commentary:
;;
;;; Code:
(require 'edit-server)
(require 'markdown-mode)

(custom-set-variables
 '(edit-server-new-frame nil)
 '(edit-server-default-major-mode 'markdown-mode))

;; Fix a really buggy issue with edit-server:
(define-key edit-server-edit-mode-map (kbd "C-x C-s") #'save-buffer)

;; Put markdown-mode into the right state:
(add-hook 'edit-server-edit-mode-hook #'pjones:markdown-visual-line)

;;; edit-server-conf.el ends here

edit-server: Make sure markdown-mode formats correctly


;;; lang/nix/config.el -*- lexical-binding: t; -*-

(use-package! nix-mode
  :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
  :mode "\\.nix\\'"
  :config
  (set-repl-handler! 'nix-mode #'+nix/open-repl)
  (set-company-backend! 'nix-mode 'company-nixos-options)
  (set-lookup-handlers! 'nix-mode
    :documentation '(+nix/lookup-option :async t))
  (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t)

  (map! :localleader
        :map nix-mode-map
        "f" #'nix-update-fetch
        "p" #'nix-format-buffer
        "r" #'nix-repl-show
        "s" #'nix-shell
        "b" #'nix-build
        "u" #'nix-unpack
        "o" #'+nix/lookup-option))

(use-package! nix-drv-mode
  :mode "\\.drv\\'")

(use-package! nix-update
  :commands nix-update-fetch)

(use-package! nix-repl
  :commands nix-repl-show)

;;; lang/nix/config.el -*- lexical-binding: t; -*-

(after! tramp
  (add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))

;;
;;; Plugins

(use-package! nix-mode
  :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
  :mode "\\.nix\\'"
  :config
  (set-repl-handler! 'nix-mode #'+nix/open-repl)
  (set-company-backend! 'nix-mode 'company-nixos-options)
  (set-lookup-handlers! 'nix-mode
    :documentation '(+nix/lookup-option :async t))
  (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t)

  (map! :localleader
        :map nix-mode-map
        "f" #'nix-update-fetch
        "p" #'nix-format-buffer
        "r" #'nix-repl-show
        "s" #'nix-shell
        "b" #'nix-build
        "u" #'nix-unpack
        "o" #'+nix/lookup-option))

(use-package! nix-drv-mode
  :mode "\\.drv\\'")

(use-package! nix-update
  :commands nix-update-fetch)

(use-package! nix-repl
  :commands nix-repl-show)

Add nix bin path to tramp-remote-path

Add nix bin path to tramp-remote-path


;; Bookmarklet to load skewer:
;;
;;     javascript:(function(){var d=document ;var s=d.createElement('script');s.src='http://localhost:8023/skewer';d.body.appendChild(s);})()
;;

(require 'skewer-mode)
(require 'skewer-repl)

(defun skewer-start ()
  (interactive)
  (let ((httpd-port 8023))
    (httpd-start)
    (message "Ready to skewer the browser. Now jack in with the bookmarklet.")))

(defalias 'skewer-demo 'run-skewer)

(provide 'setup-skewer)

;; Bookmarklet to load skewer:
;;
;;     javascript:(function(){var d=document ;var s=d.createElement('script');s.src='http://localhost:8023/skewer';d.body.appendChild(s);})()
;;

(require 'skewer-mode)
(require 'skewer-repl)

(defun skewer-start ()
  (interactive)
  (let ((httpd-port 8023))
    (httpd-start)
    (message "Ready to skewer the browser. Now jack in with the bookmarklet.")))

(defun skewer-demo ()
  (interactive)
  (let ((httpd-port 8024))
    (run-skewer)
    (skewer-repl)))

(provide 'setup-skewer)

Use skewer-demo instead of run-skewer

Use skewer-demo instead of run-skewer


;;; init-avy.el --- init file for avy

;;; Commentary:

;; Use `C-:` to jump to any position by entering 1 character and
;; use `C-'` to jump to any position by entering 2 characters.

;;; Code:

(use-package avy
  :bind
  ("C-:" . avy-goto-char)
  ("C-'" . avy-goto-char-2)
  ("M-g f" . avy-goto-line))

(provide 'init-avy)

;;; init-avy.el ends here

;;; init-avy.el --- init file for avy

;;; Commentary:

;; Use `C-:` to jump to any position by entering 1 character and
;; use `C-'` to jump to any position by entering 2 characters.

;;; Code:

(use-package avy
  :bind
  ("C-\"" . avy-goto-char)
  ("C-'" . avy-goto-char-2)
  ("M-g f" . avy-goto-line))

(provide 'init-avy)

;;; init-avy.el ends here

Update keybinding for avy mode

Update keybinding for avy mode


;;; Character sets

;;; Changing font sizes

(require-package 'default-text-scale)
(global-set-key (kbd "C-M-=") 'default-text-scale-increase)
(global-set-key (kbd "C-M--") 'default-text-scale-decrease)

(when (eq 'ns window-system)
  (set-fontset-font
   t 'symbol
   (font-spec :family "Apple Color Emoji") nil 'prepend))

(defun sanityinc/maybe-adjust-visual-fill-column ()
  "Readjust visual fill column when the global font size is modified.
This is helpful for writeroom-mode, in particular."
  ;; TODO: submit as patch
  (if visual-fill-column-mode
      (add-hook 'after-setting-font-hook 'visual-fill-column--adjust-window nil t)
    (remove-hook 'after-setting-font-hook 'visual-fill-column--adjust-window t)))

(add-hook 'visual-fill-column-mode-hook
          'sanityinc/maybe-adjust-visual-fill-column)

(provide 'init-fonts)

;;; Character sets

;;; Changing font sizes

(require-package 'default-text-scale)
(global-set-key (kbd "C-M-=") 'default-text-scale-increase)
(global-set-key (kbd "C-M--") 'default-text-scale-decrease)

(defun sanityinc/maybe-adjust-visual-fill-column ()
  "Readjust visual fill column when the global font size is modified.
This is helpful for writeroom-mode, in particular."
  ;; TODO: submit as patch
  (if visual-fill-column-mode
      (add-hook 'after-setting-font-hook 'visual-fill-column--adjust-window nil t)
    (remove-hook 'after-setting-font-hook 'visual-fill-column--adjust-window t)))

(add-hook 'visual-fill-column-mode-hook
          'sanityinc/maybe-adjust-visual-fill-column)

(provide 'init-fonts)

Remove non-working OSX color emoji support code

http://emacs.1067599.n5.nabble.com/Emoji-on-Mac-OS-X-td401600.html


(defconst mfa-dired-packages '(all-the-icons all-the-icons-dired dired-narrow dired))

(defun mfa-dired/init-all-the-icons ()
  (use-package all-the-icons
    :defer t))

(defun mfa-dired/init-all-the-icons-dired ()
  (use-package all-the-icons-dired
    :defer t
    :init
    (with-eval-after-load 'dired
      (add-hook 'dired-mode-hook #'all-the-icons-dired-mode))
    :config
    (spacemacs|hide-lighter all-the-icons-dired-mode)))

(defun mfa-dired/init-dired-narrow ()
  (use-package dired-narrow
    :defer t
    :init
    (spacemacs/set-leader-keys-for-major-mode 'dired-mode "/" #'dired-narrow)))

(defun mfa-dired/post-init-dired ()
  (spacemacs|use-package-add-hook dired
    :post-config
    (progn
      (add-hook 'dired-mode-hook #'dired-dwim-target-mode)
      (spacemacs/set-leader-keys-for-major-mode 'dired-mode
        "ot" #'dired-dwim-target-mode)
      (evil-define-key 'evilified dired-mode-map
        (kbd "RET") #'dired-find-file-by-prefix)
      (evil-define-key 'evilified dired-mode-map
        "-" #'dired-up-directory))))

(defconst mfa-dired-packages '(all-the-icons all-the-icons-dired dired-narrow dired))

(defun mfa-dired/init-all-the-icons ()
  (use-package all-the-icons
    :defer t))

(defun mfa-dired/init-all-the-icons-dired ()
  (use-package all-the-icons-dired
    :defer t
    :diminish
    :init
    (with-eval-after-load 'dired
      (add-hook 'dired-mode-hook #'all-the-icons-dired-mode))))

(defun mfa-dired/init-dired-narrow ()
  (use-package dired-narrow
    :defer t
    :init
    (spacemacs/set-leader-keys-for-major-mode 'dired-mode "/" #'dired-narrow)))

(defun mfa-dired/post-init-dired ()
  (spacemacs|use-package-add-hook dired
    :post-config
    (progn
      (add-hook 'dired-mode-hook #'dired-dwim-target-mode)
      (spacemacs/set-leader-keys-for-major-mode 'dired-mode
        "ot" #'dired-dwim-target-mode)
      (evil-define-key 'evilified dired-mode-map
        (kbd "RET") #'dired-find-file-by-prefix)
      (evil-define-key 'evilified dired-mode-map
        "-" #'dired-up-directory))))

Simplify logic that diminishes all-the-icons-dired-mode


(doom! :completion
       (company
        +auto +tng)
       (ivy +fuzzy)

       :ui
       deft
       doom
       doom-quit
       fill-column
       hl-todo
       modeline
       nav-flash
       ophints
       (popup
        +all
        +defaults)
       vc-gutter
       vi-tilde-fringe
       window-select
       workspaces

       :editor
       (evil +everywhere)
       file-templates
       (format +onsave)
       rotate-text
       snippets

       :emacs
       (undo +tree)
       dired
       electric
       ibuffer
       vc

       :term
       eshell

       :checkers
       spell
       grammar
       syntax

       :tools
       debugger
       (docker +lsp)
       editorconfig
       (eval +overlay)
       (lookup
        +docsets)
       (lsp +eglot)
       (magit +forge)
       make
       terraform
       biblio

       :lang
       (cc +lsp)
       (yaml +lsp)
       data
       emacs-lisp
       (go +lsp)
       latex
       markdown
       (org
        +roam
        +hugo
        +journal
        +gnuplot
        +pancoc
        +dragndrop
        +journal)
       plantuml
       (python +pyenv)
       rest
       (rust +eglot)
       (sh +lsp)

       :email
       (mu4e +gmail)

       :app
       (rss +org)

       :config
       (default +bindings +smartparens))

(doom! :completion
       (company
        +auto +tng)
       (ivy +fuzzy)

       :ui
       deft
       doom
       doom-quit
       fill-column
       hl-todo
       modeline
       nav-flash
       ophints
       (popup
        +all
        +defaults)
       vc-gutter
       vi-tilde-fringe
       window-select
       workspaces

       :editor
       (evil +everywhere)
       file-templates
       (format +onsave)
       rotate-text
       snippets

       :emacs
       (undo +tree)
       dired
       electric
       ibuffer
       vc

       :term
       eshell

       :checkers
       spell
       grammar
       syntax

       :tools
       debugger
       (docker +lsp)
       editorconfig
       (eval +overlay)
       (lookup
        +docsets)
       (lsp)
       (magit +forge)
       make
       terraform
       biblio

       :lang
       (cc +lsp)
       (yaml +lsp)
       data
       emacs-lisp
       (go +lsp)
       latex
       markdown
       (org
        +roam
        +hugo
        +journal
        +gnuplot
        +pancoc
        +dragndrop
        +journal)
       plantuml
       (python +pyenv +lsp)
       rest
       (rust +eglot)
       (sh +lsp)

       :email
       (mu4e +gmail)

       :app
       (rss +org)

       :config
       (default +bindings +smartparens))

Use lsp instead of eglot

Emacs: Use lsp instead of eglot


;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

;; ---------------------------------------------------------------------------
;; Prefixes
;; ---------------------------------------------------------------------------

;; Variables

(defvar colors-enable-rainbow-identifiers nil
  "if non nil the `rainbow-identifers' package is enabled.")

(defvar colors-enable-nyan-cat-progress-bar nil
  "if non nil all nyan cat packges are enabled (for now only `nyan-mode').")

;; Command prefixes

(setq colors/key-binding-prefixes '(("C" .  "colors")))
(when colors-enable-rainbow-identifiers
  (push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
       colors/key-binding-prefixes)

;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

;; Variables

(defvar colors-enable-rainbow-identifiers nil
  "if non nil the `rainbow-identifers' package is enabled.")

(defvar colors-enable-nyan-cat-progress-bar nil
  "if non nil all nyan cat packges are enabled (for now only `nyan-mode').")

;; Command prefixes

(setq colors/key-binding-prefixes '(("C" .  "colors")))
(when colors-enable-rainbow-identifiers
  (push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
       colors/key-binding-prefixes)

Remove dead comment in colors layer

Remove dead comment in colors layer


;;; seanmacs-libs.el --- Functions/libraries -*- lexical-binding: t; -*-

;;; Commentary:
;; Functions and libraries that should be loaded early on, and can be used
;; elsewhere within my configuration.

;;; Code:

;; Useful string utilities, e.g. 's-contains-p'.
(use-package s :straight t)

(use-package dash :straight t)

(defun sm/run-and-bury (fn &rest args)
  "Run FN with ARGS then bury the buffer."
  (let ((buf (buffer-name)))
    (apply fn args)
    (bury-buffer buf)))

(provide 'seanmacs-libs)
;;; seanmacs-libs.el ends here

;;; seanmacs-libs.el --- Functions/libraries -*- lexical-binding: t; -*-

;;; Commentary:
;; Functions and libraries that should be loaded early on, and can be used
;; elsewhere within my configuration.

;;; Code:

;; Useful string utilities, e.g. 's-contains-p'.
(use-package s :straight t)

(use-package dash :straight t)

(defun sm/run-and-bury (fn &rest args)
  "Run FN with ARGS then bury the buffer."
  (let ((buf (buffer-name)))
    (apply fn args)
    (bury-buffer buf)))

(defun sm/format-github-url (origin branch filepath beg &optional end)
  (let* ((repo
          (thread-last origin
            (s-chop-suffixes '("/" ".git"))
            (s-chop-prefixes '("git@github.com:" "https://github.com/"))))
         (url (format "https://github.com/%s/tree/%s/%s#L%d" repo branch filepath beg)))
    (if end
        (concat url (format "-L%d" end))
      url)))

(defun sm/browse-github-url-at-point (beg end)
  "Open file at point on github using BEG and END to link to the correct section of code."
  (interactive (if (use-region-p)
                   (list (line-number-at-pos (region-beginning))
                         (line-number-at-pos (region-end)))
                 (list (line-number-at-pos) nil)))
  (when (magit-toplevel)
    (let ((origin (magit-get "remote.origin.url"))
          (branch (magit-get-current-branch))
          (filepath (s-chop-prefix (magit-toplevel) (buffer-file-name))))
      (browse-url (sm/format-github-url origin branch filepath beg end)))))

(provide 'seanmacs-libs)
;;; seanmacs-libs.el ends here

Add function to open file at point in github


(when (maybe-require-package 'elm-mode)
  (setq-default elm-format-on-save t)
  (after-load 'elm-mode
    (diminish 'elm-indent-mode)
    (when (executable-find "elm-oracle")
      (add-hook 'elm-mode-hook 'elm-oracle-setup-completion))
    (when (executable-find "elm-format")
      (setq-default elm-format-on-save t)))
  (when (maybe-require-package 'flycheck-elm)
    (after-load 'elm-mode
      (flycheck-elm-setup))))

(provide 'init-elm)

(when (maybe-require-package 'elm-mode)
  (setq-default elm-format-on-save t)
  (after-load 'elm-mode
    (diminish 'elm-indent-mode)
    (add-hook 'elm-mode-hook
              (lambda () (sanityinc/local-push-company-backend 'company-elm)))
    (when (executable-find "elm-format")
      (setq-default elm-format-on-save t)))
  (when (maybe-require-package 'flycheck-elm)
    (after-load 'elm-mode
      (flycheck-elm-setup))))

(provide 'init-elm)

Use company instead of completion-at-point in elm-mode