;; Time-stamp: <2017-06-07 14:24:47 kmodi>

;; Python

;; Emacs built-in `python' mode
(use-package python
  :mode (("\\.py\\'" . python-mode))
  :bind (:map python-mode-map
         ("<f9>" . python-shell-send-buffer))
  :config
  (progn
    (defvar modi/python-use-ipython t
      "When non-nil, use Ipython as the python interpreter instead of python3.")

    ;; Don't warn if guessing the indention fails, just set it to the value
    ;; of `python-indent-offset'.
    (setq python-indent-guess-indent-offset-verbose nil)

    (if modi/python-use-ipython
        (progn
          (setq python-shell-buffer-name "Ipython")
          (setq python-shell-interpreter "ipython")
          ;; https://emacs.stackexchange.com/q/24453/115
          ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25306
          (setq python-shell-interpreter-args "--simple-prompt -i"))
      (setq python-shell-interpreter "python3")))) ;Default to python 3.x

(provide 'setup-python)

;; | C-c C-p | Start the python shell        |
;; | C-c C-c | Send current buffer to python |

;; Time-stamp: <2017-06-08 08:24:50 kmodi>

;; Python

;; Emacs built-in `python' mode
(use-package python
  :mode (("\\.py\\'" . python-mode))
  :bind (:map python-mode-map
         ("<f9>" . python-shell-send-buffer))
  :config
  (progn
    (defvar modi/python-use-ipython t
      "When non-nil, use Ipython as the python interpreter instead of python3.")

    ;; Don't warn if guessing the indention fails, just set it to the value
    ;; of `python-indent-offset'.
    (setq python-indent-guess-indent-offset-verbose nil)

    (if (and (executable-find "ipython")
             modi/python-use-ipython)
        (progn
          (setq python-shell-buffer-name "Ipython")
          (setq python-shell-interpreter "ipython")
          ;; https://emacs.stackexchange.com/q/24453/115
          ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25306
          (setq python-shell-interpreter-args "--simple-prompt -i"))
      (setq python-shell-interpreter "python3")))) ;Default to python 3.x

(provide 'setup-python)

;; | C-c C-p | Start the python shell        |
;; | C-c C-c | Send current buffer to python |

Check if ipython executable is available


;; -*- no-byte-compile: t; -*-
;;; lang/web/packages.el

;; requires js-beautify stylelint stylelint-scss

(package! rainbow-mode)
(package! web-beautify)
(when (featurep! :completion ivy)
  (package! counsel-css :recipe (:fetcher github :repo "hlissner/emacs-counsel-css")))

;; +html.el
(package! company-web)
(package! emmet-mode)
(package! haml-mode)
(package! pug-mode)
(package! web-mode)

;; +css.el
(package! less-css-mode)
(package! sass-mode)
(package! stylus-mode)

;; -*- no-byte-compile: t; -*-
;;; lang/web/packages.el

;; requires js-beautify stylelint stylelint-scss

(package! rainbow-mode)
(package! web-beautify)
(when (featurep! :completion ivy)
  (package! counsel-css :recipe (:fetcher github :repo "hlissner/emacs-counsel-css")))

;; +html.el
(package! emmet-mode)
(package! haml-mode)
(package! pug-mode)
(package! web-mode)
(when (featurep! :completion company)
  (package! company-web))

;; +css.el
(package! less-css-mode)
(package! sass-mode)
(package! stylus-mode)

Install company-web only if company is active


(defun pmade-server-start ()
  (when window-system
    (add-hook 'server-visit-hook 'save-place-find-file-hook)
    (server-start)))

(setq server-use-tcp t
      server-host (if (string= "hawkins.pmade.com" system-name)
                      "10.0.1.10" system-name))

(add-hook 'after-init-hook 'pmade-server-start)

(defun pmade-server-start ()
  (when window-system
    (add-hook 'server-visit-hook 'save-place-find-file-hook)
    (server-start)))

(setq server-use-tcp t
      server-host (if (string= "hawkins" system-name)
                      "10.0.1.10" system-name))

(add-hook 'after-init-hook 'pmade-server-start)

Make up your mind emacs, what does system-name return?


(use-package popwin
  :init
  (progn
    (setq display-buffer-function 'popwin:display-buffer)
    ;; use popwin with helm
    (push '("^\*helm.+\*$" :regexp t) popwin:special-display-config)
    (push '("^\*helm-.+\*$" :regexp t) popwin:special-display-config)))

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

Add popwin rule for *grep*

Add popwin rule for *grep*


(require 'go-mode)

(setq gofmt-command "goimports")
(add-to-list 'load-path "/home/you/goroot/misc/emacs/")
(add-hook 'before-save-hook 'gofmt-before-save)

(defun go-test ()
  "Runs tests for package in current buffer"
  (interactive)
  (compile (concat "ginkgo " (file-name-directory (buffer-file-name)))))

(provide 'tj-go)

(require 'go-mode)

(setq gofmt-command "goimports")
(add-to-list 'load-path "/home/you/goroot/misc/emacs/")
(add-hook 'before-save-hook 'gofmt-before-save)

(defun go-test ()
  "Runs tests for package in current buffer"
  (interactive)
  (compile (concat "ginkgo " (file-name-directory (buffer-file-name)))))

(define-key tj-map (kbd "r t") 'go-test)

(provide 'tj-go)

Add key binding for 'go test'

Add key binding for 'go test'


((nil . ((indent-tabs-mode . nil)
         (tab-width . 8)
         (c-basic-offset . 4)))
)

((nil
  (indent-tabs-mode . nil)
  (tab-width . 8)
  (c-basic-offset . 4)
  (c-file-style . "stroustrup")
  (eval . (progn
	    (c-set-offset 'innamespace '0)
	    (c-set-offset 'inline-open '0)))
  )
 )

Improve the indention in emacs just a bit.

By default emacs offsets both the inline and in-namespaces, lets
fix that.


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

(def-package! lsp-haskell
  :after haskell-mode
  :init (add-hook 'haskell-mode-hook #'+lsp|init)
  :config
  ;; Does some strange indentation if it pastes in the snippet
  (setq yas-indent-line 'fixed))

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

(def-package! lsp-haskell
  :after haskell-mode
  :init (add-hook 'haskell-mode-hook #'+lsp|init)
  :config
  ;; Does some strange indentation if it pastes in the snippet
  (setq-hook! 'haskell-mode-hook yas-indent-line 'fixed))

Set yas-indent-line only in haskell-mode


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

;;; Commentary:

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

;;; Code:

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

(provide 'init-avy)

;;; init-avy.el ends here

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

;;; Commentary:

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

;;; Code:

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

(provide 'init-avy)

;;; init-avy.el ends here

Update key bindings for avo

Update key bindings for avo


;;; init-vc.el -- init version control setup

;;; Commentary:
;;; git setup

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

(use-package git-timemachine
  :commands (git-timemachine))
(use-package gitattributes-mode)
(use-package gitconfig-mode)
(use-package gitignore-mode)
(use-package magit
  :bind ("C-x g" . magit-status))

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

;;; init-vc.el -- init version control setup

;;; Commentary:
;;; git setup

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

(use-package diff-hl
  :commands (diff-hl-dired-mode
             diff-hl-margin-mode
             diff-hl-amend-mode
             diff-hl-flydiff-mode)
  :config
  (set-face-attribute 'diff-hl-change nil
                      :foreground "blue3"
                      :background "#5656ff")
  (set-face-attribute 'diff-hl-delete nil
                      :foreground "red"
                      :background "red")
  (set-face-attribute 'diff-hl-insert nil
                      :foreground "#098d07"
                      :background "#ddffdf")
  (setq diff-hl-side 'right)
  :init
  (add-hook 'prog-mode-hook 'diff-hl-mode)
  (add-hook 'prog-mode-hook 'diff-hl-flydiff-mode)
  (add-hook 'dired-mode-hook 'diff-hl-dired-mode)
  (add-hook 'dired-mode-hook 'diff-hl-flydiff-mode)
  (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))

(use-package git-timemachine
  :commands (git-timemachine))

(use-package gitattributes-mode)

(use-package gitconfig-mode)

(use-package gitignore-mode)

(use-package magit
  :bind ("C-x g" . magit-status))

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

Add diff-hl mode to Emacs

Add diff-hl mode to Emacs


(use-package cider
  :ensure t)
(use-package paredit
  :ensure t)

(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'clojure-mode-hook 'paredit-mode)
(setq linum-format "%d ")
(add-hook 'prog-mode-hook 'linum-mode)

(use-package helm
  :ensure t
  :bind (("C-c i" . helm-imenu)
         ("C-c C-i" . helm-imenu)))

(use-package helm-ag
  :ensure t
  :bind ("C-c a" . helm-ag))
(use-package helm-projectile
  :ensure t
  :config
  (projectile-mode)
  (setq projectile-completion-system 'helm)
  (helm-projectile-on))

(use-package cider
  :ensure t)
(use-package paredit
  :ensure t)

(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'clojure-mode-hook 'paredit-mode)
(setq linum-format "%d ")
(add-hook 'prog-mode-hook 'linum-mode)

(use-package helm
  :ensure t
  :bind (("C-c i" . helm-imenu)
         ("C-c C-i" . helm-imenu)
         ("M-x" . helm-M-x)))

(use-package helm-ag
  :ensure t
  :bind ("C-c a" . helm-ag))

(use-package helm-projectile
  :ensure t
  :config
  (projectile-mode)
  (setq projectile-completion-system 'helm)
  (helm-projectile-on))

Use helm for M-x completion.

Use helm for M-x completion.


;;; setup-mail.el --- Mail conf file.
;;; Commentary:
;;; Code:

(maybe-load-file "~/Dropbox/elisp/mail.el")

;; The following settings are ~/elisp/mail.el examples.
;; (setq user-full-name        "John Doe."
;;       user-mail-address     "example@example.org"
;;       smtpmail-smtp-server  "example.org"
;;       smtpmail-smtp-service 587
;;       send-mail-function    'smtpmail-send-it)

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

;;; setup-mail.el --- Mail conf file.
;;; Commentary:
;;; Code:

(maybe-load-file "~/Dropbox/elisp/mail.el")

;; The following settings are ~/elisp/mail.el examples.
;; (setq user-full-name        "John Doe."
;;       user-mail-address     "example@example.org"
;;       smtpmail-smtp-server  "example.org"
;;       smtpmail-smtp-service 587
;;       send-mail-function    'smtpmail-send-it)

(require 'mu4e)

;; default
(setq mu4e-maildir (expand-file-name "~/Mail"))

(setq mu4e-drafts-folder "/[Gmail].Drafts")
(setq mu4e-sent-folder   "/[Gmail].Sent Mail")
(setq mu4e-trash-folder  "/[Gmail].Trash")

;; don't save message to Sent Messages, GMail/IMAP will take care of this
(setq mu4e-sent-messages-behavior 'delete)

;; setup some handy shortcuts
(setq mu4e-maildir-shortcuts
      '(("/INBOX"             . ?i)
        ("/[Gmail].Sent Mail" . ?s)
        ("/[Gmail].Trash"     . ?t)))

;; allow for updating mail using 'U' in the main view:
;; (setq mu4e-get-mail-command "offlineimap")

(setq message-citation-line-format "On %D %I:%M %p, %N wrote:"
      mail-from-style 'angles
      message-cite-style 'message-cite-style-gmail
      message-citation-line-function 'message-insert-formatted-citation-line)

;; sending mail -- replace USERNAME with your gmail username
;; also, make sure the gnutls command line utils are installed
;; package 'gnutls-bin' in Debian/Ubuntu, 'gnutls' in Archlinux.

(require 'smtpmail)

(setq message-send-mail-function 'smtpmail-send-it
      starttls-use-gnutls t
      smtpmail-starttls-credentials
      '(("smtp.gmail.com" 587 nil nil))
      smtpmail-auth-credentials
      (expand-file-name "~/.authinfo.gpg")
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587
      smtpmail-debug-info t)

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

Drop notmuch in favor of mu4e

Drop notmuch in favor of mu4e


(require 'use-package)

(use-package sqlup-mode
  :ensure t
  :config
  (add-hook 'sql-mode-hook #'sqlup-mode))

(require 'use-package)

(use-package sqlup-mode
  :ensure t
  :config
  (add-hook 'sql-mode-hook #'sqlup-mode t))

Fix sqlup mode not working on startup

Fix sqlup mode not working on startup


(autoload 'doctest-mode "doctest-mode" "Python doctest editing mode." t)

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

;;----------------------------------------------------------------------------
;; On-the-fly syntax checking via flymake
;;----------------------------------------------------------------------------
(require-package 'flymake-python-pyflakes)
(add-hook 'python-mode-hook 'flymake-python-pyflakes-load)

(provide 'init-python-mode)

Remove defunct autoload for doctest-mode


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

(defvar evil-snipe-excluded-packages '()
  "List of packages to exclude.")

(defun evil-snipe/init-evil-snipe ()
  (require 'evil-snipe)
  (global-evil-snipe-mode t)

  (setq evil-snipe-scope 'whole-buffer
        evil-snipe-enable-highlight t
        evil-snipe-enable-incremental-highlight t
        evil-snipe-enable-half-cursor nil
        evil-snipe-show-prompt nil
        evil-snipe-smart-case t)

  (when evil-snipe-enable-alternate-f-and-t-behaviors
    (setq evil-snipe-repeat-scope 'whole-buffer
          evil-snipe-override-evil t)))

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

(defvar evil-snipe-excluded-packages '()
  "List of packages to exclude.")

(defun evil-snipe/init-evil-snipe ()
  (use-package evil-snipe
    :diminish evil-snipe-mode
    :init
    (setq evil-snipe-scope 'whole-buffer
          evil-snipe-enable-highlight t
          evil-snipe-enable-incremental-highlight t
          evil-snipe-enable-half-cursor nil
          evil-snipe-show-prompt nil
          evil-snipe-smart-case t)
    (when evil-snipe-enable-alternate-f-and-t-behaviors
      (setq evil-snipe-repeat-scope 'whole-buffer
            evil-snipe-override-evil t))
    :config
    (global-evil-snipe-mode t)))

Refactor evil-snipe layer to use use-package.


;;; pjs-stardica.el --- Stardica code and config -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(require 'pjs)
(setq pjs-inhibit-clojure-align-on-save 't)
(setq pjs-inhibit-cleanup-on-save 't)
(setq default-directory "~/")

(require 'org)
(require 'projectile)
(setq projectile-project-root-files nil)

(add-to-list 'org-agenda-files "~/clubhouse/clubhouse.org" t)

(remove-hook 'prog-mode-hook 'whitespace-mode)

(use-package clubhouse-backend
  :load-path "~/src/backend/elisp"
  :if (file-exists-p "~/src/backend/elisp")
  :hook (clojure-mode . clubhouse-backend-font-lock)
  :commands (clubhouse-backend-jack-in-dev-system)
  :bind (("C-c C-r" . clubhouse-backend-goto-defresource)))

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

;;; pjs-stardica.el --- Stardica code and config -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(require 'pjs)
(setq pjs-inhibit-clojure-align-on-save 't)
(setq pjs-inhibit-cleanup-on-save 't)
(setq default-directory "~/")

(require 'org)
(require 'projectile)
(setq projectile-project-root-files nil)

(add-to-list 'org-agenda-files "~/clubhouse/clubhouse.org" t)

(remove-hook 'prog-mode-hook 'whitespace-mode)

(use-package clubhouse-backend
  :load-path "~/src/backend/elisp"
  :if (file-exists-p "~/src/backend/elisp")
  :init
  (unbind-key "s-c")
  :hook (clojure-mode . clubhouse-backend-font-lock)
  :bind (("s-c r" . clubhouse-backend-goto-defresource)
         ("s-c j" . clubhouse-backend-jack-in-dev-system)
         ("s-c a" . clubhouse-backend-insert-co-authored-by)))

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

Add prefix for clubhouse backend commands.


;;; ar-helm-projectile.el --- Helm projectile support.

;;; Commentary:
;; Helm projectile helpers.

;;; Code:

(require 'ar-shell)
(require 'helm-projectile)

(defun ar/helm-projectile-shell-cd ()
  "Change shell current working directory using helm projectile."
  (interactive)
  (unless (string-equal mode-name "Shell")
    (error "Not in Shell mode"))
  (let ((helm-dir-source (copy-tree  helm-source-projectile-directories-list)))
    (add-to-list 'helm-dir-source '(action . ar/shell-cd))
    (add-to-list 'helm-dir-source '(keymap . nil))
    (add-to-list 'helm-dir-source '(header-line . "cd to directory..."))
    (helm :sources helm-dir-source
          :buffer "*helm-dirs*"
          :candidate-number-limit 10000)))

(provide 'ar-helm-projectile)

;;; ar-helm-projectile.el ends here

;;; ar-helm-projectile.el --- Helm projectile support.

;;; Commentary:
;; Helm projectile helpers.

;;; Code:

(require 'ar-shell)
(require 'cl)
(require 'helm-projectile)

(defun ar/helm-projectile-shell-cd ()
  "Change shell current working directory using helm projectile."
  (interactive)
  (assert (string-equal mode-name "Shell") nil "Not in Shell mode")
  (let ((helm-dir-source (copy-tree  helm-source-projectile-directories-list)))
    (add-to-list 'helm-dir-source '(action . ar/shell-cd))
    (add-to-list 'helm-dir-source '(keymap . nil))
    (add-to-list 'helm-dir-source '(header-line . "cd to directory..."))
    (helm :sources helm-dir-source
          :buffer "*helm-dirs*"
          :candidate-number-limit 10000)))

(provide 'ar-helm-projectile)

;;; ar-helm-projectile.el ends here

Use assert instead of unless and error.

Use assert instead of unless and error.


;; When saving small files, emacs tries to copy files with uuencode
;; and base64 instead of copying wihth an extra scp session. This
;; fails on machines without uuencode/base64 support. We want to use
;; scp always.
(setq tramp-copy-size-limit nil)

;; Use login credentials strore.
(setq auth-source '("~/.authinfo.pgp" "~/.authinfo" "~/.authinfo"))

Use passwords for encrypted file instead of key store


(require 'package)
(require 'dash)

;; Add melpa to package repos
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)

(package-initialize)

(unless (file-exists-p "~/.emacs.d/elpa/archives/melpa")
  (package-refresh-contents))

(defun packages-install (packages)
  (--each packages
    (when (not (package-installed-p it))
      (package-install it)))
  (delete-other-windows))

;;; On-demand installation of packages

(defun require-package (package &optional min-version no-refresh)
  "Install given PACKAGE, optionally requiring MIN-VERSION.
If NO-REFRESH is non-nil, the available package lists will not be
re-downloaded in order to locate PACKAGE."
  (if (package-installed-p package min-version)
      t
    (if (or (assoc package package-archive-contents) no-refresh)
        (package-install package)
      (progn
        (package-refresh-contents)
        (require-package package min-version t)))))

(provide 'setup-package)

(require 'package)
(require 'dash)

;; Add melpa to package repos
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)

(setq package-pinned-packages
      '((cider              . "melpa-stable")
        (clojure-mode       . "melpa-stable")))

(package-initialize)

(unless (file-exists-p "~/.emacs.d/elpa/archives/melpa")
  (package-refresh-contents))

(defun packages-install (packages)
  (--each packages
    (when (not (package-installed-p it))
      (package-install it)))
  (delete-other-windows))

;;; On-demand installation of packages

(defun require-package (package &optional min-version no-refresh)
  "Install given PACKAGE, optionally requiring MIN-VERSION.
If NO-REFRESH is non-nil, the available package lists will not be
re-downloaded in order to locate PACKAGE."
  (if (package-installed-p package min-version)
      t
    (if (or (assoc package package-archive-contents) no-refresh)
        (package-install package)
      (progn
        (package-refresh-contents)
        (require-package package min-version t)))))

(provide 'setup-package)

Use stable cider and clojure-mode

Use stable cider and clojure-mode


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

(doom!
 :completion
 ivy
 (company +auto)

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

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

 :emacs
 (dired +icons)
 electric
 vc

 :tools
 (lookup +docsets)
 eval
 make
 magit
 lsp
 editorconfig
 flyspell
 flycheck

 :lang
 (sh +fish)
 emacs-lisp
 markdown
 (csharp +unity)
 (haskell +dante)
 (org
  +attach
  +babel
  +export
  +present)
 (cc +lsp)
 ocaml

 :term
 term

 :app
 ;;(email +gmail)    ; emacs as an email client
 ;;(rss +org)        ; emacs as an RSS reader
 ;;(write            ; emacs as a word processor (latex + org + markdown)
 ;; +wordnut         ; wordnet (wn) search
 ;; +langtool)       ; a proofreader (grammar/style check) for Emacs

 :collab
 ;;floobits          ; peer programming for a price
 ;;impatient-mode    ; show off code over HTTP

 :config
 (default)
 ;;literate
 )

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

(doom!
 :completion
 ivy
 (company +auto)

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

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

 :emacs
 (dired +icons)
 electric
 vc

 :tools
 (lookup +docsets)
 eval
 make
 magit
 lsp
 editorconfig
 flyspell
 flycheck

 :lang
 (sh +fish)
 emacs-lisp
 markdown
 (csharp +unity)
 (haskell +dante)
 (org
  +attach
  +babel
  +export
  +present)
 (cc +lsp)
 ocaml
 idris

 :term
 term

 :app
 ;;(email +gmail)    ; emacs as an email client
 ;;(rss +org)        ; emacs as an RSS reader
 ;;(write            ; emacs as a word processor (latex + org + markdown)
 ;; +wordnut         ; wordnet (wn) search
 ;; +langtool)       ; a proofreader (grammar/style check) for Emacs

 :collab
 ;;floobits          ; peer programming for a price
 ;;impatient-mode    ; show off code over HTTP

 :config
 (default)
 ;;literate
 )

Add idris mode to doom

Add idris mode to doom


(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.
 '(fringe-mode 0 nil (fringe))
 '(ido-work-directory-list-ignore-regexps (quote ("^/s/")))
 '(mode-line-format (quote ("%e" (buffer-file-truename "%f" "%b") #("-%*-" 0 4 (auto-composed t)) (vc-mode vc-mode) #("--" 0 2 (auto-composed t)) mode-line-modes #("%-" 0 2 (auto-composed t)))))
 '(mouse-wheel-scroll-amount (quote (2 ((shift) . 1) ((control)))))
 '(org-agenda-files (quote ("~/wiki/wiki.org_archive"))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(browse-url-browser-function (quote browse-url-generic))
 '(browse-url-generic-program "chromium")
 '(fringe-mode 0 nil (fringe))
 '(ido-work-directory-list-ignore-regexps (quote ("^/s/")))
 '(mode-line-format (quote ("%e" (buffer-file-truename "%f" "%b") #("-%*-" 0 4 (auto-composed t)) (vc-mode vc-mode) #("--" 0 2 (auto-composed t)) mode-line-modes #("%-" 0 2 (auto-composed t)))))
 '(mouse-wheel-scroll-amount (quote (2 ((shift) . 1) ((control)))))
 '(org-agenda-files (quote ("~/wiki/wiki.org_archive"))))
(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.
 )

Use chromium as the default browser

Use chromium as the default browser


;;; macros-yasnippet.el

;;;###autoload
(defmacro def-yas-mode! (mode)
  "Register minor MODES in yasnippet."
  `(after! yasnippet
     (when (boundp 'yas--extra-modes)
       (add-hook! ,mode
         (if (symbol-value ,mode)
             (yas-activate-extra-mode ,mode)
           (yas-deactivate-extra-mode ,mode))))))

(provide 'macros-yasnippet)
;;; macros-yasnippet.el ends here

;;; macros-yasnippet.el

;;;###autoload
(defmacro def-yas-mode! (mode)
  "Register minor MODES in yasnippet."
  `(after! yasnippet
     (add-hook! ,mode
       (if ,mode
           (yas-activate-extra-mode ,mode)
         (yas-deactivate-extra-mode ,mode)))))

(provide 'macros-yasnippet)
;;; macros-yasnippet.el ends here

Remove redundant boundp check in def-yas-mode!


;; (autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t)
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rabl" . ruby-mode))

(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))

(setq ruby-bounce-deep-indent t)
(setq ruby-hanging-brace-indent-level 2)

(require 'cl) ; If you don't have it already

;; Add ruby-end
(add-hook 'ruby-mode-hook
          (lambda ()
            (require 'ruby-end-mode)))

;; (autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t)
(add-to-list 'auto-mode-alist
             '("\\(?:\\.rb\\|ru\\|rabl\\|rake\\|thor\\|jbuilder\\|gemspec\\|podspec\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Vagrant\\|Guard\\|Pod\\)file\\)\\'" . enh-ruby-mode))

(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))

(setq ruby-bounce-deep-indent t)
(setq ruby-hanging-brace-indent-level 2)

(require 'cl) ; If you don't have it already

;; Add ruby-end
(require 'ruby-end)
(add-hook 'enh-ruby-mode-hook (lambda () (ruby-end-mode)))

;; Load cmopany mode
(add-hook 'enh-ruby-mode-hook (lambda () (company-mode)))

Use enhanced ruby instead of plain boring ruby mode.


;;; tools/prodigy/config.el -*- lexical-binding: t; -*-

(after! prodigy
  (set-evil-initial-state! 'prodigy-mode 'emacs)

  (defadvice! +prodigy--add-project-property-a (orig-fn &rest args)
    "Adds a new :project property to prodigy services, which hides the service
unless invoked from the relevant project."
    :around #'prodigy-services
    (let ((project-root (downcase (or (doom-project-root) default-directory)))
          (services (apply orig-fn args)))
      (if current-prefix-arg
          services
        (cl-remove-if-not (lambda (service)
                            (let ((project (plist-get service :project)))
                              (or (not project)
                                  (file-in-directory-p project-root project))))
                          services))))

  (define-key prodigy-mode-map "d" #'+prodigy/delete))

;;; tools/prodigy/config.el -*- lexical-binding: t; -*-

(after! prodigy
  (defadvice! +prodigy--add-project-property-a (orig-fn &rest args)
    "Adds a new :project property to prodigy services, which hides the service
unless invoked from the relevant project."
    :around #'prodigy-services
    (let ((project-root (downcase (or (doom-project-root) default-directory)))
          (services (apply orig-fn args)))
      (if current-prefix-arg
          services
        (cl-remove-if-not (lambda (service)
                            (let ((project (plist-get service :project)))
                              (or (not project)
                                  (file-in-directory-p project-root project))))
                          services))))

  (define-key prodigy-mode-map "d" #'+prodigy/delete))

Set initial state in prodigy to normal

Set initial state in prodigy to normal

This allows using evil-collection's bindings for this mode.

Signed-off-by: Rudi Grinberg <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@rgrinberg.com>


(require 'multi-term)

(setq multi-term-program "/bin/zsh")

(defun term-send-tab ()
  "Send tab in term mode."
  (interactive)
  (term-send-raw-string "\t"))

(add-to-list 'term-bind-key-alist '("<tab>" . term-send-tab))

Make tab completion work within a zsh term.


(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.
 '(apropos-sort-by-scores t)
 '(backup-directory-alist `((".*" \, temporary-file-directory)))
 '(fido-mode t)
 '(global-display-line-numbers-mode t)
 '(ido-create-new-buffer 'always)
 '(ido-enable-flex-matching t)
 '(ido-everywhere t)
 '(ido-mode 'both nil (ido))
 '(indent-tabs-mode nil)
 '(org-log-done 'time)
 '(org-log-into-drawer "LOGBOOK")
 '(package-archives
   '(("gnu" . "https://elpa.gnu.org/packages/")
     ("melpa" . "https://melpa.org/packages/")))
 '(package-selected-packages
   '(paredit sml-mode ycmd solarized-theme rust-mode rainbow-delimiters markdown-mode magit company cmake-mode))
 '(standard-indent 4)
 '(tab-always-indent nil)
 '(tab-width 4))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(apropos-sort-by-scores t)
 '(backup-directory-alist `((".*" \, temporary-file-directory)))
 '(fido-mode t)
 '(global-display-line-numbers-mode t)
 '(ido-create-new-buffer 'always)
 '(ido-enable-flex-matching t)
 '(ido-everywhere t)
 '(ido-mode 'both nil (ido))
 '(indent-tabs-mode nil)
 '(org-log-done 'time)
 '(org-log-into-drawer "LOGBOOK")
 '(package-archives
   '(("gnu" . "https://elpa.gnu.org/packages/")
     ("melpa" . "https://melpa.org/packages/")))
 '(package-selected-packages
   '(helm paredit sml-mode ycmd solarized-theme rust-mode rainbow-delimiters markdown-mode magit company cmake-mode))
 '(standard-indent 4)
 '(tab-always-indent nil)
 '(tab-width 4))
(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.
 )

Add helm package to Emacs

Add helm package to Emacs


(require 'auto-highlight-symbol)
(custom-set-variables
 '(ahs-case-fold-search nil)
 '(ahs-default-range (quote ahs-range-whole-buffer))
 '(ahs-idle-interval 0.01))

(require 'auto-highlight-symbol)
(custom-set-variables
 '(ahs-case-fold-search nil)
 '(ahs-default-range (quote ahs-range-whole-buffer))
 '(ahs-idle-interval 0.5))

Set auto-highlight-symbol delay to 0.5s instead of crazy 0.01s


;;; init-company.el -- Company mode setup

;;; Commentary:
;;; company setup

;;; Code:
(require-package 'company)
(require-package 'company-quickhelp)

(company-quickhelp-mode 1)
(global-company-mode 1)

(define-key company-active-map (kbd "\C-n") 'company-select-next)
(define-key company-active-map (kbd "\C-p") 'company-select-previous)

(setq company-dabbrev-downcase nil)
(setq company-dabbrev-ignore-case t)
(setq company-idle-delay 0.25)
(setq company-minimum-prefix-length 0)

(diminish 'company-mode)

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

;;; init-company.el -- Company mode setup

;;; Commentary:
;;; company setup

;;; Code:
(require-package 'company)
(require-package 'company-quickhelp)

(company-quickhelp-mode 1)
(global-company-mode 1)

(define-key company-active-map (kbd "\C-n") 'company-select-next)
(define-key company-active-map (kbd "\C-p") 'company-select-previous)
(add-hook 'company-completion-started-hook (lambda (arg) (fci-mode 0)))
(add-hook 'company-completion-finished-hook (lambda (arg) (fci-mode 1)))

(setq company-dabbrev-downcase nil)
(setq company-dabbrev-ignore-case t)
(setq company-idle-delay 0.25)
(setq company-minimum-prefix-length 0)

(diminish 'company-mode)

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

Fix fill column indicator and company display in Emacs


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

  ;; The following code means you get a menu if you hit "C-c p" and wait
  (after-load 'guide-key
    (add-to-list 'guide-key/guide-key-sequence "C-c p"))

  ;; Shorter modeline
  (after-load 'projectile
    (setq-default
     projectile-mode-line
     '(:eval
       (if (file-remote-p default-directory)
           " Pr"
         (format " Pr[%s]" (projectile-project-name)))))))

(provide 'init-projectile)

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

  ;; The following code means you get a menu if you hit "C-c p" and wait
  (after-load 'guide-key
    (add-to-list 'guide-key/guide-key-sequence "C-c p"))

  ;; Shorter modeline
  (after-load 'projectile
    (setq-default
     projectile-mode-line
     '(:eval
       (if (file-remote-p default-directory)
           " Proj"
         (format " Proj[%s]" (projectile-project-name)))))))

(provide 'init-projectile)

Change projectile modeline lighter and use non-aliased mode name


(pkg 'epa)

(epa-file-enable)

(defvar eric-auth-extension ".el.gpg" "The extension of encrypted files")

(defun eric-auth-init ()
  (interactive)
  (add-to-list 'load-suffixes eric-auth-extension))

(provide 'eric-auth)

(pkg 'epa)

(epa-file-enable)

(defvar eric-auth-extension "el.gpg" "The extension of encrypted files")
(defvar eric-auth-path "~" "The path where passwd file is stored")
(defvar eric-auth-file "passwd" "The filename to load for passwords and other sensitive information")
(defvar eric-auth nil "The full path + filename to load, only set this on init so the variables can be changed prior to setting up")

(defun eric-auth-init ()
  (interactive)
  (add-to-list 'load-suffixes eric-auth-extension)
  (setq eric-auth (format "%s/%s.%s" eric-auth-path eric-auth-file eric-auth-extension)))

(provide 'eric-auth)

Make this a bit more user-friendly.

Make this a bit more user-friendly.

While this might be super-config-heavy, it allows better customization
as not everyone wants to do things the way I do.  But, the defaults are
for my use.


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

(setq ranger-packages '(ranger))

(defun ranger/init-ranger ()
  (use-package ranger
    :defer t
    :init
    (progn
      (evil-leader/set-key
        "ar" 'ranger
        "ad" 'deer)
      (evil-define-key 'normal 'dired-mode-map "-" 'ranger-up-directory)
      (define-key evil-normal-state-map (kbd "-") 'deer)

      ;; set up image-dired to allow picture resize
      (setq image-dired-dir (concat spacemacs-cache-directory "image-dir"))
      (unless (file-directory-p image-dired-dir)
        (make-directory image-dired-dir)))))

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

(setq ranger-packages '(ranger))

(defun ranger/init-ranger ()
  (use-package ranger
    :defer t
    :init
    (progn
      (evil-leader/set-key
        "ar" 'ranger
        "ad" 'deer)
      (define-key evil-normal-state-map (kbd "-") 'deer)

      ;; set up image-dired to allow picture resize
      (setq image-dired-dir (concat spacemacs-cache-directory "image-dir"))
      (unless (file-directory-p image-dired-dir)
        (make-directory image-dired-dir)))
    :config
    (ranger-map (kbd "-") 'ranger-up-directory)))

Fix `ranger-up-directory` mapping for emacs / evil users.


(defun set-exec-path-from-shell-PATH ()
  (let ((path-from-shell (string-rtrim (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
    (setenv "PATH" path-from-shell)
    (setq exec-path (split-string path-from-shell path-separator))))

(when *is-a-mac*
  (eval-after-load "woman"
    '(setq woman-manpath (append (list "/opt/local/man") woman-manpath)))

  ;; When started from Emacs.app or similar, ensure $PATH
  ;; is the same the user would see in Terminal.app
  (if window-system (set-exec-path-from-shell-PATH)))

(provide 'init-exec-path)

(defun set-exec-path-from-shell-PATH ()
  (let ((path-from-shell (string-rtrim (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
    (setenv "PATH" path-from-shell)
    (setq exec-path (split-string path-from-shell path-separator))))

(when *is-a-mac*
  ;; When started from Emacs.app or similar, ensure $PATH
  ;; is the same the user would see in Terminal.app
  (if window-system (set-exec-path-from-shell-PATH)))

(provide 'init-exec-path)

Remove defunct setting of man path for 'woman


(defun my/cleanup-buffer ()
  (interactive)
  (delete-trailing-whitespace)
  (untabify (point-min) (point-max))
  (indent-region (point-min) (point-max)))

(global-set-key (kbd "C-c n") 'my/cleanup-buffer)
(global-set-key (kbd "C-c C-n") 'my/cleanup-buffer)

(defun my/cleanup-buffer ()
  (interactive)
  (delete-trailing-whitespace)
  (untabify (point-min) (point-max))
  (indent-region (point-min) (point-max))
  (when (derived-mode-p 'clojure-mode)
    (clojure-sort-ns)))

(global-set-key (kbd "C-c n") 'my/cleanup-buffer)
(global-set-key (kbd "C-c C-n") 'my/cleanup-buffer)

Sort clojure ns forms on buffer cleanup.


(require 'shell)
(require 'sh-script)

(add-hook 'shell-mode-hook 'set-tab)
(add-hook 'shell-mode-hook (lambda ()
                             (set 'sh-basic-offset 2)
                             (set 'sh-indentation 2)))

(require 'flycheck)
(add-hook 'shell-mode-hook #'flycheck-mode)

(require 'shell)
(require 'sh-script)

(add-hook 'sh-mode-hook 'set-tab)

(require 'flycheck)
(add-hook 'sh-mode-hook #'flycheck-mode)

Fix some stupid shit in sh-mode config

Fix some stupid shit in sh-mode config


;;; init-company.el -- Company mode setup

;;; Commentary:
;;; company setup

;;; Code:
(require-package 'company)
(require-package 'company-quickhelp)

(company-quickhelp-mode 1)
(global-company-mode 1)

(define-key company-active-map (kbd "\C-n") 'company-select-next)
(define-key company-active-map (kbd "\C-p") 'company-select-previous)
(add-hook 'company-completion-started-hook (lambda (arg) (fci-mode 0)))
(add-hook 'company-completion-finished-hook (lambda (arg) (fci-mode 1)))

(setq company-dabbrev-downcase nil)
(setq company-dabbrev-ignore-case t)
(setq company-idle-delay 0.25)
(setq company-minimum-prefix-length 0)

(diminish 'company-mode)

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

;;; init-company.el -- Company mode setup

;;; Commentary:
;;; company setup

;;; Code:
(require-package 'company)
(require-package 'company-quickhelp)

(company-quickhelp-mode 1)
(global-company-mode 1)

(define-key company-active-map (kbd "\C-n") 'company-select-next)
(define-key company-active-map (kbd "\C-p") 'company-select-previous)
(global-set-key (kbd "M-/") 'hippie-expand)
(add-hook 'company-completion-started-hook (lambda (arg) (fci-mode 0)))
(add-hook 'company-completion-finished-hook (lambda (arg) (fci-mode 1)))

(setq company-dabbrev-downcase nil)
(setq company-dabbrev-ignore-case t)
(setq company-idle-delay 0.25)
(setq company-minimum-prefix-length 0)

(diminish 'company-mode)

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

Use hippie-expand instead of dabbrev in Emacs


(if (equal system-name "QUE-WKS-AA427-Linux")
    (load-theme 'solarized-light t)
    (load-theme 'solarized-dark t))

Change theme depending on the hostname.

Change theme depending on the hostname.


;;; ------------------------------------------------------------------------------
;;; FILE        | .emacs-pkginit.el
;;; AUTHOR      | sameh kamal
;;; DESCRIPTION | emacs initial packages installation
;;; ------------------------------------------------------------------------------

(require 'package)

(add-to-list 'package-archives '("marmalade"    . "http://marmalade-repo.org/packages/"       ))
(add-to-list 'package-archives '("elpy"         . "http://jorgenschaefer.github.io/packages/" ))
(add-to-list 'package-archives '("melpa"        . "http://melpa.org/packages/"                ) t)

; list the packages you want
(setq package-list
      '(  use-package
	  python-environment
	  flycheck
	  elpy
	  jedi
	  seti-theme
      	  auto-complete
	  magit
	  yasnippet
	  highlight-parentheses
	  multiple-cursors
	  markdown-mode
	  markdown-mode+
	  dired+
	  diff-hl
	  org
       )
)

; activate all the packages
(package-initialize)

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

; install the missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

;;; emacs-pkginit.el ends here

;; ------------------------------------------------------------------------------
;; FILE        | .emacs-pkginit.el
;; AUTHOR      | sameh kamal
;; DESCRIPTION | emacs initial packages installation
;; ------------------------------------------------------------------------------

(require 'package)

(add-to-list 'package-archives '("marmalade"    . "http://marmalade-repo.org/packages/"       ))
(add-to-list 'package-archives '("elpy"         . "http://jorgenschaefer.github.io/packages/" ))
(add-to-list 'package-archives '("melpa"        . "http://melpa.org/packages/"                ) t)

; list the packages you want
(setq package-list
      '(  use-package
	  python-environment
	  flycheck
	  elpy
	  jedi
	  seti-theme
      	  auto-complete
	  magit
	  yasnippet
	  auctex
	  highlight-parentheses
	  multiple-cursors
	  markdown-mode
	  markdown-mode+
	  dired+
	  diff-hl
	  org
       )
)

; activate all the packages
(package-initialize)

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

; install the missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

;;; emacs-pkginit.el ends here

Add auctex to install packages list

Add auctex to install packages list


(defvar kotct/dependency-list
  '(linum-off ;; turn linum off in certain modes
    ido-vertical-mode ;; use vertical menus for ido
    ido-grid-mode ;; use a grid selection menu for ido
    smex ;; ido-enabled M-x
    anzu ;; nicer search environment
    volatile-highlights ;; highlight changed areas
    buffer-move ;; easily move buffers between windows
    expand-region ;; expand region to successively larger sexps
    magit ;; make Git and Emacs both way cooler
    auto-complete ;; code autocompletion
    markdown-mode ;; major mode for markdown
    smart-tabs-mode ;; indentation with tabs and spaces
    ace-jump-mode ;; immediately jump to any visible character
    ace-jump-zap ;; zap-to-char but harnessing ace-jump
    editorconfig ;; editorconfig plugin
    hl-todo ;; highlight TODO, FIXME, FAIL, etc.
    highlight-symbol ;; navigate between and highlight symbols
    web-mode ;; for editing web files
    elixir-mode ;; for editing Elixir code
    rust-mode ;; for editing Rust code
    yaml-mode ;; for editing YAML files
    buttercup ;; for tests
    smartparens ;; for dealing with paired control flow symbols
    gitignore-mode ;; for editing .gitignore files
    gitattributes-mode ;; for editing .gitattributes files
    gitconfig-mode ;; for editing .git/config files

    ;; THEMES
    solarized-theme)
  "A list of all packages required for operation.")

(provide 'dependencies)

(defvar kotct/dependency-list
  '(linum-off ;; turn linum off in certain modes
    ido-vertical-mode ;; use vertical menus for ido
    ido-grid-mode ;; use a grid selection menu for ido
    smex ;; ido-enabled M-x
    anzu ;; nicer search environment
    volatile-highlights ;; highlight changed areas
    buffer-move ;; easily move buffers between windows
    expand-region ;; expand region to successively larger sexps
    magit ;; make Git and Emacs both way cooler
    auto-complete ;; code autocompletion
    markdown-mode ;; major mode for markdown
    smart-tabs-mode ;; indentation with tabs and spaces
    ace-jump-mode ;; immediately jump to any visible character
    ace-jump-zap ;; zap-to-char but harnessing ace-jump
    editorconfig ;; editorconfig plugin
    hl-todo ;; highlight TODO, FIXME, FAIL, etc.
    highlight-symbol ;; navigate between and highlight symbols
    web-mode ;; for editing web files
    elixir-mode ;; for editing Elixir code
    rust-mode ;; for editing Rust code
    yaml-mode ;; for editing YAML files
    buttercup ;; for tests
    smartparens ;; for dealing with paired control flow symbols
    gitignore-mode ;; for editing .gitignore files
    gitattributes-mode ;; for editing .gitattributes files
    gitconfig-mode ;; for editing .git/config files
    fish-mode ;; for editing fish shell configuration files

    ;; THEMES
    solarized-theme)
  "A list of all packages required for operation.")

(provide 'dependencies)

Add fish-mode as a dependency

Add fish-mode as a dependency


;;; init-typescript.el --- Configuration for tide

;;; Commentary:

;;; Code:
(use-package tide
  :functions tide-setup
  :config
  (defun gp-setup-tide-mode ()
    (interactive)
    (tide-setup)
    (flycheck-mode +1)
    (setq flycheck-check-syntax-automatically '(save mode-enabled))
    (eldoc-mode +1)
    (tide-hl-identifier-mode +1)
    (company-mode +1))
  ;; aligns annotation to the right hand side
  (setq company-tooltip-align-annotations t)
  (add-hook 'typescript-mode-hook 'gp-setup-tide-mode)
  (add-hook 'before-save-hook 'tide-format-before-save)
  (setq tide-format-options '(:tabSize 2
                                       :convertTabsToSpaces t
                                       :insertSpaceAfterFunctionKeywordForAnonymousFunctions t
                                       :placeOpenBraceOnNewLineForFunctions nil
                                       :))
  (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
  (add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
  (add-hook 'web-mode-hook
            (lambda ()
              (when (string-equal "tsx" (file-name-extension buffer-file-name))
                (gp-setup-tide-mode))))
  )

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

;;; init-typescript.el --- Configuration for tide

;;; Commentary:

;;; Code:
(use-package tide
  :functions tide-setup
  :config
  (defun gp-setup-tide-mode ()
    (interactive)
    (tide-setup)
    (flycheck-mode +1)
    (setq flycheck-check-syntax-automatically '(save mode-enabled))
    (eldoc-mode +1)
    (tide-hl-identifier-mode +1)
    (company-mode +1))
  ;; aligns annotation to the right hand side
  (setq company-tooltip-align-annotations t)
  (add-hook 'typescript-mode-hook #'gp-setup-tide-mode)
  ;;(add-hook 'before-save-hook 'tide-format-before-save)
  (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode))
  (add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
  (add-hook 'web-mode-hook
            (lambda ()
              (when (string-equal "tsx" (file-name-extension buffer-file-name))
                (gp-setup-tide-mode))))
  )

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

Disable tide format before save

Disable tide format before save


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

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

(provide 'init-exec-path)

Use exec-path-from-shell to slurp SSH_* env vars into Emacs on OS X


;;; emacs/electric/autoload.el -*- lexical-binding: t; -*-

;;;###autodef
(defun set-electric! (modes &rest plist)
  "Declare :words (list of strings) or :chars (lists of chars) in MODES that
trigger electric indentation."
  (declare (indent 1))
  (unless plist
    (signal 'wrong-number-of-arguments
            (list '(:char :words) plist)))
  (cl-destructuring-bind (&key char words) plist
    (dolist (mode (doom-enlist modes))
      (let ((fn (intern (format "+electric-indent--init-%s" mode))))
        (fset fn
              (lambda ()
                (electric-indent-local-mode +1)
                (if chars (setq electric-indent-chars chars))
                (if words (setq +electric-indent-words words))))
        (add-hook (intern (format "%s-hook" mode)) fn)))))

;; FIXME obsolete :electric
;;;###autoload
(def-setting! :electric (modes &rest plist)
  "Declare :words (list of strings) or :chars (lists of chars) in MODES that
trigger electric indentation."
  :obsolete set-electric!
  `(set-electric! ,modes ,@plist))

;;; emacs/electric/autoload.el -*- lexical-binding: t; -*-

;;;###autodef
(defun set-electric! (modes &rest plist)
  "Declare :words (list of strings) or :chars (lists of chars) in MODES that
trigger electric indentation."
  (declare (indent 1))
  (unless plist
    (signal 'wrong-number-of-arguments
            (list '(:char :words) plist)))
  (cl-destructuring-bind (&key chars words) plist
    (dolist (mode (doom-enlist modes))
      (let ((fn (intern (format "+electric-indent--init-%s" mode))))
        (fset fn
              (lambda ()
                (electric-indent-local-mode +1)
                (if chars (setq electric-indent-chars chars))
                (if words (setq +electric-indent-words words))))
        (add-hook (intern (format "%s-hook" mode)) fn)))))

;; FIXME obsolete :electric
;;;###autoload
(def-setting! :electric (modes &rest plist)
  "Declare :words (list of strings) or :chars (lists of chars) in MODES that
trigger electric indentation."
  :obsolete set-electric!
  `(set-electric! ,modes ,@plist))

Fix set-electric! complaining about :char

A typo! Should be :chars


;;; -*- lexical-binding: t -*-
;;; fdoc2md.el -- Convert function documentation to markdown
(defvar fdoc-replacements
  '(("`\\([^']+\\)'" . "`\\1`"))
  "A list of alists where the car is the search regular
expression and the cdr is the replacement string.")

(defun fdoc2md (func file)
  "Extract the documentation from FUNC and try to convert it to
markdown then append it to FILE."
  (let ((doc (documentation func)))
    (mapc (lambda (re)
            (let ((start nil))
              (while (setq start (string-match (car re) doc
                                               (if start (match-end 0))))
                     (setq doc (replace-match (cdr re) nil nil doc nil)))))
            fdoc-replacements)
    (with-temp-buffer
      (insert doc)
      (append-to-file (point-min) (point-max) file))))

;;; -*- lexical-binding: t -*-
;;; fdoc2md.el -- Convert function documentation to markdown
(defvar fdoc-replacements
  '(("`\\([^']+\\)'" . "`\\1`"))
  "A list of alists where the car is the search regular
expression and the cdr is the replacement string.")

(defun fdoc2md (func file)
  "Extract the documentation from FUNC and try to convert it to
markdown then append it to FILE."
  (let ((doc (documentation func)))
    (mapc (lambda (re)
            (let ((start nil))
              (while (setq start (string-match (car re) doc
                                               (if start (match-end 0))))
                     (setq doc (replace-match (cdr re) nil nil doc nil)))))
            fdoc-replacements)
    (with-temp-buffer
      (insert doc)
      (insert "\n")
      (append-to-file (point-min) (point-max) file))))

Add a newline so we don't have to from outside


(use-package js2-mode
  :ensure t
  )

(use-package web-mode
  :ensure t
  :config
  (setq web-mode-code-indent-offset 4)
  (setq web-mode-script-padding 0)
  (setq web-mode-markup-indent-offset 2)
  )

(use-package mmm-mode
  :ensure t
  :config
  (setq mmm-global-mode 'maybe)

  (dolist (langsets '(("script" . ((coffee . coffee-mode)
                                   (es6    . js2-mode)))
                      ("style"  . ((stylus . stylus-mode)
                                   (less   . less-css-mode)
                                   (scss   . scss-mode)))))
    (let ((tag (car langsets)))
      (dolist (pair (cdr langsets))
        (let* ((lang       (car pair))
               (submode    (cdr pair))
               (class-name (make-symbol (format "vueify-%s-%s" tag lang)))
               (front      (format "<%s lang=\"%s\">" tag lang))
               (back       (format "</%s>" tag)))
          (mmm-add-classes
           `((,class-name
              :submode ,submode
              :front ,front
              :back ,back)))
          (mmm-add-mode-ext-class nil "\\.vue?\\'" class-name)))))

  (add-to-list 'auto-mode-alist '("\\.vue?\\'" . web-mode))
  )

(provide 'pkg-javascript)

(use-package js2-mode
  :ensure t
  )

(use-package web-mode
  :ensure t
  :config
  (setq web-mode-code-indent-offset 2)
  (setq web-mode-script-padding 0)
  (setq web-mode-markup-indent-offset 2)
  )

(use-package mmm-mode
  :ensure t
  :config
  (setq mmm-global-mode 'maybe)

  (dolist (langsets '(("script" . ((coffee . coffee-mode)
                                   (es6    . js2-mode)))
                      ("style"  . ((stylus . stylus-mode)
                                   (less   . less-css-mode)
                                   (scss   . scss-mode)))))
    (let ((tag (car langsets)))
      (dolist (pair (cdr langsets))
        (let* ((lang       (car pair))
               (submode    (cdr pair))
               (class-name (make-symbol (format "vueify-%s-%s" tag lang)))
               (front      (format "<%s lang=\"%s\">" tag lang))
               (back       (format "</%s>" tag)))
          (mmm-add-classes
           `((,class-name
              :submode ,submode
              :front ,front
              :back ,back)))
          (mmm-add-mode-ext-class nil "\\.vue?\\'" class-name)))))

  (add-to-list 'auto-mode-alist '("\\.vue?\\'" . web-mode))
  )

(provide 'pkg-javascript)

Set JS and CSS indents in web-mode to 2

Set JS and CSS indents in web-mode to 2


;;; db-utils-test.el -- Tests for db-utils -*- lexical-binding: t -*-

;;; Commentary:

;;; Code:

(require 'ert)
(require 'db-utils)
(require 'cl-lib)

(ert-deftest db-utils-db/ntp-to-time ()
  "Test NTP conversion to readable time with `db/ntp-to-time'."
  (should (equal (db/ntp-to-time #xdcd2ac0c #x05c6dbac)
                 "2017-05-26T13:28:44.022565583Z"))
  (should (equal (db/ntp-to-time #xbd5927ee #xbc616000)
                 "2000-08-31T18:52:30.735860824Z")))

;;; db-utils-test.el ends here

;;; db-utils-test.el -- Tests for db-utils -*- lexical-binding: t -*-

;;; Commentary:

;;; Code:

(require 'ert)
(require 'db-utils)
(require 'cl-lib)

(ert-deftest db-utils-db/ntp-to-time ()
  "Test NTP conversion to readable time with `db/ntp-to-time'."
  (should (equal (db/ntp-to-time #xdcd2ac0c #x05c6dbac)
                 "2017-05-26T13:28:44.022565583Z"))
  (should (equal (db/ntp-to-time #xbd5927ee #xbc616000)
                 "2000-08-31T18:52:30.735860824Z"))
  (should (equal (db/ntp-to-time #x00000000 #x0000000)
                 "1900-01-01T00:00:00.000000000Z")))

;;; db-utils-test.el ends here

Add obvious test for NTP conversion

Add obvious test for NTP conversion

This test could not have been added before, because conversion was not
guaranteed to work for dates before the unix epoch.  It now is, and we finally
can check the start of the NTP epoch! :)


((sh-mode .  ((indent-tabs-mode . nil)
              (sh-basic-offset  . 2))))

((sh-mode .  ((indent-tabs-mode . nil)
              (sh-indentation   . 2)
              (sh-basic-offset  . 2))))

Use 2 spaces for indent

Use 2 spaces for indent


;;; conflicts-customisations.el -- Conveniences for handling files with conflicts

(defun wh/conflicts-list ()
  "Show all the conflicts in the current buffer using occur-mode."
  (interactive)
  (occur "<<<<<<< ")

  ;; put mark on the first result in the occur window
  (other-window 1)
  (forward-line))

(use-package smerge-mode
  :config
  ;; TODO: it would be nice if this jumped to the next conflict
  (define-key smerge-mode-map (kbd "<C-return>") #'smerge-keep-current)
  (define-key smerge-mode-map (kbd "<M-return>") #'smerge-keep-current)
  (define-key smerge-mode-map (kbd "C-c <C-return>") #'smerge-keep-all)
  (define-key smerge-mode-map (kbd "<f8>") #'smerge-prev)
  (define-key smerge-mode-map (kbd "<f9>") #'smerge-next))

(provide 'conflicts-customisations)

;;; conflicts-customisations.el -- Conveniences for handling files with conflicts

(defun wh/conflicts-list ()
  "Show all the conflicts in the current buffer using occur-mode."
  (interactive)
  (occur "<<<<<<< ")

  ;; put mark on the first result in the occur window
  (other-window 1)
  (forward-line))

(defun wh/smerge-keep-current-move-next ()
  "Accept the hunk at point and move to the next merge conflict."
  (interactive)
  (smerge-keep-current)
  (smerge-next))

(use-package smerge-mode
  :config
  ;; TODO: it would be nice if this jumped to the next conflict
  (define-key smerge-mode-map (kbd "<C-return>") #'smerge-keep-current)
  (define-key smerge-mode-map (kbd "<M-return>") #'smerge-keep-current)
  (define-key smerge-mode-map (kbd "C-c <C-return>") #'smerge-keep-all)
  (define-key smerge-mode-map (kbd "<f8>") #'smerge-prev)
  (define-key smerge-mode-map (kbd "<f9>") #'smerge-next))

(provide 'conflicts-customisations)

Add helper for accepting and moving between merge conflicts


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

;;; Commentary:

;; Settings related to Emacs appearance

;;; Code:

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

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

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

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

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

;;; appearance.el ends here

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

;;; Commentary:

;; Settings related to Emacs appearance

;;; Code:

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

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

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

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

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

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

;;; appearance.el ends here

Change the font on graphical mode Emacs

Change the font on graphical mode Emacs


;; Seed the random-number generator
(random t)

;; Whitespace-style
(setq whitespace-style '(trailing lines space-before-tab
                                  indentation space-after-tab)
      whitespace-line-column 100)

;; Add Urban Dictionary to webjump (C-x g)
(eval-after-load "webjump"
  '(add-to-list 'webjump-sites '("Urban Dictionary" .
                             [simple-query
                              "www.urbandictionary.com"
                              "http://www.urbandictionary.com/define.php?term="
                              ""])))

;; Various superfluous white-space. Just say no.
(add-hook 'before-save-hook 'cleanup-buffer-safe)

;; Newline after inserting closing tag in html-mode
(defadvice sgml-close-tag (after close-tag-then-newline activate)
  (newline-and-indent))

;; Add JSP expansions to html-mode
(eval-after-load "sgml-mode" '(require 'jsp-expansions))

;; A bit of misc cargo culting in misc.el
(setq xterm-mouse-mode t)

(provide 'my-misc)

;; Seed the random-number generator
(random t)

;; Whitespace-style
(setq whitespace-style '(trailing lines space-before-tab
                                  indentation space-after-tab)
      whitespace-line-column 100)

;; Add Urban Dictionary to webjump (C-x g)
(eval-after-load "webjump"
  '(add-to-list 'webjump-sites '("Urban Dictionary" .
                             [simple-query
                              "www.urbandictionary.com"
                              "http://www.urbandictionary.com/define.php?term="
                              ""])))

;; Various superfluous white-space. Just say no.
(add-hook 'before-save-hook 'cleanup-buffer-safe)

;; Newline after inserting closing tag in html-mode
(defadvice sgml-close-tag (after close-tag-then-newline activate)
  (newline-and-indent))

;; Add JSP expansions to html-mode
(eval-after-load "sgml-mode" '(require 'jsp-expansions))

;; A bit of misc cargo culting in misc.el
(setq xterm-mouse-mode t)

;; Fix ido-ubiquitous for newer packages
(defmacro ido-ubiquitous-use-new-completing-read (cmd package)
  `(eval-after-load ,package
     '(defadvice ,cmd (around ido-ubiquitous-new activate)
        (let ((ido-ubiquitous-enable-compatibility nil))
          ad-do-it))))

(ido-ubiquitous-use-new-completing-read webjump 'webjump)
(ido-ubiquitous-use-new-completing-read yas/expand 'yasnippet)

(provide 'my-misc)

Fix ido-ubiquitous for newer packages

Fix ido-ubiquitous for newer packages


(require 'edts-start)

;; (setq edts-log-level 'debug)

;; inherits faces from flycheck
(custom-set-faces
 '(edts-face-error-line ((t (:inherit flycheck-error-face))))
 '(edts-face-error-mode-line ((t (:inherit flycheck-error-face-mode-line))))
 '(edts-face-warning-line ((t (:inherit flycheck-warning-face))))
 '(edts-face-warning-mode-line ((t (:inherit flycheck-warning-face-mode-line))))
 )

Customize edts face for on the fly syntax check (inherits from flycheck faces).


;;; init-direnv.el --- Integrate with direnv -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(defun sanityinc/maybe-enable-envrc-global-mode ()
  (when (executable-find "direnv")
    (envrc-global-mode)))

(when (maybe-require-package 'envrc)
  (add-hook 'after-init-hook 'sanityinc/maybe-enable-envrc-global-mode))

(provide 'init-direnv)

;;; init-direnv.el ends here

;;; init-direnv.el --- Integrate with direnv -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(defun sanityinc/maybe-enable-envrc-global-mode ()
  "Enable `envrc-global-mode' if `direnv' is installed."
  (when (executable-find "direnv")
    (envrc-global-mode)))

(when (maybe-require-package 'envrc)
  (after-load 'envrc
    (define-key envrc-mode-map (kbd "C-c $") 'envrc-command-map))
  (add-hook 'after-init-hook 'sanityinc/maybe-enable-envrc-global-mode))

(provide 'init-direnv)

;;; init-direnv.el ends here

Add prefix binding of "C-c $" for commands in envrc-mode


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

(use-package! erlang
  :mode ("\\.erlang\\'" . erlang-mode)
  :mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
  :mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode))

(use-package! flycheck-rebar3
  :when (featurep! :checkers syntax)
  :after flycheck
  :config (flycheck-rebar3-setup))

(use-package! ivy-erlang-complete
  :when (featurep! :completion ivy)
  :hook (erlang-mode . ivy-erlang-complete-init)
  :config
  (add-hook! 'erlang-mode-hook
    (add-hook 'after-save-hook #'ivy-erlang-complete-reparse nil t)))

(use-package! company-erlang
  :when (featurep! :completion company)
  :hook (erlang-mode . company-erlang-init))

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

(use-package! erlang
  :mode ("\\.erlang\\'" . erlang-mode)
  :mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode)
  :mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode))

(use-package! flycheck-rebar3
  :when (featurep! :checkers syntax)
  :after flycheck
  :config (flycheck-rebar3-setup))

(use-package! ivy-erlang-complete
  :when (featurep! :completion ivy)
  :hook (erlang-mode . ivy-erlang-complete-init)
  :config
  (add-hook! 'erlang-mode-hook
    (add-hook 'after-save-hook #'ivy-erlang-complete-reparse nil t)))

(use-package! company-erlang
  :when (featurep! :completion company)
  :unless (featurep! +lsp)
  :hook (erlang-mode . company-erlang-init))

(when (featurep! +lsp)
  (add-hook 'erlang-mode-hook #'lsp!))

Add LSP Support to Erlang

Add LSP Support to Erlang


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

;;; 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
  (dolist (cmd '(paredit-forward-delete paredit-backward-delete))
    (put cmd 'delete-selection 'supersede))
  (dolist (cmd '(paredit-newline
                 paredit-open-round
                 paredit-open-bracket
                 paredit-open-curly
                 paredit-open-angled
                 paredit-open-parenthesis))
    (put cmd '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 delsel work with more Paredit commands


;;; ar-helm-projectile.el --- Helm projectile support.

;;; Commentary:
;; Helm projectile helpers.

;;; Code:

(require 'ar-shell)
(require 'helm-projectile)

(defun ar/helm-projectile-shell-cd ()
  "Change shell current working directory using helm projectile."
  (interactive)
  (unless (string-equal mode-name "Shell")
    (error "Not in Shell mode"))
  (let ((helm-dir-source (copy-tree  helm-source-projectile-directories-list)))
    (add-to-list 'helm-dir-source '(action . ar/shell-cd))
    (add-to-list 'helm-dir-source '(keymap . nil))
    (add-to-list 'helm-dir-source '(header-line . "cd to directory..."))
    (helm :sources helm-dir-source
          :buffer "*helm-dirs*"
          :candidate-number-limit 10000)))

(provide 'ar-helm-projectile)

;;; ar-helm-projectile.el ends here

;;; ar-helm-projectile.el --- Helm projectile support.

;;; Commentary:
;; Helm projectile helpers.

;;; Code:

(require 'ar-shell)
(require 'cl)
(require 'helm-projectile)

(defun ar/helm-projectile-shell-cd ()
  "Change shell current working directory using helm projectile."
  (interactive)
  (assert (string-equal mode-name "Shell") nil "Not in Shell mode")
  (let ((helm-dir-source (copy-tree  helm-source-projectile-directories-list)))
    (add-to-list 'helm-dir-source '(action . ar/shell-cd))
    (add-to-list 'helm-dir-source '(keymap . nil))
    (add-to-list 'helm-dir-source '(header-line . "cd to directory..."))
    (helm :sources helm-dir-source
          :buffer "*helm-dirs*"
          :candidate-number-limit 10000)))

(provide 'ar-helm-projectile)

;;; ar-helm-projectile.el ends here

Use assert instead of unless and error.

Use assert instead of unless and error.


(require 'company)

;; (add-to-list 'company-backends 'company-c_headers)

;; Load with `irony-mode` as a grouped backend
;; (require 'company-irony-c-headers)

(eval-after-load 'company
'(add-to-list
'company-backends '(company-irony-c-headers company-irony)))

;; When compiler options change, call
;; `company-irony-c-headers-reload-compiler-output` manually to
;; reload.

(require 'company)

;; (add-to-list 'company-backends 'company-c_headers)

;; Load with `irony-mode` as a grouped backend
;; (require 'company-irony-c-headers)

(eval-after-load 'company
'(add-to-list
'company-backends '(company-irony-c-headers company-irony)))

(eval-after-load 'flycheck
    '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))

;; When compiler options change, call
;; `company-irony-c-headers-reload-compiler-output` manually to
;; reload.

Add flycheck-irony to C/C++ nodes

Add flycheck-irony to C/C++ nodes


;; Time-stamp: <2015-02-23 11:42:33 kmodi>

(use-package page-break-lines
  :config
  (progn
    (setq page-break-lines-modes
          '(emacs-lisp-mode
            lisp-mode
            scheme-mode
            compilation-mode
            outline-mode
            help-mode
            text-mode))
    ;; Calling `global-page-break-lines-mode' will enable `page-break-mode'
    ;; automatically in all the modes listed in `page-break-lines-modes' var
    (global-page-break-lines-mode)))

(provide 'setup-page-break-lines)

;; Time-stamp: <2015-05-06 11:50:36 kmodi>

;; Show actual lines instead of the page break char ^L
;; https://github.com/purcell/page-break-lines

(use-package page-break-lines
  :config
  (progn
    (setq page-break-lines-modes
          '(emacs-lisp-mode
            lisp-mode
            scheme-mode
            compilation-mode
            outline-mode
            help-mode
            text-mode
            fundamental-mode
            special-mode))
    ;; Calling `global-page-break-lines-mode' will enable `page-break-mode'
    ;; automatically in all the modes listed in `page-break-lines-modes' var
    (global-page-break-lines-mode)))

(provide 'setup-page-break-lines)

Enable pgbl mode for more major modes

Change: Enable pgbl mode for more major modes


(check-packages '(haskell-mode ghc))

(require 'auto-complete)
(require 'haskell-mode)
(require 'haskell-indent)
(autoload 'ghc-init "ghc" nil t)

(defun my-haskell-config ()
  "Haskell config"
  (turn-on-haskell-indent)
  (auto-complete-mode)
  (ghc-init)
  (add-hook 'after-save-hook 'flymake-start-syntax-check)
  (define-key move-mode-map (kbd "?") 'ghc-flymake-display-errors)
  (linum-mode))

(add-hook 'haskell-mode-hook 'my-haskell-config)

(custom-set-variables
 '(flymake-log-level 2))

(check-packages '(haskell-mode ghc))

(require 'auto-complete)
(require 'haskell-mode)
(require 'haskell-indent)
(autoload 'ghc-init "ghc" nil t)

(defun my-haskell-config ()
  "Haskell config"
  (turn-on-haskell-indent)
  (auto-complete-mode)
  (ghc-init)
  (add-hook 'after-save-hook 'flymake-start-syntax-check)
  (define-key move-mode-map (kbd "?") 'ghc-flymake-display-errors)
  (define-key move-mode-map (kbd ">") 'flymake-goto-next-error)
  (define-key move-mode-map (kbd "<") 'flymake-goto-prev-error)
  (linum-mode))

(add-hook 'haskell-mode-hook 'my-haskell-config)

(custom-set-variables
 '(flymake-log-level 2))

Add flymake next and prev errors

Add flymake next and prev errors


((nil
  (indent-tabs-mode . nil)
  (tab-width . 8)
  (c-basic-offset . 3)
  (c-file-style . "stroustrup")
  (eval . (progn
	    (c-set-offset 'innamespace '0)
	    (c-set-offset 'inline-open '0)))
  )
 )

((nil
  (indent-tabs-mode . nil)
  (tab-width . 8)
  (c-basic-offset . 3)
  (c-file-style . "stroustrup")
  (fill-column . 78)
  (eval . (progn
	    (c-set-offset 'innamespace '0)
	    (c-set-offset 'inline-open '0)))
  )
 )

Add emacs setup for the docs/devinfo.html comment wrapping recommendation.

Reviewed-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>


;; -*- no-byte-compile: t; -*-
;;; lang/ess/packages.el

(package! ess :pin "2812b85880")
(package! ess-R-data-view :pin "d6e98d3ae1")
(package! polymode :pin "3eab3c9eed")
(package! poly-R :pin "0443c89b4d")

Add polymode to handle RMarkdown and RNoweb files

As of ESS 19+, ess-noweb and ess-swv libraries are now obsolete, and
polymode should be used instead (https://emacs.stackexchange.com/a/17065).


;;; radian-patch.el --- Patching functions in other packages

(require 'radian-package)

;; Occasionally you need to customize a small part of a large function
;; defined by another package. This library provides an elegant,
;; clear, and robust way of doing so. See the README [1].
;;
;; [1]: https://github.com/raxod502/el-patch
(use-package el-patch
  :straight (:host github
                   :repo "raxod502/el-patch"
                   :branch "develop")
  :config

  ;; When patching variable definitions, override the original values.
  (setq el-patch-use-aggressive-defvar t)

  ;; Support for deferred installation in `el-patch-validate-all'.

  (defun radian-require-with-deferred-install (feature &rest args)
    "Require FEATURE, installing PACKAGE if necessary.

\(fn FEATURE &optional PACKAGE)"
    (let ((package feature))
      (when args
        (setq package (car args)))
      (when package
        (use-package-install-deferred-package package :el-patch))
      (require feature)))

  (setq el-patch-require-function #'radian-require-with-deferred-install))

(provide 'radian-patch)

;;; radian-patch.el ends here

;;; radian-patch.el --- Patching functions in other packages

(require 'radian-package)

;; Occasionally you need to customize a small part of a large function
;; defined by another package. This library provides an elegant,
;; clear, and robust way of doing so. See the README [1].
;;
;; [1]: https://github.com/raxod502/el-patch
(use-package el-patch
  :straight (:host github
                   :repo "raxod502/el-patch"
                   :branch "develop")
  :config

  ;; When patching variable definitions, override the original values.
  (setq el-patch-use-aggressive-defvar t))

(provide 'radian-patch)

;;; radian-patch.el ends here

Remove el-patch deferred installation support


;; Add melpa to package repos

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

;; Setup packages
(require 'setup-package)

;; Install extensions if they're missing
(defun init--install-packages ()
  (packages-install
   '(zenburn-theme
     heroku-theme
     undo-tree
     smooth-scrolling
     flx
     flx-ido
     ido-vertical-mode
     ido-ubiquitous
     ido-at-point
     smex
     magit
     magit-log-edit ;; old commit mode (new one opens in new frame 28/10/2013
     s
     editorconfig
     projectile
     web-mode
     )))

(condition-case nil
    (init--install-packages)
  (error
   (package-refresh-contents)
   (init--install-packages)))

;; simple requires
(require 'editorconfig)

;; now configure some packages in their own .el file
(require 'setup-ido)
(require 'setup-projectile)
(require 'setup-webmode)
;;(require 'setup-magit)

(provide '_packages)

;; Add melpa to package repos

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

;; Setup packages
(require 'setup-package)

;; Install extensions if they're missing
(defun init--install-packages ()
  (packages-install
   '(zenburn-theme
     heroku-theme
     undo-tree
     smooth-scrolling
     flx
     flx-ido
     ido-vertical-mode
     ido-ubiquitous
     ido-at-point
     smex
     magit
     magit-log-edit ;; old commit mode (new one opens in new frame 28/10/2013
     s
     editorconfig
     projectile
     web-mode
     spaces
     )))

(condition-case nil
    (init--install-packages)
  (error
   (package-refresh-contents)
   (init--install-packages)))

;; simple requires
(require 'editorconfig)
(require 'spaces)

;; now configure some packages in their own .el file
(require 'setup-ido)
(require 'setup-projectile)
(require 'setup-webmode)
;;(require 'setup-magit)

(provide '_packages)

Add spaces (save and restore window configs)


(require 'anything-config)

;; From http://www.emacswiki.org/cgi-bin/wiki/AnythingSources
(defvar anything-c-source-occur
  '((name . "Occur")
    (init . (lambda ()
              (setq anything-occur-current-buffer
                    (current-buffer))))
    (candidates . (lambda ()
                    (let ((anything-occur-buffer (get-buffer-create "*Anything Occur*")))
                      (with-current-buffer anything-occur-buffer
                        (occur-mode)
                        (erase-buffer)
                        (let ((count (occur-engine anything-pattern
                                                   (list anything-occur-current-buffer) anything-occur-buffer
                                                   list-matching-lines-default-context-lines case-fold-search
                                                   list-matching-lines-buffer-name-face
                                                   nil list-matching-lines-face
                                                   (not (eq occur-excluded-properties t)))))
                          (when (> count 0)
                            (setq next-error-last-buffer anything-occur-buffer)
                            (cdr (split-string (buffer-string) "\n" t))))))))
    (action . (("Goto line" . (lambda (candidate)
                                (with-current-buffer "*Anything Occur*"
                                  (search-forward candidate))
                                (goto-line (string-to-number candidate) anything-occur-current-buffer)))))
    (requires-pattern . 3)
    (volatile)
    (delayed)))

(setq anything-sources
      '(anything-c-source-buffers
        anything-c-source-recentf
        anything-c-source-occur
        anything-c-source-files-in-current-dir
        anything-c-source-emacs-commands
        anything-c-source-emacs-functions))

(setq anything-samewindow nil)
(setq anything-input-idle-delay 0.05)

(global-set-key [\M-f10] 'anything)

(provide 'init-anything)

(require 'anything-config)

(setq anything-sources
      '(anything-c-source-buffers
        anything-c-source-recentf
        anything-c-source-occur
        anything-c-source-files-in-current-dir
        anything-c-source-emacs-commands
        anything-c-source-emacs-functions))

(setq anything-samewindow nil)
(setq anything-input-idle-delay 0.05)

(global-set-key [\M-f10] 'anything)

(provide 'init-anything)

Remove local anything-c-source-occur defn, which is now part of anything-config


;;; package --- Summary

;;; Commentary:

;;; Code:

(require 'bitbake)

sddsf
(add-tsdfo-list 'auto-mode-alist '("\\.bb\\'"       . bitbake-mode))
(add-to-list 'auto-mode-alist '("\\.bbappend\\'" . bitbake-mode))

;;; package --- Summary

;;; Commentary:

;;; Code:

(require 'bitbake)

(add-to-list 'auto-mode-alist '("\\.bb\\'"       . bitbake-mode))
(add-to-list 'auto-mode-alist '("\\.bbappend\\'" . bitbake-mode))

Fix syntax error in bitbake config file

Fix syntax error in bitbake config file


;;; pyjab.el --- control purple-powered IM clients from emacs using pyjab

;; Copyright (C) 2011 - Jérémie Roquet

;; Author: Jérémie Roquet <arkanosis@gmail.com>
;; Maintainer: Jérémie Roquet <arkanosis@gmail.com>
;; Version: 0.1
;; Keywords: purple jabber client chat
;; URL: http://github.com/Arkanosis/pyjab

(defun pyjab_send()
  (interactive)
  (let (recipients)
    (mapc
      (lambda (recipient)
	(push recipient recipients))
      (split-string
        (shell-command-to-string "pyjab \\*")
	","))
    (princ
      (shell-command-to-string
        (format
 	  "pyjab %s \"%s\""
	  (ido-completing-read "recipient: " recipients)
	  (if
	    mark-active
	    (buffer-substring
	      (region-beginning)
	      (region-end))
	    (read-string "message: " "" nil "" nil)))))))

(provide 'pyjab)

;;; ansi-color.el ends here

;;; pyjab.el --- control purple-powered IM clients from emacs using pyjab

;; Copyright (C) 2011 - Jérémie Roquet

;; Author: Jérémie Roquet <arkanosis@gmail.com>
;; Maintainer: Jérémie Roquet <arkanosis@gmail.com>
;; Version: 0.1
;; Keywords: purple jabber client chat
;; URL: http://github.com/Arkanosis/pyjab

(defun pyjab_send()
  (interactive)
  (let (recipients)
    (mapc
      (lambda (recipient)
	(push recipient recipients))
      (split-string
        (shell-command-to-string "pyjab \\*")
	","))
    (princ
      (shell-command-to-string
        (format
 	  "pyjab %s \"%s\""
	  (ido-completing-read "recipient: " recipients)
	  (if
	    mark-active
	    (buffer-substring
	      (region-beginning)
	      (region-end))
	    (read-string "message: " "" nil "" nil)))))))

(provide 'pyjab)

;;; pyjab.el ends here

Fix the comment at the end of the emacs module

The module is of course pyjab.el


(require 'flycheck)

(dolist (mode '(elixir
                json
                python
                ruby))
(add-hook (intern (concat (symbol-name mode) "-mode-hook"))
		  'flycheck-mode))

(setq flycheck-check-syntax-automatically '(save mode-enabled))

(require 'flycheck)

(dolist (mode '(c
                elixir
                json
                python
                ruby))
(add-hook (intern (concat (symbol-name mode) "-mode-hook"))
		  'flycheck-mode))

(setq flycheck-check-syntax-automatically '(save mode-enabled))

Add flycheck support for c-mode

Add flycheck support for c-mode


;;; my-snippets.el --- Snippets settings & customisations -*- lexical-binding: t -*-

;; Copyright (C) 2016  Sergey Timanin

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

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

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

;;; Commentary:

;;; Code:

(use-package yasnippet
  :defer t
  :config
  (yas-global-mode 1)
  :diminish
  (yas-minor-mode))

(provide 'my-snippets)

;;; my-snippets.el ends here

;;; my-snippets.el --- Snippets settings & customisations -*- lexical-binding: t -*-

;; Copyright (C) 2016  Sergey Timanin

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

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

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

;;; Commentary:

;;; Code:

(use-package yasnippet
  :defer t
  :config
  (yas-global-mode 1)
  :diminish
  (yas-minor-mode))

(use-package yasnippet-snippets
  :after yasnippet)

(provide 'my-snippets)

;;; my-snippets.el ends here

Add official yasnippet snippets collection


(require 'fill-column-indicator)

(setq fci-rule-column 79)
(setq fci-rule-width 1)
(setq fci-enabled 0)

(defun toggle-fill-column-indicator ()
  (interactive)
  (make-local-variable 'fci-enabled)
  (if (> fci-enabled 0) (deactivate-fci) (activate-fci)))

(defun activate-fci ()
  (setq fci-enabled 1)
  (fci-mode 1))

(defun deactivate-fci ()
  (setq fci-enabled 0)
  (fci-mode 0))

(require 'fill-column-indicator)

(setq fci-rule-width 1)
(setq fci-enabled 0)

(defun toggle-fill-column-indicator ()
  (interactive)
  (make-local-variable 'fci-enabled)
  (if (> fci-enabled 0) (deactivate-fci) (activate-fci)))

(defun activate-fci ()
  (setq fci-rule-column 79)
  (setq fci-enabled 1)
  (fci-mode 1))

(defun deactivate-fci ()
  (setq fci-enabled 0)
  (fci-mode 0))

Fix correct column to highlight with fill-column-indicator


(defun configure-sql-indentation ()
  "Configure the indentation settings for `sqlind-minor-mode'."
  (require 'sql-indent-left)
  (setq
   sqlind-basic-offset 2
   sqlind-indentation-offsets-alist
   `((in-select-clause +)
     (select-join-condition +)
     (nested-statement-open sqlind-use-anchor-indentation +)
     (nested-statement-continuation sqlind-use-anchor-indentation +)
     (create-statement 0) ;; For ALTER TABLE actions
     ,@sqlind-indentation-left-offsets-alist)))
(add-hook 'sqlind-minor-mode-hook 'configure-sql-indentation)

(defun configure-sql-indentation ()
  "Configure the indentation settings for `sqlind-minor-mode'."
  (require 'sql-indent-left)
  (setq
   sqlind-basic-offset 2
   sqlind-indentation-offsets-alist
   `((in-select-clause +)
     (select-join-condition +)
     (nested-statement-open sqlind-use-anchor-indentation +)
     (nested-statement-continuation sqlind-use-anchor-indentation +)
     (create-statement 0) ;; For ALTER TABLE actions
     (in-update-clause +)
     ,@sqlind-indentation-left-offsets-alist)))
(add-hook 'sqlind-minor-mode-hook 'configure-sql-indentation)

Indent continuations of UPDATE clauses

Indent continuations of UPDATE clauses


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

(require 'evil)
(evil-mode t)

(require 'org)
(setq org-log-done t)

(menu-bar-mode -1)

Disable the emacs menu bar

Disable the emacs menu bar


(require 'anything-config)

(setq anything-sources
      '(anything-c-source-org-headline
        anything-c-source-buffers
        anything-c-source-recentf
        anything-c-source-files-in-current-dir
        anything-c-source-lacarte
        anything-c-source-emacs-commands
        anything-c-source-emacs-functions
        anything-c-source-minibuffer-history))

(setq anything-samewindow nil)
(setq anything-input-idle-delay 0.2)

(global-set-key [\M-f10] 'anything-at-point) ;; With C-u prefix, starts with symbol at point

(provide 'init-anything)

(require 'anything-config)

(setq anything-sources
      '(anything-c-source-ctags
        anything-c-source-org-headline
        anything-c-source-buffers
        anything-c-source-recentf
        anything-c-source-files-in-current-dir
        anything-c-source-lacarte
        anything-c-source-emacs-commands
        anything-c-source-emacs-functions
        anything-c-source-minibuffer-history))

(setq anything-samewindow nil)
(setq anything-input-idle-delay 0.2)

(add-to-list 'anything-c-ctags-modes 'ruby-mode)

(global-set-key [\M-f10] 'anything-at-point) ;; With C-u prefix, starts with symbol at point

(provide 'init-anything)

Enable ctags support in anything.el, and add ruby-mode to the list of supported modes


;;; init-flycheck.el -- Flycheck setup

;;; Commentary:
;;; Load Flycheck and define custom checkers

;;; Code:
(use-package flycheck
  :config
  (flycheck-def-config-file-var flycheck-haml-lintrc haml-lint ".haml-lint.yml"
    :safe #'stringp)
  (flycheck-define-checker haml-lint
    "Haml style checker using haml-lint
See URL https://github.com/brigade/haml-lint"
    :command ("~/haml-lint.sh"
              (config-file "--config" flycheck-haml-lintrc)
              source)
    :error-patterns
    ((warning line-start
              (file-name) ":" line " [W] "  (message)
              line-end))
    :modes (haml-mode))
  (add-to-list 'flycheck-checkers 'haml-lint)
  :init
  (add-hook 'after-init-hook #'global-flycheck-mode)
  :diminish flycheck-mode)

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

;;; init-flycheck.el -- Flycheck setup

;;; Commentary:
;;; Load Flycheck and define custom checkers

;;; Code:
(use-package flycheck
  :config
  (flycheck-def-config-file-var flycheck-haml-lintrc haml-lint ".haml-lint.yml" :safe #'stringp)
  (flycheck-define-checker haml-lint
    "Haml style checker using haml-lint
See URL https://github.com/brigade/haml-lint"
    :command ("~/haml-lint.sh"
              (config-file "--config" flycheck-haml-lintrc)
              source)
    :error-patterns
    ((warning line-start
              (file-name) ":" line " [W] "  (message)
              line-end))
    :modes (haml-mode))
  (add-to-list 'flycheck-checkers 'haml-lint)
  (bind-key "s-f" (defhydra flycheck-hydra ()
                    "errors"
                    ("n" flycheck-next-error "next")
                    ("p" flycheck-previous-error "previous")
                    ("q" nil "quit"))
            flycheck-mode-map)
  :init
  (add-hook 'after-init-hook #'global-flycheck-mode)
  :diminish flycheck-mode)

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

Add a hydra to Flycheck

Add a hydra to Flycheck


;; Gosin's Emacs Configuration 2021/01/09
;; add ELPA and MELPA package repos
(setq package-archives
      '(("gnu" . "http://elpa.gnu.org/packages/")
	("melpa" . "http://melpa.org/packages/")))

;; user solarized dark color theme
(add-to-list 'custom-theme-load-path "~/.emacs.d/solarized_theme")
(set-terminal-parameter nil 'background-mode 'dark)
(set-frame-parameter nil 'background-mode 'dark)
(load-theme 'solarized t)

;; define three useful commands(from org guide)
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)

(custom-set-variables
 ;; score apropos results by relavance.
 '(apropos-sort-by-scores t)
 ;; show line numbers
 '(global-display-line-numbers-mode t))

;; Gosin's Emacs Configuration 2021/01/09
;; add ELPA and MELPA package repos
(setq package-archives
      '(("gnu" . "http://elpa.gnu.org/packages/")
	("melpa" . "http://melpa.org/packages/")))

;; user solarized dark color theme
(add-to-list 'custom-theme-load-path "~/.emacs.d/solarized_theme")
(set-terminal-parameter nil 'background-mode 'dark)
(set-frame-parameter nil 'background-mode 'dark)
(load-theme 'solarized t)

;; define three useful commands(from org guide)
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)

(custom-set-variables
 ;; score apropos results by relavance.
 '(apropos-sort-by-scores t)
 ;; show line numbers.
 '(global-display-line-numbers-mode t)
 ;; save back up files to temporary directories.
 '(backup-directory-alist `((".*" . ,temporary-file-directory))))

Store back up files to temp directory for Emacs


(require-package 'csv-mode)
(require-package 'csv-nav)

(add-auto-mode 'csv-mode "\\.[Cc][Ss][Vv]\\'")
(autoload 'csv-nav-mode "csv-nav" "Major mode for navigating comma-separated value files." t)

(setq csv-separators '("," ";" "|" " "))

(provide 'init-csv)

(require-package 'csv-mode)
(require-package 'csv-nav)

(add-auto-mode 'csv-mode "\\.[Cc][Ss][Vv]\\'")

(setq csv-separators '("," ";" "|" " "))

(provide 'init-csv)

Remove redundant autoload for csv-nav-mode (fixed upstream)


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

(provide 'init-elm)

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

(provide 'init-elm)

Use elm-test-runner instead of elm-test

Use elm-test-runner instead of elm-test


(require-package 'haskell-mode)

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

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

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

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

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

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

(provide 'init-haskell)

(require-package 'haskell-mode)

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

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

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

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

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

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

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

(provide 'init-haskell)

Use haskell-mode for .ghci files

Use haskell-mode for .ghci files


(use-package web-mode
  :ensure t)

(use-package json-mode
  :ensure t)

(use-package js2-mode
  :ensure t)

(provide 'web-tech-part)

(use-package web-mode
  :ensure t
  :config
  (add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode))
  (setq-default web-mode-code-indent-offset 2)
  (setq-default web-mode-markup-indent-offset 2)
  (setq-default web-mode-css-indent-offset 2))

(use-package json-mode
  :ensure t)

(use-package js2-mode
  :ensure t)

(provide 'web-tech-part)

Make php default to web-mode

Make php default to web-mode


(use-package volatile-highlights
  :init (volatile-highlights-mode t)
  :config
  (progn
    ;; define extensions for evil mode
    (vhl/define-extension 'evil_past_after 'evil-paste-after)
    (vhl/install-extension 'evil_past_after)))

(use-package volatile-highlights
  :init (volatile-highlights-mode t))

Remove evil config for volatile highlight (not working)


;;; init-uml.el -- uml inside emacs

;;; Commentary:
;;; edit and preview plant uml files inside Emacs
;;; Code:
(require 'use-package)

(use-package puml-mode
  :mode (("\\.puml\\'" . puml-mode)
         ("\\.plantuml\\'" . puml-mode)))

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

;;; init-uml.el -- uml inside emacs

;;; Commentary:
;;; edit and preview plant uml files inside Emacs
;;; Code:
(require 'use-package)

(use-package plantuml-mode
  :mode (("\\.puml\\'" . puml-mode)
         ("\\.plantuml\\'" . puml-mode)))

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

Fix Plant UML Emacs package name

Fix Plant UML Emacs package name


(column-number-mode t)
(display-time-mode 1)
(electric-pair-mode t)
(auto-fill-mode -1)
(global-linum-mode 1)
(setq-default indent-tabs-mode nil)
(popwin-mode 1)
(drag-stuff-global-mode 1)
(global-auto-complete-mode t)
(whole-line-or-region-mode t)

(column-number-mode t)
(display-time-mode 1)
(electric-pair-mode t)
(auto-fill-mode -1)
(global-linum-mode 1)
(setq-default indent-tabs-mode nil)
(popwin-mode 1)
(delete-selection-mode 1)
(drag-stuff-global-mode 1)
(global-auto-complete-mode t)
(whole-line-or-region-mode t)

Add deletion mode to emacs

Add deletion mode to emacs