(when *is-a-mac*
  (setq mac-command-modifier 'meta)
  (setq mac-option-modifier 'none)
  (setq default-input-method "MacOSX")
  ;; Make mouse wheel / trackpad scrolling less jerky
  (setq mouse-wheel-scroll-amount '(1
                                    ((shift) . 5)
                                    ((control))))
  (dolist (multiple '("" "double-" "triple-"))
    (dolist (direction '("right" "left"))
      (global-set-key (kbd (concat "<" multiple "wheel-" direction ">")) 'ignore)))
  (global-set-key (kbd "M-`") 'ns-next-frame)
  (global-set-key (kbd "M-h") 'ns-do-hide-emacs)
  (after-load 'nxml-mode
    (define-key nxml-mode-map (kbd "M-h") nil))
  (global-set-key (kbd "M-ˍ") 'ns-do-hide-others) ;; what describe-key reports for cmd-option-h
  )

(provide 'init-osx-keys)

(when *is-a-mac*
  (setq mac-command-modifier 'meta)
  (setq mac-option-modifier 'none)
  (setq default-input-method "MacOSX")
  ;; Make mouse wheel / trackpad scrolling less jerky
  (setq mouse-wheel-scroll-amount '(1
                                    ((shift) . 5)
                                    ((control))))
  (dolist (multiple '("" "double-" "triple-"))
    (dolist (direction '("right" "left"))
      (global-set-key (kbd (concat "<" multiple "wheel-" direction ">")) 'ignore)))
  (global-set-key (kbd "M-`") 'ns-next-frame)
  (global-set-key (kbd "M-h") 'ns-do-hide-emacs)
  (global-set-key (kbd "M-˙") 'ns-do-hide-others)
  (after-load 'nxml-mode
    (define-key nxml-mode-map (kbd "M-h") nil))
  (global-set-key (kbd "M-ˍ") 'ns-do-hide-others) ;; what describe-key reports for cmd-option-h
  )

(provide 'init-osx-keys)

Make standard OS X "Hide Others" keystroke work


;;; Mail and News Servers

;; News via NNTP
(setq
 nntp-authinfo-file pmade-authinfo
 gnus-select-method '(nntp "nntp.aioe.org"))

;; Mail via IMAP and SMTP
(setq
 pmade-mail-server "mail.pmade.com"
 gnus-secondary-select-methods `((nnimap ,pmade-mail-server (nnimap-stream ssl)))
 nnimap-authinfo-file pmade-authinfo
 message-send-mail-function 'smtpmail-send-it
 smtpmail-smtp-server pmade-mail-server
 smtpmail-auth-credentials pmade-authinfo
 smtpmail-starttls-credentials `((,pmade-mail-server 25 nil nil))
 smtpmail-local-domain "pmade.com")

;; Place sent mail on the server
(setq gnus-message-archive-group "nnimap+mail.pmade.com:INBOX.Sent")

;; Use the correct value for the Message-ID header
(defun message-make-message-id ()
  (concat "<" (message-unique-id) "@pmade.com>"))

;;; Mail and News Servers

;; News via NNTP
(setq
 nntp-authinfo-file pmade-authinfo
 gnus-select-method '(nntp "nntp.aioe.org"))

;; Mail via IMAP and SMTP
(setq
 pmade-mail-server "mail.pmade.com"
 nnimap-authinfo-file pmade-authinfo
 message-send-mail-function 'smtpmail-send-it
 smtpmail-smtp-server pmade-mail-server
 smtpmail-auth-credentials pmade-authinfo
 smtpmail-starttls-credentials `((,pmade-mail-server 25 nil nil))
 smtpmail-local-domain "pmade.com")

(setq gnus-secondary-select-methods
      `((nntp   "news.gmane.org")
        (nnimap ,pmade-mail-server (nnimap-stream ssl))))

;; Place sent mail on the server
(setq gnus-message-archive-group "nnimap+mail.pmade.com:INBOX.Sent")

;; Use the correct value for the Message-ID header
(defun message-make-message-id ()
  (concat "<" (message-unique-id) "@pmade.com>"))

Add gmane as a source

Add gmane as a source


(ert-deftest count-white-spaces/test ()
  (should (eq (count-white-spaces "a") 0))
  (should (eq (count-white-spaces " a") 1))
  (should (eq (count-white-spaces " a ") 1))
  (should (eq (count-white-spaces "  a") 2)))

(ert-deftest get-yaml-key/test ()
  (should (s-equals? (get-yaml-key "  abc:") "abc"))
  (should (s-equals? (get-yaml-key "hello_world:") "hello_world"))
  (should (s-equals? (get-yaml-key "  hello1: abc") "hello1")))

(ert-deftest yaml-tomato--get-yaml-key/test ()
  (should (s-equals? (yaml-tomato--get-yaml-key "  abc:") "abc"))
  (should (s-equals? (yaml-tomato--get-yaml-key "hello_world:") "hello_world"))
  (should (s-equals? (yaml-tomato--get-yaml-key "  hello1: abc") "hello1")))

Use preffered community standard way of naming


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

(after! projectile
  (add-to-list 'projectile-project-root-files "project.godot"))

;;
;;; Packages

(use-package! gdscript-mode
  :defer t
  :config
  (set-lookup-handlers! 'gdscript-mode
    :documentation #'gdscript-docs-browse-symbol-at-point)

  (when (featurep! +lsp)
    (add-hook 'gdscript-mode-local-vars-hook #'lsp!))

  (map! :localleader
        :map gdscript-mode-map

        (:prefix ("r" . "run")
         "e" #'gdscript-godot-open-project-in-editor
         "p" #'gdscript-godot-run-project
         "d" #'gdscript-godot-run-project-debug
         "s" #'gdscript-godot-run-current-scene)

        (:prefix ("h" . "help")
         "b" #'gdscript-docs-browse-api
         "f" #'gdscript-docs-browse-symbol-at-point)

        (:prefix ("f" . "format")
         "b" #'gdscript-format-buffer
         "r" #'gdscript-format-region)))

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

(after! projectile
  (add-to-list 'projectile-project-root-files "project.godot"))

;;
;;; Packages

(use-package! gdscript-mode
  :defer t
  :config
  (set-lookup-handlers! 'gdscript-mode
    :documentation #'gdscript-docs-browse-symbol-at-point)

  (when (featurep! +lsp)
    (add-hook 'gdscript-mode-local-vars-hook #'lsp!))

  (map! :localleader
        :map gdscript-mode-map

        (:prefix ("r" . "run")
         :desc "Open project in Godot" "e" #'gdscript-godot-open-project-in-editor
         :desc "Run project" "p" #'gdscript-godot-run-project
         :desc "Run debug" "d" #'gdscript-godot-run-project-debug
         :desc "Run current scene" "s" #'gdscript-godot-run-current-scene)

        (:prefix ("d" . "debug")
         :desc "Add breakpoint" "a"  #'gdscript-debug-add-breakpoint
         :desc "Display breakpoint buffer" "b" #'gdscript-debug-display-breakpoint-buffer
         :desc "Remove breakpoint" "d" #'gdscript-debug-remove-breakpoint
         :desc "Continue execution" "c" #'gdscript-debug-continue
         :desc "Next" "n" #'gdscript-debug-next
         :desc "Step" "s" #'gdscript-debug-step)

        (:prefix ("h" . "help")
         :desc "Browse online API" "b" #'gdscript-docs-browse-api
         :desc "Browse API at point" "f" #'gdscript-docs-browse-symbol-at-point)

        (:prefix ("f" . "format")
         :desc "Format buffer" "b" #'gdscript-format-buffer
         :desc "Format region" "r" #'gdscript-format-region)))

Add shortcuts and descriptions for GDScript module


;;; radian-yank.el --- Killing and yanking

;; If you start typing when you have something selected, then the
;; selection will be deleted. If you press DEL while you have
;; something selected, it will be deleted rather than
;; killed. (Otherwise, in both cases the selection is deselected and
;; the normal function of the key is performed.)
(delete-selection-mode 1)

;; Make delete-selection-mode work properly with Paredit (so that, for
;; example, pressing DEL while there is a selection will actually
;; cause the region to be deleted, as expected). See the commentary in
;; delsel.el for details about what is going on here.
(with-eval-after-load 'paredit
  (put 'paredit-forward-delete 'delete-selection 'supersede)
  (put 'paredit-backward-delete 'delete-selection 'supersede)
  (put 'paredit-newline 'delete-selection t))

;; Eliminate duplicates in the kill ring. That is, if you kill the
;; same thing twice, you won't have to use M-y twice to get past it to
;; older entries in the kill ring.
(setq kill-do-not-save-duplicates t)

(provide 'radian-yank)

;;; radian-yank.el ends here

;;; radian-yank.el --- Killing and yanking

;; If you start typing when you have something selected, then the
;; selection will be deleted. If you press DEL while you have
;; something selected, it will be deleted rather than
;; killed. (Otherwise, in both cases the selection is deselected and
;; the normal function of the key is performed.)
(delete-selection-mode 1)

;; Make delete-selection-mode work properly with Paredit (so that, for
;; example, pressing DEL while there is a selection will actually
;; cause the region to be deleted, as expected). See the commentary in
;; delsel.el for details about what is going on here.
(with-eval-after-load 'paredit
  (put 'paredit-forward-delete 'delete-selection 'supersede)
  (put 'paredit-backward-delete 'delete-selection 'supersede)
  (put 'paredit-newline 'delete-selection t))

;; Make delete-selection-mode work properly with AUCTeX.
(with-eval-after-load 'latex
  (put 'LaTeX-insert-left-brace 'delete-selection t))

;; Eliminate duplicates in the kill ring. That is, if you kill the
;; same thing twice, you won't have to use M-y twice to get past it to
;; older entries in the kill ring.
(setq kill-do-not-save-duplicates t)

(provide 'radian-yank)

;;; radian-yank.el ends here

Make delete-selection-mode work with AUCTeX


;;; core-workgroups.el
;; see lib/workgroup-defuns.el

(use-package workgroups2
  :init
  (setq wg-session-file          (! (expand-file-name "wg-default" narf-temp-dir))
        wg-workgroup-directory   (! (expand-file-name "workgroups" narf-temp-dir))
        wg-first-wg-name         "main"
        wg-session-load-on-start t
        wg-mode-line-display-on  nil
        wg-mess-with-buffer-list t
        ;; What to do on Emacs exit / workgroups-mode exit?
        wg-emacs-exit-save-behavior           'save       ; Options: 'save 'ask nil
        wg-workgroups-mode-exit-save-behavior 'save)
  :config
  (defvar narf/helm-source-wg
    '((name       . "Workgroups")
      (candidates . wg-workgroup-names)
      (action     . narf/wg-helm-switch-to-workgroup)))

  (after! projectile
    ;; Turns projectile switch-project interface (or helm's interface to it)
    ;; create a new workgroup for the new project.
    (setq projectile-switch-project-action 'narf/wg-projectile-switch-project))

  ;; Initialize!
  (add-hook! after-init
    (workgroups-mode 1)
    (diminish 'workgroups-mode)))

(provide 'core-workgroups)
;;; core-workgroups.el ends here

;;; core-workgroups.el
;; see lib/workgroup-defuns.el

(use-package workgroups2
  :when window-system
  :init
  (setq wg-session-file          (! (expand-file-name "wg-default" narf-temp-dir))
        wg-workgroup-directory   (! (expand-file-name "workgroups" narf-temp-dir))
        wg-first-wg-name         "main"
        wg-session-load-on-start t
        wg-mode-line-display-on  nil
        wg-mess-with-buffer-list t
        ;; What to do on Emacs exit / workgroups-mode exit?
        wg-emacs-exit-save-behavior           'save       ; Options: 'save 'ask nil
        wg-workgroups-mode-exit-save-behavior 'save)
  :config
  (defvar narf/helm-source-wg
    '((name       . "Workgroups")
      (candidates . wg-workgroup-names)
      (action     . narf/wg-helm-switch-to-workgroup)))

  (after! projectile
    ;; Turns projectile switch-project interface (or helm's interface to it)
    ;; create a new workgroup for the new project.
    (setq projectile-switch-project-action 'narf/wg-projectile-switch-project))

  ;; Initialize!
  (add-hook! after-init
    (workgroups-mode 1)
    (diminish 'workgroups-mode)))

(provide 'core-workgroups)
;;; core-workgroups.el ends here

Disable workgroups2 in terminal emacs

Disable workgroups2 in terminal emacs


;;; hello-world-test.el --- Tests for Hello World (exercism)

;;; Commentary:
;; Common test data version: 1.1.0 be3ae66

;;; Code:

(load-file "hello-world.el")

(ert-deftest hello-world-test ()
  (should (equal (hello) "Hello, World!")))

(provide 'hello-world-test)

;;; hello-world-test.el ends here

;;; hello-world-test.el --- Tests for Hello World (exercism)

;;; Commentary:
;; Common test data version: 1.1.0 be3ae66

;;; Code:

(load-file "hello-world.el")

(ert-deftest hello-world-test ()
  (should (string= (hello) "Hello, World!")))

(provide 'hello-world-test)

;;; hello-world-test.el ends here

Use proper string equality test for 'Hello, World'


(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")

;; ansi-color-apply and filter were causing out-of-range errors for zeus
(setq prodigy-output-filters (remove 'ansi-color-apply prodigy-output-filters))

(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")

(prodigy-define-tag :name 'resque-scheduler
  :ready-message "Schedules Loaded")

;; ansi-color-apply and filter were causing out-of-range errors for zeus
(setq prodigy-output-filters (remove 'ansi-color-apply prodigy-output-filters))

(provide 'clgc-prodigy)

Add ready message for resque scheduler loaded


(require 'my-functions)

;browse-kill-ring
(let ((my-package-list '(color-theme
                         color-theme-approximate
                         color-theme-buffer-local
                         color-theme-solarized
                         demangle-mode
                         elpy
                         fic-mode
                         flycheck
                         flycheck-cask
                         flycheck-haskell
                         git-timemachine
                         google-this
                         graphviz-dot-mode
                         hide-lines
                         indent-guide
                         jinja2-mode
                         js2-mode
                         kill-ring-ido
                         lorem-ipsum
                         markdown-mode
                         noflet
                         python-mode
                         rebox2
                         whole-line-or-region
                         yasnippet)))
  (mapc #'my/require-package my-package-list)
 )

(require 'my-functions)

;browse-kill-ring
(let ((my-package-list '(color-theme
                         color-theme-approximate
                         color-theme-buffer-local
                         color-theme-solarized
                         demangle-mode
                         elpy
                         fic-mode
                         flycheck
                         git-timemachine
                         google-this
                         graphviz-dot-mode
                         hide-lines
                         indent-guide
                         jinja2-mode
                         js2-mode
                         kill-ring-ido
                         lorem-ipsum
                         markdown-mode
                         noflet
                         python-mode
                         rebox2
                         whole-line-or-region
                         yasnippet)))
  (mapc #'my/require-package my-package-list)
 )

Remove flycheck haskell and unused flycheck-cask


(when (maybe-require-package 'purescript-mode)
  (when (maybe-require-package 'psc-ide)
    (add-hook 'purescript-mode-hook
              (lambda ()
                (psc-ide-mode)
                (company-mode)
                (flycheck-mode)
                (turn-on-purescript-indentation))))
  (when (maybe-require-package 'add-node-modules-path)
    (after-load 'purescript-mode
      (add-hook 'purescript-mode-hook 'add-node-modules-path))))

(provide 'init-purescript)

(when (maybe-require-package 'purescript-mode)
  (when (maybe-require-package 'psc-ide)
    (add-hook 'purescript-mode-hook
              (lambda ()
                (psc-ide-mode)
                (company-mode)
                (flycheck-mode)
                (turn-on-purescript-indentation))))

  (when (maybe-require-package 'psci)
    (add-hook 'purescript-mode-hook 'inferior-psci-mode))

  (when (maybe-require-package 'add-node-modules-path)
    (after-load 'purescript-mode
      (add-hook 'purescript-mode-hook 'add-node-modules-path))
    (after-load 'psci
      (advice-add 'psci :around (lambda (oldfun &rest args)
                                  (let ((psci/purs-path (or (executable-find "purs")
                                                            psci/purs-path)))
                                    (apply oldfun args)))))))

(provide 'init-purescript)

Add psci support for purescript

Add psci support for purescript


(keyboard-translate ?\C-h ?\C-?)
(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

;; C-H delete
(keyboard-translate ?\C-h ?\C-?)

;; use system tempdir for auto save files
(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

Add comment for emacs config

Add comment for emacs config


(when (maybe-require-package 'projectile)
  (add-hook 'after-init-hook 'projectile-mode)

  (after-load 'projectile
    (define-key projectile-mode-map (kbd "C-c C-p") 'projectile-command-map)

    ;; Shorter modeline
    (setq-default projectile-mode-line-lighter " Proj"))

  (maybe-require-package 'ibuffer-projectile))

(provide 'init-projectile)

(when (maybe-require-package 'projectile)
  (add-hook 'after-init-hook 'projectile-mode)

  ;; Shorter modeline
  (setq-default projectile-mode-line-lighter " Proj")

  (after-load 'projectile
    (define-key projectile-mode-map (kbd "C-c C-p") 'projectile-command-map))

  (maybe-require-package 'ibuffer-projectile))

(provide 'init-projectile)

Set shorter projectile modeline correctly


;;; ui/minimap/config.el -*- lexical-binding: t; -*-

(use-package! minimap
  :hook doom-load-theme-hook
  :config
  (setq minimap-window-location 'right
        minimap-update-delay 0
        minimap-width-fraction 0.09
        minimap-minimum-width 15)
  (custom-set-faces!
    `(minimap-current-line-face
      :background ,(doom-color 'selection))
    `(minimap-active-region-background
      :background ,(doom-color 'vertical-bar))))

;;; ui/minimap/config.el -*- lexical-binding: t; -*-

(use-package! minimap
  :hook doom-load-theme-hook
  :config
  (setq minimap-window-location 'right
        minimap-update-delay 0
        minimap-width-fraction 0.09
        minimap-minimum-width 15))

Remove custom faces from module

Remove custom faces from module

Removed the custom faces from the module in favor of setting them in
doom-themes itself
https://github.com/hlissner/emacs-doom-themes/pull/467


(require-package 'ledger-mode)

(add-to-list 'auto-mode-alist '("\\.ledger$" . ledger-mode))

(when (> emacs-major-version 23)
  (require-package 'flycheck-ledger))
(after-load 'flycheck
  (require 'flycheck-ledger))
(after-load 'ledger-mode
  (define-key ledger-mode-map (kbd "RET") 'newline)
  (define-key ledger-mode-map (kbd "C-o") 'open-line))

(setq ledger-highlight-xact-under-point nil
      ledger-use-iso-dates nil)

(exec-path-from-shell-copy-env "LEDGER_FILE")

(add-hook 'ledger-mode-hook 'goto-address-prog-mode)

(provide 'init-ledger)

(require-package 'ledger-mode)

(add-to-list 'auto-mode-alist '("\\.ledger$" . ledger-mode))

(when (> emacs-major-version 23)
  (require-package 'flycheck-ledger))
(after-load 'flycheck
  (require 'flycheck-ledger))
(after-load 'ledger-mode
  (define-key ledger-mode-map (kbd "RET") 'newline)
  (define-key ledger-mode-map (kbd "C-o") 'open-line))

(setq ledger-highlight-xact-under-point nil
      ledger-use-iso-dates nil)

(when (memq window-system '(mac ns))
  (exec-path-from-shell-copy-env "LEDGER_FILE"))

(add-hook 'ledger-mode-hook 'goto-address-prog-mode)

(provide 'init-ledger)

Check OS before using exec-path-from-shell for $LEDGER_FILE

See #174


(defun sanityinc/time-subtract-millis (b a)
  (* 1000.0 (float-time (time-subtract b a))))

(defvar sanityinc/require-times nil
  "A list of (FEATURE . LOAD-DURATION).
LOAD-DURATION is the time taken in milliseconds to load FEATURE.")

(defadvice require
  (around build-require-times (feature &optional filename noerror) activate)
  "Note in `sanityinc/require-times' the time taken to require each feature."
  (let* ((already-loaded (memq feature features))
         (require-start-time (and (not already-loaded) (current-time))))
    (prog1
        ad-do-it
      (when (and (not already-loaded) (memq feature features))
        (add-to-list 'sanityinc/require-times
                     (cons feature
                           (sanityinc/time-subtract-millis (current-time)
                                                           require-start-time))
                     t)))))

(provide 'init-benchmarking)

(defun sanityinc/time-subtract-millis (b a)
  (* 1000.0 (float-time (time-subtract b a))))

(defvar sanityinc/require-times nil
  "A list of (FEATURE . LOAD-DURATION).
LOAD-DURATION is the time taken in milliseconds to load FEATURE.")

(defadvice require (around sanityinc/build-require-times (feature &optional filename noerror) activate)
  "Note in `sanityinc/require-times' the time taken to require each feature."
  (let* ((already-loaded (memq feature features))
         (require-start-time (and (not already-loaded) (current-time))))
    (prog1
        ad-do-it
      (when (and (not already-loaded) (memq feature features))
        (let ((time (sanityinc/time-subtract-millis (current-time) require-start-time)))
          (add-to-list 'sanityinc/require-times
                       (cons feature time)
                       t))))))

(provide 'init-benchmarking)

Tidy up the require-times benchmarking advice


;;; -*- lexical-binding: t -*-
;;; my-markdown.el --- Markdown 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:

;; Associate file extensions with this mode
;; from: http://jblevins.org/projects/markdown-mode/
(use-package markdown-mode
  :config
  (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
  (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
  (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
  ;; Path to the markdown binary
  ;; check if needed
  (custom-set-variables '(markdown-command "/usr/local/bin/markdown")))

(provide 'my-markdown)

;;; my-markdown.el ends here

;;; -*- lexical-binding: t -*-
;;; my-markdown.el --- Markdown 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:

;; Associate file extensions with this mode
;; from: http://jblevins.org/projects/markdown-mode/
(use-package markdown-mode
  :commands (markdown-mode gfm-mode)
  :mode (("README\\.md\\'" . gfm-mode)
         ("\\.md\\'" . markdown-mode)
         ("\\.markdown\\'" . markdown-mode))
  :init (setq markdown-command "markdown"))

(provide 'my-markdown)

;;; my-markdown.el ends here

Tidy up the markdown config as per official docs.


;;; packages.el --- Nim Configuration Layer for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Max Gonzih
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

;; Variables

(spacemacs|defvar-company-backends nim-mode)
(spacemacs|defvar-company-backends nimscript-mode)

(spacemacs|define-jump-handlers python-mode)

;;; packages.el --- Nim Configuration Layer for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Max Gonzih
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

;; Variables

(spacemacs|defvar-company-backends nim-mode)
(spacemacs|defvar-company-backends nimscript-mode)

(spacemacs|define-jump-handlers nim-mode)

Fix whoopsie from previous commit

Fix whoopsie from previous commit


;; This file is automatically generated by the multiple-cursors extension.
;; It keeps track of your preferences for running commands with multiple cursors.

(setq mc/cmds-to-run-for-all
      '(
        beginning-of-line-dwim
        forward-sexp
        sp--self-insert-command
        yas-expand
        zap-up-to-char
        zap-up-to-non-whitespace
        ))

(setq mc/cmds-to-run-once
      '(
        ag-project-at-point
        smex
        sp-rewrap-sexp
        sp-splice-sexp
        ))

;; This file is automatically generated by the multiple-cursors extension.
;; It keeps track of your preferences for running commands with multiple cursors.

(setq mc/cmds-to-run-for-all
      '(
        backward-sexp
        beginning-of-line-dwim
        forward-sexp
        sp--self-insert-command
        yas-expand
        zap-up-to-char
        zap-up-to-non-whitespace
        ))

(setq mc/cmds-to-run-once
      '(
        ag-project-at-point
        smex
        sp-rewrap-sexp
        sp-splice-sexp
        ))

Mark backward-sexp as safe for multiple cursors.


;;; 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)

;;; 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)

  ;; Fix #3927: disable idle completion because `company-nixos-options' is
  ;; dreadfully slow. It can still be invoked manually..
  (setq-hook! 'nix-mode-hook company-idle-delay nil)

  (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)

Disable idle completion in nix-mode

Disable idle completion in nix-mode

company-nixos-options is dreadfully slow, so we make code completion
manual in nix-mode.

Closes #3927


;;; app/twitter/autoload.el -*- lexical-binding: t; -*-

;;;###autoload
(defun =twitter ()
  (interactive)
  (+workspace-switch "Twitter" t)
  (delete-other-windows)
  (condition-case ex
      (progn
        (call-interactively #'twit)
        (unless (get-buffer (car twittering-initial-timeline-spec-string))
          (error "Failed to open twitter"))
        (switch-to-buffer (car twittering-initial-timeline-spec-string))
        (dolist (name (cdr twittering-initial-timeline-spec-string))
          (split-window-horizontally)
          (switch-to-buffer name))
        (balance-windows))
    ('error
     (+twitter/quit-all))))

;;;###autoload
(defun +twitter/quit ()
  (interactive)
  (when (eq major-mode 'twittering-mode)
    (twittering-kill-buffer)
    (+workspace/close-window-or-workspace)))

;;;###autoload
(defun +twitter/quit-all ()
  (interactive)
  (+workspace/delete "Twitter")
  (dolist (buf (doom-buffers-in-mode 'twittering-mode))
    (with-current-buffer buf
      (twittering-kill-buffer))))

;;;###autoload
(defun +twitter/rerender-all ()
  (interactive)
  (dolist (buf (doom-buffers-in-mode 'twittering-mode))
    (with-current-buffer buf
      (twittering-rerender-timeline-all buf))))

;;; app/twitter/autoload.el -*- lexical-binding: t; -*-

;;;###autoload
(defun =twitter ()
  (interactive)
  (+workspace-switch "*Twitter*" t)
  (delete-other-windows)
  (condition-case ex
      (progn
        (call-interactively #'twit)
        (unless (get-buffer (car twittering-initial-timeline-spec-string))
          (error "Failed to open twitter"))
        (switch-to-buffer (car twittering-initial-timeline-spec-string))
        (dolist (name (cdr twittering-initial-timeline-spec-string))
          (split-window-horizontally)
          (switch-to-buffer name))
        (balance-windows))
    ('error
     (+twitter/quit-all))))

;;;###autoload
(defun +twitter/quit ()
  (interactive)
  (when (eq major-mode 'twittering-mode)
    (twittering-kill-buffer)
    (+workspace/close-window-or-workspace)))

;;;###autoload
(defun +twitter/quit-all ()
  (interactive)
  (+workspace/delete "Twitter")
  (dolist (buf (doom-buffers-in-mode 'twittering-mode))
    (with-current-buffer buf
      (twittering-kill-buffer))))

;;;###autoload
(defun +twitter/rerender-all ()
  (interactive)
  (dolist (buf (doom-buffers-in-mode 'twittering-mode))
    (with-current-buffer buf
      (twittering-rerender-timeline-all buf))))

Fix app/twitter workspace name: *Twitter*


;; Time-stamp: <2014-11-07 12:45:03 kmodi>

;; LaTeX

(prepend-path (concat user-emacs-directory "/auctex"))

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)

(setq LaTeX-command "latex -shell-escape")

;; Source: http://www.sigmafield.org/2009/10/03/using-doc-view-with-auto-revert-to-view-latex-pdf-output-in-emacs
(add-hook 'doc-view-mode-hook 'auto-revert-mode)
;; Source: http://www.gnu.org/software/auctex/manual/auctex/Multifile.html
(setq TeX-PDF-mode t
      TeX-auto-save t
      TeX-parse-self t
      TeX-save-query nil)

(setq-default TeX-master nil) ; Query for master file.

(provide 'setup-latex)

;; Time-stamp: <2014-11-07 13:52:39 kmodi>
;;
;; LaTeX
;;
;; NOTE: auctex has to be installed from outside emacs for the below `load's
;; to work.
;;
;; 1. Download the latest auctex from http://www.gnu.org/software/auctex/download-for-unix.html
;; 2. tar xvzf auctex-VERSION.tar.gz
;; 3. ./configure --prefix=/home/kmodi/usr_local --with-lispdir=/home/kmodi/.emacs.d/auctex/ --with-texmf-dir=/home/kmodi/texlive/texmf-local/
;;    - prefix <- Location of your /usr/local
;;    - with-lispdir <- I prefer to keep auctex elisp stuff in my ~/.emacs.d
;;    - with-texmf-dir <- Location of texlive texmf directory
;; 4. make
;; 5. make install

(prepend-path (concat user-emacs-directory "/auctex"))

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)

(setq LaTeX-command "latex -shell-escape")

;; Source: http://www.sigmafield.org/2009/10/03/using-doc-view-with-auto-revert-to-view-latex-pdf-output-in-emacs
(add-hook 'doc-view-mode-hook 'auto-revert-mode)

;; Source: http://www.gnu.org/software/auctex/manual/auctex/Multifile.html
(setq TeX-PDF-mode t
      TeX-auto-save t
      TeX-parse-self t
      TeX-save-query nil)

(setq-default TeX-master nil) ; Query for master file.

(provide 'setup-latex)

Add information on how to install auctex


(
 (nil . ((projectile-project-compilation-dir . "./build")
         (projectile-project-compilation-cmd . "ninja")

         ;; Include common in file listings
         (projectile-hg-command .  "hg locate -f -0 -I . && hg locate -R common -f -0 -I common/")
         )
      )
 )

(
 (nil . ((projectile-project-compilation-dir . "./build")
         (projectile-project-compilation-cmd . "ninja")

         ;; Include common in file listings
         (projectile-hg-command .  "hg files -0 -S")
         )
      )
 )

Use hg files not hg locate

Use hg files not hg locate


(add-auto-mode 'haml-mode "\.haml$")
(add-auto-mode 'sass-mode "\.sass$")
(autoload 'haml-mode "haml-mode" "Mode for editing haml files" t)
(autoload 'sass-mode "sass-mode" "Mode for editing sass files" t)

(require 'flymake-haml)
(add-hook 'haml-mode-hook 'flymake-haml-load)
(add-hook 'sass-mode-hook 'flymake-sass-load)

(provide 'init-haml)

(add-auto-mode 'haml-mode "\.haml$")
(add-auto-mode 'sass-mode "\.sass$" "\.scss$")
(autoload 'haml-mode "haml-mode" "Mode for editing haml files" t)
(autoload 'sass-mode "sass-mode" "Mode for editing sass files" t)

(require 'flymake-haml)
(add-hook 'haml-mode-hook 'flymake-haml-load)
(add-hook 'sass-mode-hook 'flymake-sass-load)

(provide 'init-haml)

Use sass-mode in .scss files too

Use sass-mode in .scss files too


(require 'wrap-region)

;; Active in all modes
(wrap-region-global-mode t)

;; Only wrap region if trigger key is given a negative prefix argument
(setq wrap-region-only-with-negative-prefix t)

;; Custom wrappers

(wrap-region-add-wrapper "{ value: " " }" "v" 'js2-mode)
(wrap-region-add-wrapper "$(" ")" "$" 'js2-mode)

(wrap-region-add-wrapper "<c:out value=\"" "\"/>" "o" 'html-mode)
(wrap-region-add-wrapper "
" "
" "p" 'html-mode)
(wrap-region-add-wrapper "
" "
" "l" 'html-mode)
(wrap-region-add-wrapper "" "" "s" 'html-mode)
(wrap-region-add-wrapper "" "" "a" 'html-mode)
(wrap-region-add-wrapper "" "" "r" 'html-mode)
(wrap-region-add-wrapper "
" "
" "h" 'html-mode)
(wrap-region-add-wrapper "${" "}" "$" 'html-mode)

(provide 'setup-wrap-region)

(require 'wrap-region)

;; Active in all modes
(wrap-region-global-mode t)

;; Only wrap region if trigger key is given a negative prefix argument
(setq wrap-region-only-with-negative-prefix t)

;; Don't screw up key bindings in magit-mode
(add-to-list 'wrap-region-except-modes 'magit-mode)

;; Custom wrappers

(wrap-region-add-wrapper "{ value: " " }" "v" 'js2-mode)
(wrap-region-add-wrapper "$(" ")" "$" 'js2-mode)

(wrap-region-add-wrapper "<c:out value=\"" "\"/>" "o" 'html-mode)
(wrap-region-add-wrapper "
" "
" "p" 'html-mode)
(wrap-region-add-wrapper "
" "
" "l" 'html-mode)
(wrap-region-add-wrapper "" "" "s" 'html-mode)
(wrap-region-add-wrapper "" "" "a" 'html-mode)
(wrap-region-add-wrapper "" "" "r" 'html-mode)
(wrap-region-add-wrapper "
" "
" "h" 'html-mode)
(wrap-region-add-wrapper "${" "}" "$" 'html-mode)

(provide 'setup-wrap-region)

Fix problem in magit with staging/reverting chunks in region.


(defvar scala-packages
  '(
    ensime
    sbt-mode
    scala-mode2
    )
  "List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")

(defun spacemacs/init-ensime ()
  (use-package ensime
    :defer t
    :config
    (progn
      (evil-define-key 'normal scala-mode-map "J" 'spacemacs/scala-join-line)

      (evil-define-key 'normal ensime-popup-buffer-map
        (kbd "q") 'ensime-popup-buffer-quit-function)

      (evil-define-key 'normal ensime-refactor-info-map
        (kbd "q") 'spacemacs/ensime-refactor-cancel
        (kbd "c") 'spacemacs/ensime-refactor-accept
        (kbd "RET") 'spacemacs/ensime-refactor-accept)

      (evil-define-key 'normal ensime-compile-result-map
        (kbd "g") 'ensime-show-all-errors-and-warnings
        (kbd "TAB") 'forward-button
        (kbd "<backtab>") 'backward-button
        (kbd "M-n") 'forward-button
        (kbd "M-p") 'backward-button))))

(defvar scala-packages
  '(
    ensime
    sbt-mode
    scala-mode2
    )
  "List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")

(defun spacemacs/init-ensime ()
  (use-package ensime
    :commands (ensime-mode)
    :init
    (add-hook 'scala-mode-hook 'ensime-mode)
    :config
    (progn
      (evil-define-key 'normal scala-mode-map "J" 'spacemacs/scala-join-line)

      (evil-define-key 'normal ensime-popup-buffer-map
        (kbd "q") 'ensime-popup-buffer-quit-function)

      (evil-define-key 'normal ensime-refactor-info-map
        (kbd "q") 'spacemacs/ensime-refactor-cancel
        (kbd "c") 'spacemacs/ensime-refactor-accept
        (kbd "RET") 'spacemacs/ensime-refactor-accept)

      (evil-define-key 'normal ensime-compile-result-map
        (kbd "g") 'ensime-show-all-errors-and-warnings
        (kbd "TAB") 'forward-button
        (kbd "<backtab>") 'backward-button
        (kbd "M-n") 'forward-button
        (kbd "M-p") 'backward-button))))

Enable ensime in all scala buffers

Enable ensime in all scala buffers


(setq load-path (cons "~/.emacs.d/site-lisp/org-mode/lisp" load-path))
(setq load-path (cons "~/.emacs.d/site-lisp/org-mode/contrib/lisp" load-path))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))

;; Save the running clock and all clock history when exiting Emacs, load it on startup
(setq org-clock-persistence-insinuate t)
(setq org-clock-persist t)
(setq org-clock-in-resume t)

;; Change task state to STARTED when clocking in
(setq org-clock-in-switch-to-state "STARTED")
;; Save clock data and notes in the LOGBOOK drawer
(setq org-clock-into-drawer t)
;; Removes clocked tasks with 0:00 duration
(setq org-clock-out-remove-zero-time-clocks t)

(eval-after-load "org"
  '(require 'org-checklist))

(provide 'init-org)

(setq load-path (cons "~/.emacs.d/site-lisp/org-mode/lisp" load-path))
(setq load-path (cons "~/.emacs.d/site-lisp/org-mode/contrib/lisp" load-path))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))

(setq org-todo-keywords (quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d!/!)"))))

;; Save the running clock and all clock history when exiting Emacs, load it on startup
(setq org-clock-persistence-insinuate t)
(setq org-clock-persist t)
(setq org-clock-in-resume t)

;; Change task state to STARTED when clocking in
(setq org-clock-in-switch-to-state "STARTED")
;; Save clock data and notes in the LOGBOOK drawer
(setq org-clock-into-drawer t)
;; Removes clocked tasks with 0:00 duration
(setq org-clock-out-remove-zero-time-clocks t)

(eval-after-load "org"
  '(require 'org-checklist))

(provide 'init-org)

Add "STARTED" to my default org TODO keywords


(require 'flyspell)
(setq flyspell-issue-message-flg nil)

(add-hook 'enh-ruby-mode-hook
          (lambda () (flyspell-prog-mode)))

(add-hook 'web-mode-hook
          (lambda () (flyspell-prog-mode)))

(add-hook 'org-mode-hook
	  (lambda () (flyspell-prog-mode)))

(add-hook 'haml-mode-hook
	  (lambda () ('flymake-haml-load)))

;; flyspell mode breaks auto-complete mode without this.
(ac-flyspell-workaround)

(require 'flyspell)
(setq flyspell-issue-message-flg nil)
(setq ispell-dictionary "british")

(add-hook 'enh-ruby-mode-hook
          (lambda () (flyspell-prog-mode)))

(add-hook 'web-mode-hook
          (lambda () (flyspell-prog-mode)))

(add-hook 'coffee-mode-hook
	  (lambda () (flyspell-prog-mode)))

(add-hook 'org-mode-hook
	  (lambda () (flyspell-prog-mode)))

(add-hook 'haml-mode-hook
	  (lambda () ('flymake-haml-load)))

;; flyspell mode breaks auto-complete mode without this.
(ac-flyspell-workaround)

Set my spell checker to british

Set my spell checker to british


;;; init.el -*- lexical-binding: t; -*-

(doom!
    :completion
    (ivy +icons +prescient +fuzzy)
    (company +childframe)

    :ui
    doom
    doom-dashboard
    modeline
    ophints
    hl-todo
    nav-flash
    treemacs
    (popup +all +defaults)
    (pretty-code +fira)
    vc-gutter
    vi-tilde-fringe
    window-select
    hydra
    zen

    :editor
    (evil +everywhere +commands)
    snippets
    file-templates
    multiple-cursors
    rotate-text
    fold
    format

    :emacs
    (dired +icons)
    vc

    :tools
    lookup
    eval
    make
    (magit +forge)
    (lsp +peek)
    editorconfig
    pdf
    ein

    :lang
    (sh +fish)
    emacs-lisp
    markdown
    (haskell +lsp)
    (org
        +attach
        +babel
        +export)
    (cc +lsp)
    idris
    (web +html +css)
    (latex +latexmk +viewers)
    (python +lsp)
    (javascript +lsp)
    rest
    data
    (rust +lsp)
    csharp
    coq

    :checkers
    grammar
    spell
    (syntax +childframe)

    :term
    vterm
    eshell

    :app
    ;;(email +gmail)    ; emacs as an email client
    ;;(rss +org)        ; emacs as an RSS reader
    )

;; Needs to be set early so it can't go into config
(setq evil-respect-visual-line-mode t)

;;; init.el -*- lexical-binding: t; -*-

(doom!
    :completion
    (ivy +icons +prescient +fuzzy)
    (company +childframe)

    :ui
    doom
    doom-dashboard
    modeline
    ophints
    hl-todo
    nav-flash
    treemacs
    (popup +all +defaults)
    (ligatures +fira)
    vc-gutter
    vi-tilde-fringe
    window-select
    hydra
    zen

    :editor
    (evil +everywhere +commands)
    snippets
    file-templates
    multiple-cursors
    rotate-text
    fold
    format

    :emacs
    (dired +icons)
    vc

    :tools
    lookup
    eval
    make
    (magit +forge)
    (lsp +peek)
    editorconfig
    pdf
    ein

    :lang
    (sh +fish)
    emacs-lisp
    markdown
    (haskell +lsp)
    (org
        +attach
        +babel
        +export)
    (cc +lsp)
    idris
    (web +html +css)
    (latex +latexmk +viewers)
    (python +lsp)
    (javascript +lsp)
    rest
    data
    (rust +lsp)
    csharp
    coq

    :checkers
    grammar
    spell
    (syntax +childframe)

    :term
    vterm
    eshell

    :app
    ;;(email +gmail)    ; emacs as an email client
    ;;(rss +org)        ; emacs as an RSS reader
    )

;; Needs to be set early so it can't go into config
(setq evil-respect-visual-line-mode t)

Change pretty-code module to ligatures

[emacs] Change pretty-code module to ligatures


(defconst mfa-pass-packages '(helm-pass))

(defun mfa-pass/init-helm-pass ()
  (use-package helm-pass
    :defer t
    :init
    (spacemacs/set-leader-keys "op" #'helm-pass)))

(defconst mfa-pass-packages '(helm-pass))

(defun mfa-pass/init-helm-pass ()
  (use-package helm-pass
    :defer t
    :init
    (spacemacs/set-leader-keys "ou" #'helm-pass)))

Change keybinding of helm-pass to not conflict with projectile term


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

;; Emacs IRC client
(require 'prelude-erc)
(require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
(require 'prelude-helm) ;; Interface for narrowing and search
(require 'prelude-helm-everywhere) ;; Enable Helm everywhere
(require 'prelude-company)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
;; (require 'prelude-mediawiki)
;; (require 'prelude-evil)

;;; Programming languages support
(require 'prelude-c)
(require 'prelude-emacs-lisp)
(require 'prelude-lisp)
(require 'prelude-org) ;; Org-mode helps you keep TODO lists, notes and more
(require 'prelude-perl)
(require 'prelude-python)
(require 'prelude-scheme)
(require 'prelude-shell)
(require 'prelude-xml)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
;; (require 'prelude-erlang)
;; (require 'prelude-elixir)
;; (require 'prelude-go)
;; (require 'prelude-haskell)
;; (require 'prelude-js)
;; (require 'prelude-latex)
;; (require 'prelude-ocaml)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
;; (require 'prelude-scss)
;; (require 'prelude-web) ;; Emacs mode for web templates
;; (require 'prelude-yaml)

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

;; Emacs IRC client
(require 'prelude-erc)
(require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
(require 'prelude-helm) ;; Interface for narrowing and search
(require 'prelude-helm-everywhere) ;; Enable Helm everywhere
(require 'prelude-company)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
;; (require 'prelude-mediawiki)
;; (require 'prelude-evil)

;;; Programming languages support
(require 'prelude-c)
(require 'prelude-emacs-lisp)
(require 'prelude-lisp)
(require 'prelude-org) ;; Org-mode helps you keep TODO lists, notes and more
(require 'prelude-perl)
(require 'prelude-python)
(require 'prelude-scheme)
(require 'prelude-shell)
(require 'prelude-xml)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
;; (require 'prelude-erlang)
;; (require 'prelude-elixir)
(require 'prelude-go)
(require 'prelude-haskell)
;; (require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-ocaml)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
;; (require 'prelude-scss)
;; (require 'prelude-web) ;; Emacs mode for web templates
;; (require 'prelude-yaml)

Add some more modules to Emacs

Add some more modules to Emacs

Signed-off-by: Rafael Campos Nunes <42f0a9af43f2538fd3153aecc7c3ff958e89d724@engineer.com>


;;; osx.el --- Handles configuration specifc to OS X

;;; Commentary:

;; All configuration only relevant when running Emacs on OS X.

;;; Code:

;; Use command as meta key, leave option alone
(setq mac-command-modifier 'meta)
(setq mac-option-modifier nil)

;; Menu bar is not annoying in OSX
(menu-bar-mode 1)

;; Make the browser the OS X default
(setq browse-url-browser-function 'browse-url-default-macosx-browser)

;; In dired, move deletions to trash
(setq delete-by-moving-to-trash t)

;; Set font
(set-frame-font "-apple-Source_Code_Pro-medium-normal-normal-*-*-*-*-*-m-0-iso10646-1")

(defun finder ()
  "Opens file directory in Finder."
  (interactive)
  (let ((file (buffer-file-name)))
    (if file
        (shell-command
         (format "%s %s" (executable-find "open") (file-name-directory file)))
      (error "Buffer is not attached to any file"))))

;; Use GNU ls - install with:
;;    brew install xz
;;    brew install coreutils
(setq insert-directory-program "gls")

(provide 'osx)
;;; osx.el ends here

;;; osx.el --- Handles configuration specifc to OS X

;;; Commentary:

;; All configuration only relevant when running Emacs on OS X.

;;; Code:

;; Use command as meta key, leave option alone
(setq mac-command-modifier 'meta)
(setq mac-option-modifier nil)

;; Menu bar is not annoying in OSX
(menu-bar-mode 1)

;; Make the browser the OS X default
(setq browse-url-browser-function 'browse-url-default-macosx-browser)

;; In dired, move deletions to trash
(setq delete-by-moving-to-trash t)

;; Set font
(set-frame-font "-apple-Source_Code_Pro_for_Powerline-medium-normal-normal-*-12-*-*-*-m-0-iso10646-1")

(defun finder ()
  "Opens file directory in Finder."
  (interactive)
  (let ((file (buffer-file-name)))
    (if file
        (shell-command
         (format "%s %s" (executable-find "open") (file-name-directory file)))
      (error "Buffer is not attached to any file"))))

;; Use GNU ls - install with:
;;    brew install xz
;;    brew install coreutils
(setq insert-directory-program "gls")

(provide 'osx)
;;; osx.el ends here

Fix Emacs font on OS X

Fix Emacs font on OS X


;;; projectile-conf.el -- Settings for projectile.
(eval-when-compile
  (require 'projectile))

(custom-set-variables
 '(projectile-switch-project-action 'projectile-dired)
 '(projectile-mode-line
   '(:eval (format " [%s]" (projectile-project-name)))))

(add-to-list 'projectile-globally-ignored-modes "mu4e-.*-mode")
(add-to-list 'projectile-globally-ignored-modes "org-agenda-mode")

(add-to-list 'projectile-project-root-files "GNUmakefile")
(add-to-list 'projectile-project-root-files "Rakefile")
(add-to-list 'projectile-project-root-files "package.json")
(add-to-list 'projectile-project-root-files-bottom-up ".dir-locals.el")

(projectile-register-project-type
   'edify '("default.nix" "courses" "content")
   "nix-shell --run 'edify build courses/*'")

(projectile-register-project-type
   'haskell '("default.nix" "Setup.hs") "nix-hs")

;;; projectile-conf.el -- Settings for projectile.
(eval-when-compile
  (require 'projectile))

(custom-set-variables
 '(projectile-switch-project-action 'projectile-dired)
 '(projectile-mode-line
   '(:eval (format " [%s]" (projectile-project-name)))))

(add-to-list 'projectile-globally-ignored-modes "mu4e-.*-mode")
(add-to-list 'projectile-globally-ignored-modes "org-agenda-mode")

(add-to-list 'projectile-project-root-files "GNUmakefile")
(add-to-list 'projectile-project-root-files "Rakefile")
(add-to-list 'projectile-project-root-files "package.json")
(add-to-list 'projectile-project-root-files-bottom-up ".dir-locals.el")

(projectile-register-project-type
 'edify '("default.nix" "courses" "content")
 :compile "nix-shell --run 'edify build courses/*'")

(projectile-register-project-type
 'haskell '("default.nix" "Setup.hs")
 :compile "nix-hs")

Update to latest version of projectile

Update to latest version of projectile


(require 'clojure-mode)

(define-key clojure-mode-map (kbd "C-c C-j") 'clj-jump-to-other-file)
(define-key clojure-mode-map (kbd "C-c M-j") 'clj-jump-to-other-file-other-window)

(provide 'setup-clojure-mode)

(require 'clojure-mode)

(define-key clojure-mode-map (kbd "C-c C-j") 'clj-jump-to-other-file)
(define-key clojure-mode-map (kbd "C-c M-j") 'clj-jump-to-other-file-other-window)

(defadvice clojure-test-run-tests (before save-first activate)
  (save-buffer))

(autoload 'clojure-test-mode "clojure-test-mode")

(provide 'setup-clojure-mode)

Save buffer before running tests in clojure-test-mode


;; Time-stamp: <2014-08-13 11:24:24 kmodi>

;; Number
;; https://github.com/chrisdone/chrisdone-emacs/blob/master/packages/number/number.el

(req-package number)

(provide 'setup-number)

;; Time-stamp: <2015-01-21 14:19:14 kmodi>

;; Number
;; https://github.com/chrisdone/number

(req-package number)

(provide 'setup-number)

Fix the package source link in comment

Fix the package source link in comment


(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (brin)))
 '(custom-safe-themes
   (quote
    ("7bde52fdac7ac54d00f3d4c559f2f7aa899311655e7eb20ec5491f3b5c533fe8" "9f3a4edb56d094366afed2a9ba3311bbced0f32ca44a47a765d8ef4ce5b8e4ea" default)))
 '(session-use-package t nil (session)))
(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.
 '(diff-refine-added ((t (:inherit diff-refine-change :background "SpringGreen4"))))
 '(diff-refine-removed ((t (:inherit diff-refine-change :background "firebrick4"))))
 '(mode-line ((t (:background "#292B2D" :foreground "#3A85BD"))))
 '(mode-line-buffer-id ((t (:foreground "SpringGreen3")))))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (brin base16-default-dark)))
 '(custom-safe-themes
   (quote
    ("7bde52fdac7ac54d00f3d4c559f2f7aa899311655e7eb20ec5491f3b5c533fe8" "9f3a4edb56d094366afed2a9ba3311bbced0f32ca44a47a765d8ef4ce5b8e4ea" default))))
(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.
 '(diff-refine-added ((t (:inherit diff-refine-change :background "SpringGreen4"))))
 '(diff-refine-removed ((t (:inherit diff-refine-change :background "firebrick4"))))
 '(mode-line ((t (:background "#292B2D" :foreground "#3A85BD"))))
 '(mode-line-buffer-id ((t (:foreground "SpringGreen3")))))

Change order of loading themes

Change order of loading themes


(require 'key-chord)
(key-chord-mode 1)

;; Move to char similar to "f" in vim, f+j forward, f+h backward
(key-chord-define-global "fj" 'iy-go-to-char)
(key-chord-define-global "fh" 'iy-go-to-char-backward)

;; Indent entire buffer and fix whitespace
(key-chord-define-global "i0" 'indent-buffer)
(key-chord-define-global "i9" 'whitespace-cleanup)

(provide 'key-chords)

(require 'key-chord)
(key-chord-mode 1)

;; Move to char similar to "f" in vim, f+j forward, f+h backward
(key-chord-define-global "fj" 'iy-go-to-char)
(key-chord-define-global "fh" 'iy-go-to-char-backward)

(provide 'key-chords)

Remove unneccessary chords - already have C-c n (cleanup-buffer)


(use-package evil-nerd-commenter
  :config
  (evil-leader/set-key
    ";"  'evilnc-comment-or-uncomment-lines
    "ci" 'evilnc-comment-or-uncomment-lines
    "cl" 'evilnc-quick-comment-or-uncomment-to-the-line
    "cc" 'evilnc-copy-and-comment-lines
    "cp" 'evilnc-comment-or-uncomment-paragraphs
    "cr" 'comment-or-uncomment-region))

(provide 'evil-nerd-commenter-settings)

(use-package evil-nerd-commenter
  :config
  (evil-leader/set-key
    ";"  'evilnc-comment-or-uncomment-lines
    "ci" 'evilnc-comment-or-uncomment-lines
    "cl" 'evilnc-quick-comment-or-uncomment-to-the-line
    "cc" 'evilnc-copy-and-comment-lines
    "cp" 'evilnc-comment-or-uncomment-paragraphs
    "cr" 'comment-or-uncomment-region))

(add-hook 'c-mode-common-hook
          (lambda ()
            ;; Preferred comment style
            (setq comment-start "// "
                  comment-end "")))

(provide 'evil-nerd-commenter-settings)

Change default c-mode comment style to single line comments


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

// Coverage exclusion file for uart
CHECKSUM: "1115183444 4229339"
INSTANCE: tb.dut.uart_core
// this is unreachable condition
Condition 16 "7100374" "(break_err && (break_st == BRK_CHK)) 1 -1" (2 "10")
CHECKSUM: "1115183444 3548154843"
INSTANCE: tb.dut.uart_core
// these are scanmode ralated branches
Branch 1 "2534752149" "scanmode_i" (0) "scanmode_i 1"
Branch 5 "2534752149" "scanmode_i" (0) "scanmode_i 1"
Branch 1 "2534752149" "scanmode_i" (1) "scanmode_i 0"
Branch 5 "2534752149" "scanmode_i" (1) "scanmode_i 0"
// default branch, it's unreachable
Branch 9 "221332935" "(!rst_ni)" (5) "(!rst_ni) 0,default,-,-"

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

// Coverage exclusion file for uart
ANNOTATION: "[UNR] default branch"
CHECKSUM: "2856317324 3065048585"
INSTANCE: tb.dut.uart_core
Branch 7 "2483258407" "(!rst_ni)" (5) "(!rst_ni) 0,default,-,-"

[uart/dv] Update coverage exclusion file as design change


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

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

(defvar pjones:packages
  '(magit flymake-ruby ruby-end inf-ruby htmlize yaml-mode bm gist haskell-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))))

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

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

(defvar pjones:packages
  '(magit flymake-ruby ruby-end inf-ruby htmlize yaml-mode
          bm gist haskell-mode switch-window)
  "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))))

Add a package for switching windows easily


;; show line numbers
(global-linum-mode t)

;; enable arrow keys
(setq prelude-guru nil)

;; disable standard theme
(disable-theme 'zenburn)

;; disable spellchecking
(setq prelude-flyspell nil)

;; hide scrollbar
(scroll-bar-mode -1)

;; Highlight current line
(global-hl-line-mode 0)

;; Install Intero
(require  'intero)
(add-hook 'haskell-mode-hook 'intero-mode)

;; PureScript
(require 'psc-ide)

(add-hook 'purescript-mode-hook
  (lambda ()
    (psc-ide-mode)
    (company-mode)
    (flycheck-mode)
    (turn-on-purescript-indentation)))

;; nix
(require 'nix-mode)

;; show line numbers
(global-linum-mode t)

;; enable arrow keys
(setq prelude-guru nil)

;; disable standard theme
(disable-theme 'zenburn)

;; disable spellchecking
(setq prelude-flyspell nil)

;; hide scrollbar
(scroll-bar-mode -1)

;; Highlight current line
(global-hl-line-mode 0)

;; Install Intero
(package-install 'intero)
(add-hook 'haskell-mode-hook 'intero-mode)

;; PureScript
(package-install 'psc-ide)

(add-hook 'purescript-mode-hook
  (lambda ()
    (psc-ide-mode)
    (company-mode)
    (flycheck-mode)
    (turn-on-purescript-indentation)))

;; nix
(package-install 'nix-mode)

Fix installation of needed packages

Fix installation of needed packages


;; Make dired less verbose
(require 'dired-details)
(setq-default dired-details-hidden-string "  ")
(dired-details-install)

(provide 'setup-dired)

;; Make dired less verbose
(require 'dired-details)
(setq-default dired-details-hidden-string "")
(dired-details-install)

(provide 'setup-dired)

Remove more whitespace from dired listings.


;; Time-stamp: <2013-12-02 17:07:21 kmodi>

;; Hardcore mode

(setq too-hardcore-backspace t)
(setq too-hardcore-return t)

(require 'hardcore-mode)

(global-hardcore-mode)

(provide 'setup-hardcore)

;; Time-stamp: <2014-07-13 23:57:23 kmodi>

;; Hardcore mode

(setq too-hardcore-backspace t)
(setq too-hardcore-return t)

(require 'hardcore-mode)

(global-hardcore-mode)

(setq setup-hardcore-loaded t)
(provide 'setup-hardcore)

Set a var when loading this setup file

Set a var when loading this setup file


;;; package --- Summary

;;; Commentary:

;;; Code:

;; in default Emacs, themes can be kind of stacked.
;; Dissable this behavior.
(defadvice load-theme
    (before theme-dont-propagate activate)
  (mapcar #'disable-theme custom-enabled-themes))

;;; package --- Summary

;;; Commentary:

;;; Code:

;; in default Emacs, themes can be kind of stacked.
;; Dissable this behavior.
(defadvice load-theme
    (before theme-dont-propagate activate)
  (mapc #'disable-theme custom-enabled-themes))

Change deprecated "mapcar" to "mapc"

Change deprecated "mapcar" to "mapc"


(setq ad-redefinition-action 'accept)
(setq-default truncate-lines t)

(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default tab-stop-list (number-sequence 2 120 2))

(defalias 'yes-or-no-p 'y-or-n-p)

(add-hook 'before-save-hook 'delete-trailing-whitespace)

(setq prettify-symbols-unprettify-at-point t)
(prettify-symbols-mode)

;; Enable yanking and pasting to and from both clipboards
(setq x-select-enable-clipboard t)
(setq x-select-enable-primary t)
(setq mouse-drag-copy-region t)

(setq ad-redefinition-action 'accept)
(setq-default truncate-lines t)

(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default tab-stop-list (number-sequence 2 120 2))

(defalias 'yes-or-no-p 'y-or-n-p)

(add-hook 'before-save-hook 'delete-trailing-whitespace)

(setq prettify-symbols-unprettify-at-point t)
(prettify-symbols-mode)

;; Enable yanking and pasting to and from both clipboards
(setq select-enable-clipboard t)
(setq select-enable-primary t)
(setq mouse-drag-copy-region t)

Set clipboard copying with newer vars

emacs: Set clipboard copying with newer vars


;; -*- coding: utf-8 -*-
(use-package markdown-mode
  :mode ("\\.text\\'" "\\.markdown\\'" "\\.md\\'"))

;; -*- coding: utf-8 -*-
(use-package markdown-mode
  :commands (markdown-mode gfm-mode)
  :mode (("README\\.md\\'" . gfm-mode)
         ("\\.md\\'" . markdown-mode)
         ("\\.markdown\\'" . markdown-mode))
  :init (setq markdown-command "multimarkdown"))

Update config for mark down mode

Update config for mark down mode


(require-package 'flymake-cursor)

(setq flymake-gui-warnings-enabled nil)

;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
;; at which point buffer-file-name is nil
(eval-after-load 'flymake
  '(progn
     (global-set-key (kbd "C-`") 'flymake-goto-next-error)

     (defun flymake-can-syntax-check-file (file-name)
       "Determine whether we can syntax check FILE-NAME.
Return nil if we cannot, non-nil if we can."
       (if (and file-name (flymake-get-init-function file-name)) t nil))))

(provide 'init-flymake)

(require-package 'flymake-cursor)

(setq flymake-gui-warnings-enabled nil)

;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
;; at which point buffer-file-name is nil
(eval-after-load 'flymake
  '(progn
     (defun flymake-can-syntax-check-file (file-name)
       "Determine whether we can syntax check FILE-NAME.
Return nil if we cannot, non-nil if we can."
       (if (and file-name (flymake-get-init-function file-name)) t nil))))

(provide 'init-flymake)

Remove binding of C-` for flymake-goto-next-error


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

(after! projectile
  (add-to-list 'projectile-project-root-files "build.sbt"))

;;
;;; Packages

(after! scala-mode
  (setq scala-indent:align-parameters t
        ;; indent block comments to first asterix, not second
        scala-indent:use-javadoc-style t)

  (setq-hook! 'scala-mode-hook
    comment-line-break-function #'+scala-comment-indent-new-line-fn)

  (when (featurep! +lsp)
    (add-hook 'scala-mode-local-vars-hook #'lsp!))

  (set-ligatures! 'scala-mode
    ;; Functional
    :def "def"
    :composition  "compose"
    ;; HKT
    :lambda       "Lambda"
    ;; Types
    :null         "none"
    :null         "None"
    :true         "true"
    :false        "false"
    :int          "Int"
    :str          "String"
    :float        "Float"
    :bool         "Boolean"
    :list         "List"
    ;; Flow
    :for          "for"
    :not          "!"
    :and          "&&"
    :or           "||"
    :yield        "yield"
    ;; Other
    :union        "union"
    :intersect    "intersect"
    :diff         "diff"))

(use-package! sbt-mode
  :after scala-mode
  :config (set-repl-handler! 'scala-mode #'+scala/open-repl :persist t))

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

(after! projectile
  (add-to-list 'projectile-project-root-files "build.sbt"))

;;
;;; Packages

(after! scala-mode
  (setq scala-indent:align-parameters t
        ;; indent block comments to first asterix, not second
        scala-indent:use-javadoc-style t)

  (setq-hook! 'scala-mode-hook
    comment-line-break-function #'+scala-comment-indent-new-line-fn)

  (when (featurep! +lsp)
    (setq-hook! 'scala-mode-hook lsp-enable-indentation nil)
    (add-hook 'scala-mode-local-vars-hook #'lsp!))

  (set-ligatures! 'scala-mode
    ;; Functional
    :def "def"
    :composition  "compose"
    ;; HKT
    :lambda       "Lambda"
    ;; Types
    :null         "none"
    :null         "None"
    :true         "true"
    :false        "false"
    :int          "Int"
    :str          "String"
    :float        "Float"
    :bool         "Boolean"
    :list         "List"
    ;; Flow
    :for          "for"
    :not          "!"
    :and          "&&"
    :or           "||"
    :yield        "yield"
    ;; Other
    :union        "union"
    :intersect    "intersect"
    :diff         "diff"))

(use-package! sbt-mode
  :after scala-mode
  :config (set-repl-handler! 'scala-mode #'+scala/open-repl :persist t))

Disable lsp indentation in scala mode

Disable lsp indentation in scala mode


(require-package 'exec-path-from-shell)

(after-load 'exec-path-from-shell
  (dolist (var '("SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO" "LANG" "LC_CTYPE"))
    (add-to-list 'exec-path-from-shell-variables var)))

(when (memq window-system '(mac ns x))
  (setq-default exec-path-from-shell-arguments nil)
  (exec-path-from-shell-initialize))

(provide 'init-exec-path)

(require-package 'exec-path-from-shell)

(after-load 'exec-path-from-shell
  (dolist (var '("SSH_AUTH_SOCK" "SSH_AGENT_PID" "GPG_AGENT_INFO" "LANG" "LC_CTYPE"))
    (add-to-list 'exec-path-from-shell-variables var)))

(when (memq window-system '(mac ns x))
  (exec-path-from-shell-initialize))

(provide 'init-exec-path)

Revert "Run exec-path-from-shell in strict mode, requiring optimal shell config"

This reverts commit c01ca45ff5a3c4d6312e7d85e5c1fea2f42f95c2.


;; 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)))

(require 'mouse-slider-mode)

(add-to-list 'mouse-slider-mode-eval-funcs
             '(js2-mode . skewer-eval-defun))

(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)
(require 'skewer-html)
(require 'skewer-css)

(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)))

(require 'mouse-slider-mode)

(add-to-list 'mouse-slider-mode-eval-funcs
             '(js2-mode . skewer-eval-defun))

(provide 'setup-skewer)

Add html and css support for skewer

Add html and css support for skewer


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

(spacemacs/safe-set-leader-keys
  "je" #'spacemacs/goto-error-transient-state/body
  "jm" #'display-compilation-buffer)

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

(spacemacs/safe-set-leader-keys
  "cb" #'display-compilation-buffer
  "je" #'spacemacs/goto-error-transient-state/body)

Change display-compilation-buffer key binding to 'SPC c b'

The ideal binding 'SPC j c' is already taken. As second-best option, let's move
the binding closer to 'SPC c d' which closes the compilation window.


(use-package gruvbox-theme
  :ensure t
  :defer t
  :init
  (load-theme 'gruvbox t)
  )

(provide 'pkg-ui)

(use-package gruvbox-theme
  :ensure t
  :defer t
  :init
  (setq gruvbox-contrast 'medium)
  (load-theme 'gruvbox t)
  )

(provide 'pkg-ui)

Set Gruvbox contrast to medium

Set Gruvbox contrast to medium


(add-hook 'clojure-mode-hook 'pretty-lambdas)
(add-hook 'clojure-mode-hook (lambda () (enable-paredit clojure-mode-map)))

(setq clojure-src-root (expand-file-name "~/Projects/External"))

(setq swank-clojure-jar-path (concat clojure-src-root "/clojure/clojure.jar")
      swank-clojure-extra-classpaths (list (concat clojure-src-root "/clojure-contrib/clojure-contrib.jar")))

(require 'swank-clojure-autoload)
(eval-after-load 'clojure-mode '(clojure-slime-config))

(defun slime-clojure ()
  "Fire up slime running the swank-clojure backend"
  (interactive)
  (slime 'clojure))

(provide 'init-clojure)

(add-hook 'clojure-mode-hook 'pretty-lambdas)
(add-hook 'clojure-mode-hook (lambda () (enable-paredit clojure-mode-map)))

(setq clojure-src-root (expand-file-name "~/Projects/External"))

(setq swank-clojure-jar-path (concat clojure-src-root "/clojure/clojure.jar")
      swank-clojure-extra-classpaths (list (concat clojure-src-root "/clojure-contrib/clojure-contrib.jar")))

(require 'swank-clojure-autoload)

(defun slime-clojure ()
  "Fire up slime running the swank-clojure backend"
  (interactive)
  (slime 'clojure))

(provide 'init-clojure)

Remove broken initialization call for swank clojure


;;; pjs-reset.el --- Reset after changing configuration -*- lexical-binding: t; -*-
;;
;;; Commentary:
;;
;;; Code:
(require 'pjs-system)
(require 'pjs-exwm)

(defun pjs-reset ()
  "Recompile and reload all Emacs Lisp.  If EXWM is configured, also reset that."
  (interactive)
  (byte-recompile-file (concat user-emacs-directory "init.el") nil 0)
  (when (file-exists-p pjs-system-file)
    (byte-recompile-file pjs-system-file nil 0))
  (byte-recompile-directory (concat user-emacs-directory "elpa") 0)
  (byte-recompile-directory (concat user-emacs-directory "lisp") 0)
  (load (concat user-emacs-directory "init.el"))
  (pjs-load-system-file)
  (when pjs-exwm-configured-p
    (pjs-configure-exwm)
    (exwm-reset)))

(provide 'pjs-reset)
;;; pjs-reset.el ends here

;;; pjs-reset.el --- Reset after changing configuration -*- lexical-binding: t; -*-
;;
;;; Commentary:
;;
;;; Code:
(require 'pjs-system)
(require 'pjs-exwm)

(defun pjs-reset ()
  "Recompile and reload all Emacs Lisp.  If EXWM is configured, also reset that."
  (interactive)
  (byte-recompile-file (concat user-emacs-directory "init.el") nil 0)
  (when (file-exists-p pjs-system-file)
    (byte-recompile-file pjs-system-file nil 0))
  (byte-recompile-directory (concat user-emacs-directory "elpa") 0)
  (byte-recompile-directory (concat user-emacs-directory "lisp") 0)
  (load (concat user-emacs-directory "init"))
  (pjs-load-system-file)
  (when pjs-exwm-configured-p
    (pjs-configure-exwm)
    (exwm-reset)))

(provide 'pjs-reset)
;;; pjs-reset.el ends here

Load compiled init file, not source

Load compiled init file, not source


(eval-after-load "package"
  '(progn
     (when (> emacs-major-version 23)
       (add-to-list 'package-archives '("tromey" . "http://tromey.com/elpa/")))
    (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
))

(defun require-package (package &optional min-version)
  "Ask elpa to install given PACKAGE."
  (or (package-installed-p package min-version)
      (package-install package)))

(require 'package)
(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

(require-package 'fringe-helper)
(require-package 'color-theme)
(require-package 'json)
(require-package 'erc)
(require-package 'slime)
(require-package 'slime-fuzzy)
(require-package 'slime-repl)
(require-package 'project-local-variables)
(require-package 'highlight-symbol)
(require-package 'lua-mode)
(require-package 'gnuplot)
(require-package 'haskell-mode)
(require-package 'ruby-mode)

(provide 'init-elpa)

(eval-after-load "package"
  '(progn
     (when (> emacs-major-version 23)
       (add-to-list 'package-archives '("tromey" . "http://tromey.com/elpa/")))
    (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
))

(defun require-package (package &optional min-version)
  "Ask elpa to install given PACKAGE."
  (or (package-installed-p package min-version)
      (package-install package)))

(require 'package)
(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

(require-package 'all)
(require-package 'color-theme)
(require-package 'erc)
(require-package 'fringe-helper)
(require-package 'gnuplot)
(require-package 'haskell-mode)
(require-package 'highlight-symbol)
(require-package 'json)
(require-package 'lua-mode)
(require-package 'project-local-variables)
(require-package 'ruby-mode)
(require-package 'slime)
(require-package 'slime-fuzzy)
(require-package 'slime-repl)

(provide 'init-elpa)

Adjust list of required elpa packages

Adjust list of required elpa packages


(use-package ivy
  :init
  (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  :defer 5)

(use-package counsel
  :defer 5
  :bind (
         ("M-x" . counsel-M-x)
         ("C-x C-f" . counsel-find-file)
         ("s-f" . counsel-git)
         ("s-g" . counsel-git-grep)
         ("s-&" . counsel-shell-command)
         ("C-s-l" . counsel-locate)
         )
  :config

  ;; Display a history when running commands
  (defun counsel-shell-command ()
    "Forward to `shell-command'."
    (interactive)
    (ivy-read "➣ "
              shell-command-history
              :action (lambda (command)
                        (interactive (list (read-shell-command "$ ")))
                        (start-process-shell-command command nil command))
              :caller 'counsel-shell-command))
  )

(use-package swiper
  :defer 5
  :bind (("C-s" . swiper)))

(use-package ivy
  :init
  (ido-mode 0)
  (ivy-mode 1)
  (setq ivy-use-virtual-buffers t)
  :defer 5)

(use-package counsel
  :defer 5
  :bind (
         ("M-x" . counsel-M-x)
         ("C-x C-f" . counsel-find-file)
         ("s-f" . counsel-git)
         ("s-g" . counsel-git-grep)
         ("s-&" . counsel-shell-command)
         ("C-s-l" . counsel-locate)
         )
  :config

  ;; Display a history when running commands
  (defun counsel-shell-command ()
    "Forward to `shell-command'."
    (interactive)
    (ivy-read "➣ "
              shell-command-history
              :action (lambda (command)
                        (interactive (list (read-shell-command "$ ")))
                        (start-process-shell-command command nil command))
              :caller 'counsel-shell-command))
  )

(use-package swiper
  :defer 5
  :bind (("C-s" . swiper)))

Disable ido-mode as we now use ivy

Disable ido-mode as we now use ivy


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

(cond ((featurep! +intero) (load! "+intero"))
      ((featurep! +dante)  (load! "+dante")))

;;
;; Common plugins
;;

(def-package! hindent
  :hook (haskell-mode . hindent-mode))

(after! haskell-mode
  (add-hook 'haskell-mode-hook 'subword-mode)
  (add-hook 'haskell-mode-hook #'interactive-haskell-mode)
  (set-lookup-handlers! 'haskell-mode :definition #'haskell-mode-jump-to-def-or-tag)
  (set-file-template! 'haskell-mode :trigger #'haskell-auto-insert-module-template :project t)
  (set-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell-repl-buffer)

  (add-to-list 'completion-ignored-extensions ".hi")

  (map! :map haskell-mode-map
        :localleader
        ;; this is set to use cabal for dante users and stack for intero users:
        :n "b" #'haskell-process-cabal-build
        :n "c" #'haskell-cabal-visit-file
        :n "p" #'hindent-reformat-buffer
        :v "p" #'hindent-reformat-region))

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

(cond ((featurep! +intero) (load! "+intero"))
      ((featurep! +dante)  (load! "+dante")))

;;
;; Common plugins
;;

(def-package! hindent
  :hook (haskell-mode . hindent-mode))

(after! haskell-mode
  (add-hook 'haskell-mode-hook 'subword-mode) ;; improves text navigation with camelCase:
  (add-hook 'haskell-mode-hook 'haskell-collapse-mode) ;; support collapsing haskell code blocks.
  (add-hook 'haskell-mode-hook #'interactive-haskell-mode)
  (set-lookup-handlers! 'haskell-mode :definition #'haskell-mode-jump-to-def-or-tag)
  (set-file-template! 'haskell-mode :trigger #'haskell-auto-insert-module-template :project t)
  (set-repl-handler! '(haskell-mode haskell-cabal-mode literate-haskell-mode) #'+haskell-repl-buffer)

  (add-to-list 'completion-ignored-extensions ".hi")

  (map! :map haskell-mode-map
        :localleader
        ;; this is set to use cabal for dante users and stack for intero users:
        :n "b" #'haskell-process-cabal-build
        :n "c" #'haskell-cabal-visit-file
        :n "p" #'hindent-reformat-buffer
        :v "p" #'hindent-reformat-region
        :n "h" #'haskell-hide-toggle
        :n "H" #'haskell-hide-toggle-all))

Add support for folding haskell code blocks


;;; sh-script-conf.el -- Settings for sh-mode.
(eval-when-compile (require 'sh-script))
(setq-default sh-basic-offset 2)
(setq sh-indentation 2)

Fix indentation for shell scripts in Emacs 24.4


((emacs-lisp-mode . (eval .
                        (progn (setq-default flycheck-emacs-lisp-load-path 'inherit)))))

((emacs-lisp-mode . ((flycheck-emacs-lisp-load-path . inherit))))

Fix project local Flycheck setup

Fix project local Flycheck setup


;; Initialize package sources
(require 'package)

(setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/")
                         ("org" . "http://orgmode.org/elpa/")
                         ("gnu" . "http://elpa.gnu.org/packages/")))

(unless package-archive-contents
  (package-refresh-contents))
(package-initialize)

;; Initialize use-package
(unless (package-installed-p 'use-package)
  (package-install 'use-package))
(require 'use-package)

;; Ensure latest Org with contrib is installed first
(use-package org :ensure org-plus-contrib)

;; Load customization settings from another file
(setq custom-file "~/.emacs.d/config/customize.el")
(load custom-file)

;; Load real configuration from config.org
(when (file-readable-p "~/.emacs.d/config.org")
  (org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))

;; Initialize package sources
(require 'package)

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

(unless package-archive-contents
  (package-refresh-contents))
(package-initialize)

;; Initialize use-package
(unless (package-installed-p 'use-package)
  (package-install 'use-package))
(require 'use-package)

;; Ensure latest Org with contrib is installed first
(use-package org :ensure org-plus-contrib)

;; Load customization settings from another file
(setq custom-file "~/.emacs.d/config/customize.el")
(load custom-file)

;; Load real configuration from config.org
(when (file-readable-p "~/.emacs.d/config.org")
  (org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))

Use https for package archives, add MELPA Stable


(when (eval-when-compile (>= emacs-major-version 24))
  (require-package 'flycheck)
  (add-hook 'after-init-hook 'global-flycheck-mode))

(provide 'init-flycheck)

(when (eval-when-compile (>= emacs-major-version 24))
  (require-package 'flycheck)
  (add-hook 'after-init-hook 'global-flycheck-mode))

;; Override default flycheck triggers
(setq flycheck-check-syntax-automatically '(save idle-change mode-enabled)
      flycheck-idle-change-delay 0.8)
(provide 'init-flycheck)

Make flycheck execution defaults less aggressive


(require-package 'tidy)
(add-hook 'html-mode-hook (lambda () (tidy-build-menu html-mode-map)))

(require-package 'tagedit)
(after-load 'sgml-mode
  (tagedit-add-paredit-like-keybindings)
  (add-hook 'sgml-mode-hook (lambda () (tagedit-mode 1))))

(add-auto-mode 'html-mode "\\.(jsp|tmpl)\\'")

;; Note: ERB is configured in init-ruby-mode

(provide 'init-html)

(require-package 'tidy)
(add-hook 'html-mode-hook (lambda () (tidy-build-menu html-mode-map)))

(require-package 'tagedit)
(after-load 'sgml-mode
  (tagedit-add-paredit-like-keybindings)
  (add-hook 'sgml-mode-hook (lambda () (tagedit-mode 1))))

(add-auto-mode 'html-mode "\\.\\(jsp\\|tmpl\\)\\'")

;; Note: ERB is configured in init-ruby-mode

(provide 'init-html)

Fix regexp for jsp auto-mode-alist entry (thanks @liuchunhua)

Closes #298


(defun pipe (filename buffer-name)
  "Open FILENAME and append its content to buffer BUFFER-NAME.

If a buffer with that name does not exist, it's created."
  (find-file filename)
  (append-to-buffer (get-buffer-create buffer-name) (point-min) (point-max))
  (kill-buffer)
  (switch-to-buffer buffer-name))

(defun pipe (filename buffer-name)
  "Open FILENAME and insert its content to buffer BUFFER-NAME.

If the buffer BUFFER-NAME does not exist, it's created.
If narrowing is taking place in buffer BUFFER-NAME only the narrowed region is
replaced by the piped content."
  (find-file filename)
  (let ((stdin (get-buffer-create buffer-name))
        (tmp (current-buffer)))
    (switch-to-buffer stdin)
    (delete-region (point-min) (point-max))
    (switch-to-buffer tmp)
    (append-to-buffer stdin (point-min) (point-max))
    (kill-buffer)))

Support for replacing buffer contents and respect narrowing


;; full screen magit-status

(defun magit-status-fullscreen (prefix)
  (interactive "P")
  (magit-status)
  (unless prefix
    (delete-other-windows)))

;; don't prompt me

(set-default 'magit-unstage-all-confirm nil)
(set-default 'magit-stage-all-confirm nil)
(set-default 'magit-revert-buffers 'silent)

;; full screen vc-annotate

(defun vc-annotate-quit ()
  "Restores the previous window configuration and kills the vc-annotate buffer"
  (interactive)
  (kill-buffer)
  (jump-to-register :vc-annotate-fullscreen))

(eval-after-load "vc-annotate"
  '(progn
     (defadvice vc-annotate (around fullscreen activate)
       (window-configuration-to-register :vc-annotate-fullscreen)
       ad-do-it
       (delete-other-windows))

     (define-key vc-annotate-mode-map (kbd "q") 'vc-annotate-quit)))

(provide 'setup-magit)

;; full screen magit-status

(defun magit-status-fullscreen (prefix)
  (interactive "P")
  (magit-status)
  (unless prefix
    (delete-other-windows)))

;; don't prompt me

(set-default 'magit-unstage-all-confirm nil)
(set-default 'magit-stage-all-confirm nil)
(set-default 'magit-push-always-verify nil)
(set-default 'magit-revert-buffers 'silent)

;; full screen vc-annotate

(defun vc-annotate-quit ()
  "Restores the previous window configuration and kills the vc-annotate buffer"
  (interactive)
  (kill-buffer)
  (jump-to-register :vc-annotate-fullscreen))

(eval-after-load "vc-annotate"
  '(progn
     (defadvice vc-annotate (around fullscreen activate)
       (window-configuration-to-register :vc-annotate-fullscreen)
       ad-do-it
       (delete-other-windows))

     (define-key vc-annotate-mode-map (kbd "q") 'vc-annotate-quit)))

(provide 'setup-magit)

Stop magit always verifing when pushing

Stop magit always verifing when pushing


;; ==============================================================================
;; Undo/redo extensions
;; ------------------------------------------------------------------------------

;; (use-package "redo+"
;;   :load-path "site-lisp/redo+")

(use-package "undo-tree"
  :config
  (global-undo-tree-mode)
  (global-set-key (kbd "s-z g") 'global-undo-tree-mode)
  (global-set-key (kbd "s-z t") 'undo-tree-visualize)
  (define-key function-key-map (kbd "s-z z") 'undo)
  (define-key function-key-map (kbd "s-z Z") 'redo))

(autoload 'longlines-mode "longlines.el"
  "Minor mode for editing long lines." t)

;; ==============================================================================
;; Undo/redo extensions
;; ------------------------------------------------------------------------------

;; (use-package "redo+"
;;   :load-path "site-lisp/redo+")

(use-package "undo-tree"
  :config
  (global-undo-tree-mode)
  ;; (global-set-key (kbd "s-z g") 'global-undo-tree-mode)
  ;; (global-set-key (kbd "s-z t") 'undo-tree-visualize)
  ;; (define-key function-key-map (kbd "s-z z") 'undo)
  ;; (define-key function-key-map (kbd "s-z Z") 'redo)
  )

(autoload 'longlines-mode "longlines.el"
  "Minor mode for editing long lines." t)

Disable custom undo-tree-mode key bindings as they do not work on Mac


;;; tern.el --- Configuration for tern

;;; Commentary:

;;; Code:
(use-package tern
  :ensure t
  :load-path "~/.emacs.d/lib/tern/emacs/"
  :init
  (add-hook 'js2-mode-hook (lambda () (tern-mode t)))
  (autoload 'tern-mode "tern.el" nil t)
  :config
  (eval-after-load 'tern
    '(progn
       (use-package tern-auto-complete
         :ensure t
         :config
         (tern-ac-setup)))))

;;; tern.el ends here

;;; tern.el --- Configuration for tern

;;; Commentary:

;;; Code:
(use-package tern
  :ensure t
  :load-path
  ("~/.emacs.d/lib/tern/emacs/")
  :init
  (add-hook 'js2-mode-hook (lambda () (tern-mode t)))
  (autoload 'tern-mode "tern.el" nil t)
  :config
  (eval-after-load 'tern
    '(progn
       (use-package tern-auto-complete
         :ensure t
         :config
         (tern-ac-setup)))))

;;; tern.el ends here

Make Tern's load-path a list

Make Tern's load-path a list


(define-key osx-key-mode-map [(alt m)] nil)
(use-package magit
  :ensure t
  :demand
  :init
  (setq magit-auto-revert-mode nil)
  :config
  (defhydra hydra-magit (:color teal :hint nil)
"
                   Magit

  Status        Changes           Rebase            Cherry Pick       Merge
--------------------------------------------------------------------------------------
_s_: status      _c_: commit        _r_: rebase          _p_: cherry pick    _m_: merge
_d_: diff        _C_: amend         _A-r_: continue      _A-p_: continue
_l_: log         _h_: reset
_f_: reflog      _H_: reset hard

"
    ("s" magit-status)
    ("d" magit-diff)
    ("l" magit-log-current)
    ("f" magit-reflog)
    ("c" magit-commit)
    ("C" magit-commit-amend)
    ("h" magit-reset-head)
    ("H" magit-reset-hard)
    ("r" magit-rebase-interactive)
    ("A-r" magit-rebase-continue)
    ("p" magit-cherry-pick)
    ("A-p" magit-sequencer-continue)
    ("m" magit-merge)
    ("q" nil "cancel" :color blue)
    ("RET" magit-visit-thing)
    )
  (global-set-key (kbd "A-m") 'hydra-magit/body)
  )

(provide 'setup-magit)

(define-key osx-key-mode-map [(alt m)] nil)
(use-package magit
  :ensure t
  :demand
  :init
  (setq magit-auto-revert-mode nil)
  :config
  (defhydra hydra-magit (:color teal :hint nil)
"
                   Magit

  Status        Changes           Rebase            Cherry Pick       Merge
--------------------------------------------------------------------------------------
_s_: status      _c_: commit        _r_: rebase          _p_: cherry pick    _m_: merge
_d_: diff        _h_: reset         _A-r_: continue      _A-p_: continue
_l_: log         _H_: reset hard
_f_: reflog

"
    ("s" magit-status)
    ("d" magit-diff)
    ("l" magit-log-current)
    ("f" magit-reflog)
    ("c" magit-commit)
    ("h" magit-reset-head)
    ("H" magit-reset-hard)
    ("r" magit-rebase)
    ("A-r" magit-rebase-continue)
    ("p" magit-cherry-pick)
    ("A-p" magit-sequencer-continue)
    ("m" magit-merge)
    ("q" nil "cancel" :color blue)
    ("RET" magit-visit-thing)
    )
  (global-set-key (kbd "A-m") 'hydra-magit/body)
  )

(provide 'setup-magit)

Update magit commit/rebase hydra bindings


;;; Character sets

(defcustom sanityinc/force-default-font-for-symbols nil
  "When non-nil, force Emacs to use your default font for symbols."
  :type 'boolean)

(defun sanityinc/maybe-use-default-font-for-symbols ()
  "Force Emacs to render symbols using the default font, if so configured."
  (when sanityinc/force-default-font-for-symbols
    (set-fontset-font "fontset-default" 'symbol (face-attribute 'default :family))))

(add-hook 'after-init-hook 'sanityinc/maybe-use-default-font-for-symbols)

;; set a default font
;; Download font from here: https://github.com/powerline/fonts
(when (member "Inconsolata-dz" (font-family-list))
  (set-face-attribute 'default nil :font "Inconsolata-dz"))

;;; 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)

(provide 'init-fonts)

;;; Character sets

(defcustom sanityinc/force-default-font-for-symbols nil
  "When non-nil, force Emacs to use your default font for symbols."
  :type 'boolean)

(defun sanityinc/maybe-use-default-font-for-symbols ()
  "Force Emacs to render symbols using the default font, if so configured."
  (when sanityinc/force-default-font-for-symbols
    (set-fontset-font "fontset-default" 'symbol (face-attribute 'default :family))))

(add-hook 'after-init-hook 'sanityinc/maybe-use-default-font-for-symbols)

;; set a default font
;; Download font from here: https://github.com/google/fonts
(when (member "Source Code Pro" (font-family-list))
  (setq my-font "Source Code Pro-12")
  (set-face-attribute 'default nil :font my-font))

;;; 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)

(provide 'init-fonts)

Change font to Source Code Pro

Change font to Source Code Pro


(require-package 'j-mode)
(require-package 'android-mode)
(require-package 'fuel)
(require-package 'idris-mode)

(require-package 'auctex)
(require-package 'reftex)
(require-package 'auto-complete-auctex)
(require 'auto-complete-auctex)

(setq slime-path (file-name-directory (locate-library "slime")))
(setq slime-backend (expand-file-name "swank-loader.lisp" slime-path))
(setq slime-lisp-implementations
     '((sbcl ("sbcl" "--core" "/home/krzys/prog-local/sbcl.core-for-slime")) (clisp ("/usr/bin/clisp"))))

(ac-flyspell-workaround)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
(add-hook 'text-mode-hook 'flyspell-mode)

(provide 'init-local)

(require-package 'j-mode)
(require-package 'android-mode)
(require-package 'fuel)
(require-package 'idris-mode)

(require-package 'auctex)
(require-package 'reftex)

(setq slime-path (file-name-directory (locate-library "slime")))
(setq slime-backend (expand-file-name "swank-loader.lisp" slime-path))
(setq slime-lisp-implementations
     '((sbcl ("sbcl" "--core" "/home/krzys/prog-local/sbcl.core-for-slime")) (clisp ("/usr/bin/clisp"))))

(ac-flyspell-workaround)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
(add-hook 'text-mode-hook 'flyspell-mode)

(provide 'init-local)

Remove Auctex autocomplete. Didn't work anyway


(defconst mfa-treemacs-packages '(treemacs treemacs-evil))

(defun mfa-treemacs/init-treemacs ()
  (use-package treemacs
    :defer t
    :init
    (progn
      (setq treemacs-header-function #'treemacs--create-header-projectile)
      (spacemacs/set-leader-keys
        "fT" #'treemacs
        "ft" #'treemacs-toggle
        "pt" #'treemacs-projectile))
    :config
    (require 'treemacs-evil)))

(defun mfa-treemacs/init-treemacs-evil ()
  (use-package treemacs-evil
    :defer t))

(defconst mfa-treemacs-packages '(treemacs treemacs-evil))

(defun mfa-treemacs/init-treemacs ()
  (use-package treemacs
    :defer t
    :init
    (spacemacs/set-leader-keys
      "fT" #'treemacs
      "ft" #'treemacs-toggle
      "pt" #'treemacs-projectile)
    :config
    (require 'treemacs-evil)))

(defun mfa-treemacs/init-treemacs-evil ()
  (use-package treemacs-evil
    :defer t))

Reset treemacs header back to default

Reset treemacs header back to default


(setq evil-leader/in-all-states t
      evil-leader/leader "SPC"
      evil-leader/non-normal-prefix "s-")
(require 'evil-leader)
;; Unset shortcuts which shadow evil leader
(eval-after-load "compile"
  (define-key compilation-mode-map (kbd "SPC") nil))
;; make leader available in visual mode
(define-key evil-visual-state-map (kbd "SPC") evil-leader/map)
(define-key evil-motion-state-map (kbd "SPC") evil-leader/map)
(define-key evil-emacs-state-map  (kbd "SPC") evil-leader/map)

(setq evil-leader/in-all-states t
      evil-leader/leader "SPC"
      evil-leader/non-normal-prefix "s-")
(require 'evil-leader)
;; Unset shortcuts which shadow evil leader
(eval-after-load "compile"
  (define-key compilation-mode-map (kbd "SPC") nil))
;; make leader available in visual mode
(define-key evil-visual-state-map (kbd "SPC") evil-leader--default-map)
(define-key evil-motion-state-map (kbd "SPC") evil-leader--default-map)
(define-key evil-emacs-state-map  (kbd "SPC") evil-leader--default-map)

Update code to match recent breaking changes in evil-leader.


(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.
 '(xterm-extra-capabilities (quote modifyOtherKeys)))

(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
    (go-mode magit yari yaml-mode volatile-highlights smooth-scrolling smex smartparens scss-mode sass-mode rainbow-mode projectile paredit monroe mic-paren markdown-mode inf-ruby haskell-mode gnu-apl-mode git-gutter expand-region evil elscreen color-theme-railscasts cider auto-complete anything)))
 '(xterm-extra-capabilities (quote modifyOtherKeys)))

Add Emacs `Custom` selected packages

Add Emacs `Custom` selected packages

This subsumes a lot of what `.emacs.d/lisp/early-packages.el` was trying
to do. I'm not sure I like using `Custom` for this, but it captures the
current state of my main laptop, so pushing it in order to share config.


;; -*- coding: utf-8; mode: emacs-lisp -*-
;; Emacs customization file by Peter Hillerström
;; ____________________________________________________________________________
;; Aquamacs custom-file warning:
;; Warning: After loading this .emacs file, Aquamacs will also load
;; customizations from `custom-file' (customizations.el). Any settings there
;; will override those made here.
;; Consider moving your startup settings to the Preferences.el file, which
;; is loaded after `custom-file':
;; ~/Library/Preferences/Aquamacs Emacs/Preferences
;; _____________________________________________________________________________

;; ==============================================================================
;; Generic config
;; ------------------------------------------------------------------------------

(setq usr-prefix
      (cond ((eq system-type 'darwin) "/usr/local")
            ((eq system-type 'linux) "/usr")
            (t "/usr")))

(setq rc-dir (concat user-emacs-directory "rc/"))

(setq custom-file (concat rc-dir "custom.el"))
(load custom-file 'no-error)

;; Basic Common Lisp in Emacs Lisp
(eval-when-compile (require 'cl-lib))

(defun configure (path)
  (load-file (concat rc-dir path ".el")))

(configure "init")
(configure "packages")
(add-hook 'after-init-hook
          #'(lambda ()
              (load (concat rc-dir "modules.el"))))

;; -*- coding: utf-8; mode: emacs-lisp -*-
;; Emacs customization file by Peter Hillerström
;; ____________________________________________________________________________
;; Aquamacs custom-file warning:
;; Warning: After loading this .emacs file, Aquamacs will also load
;; customizations from `custom-file' (customizations.el). Any settings there
;; will override those made here.
;; Consider moving your startup settings to the Preferences.el file, which
;; is loaded after `custom-file':
;; ~/Library/Preferences/Aquamacs Emacs/Preferences
;; _____________________________________________________________________________

;; ==============================================================================
;; Generic config
;; ------------------------------------------------------------------------------

(setq usr-prefix
      (cond ((eq system-type 'darwin) "/usr/local")
            ((eq system-type 'linux) "/usr")
            (t "/usr")))

(setq rc-dir (concat user-emacs-directory "rc/"))

(setq custom-file (concat rc-dir "custom.el"))
(load custom-file 'no-error)

(defun configure (path)
  (load-file (concat rc-dir path ".el")))

(configure "init")
(configure "packages")
(add-hook 'after-init-hook
          #'(lambda ()
              (load (concat rc-dir "modules.el"))))

Remove unneeded require of cl-lib inside eval-when-compile


;;; editor/parinfer/doctor.el -*- lexical-binding: t; -*-

(when (featurep! +rust)
  (unless (fboundp 'module-load)
    (warn! "Your emacs wasn't built with dynamic modules support. `parinfer-rust-mode' won't work"))
  (when (and (eq system-type 'berkeley-unix)
             (not (file-readable-p
                   (concat user-emacs-directory ".local/etc/parinfer-rust/libparinfer_rust.so"))))
    (warn! (concat "Could not read " user-emacs-directory
                   ".local/etc/parinfer-rust/libparinfer_rust.so. "
                   "`parinfer-rust-mode' won't work"))))

Use easier to read line break.

Use easier to read line break.

Signed-off-by: Johan Thoren <759412786bc533369b22377bf83fb9056c5b25b2@thoren.xyz>


;;; js-doc.el --- Configuration for js-doc

;;; Commentary:
;; Load js-doc
;; - Hook into js2-mode

;;; Code:
(use-package js-doc
  :ensure t
  :init
  (add-hook 'js2-mode-hook
            #'(lambda ()
                (define-key js2-mode-map "\C-ci" 'js-doc-insert-function-doc)
                (define-key js2-mode-map "\C-cf" 'js-doc-insert-file-doc)
                (define-key js2-mode-map "@" 'js-doc-insert-tag))))

;;; js-doc.el ends here

;;; js-doc.el --- Configuration for js-doc

;;; Commentary:
;; Load js-doc
;; - Hook into js2-mode

;;; Code:
(use-package js-doc
  :ensure t
  :init
  (add-hook 'js2-mode-hook
            #'(lambda ()
                (define-key js2-mode-map "\C-ci" 'js-doc-insert-function-doc)
                (define-key js2-mode-map "\C-cf" 'js-doc-insert-file-doc))))

;;; js-doc.el ends here

Remove binding for '@' symbol in jsdoc comments