Kasim Emacs Config


I do not recommend replacing your config with mine or just starting your emacs learning journey with someone else’s config. Comment out loading my config.org from init.el and start with your own empty copy of config.org where you can add customization as you go along.

Useful elisp libs and fns


(defun kbeg-end(comment)
   (list (read-string "Please enter your comments: ")))
  (insert (format "#---> beginning of: %s --->\n\n" comment))
  (insert (format "#<--- ending of: %s <---\n" comment))

(defun kcreate-non-existent-directory ()
  (let ((parent-directory (file-name-directory buffer-file-name)))
    (when (and (not (file-exists-p parent-directory))
               (y-or-n-p (format "Directory `%s' does not exist! Create it?" parent-directory)))
      (make-directory parent-directory t))))
(add-to-list 'find-file-not-found-functions #'kcreate-non-existent-directory)

(defun kcurrent-font ()
   (format "Current font is: %s" (face-attribute 'default :font))))

(defun kload-config ()
  "Reloads my Emacs config."
  (org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))

(defun ktemp-window-kill-buffer ()
  "Kills temp buffer shown"
  ;; Window selection is used because point goes to a different window
  ;; if more than 2 windows are present
  (let ((win-curr (selected-window))
        (temp (or (get-buffer-window "*Help*" 0)
                  (get-buffer-window "*grep*" 0)
                  (get-buffer-window "*Completions*" 0)
                  (get-buffer-window "*compilation*" 0)
                  (get-buffer-window "*Occur*" 0))))
    (select-window temp)
    (select-window win-curr)))

(defun kformat-org-src-block ()
  (when (org-in-src-block-p)
    (indent-region (point-min) (point-max))

(defun ksudo-edit (&optional arg)
  ;; Edit currently visited file as root. With a prefix ARG prompt
  ;; for a file to visit.  Will also prompt for a file to
  ;; visit if current buffer is not visiting a file.
  (interactive "P")
  (if (or arg (not buffer-file-name))
      (find-file (concat "/sudo:root@localhost:"
                         (ido-read-file-name "Find file(as root): ")))
    (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))

(defun kfill-or-unfill ()
  "Like `fill-paragraph', but unfill if used twice."
  (let ((fill-column
         (if (eq last-command 'kfill-or-unfill)
             (progn (setq this-command nil)
    (call-interactively #'fill-paragraph)))
(global-set-key [remap fill-paragraph]

(defun kdired-open-file ()
  "In Dired, open a file using its default application."
  (let ((file (dired-get-filename nil t)))
    (unless (file-directory-p file)
      (message "Opening %s..." file)
      (call-process (if (equal system-type 'darwin)
                      "xdg-open") nil 0 nil file))))

(defun kkill-buffers-by-mode (mode)
  (mapc (lambda (buffer)
          (when (eq mode (buffer-local-value 'major-mode buffer))
            (kill-buffer buffer)))

(defun kkill-dired-buffers ()
  (kkill-buffers-by-mode 'dired-mode))

(defun kkill-term-buffers ()
  (kkill-buffers-by-mode 'term-mode))

(defun kdelete-file ()
  (delete-file buffer-file-name)

(defun kget-buffer-dir ()
  (if buffer-file-name
      (file-name-directory buffer-file-name)

(defun kcopy-to-os-clipboard (str)
  (when str
    (kill-new str)

(defun kfqn ()
  (kcopy-to-os-clipboard buffer-file-name))

(defun kdir ()
  (kcopy-to-os-clipboard (kget-buffer-dir)))

(defun 3coll-view ()
    (dotimes (i (1- (/ (/ (frame-pixel-width) (frame-char-width)) 90)))
      (split-window-horizontally 90)
      (other-window 1)

(defun 4windows-view ()
  "Splite window into 4 sub-window"
  (progn (split-window-vertically)
         (other-window 2)

(defun kpdf-view ()
  "For pdf reading"
    (shrink-window-horizontally 40)))

(defun kuntabify-buffer ()
  "Untabify current buffer"
  (untabify (point-min) (point-max)))

(defun kfocus-window ()
  "Focus current window by deleting windows up or down"
  (condition-case nil

(defun ktoggle-modes (modes flag)
  (dolist (mode modes)
    (when (fboundp mode) (funcall mode flag))))

(defun knotify-compilation-result (buffer msg)
  ;; Notify that the compilation is finished,
  ;; and set the focus back to Emacs frame if failed"
  (if (string-match "^finished" msg)
      (tooltip-show "\n Command Successful :-) \n ")
    (progn (tooltip-show "\n Command Failed :-( \n ")
           (select-frame-set-input-focus current-frame))))

(defun kswap-buffers (arg)
  "Swaps the buffers shown in two windows."
  (interactive "p")
  (let ((selector (if (>= arg 0) 'next-window 'previous-window)))
    (while (/= arg 0)
      (let ((this-win (window-buffer))
            (next-win (window-buffer (funcall selector))))
        (set-window-buffer (selected-window) next-win)
        (set-window-buffer (funcall selector) this-win)
        (select-window (funcall selector)))
      (setq arg (if (plusp arg) (1- arg) (1+ arg))))))

(defun ktoggle-frame-split ()
  ;; If the frame is split vertically, split it horizontally or vice versa.
  ;; Assumes that the frame is only split into two."
  (unless (= (length (window-list)) 2) (error "Can only toggle a frame split in two"))
  (let ((split-vertically-p (window-combined-p)))
    (delete-window) ; closes current window
    (if split-vertically-p
      (split-window-vertically)) ; gives us a split with the other window twice
    (switch-to-buffer nil)))

(defun ktail-f (file)
  ;; Create a COMINT mode buffer running the `tail -f` command on
  ;; specified FILE. If FILE is a ssh/scp style remote file spec,
  ;; e.g.,
  ;; user@remote.host.com:/path/to/file.txt
  ;; then a ssh connection is opened to remote.host.com, and `tail -f`
  ;; is invoked on the remote server."
  (interactive "Flocal or remote file: ")
  (let ((buf-name (concat "tail-f " file))
        (re "\\(\\w+\\)@\\([^:]+\\):\\(.*\\)"))
    (if (string-match re file)
        (let ((user (match-string 1 file))
              (host (match-string 2 file))
              (file1 (match-string 3 file)))
          (make-comint buf-name "ssh" nil
                       "-l" user
                       "tail" "-f" file1))
      (make-comint buf-name "tail" nil "-f" (expand-file-name file)))
    (pop-to-buffer (concat "*" buf-name "*"))))

(defun kcopy-region-as-a-line ()
  (when (region-active-p)
    (let ((s (buffer-substring (region-beginning) (region-end))))
    (kill-new (s-collapse-whitespace
               (replace-regexp-in-string "\n" " " s))))))

(defun ksend-region-nextw ()
  (when (region-active-p)
    (let ((s (buffer-substring (region-beginning) (region-end))))
        (insert s)
        (execute-kbd-macro (kbd "<return>"))

(defun ksave-all ()
  (save-some-buffers t))
(add-hook 'focus-out-hook 'ksave-all)

(defun krun (cmd)
     "Enter cmd to run (append ##name for buffer name): "
     (kread-lines (getenv "HISTFILE")))))
  (let* ((cmds (split-string cmd " ##"))
         (bname (format "*%s*" (or (second cmds)
    (shx bname)
    (pop-to-buffer-same-window bname)
    (insert (format "%s\n" cmd))

(defun kprev-w ()
  (other-window -1))

(defun knext-w ()
  (other-window 1))

(defun kshell ()
  (let ((dir (ktry-get-project-root))
        (proj (format "*%s*" (kproject-name))))
    (if (and dir proj)
        (shx proj dir)
      (shx "*shx*" (kget-buffer-dir)))))

(defun kshell-history (term)
     (let ((history nil))
       ;; We have to build up a list ourselves from the ring vector.
       (dotimes (index (ring-length comint-input-ring))
         (push (ring-ref comint-input-ring index) history))
       ;; Show them most-recent-first.
       (setq history (nreverse history))))))
  (insert term))

(defun kshell-on-region (cmd)
  (let ((b (if mark-active (min (point) (mark)) (point-min)))
        (e (if mark-active (max (point) (mark)) (point-max))))
    (shell-command-on-region b e cmd (current-buffer) t)))

(defun kshell-process-sentinel (process state)
  ;; show shell status and kill the buffer automatically
  (message "shell: %s" state)
  (if (or
       (string-match "exited abnormally with code.*" state)
       (string-match "finished" state))
      (kill-buffer (current-buffer))))

(add-hook 'comint-exec-hook
          (lambda ()
            (set-process-sentinel (get-buffer-process (current-buffer))

(defun kjson ()
  (kshell-on-region "python -mjson.tool"))

(defun ksetup-term ()
  ;; mode-map
  (setq mouse-drag-copy-region t)
  (setq term-buffer-maximum-size 100000)
  (setq shell-file-name "bash")
  (define-key term-mode-map (kbd "M-x") 'counsel-M-x)
  (define-key term-mode-map (kbd "M-O") 'knext-w)
  (define-key term-mode-map (kbd "M-o") 'ivy-switch-buffer)
  (define-key term-mode-map (kbd "M-i") 'swiper)
  (define-key term-mode-map (kbd "M-I") 'avy-goto-char-timer)
  (define-key term-mode-map (kbd "<f12>") 'kshell)

  ;; raw map
  (define-key term-raw-map (kbd "C-y") 'term-paste)
  (define-key term-raw-map (kbd "C-k")
    (lambda ()
      (term-send-raw-string "\C-k")
  (define-key term-raw-map (kbd "M-x") 'counsel-M-x)
  (define-key term-raw-map (kbd "M-O") 'knext-w)
  (define-key term-raw-map (kbd "M-o") 'ivy-switch-buffer)
  (define-key term-raw-map (kbd "M-i") 'swiper)
  (define-key term-raw-map (kbd "M-I") 'avy-goto-char-timer)
  (define-key term-raw-map (kbd "<f12>") 'kshell))

(defun kterm ()
  "If the current buffer is:
       1) a running ansi-term named *ansi-term*, rename it.
       2) a stopped ansi-term, kill it and create a new one.
       3) a non ansi-term, go to an already running ansi-term
          or start a new one while killing a defunt one"
  (require 'term)
  (let ((is-term (string= "term-mode" major-mode))
        (is-running (term-check-proc (buffer-name)))
        (term-cmd "/bin/bash")
        (anon-term (get-buffer "*ansi-term*")))
    (if is-term
        (if is-running
            (if (string= "*ansi-term*" (buffer-name))
                (call-interactively 'rename-buffer)
              (if anon-term
                  (pop-to-buffer "*ansi-term*")
                (ansi-term term-cmd)))
          (kill-buffer (buffer-name))
          (ansi-term term-cmd))
      (if anon-term
          (if (term-check-proc "*ansi-term*")
              (pop-to-buffer "*ansi-term*")
            (kill-buffer "*ansi-term*")
            (ansi-term term-cmd))
        (ansi-term term-cmd)))))
(global-set-key (kbd "C-c t") 'kterm)

(defun khooks ()
  (add-hook 'term-exec-hook 'kterm-exec-hook)
  (add-hook 'term-mode-hook 'ksetup-term)
  (add-hook 'prog-mode-hook
            '(lambda ()

(defun vpn ()
  (kdo-term-run "vpn"

(defun visit-project-clj ()
  (find-file (format "%s/%s" (ktry-get-project-root) "project.clj")))

(defun kltest (&optional ns &optional fn)
  (let* ((test (format "cd %s && %s test"
                       (expand-file-name "~/rcfiles/bin/klj.sh")))
         (command (cond
                   ((and ns fn)
                    (format "%s run-ns -n %s/%s" test ns fn))

                    (format "%s run-ns -n %s" test ns))

                    (format "%s unit" test)))))
    (compile (s-trim command))))

(defun kdo-term-run (new-buffer-name cmd &rest switches)
  (setq term-ansi-buffer-name new-buffer-name)
  (setq term-ansi-buffer-name (generate-new-buffer-name term-ansi-buffer-name))
  (setq term-ansi-buffer-name (apply 'make-term term-ansi-buffer-name cmd nil switches))
  (set-buffer term-ansi-buffer-name)
  (term-set-escape-char ?\C-c)
  (switch-to-buffer term-ansi-buffer-name))

(defun kread-lines (filePath)
  "Return a list of lines of a file at filePath."
    (insert-file-contents filePath)
    (split-string (buffer-string) "\n" t)))

(defun ssh (host)
     "Enter remote host: "
     (-keep (lambda (s)
              (when (s-starts-with? "host" s t)
                (second (split-string s " " t))))
            (kread-lines "~/.ssh/config")))))
  (kdo-term-run host "ssh" host))

(defun kterm-exec-hook ()
  (let* ((buff (current-buffer))
         (proc (get-buffer-process buff)))
     `(lambda (process event)
        (if (string= event "finished\n")
            (kill-buffer ,buff))))))

(defun compilation-mode-colorize-buffer ()
  (ansi-color-apply-on-region (point-min) (point-max))

(defun ksetup-ansi-color ()
  (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
  (add-hook 'comint-mode-hook 'ansi-color-for-comint-mode-on)
  (add-hook 'compilation-filter-hook 'compilation-mode-colorize-buffer)
  (add-hook 'eshell-preoutput-filter-functions 'ansi-color-filter-apply))

(defun kemacs-startup ()
  (add-to-list 'initial-frame-alist '(fullscreen . maximized))

(defun ksymbol-after-slash ()
  (first (last (split-string (symbol-name (symbol-at-point)) "/"))))

(defun kgrep (s)
  "git-grep the entire current repo"
  (interactive "sPlease enter grep term: ")
  (grep-find (concat "git --no-pager grep -P -n "
                     (format "'%s'" s)
                     " `git rev-parse --show-toplevel`"))
  (pop-to-buffer "*grep*"))

(defun kref ()
  "git-grep the entire current repo for reference"
  (kgrep (cond ((string= "clojure-mode" major-mode)
                (format "/%s" (ksymbol-after-slash)))
               ((string= "ruby-mode" major-mode)
                (format ".%s" (ksymbol-after-slash))))))
(global-set-key (kbd "C-.") 'kref)

(defun ktry-get-project-root ()
  (condition-case nil

(defun kproject-name ()
  (when-let ((root (ktry-get-project-root)))
    (-> (s-split "/" root t)

(defun klisp-buffer-p ()
  (or (string= "clojure-mode" major-mode)
      (string= "emacs-lisp-mode" major-mode)))

(defun kafter-save ()
  (when (klisp-buffer-p)
    (condition-case err
(add-hook 'after-save-hook 'kafter-save)

(defun kbefore-save ()
  (when (klisp-buffer-p)
(add-hook 'before-save-hook 'kbefore-save)

(defun pop-kill-ring ()
  (when kill-ring
    (setq kill-ring (cdr kill-ring)))
  (when kill-ring-yank-pointer
    (setq kill-ring-yank-pointer kill-ring)))

(defun dwim-term (&optional p prompt)
  (if p
      (or (kcopy-region-as-a-line) (symbol-at-point))
    (read-string prompt)))

(defun dwim-term-r (&optional p prompt)
  (if p
      (read-string prompt)
    (or (kcopy-region-as-a-line) (symbol-at-point))))

(defun kterm-toggle-mode ()
  "Toggles term between line mode and char mode"
  (if (term-in-line-mode)

(defun just-one-space-in-region (beg end)
  "replace all whitespace in the region with single spaces"
  (interactive "r")
      (narrow-to-region beg end)
      (goto-char (point-min))
      (while (re-search-forward "\\s-+" nil t)
        (replace-match " ")))))

(defun kcomint-format-output ()
  "Copy all output from interpreter since last input."
  (with-current-buffer inferior-clojure-buffer
    (let ((proc (get-buffer-process inferior-clojure-buffer)))
        (let ((pmark (progn (goto-char (process-mark proc))
                            (forward-line 0)
          (->> (buffer-substring comint-last-input-end pmark)
               (s-chop-suffix "nil")
               (s-split "#_=>")

(defun kmessage-error (str)
  (let ((last-line (->> (s-split "\n" str)
                        (s-truncate (- (frame-width) 3)))))
    (when (or (s-contains-p "FAIL" str)
              (s-contains-p "Exception" str)
              (s-contains-p "Error" str))
      (message "%s" (propertize last-line
                                'face '(:foreground "red"))))
    (when (and (s-contains-p ":fail 0" str)
               (s-contains-p ":error 0" str))
      (message "%s" (propertize last-line
                                'face '(:background "green"))))))

(defun kgoto-test-file ()
  (when (and (string= "clojure-mode" major-mode)
             (not (string-suffix-p "_test.clj" (buffer-file-name))))

    (let ((test-file (->> (s-replace "/src/" "/test/" (buffer-file-name))
                          (s-replace ".clj"  "_test.clj"))))
      (when (file-exists-p test-file)
        (find-file-other-window test-file)))))

(defun kgoto-src-file ()
  (when (and (string= "clojure-mode" major-mode)
             (not (s-contains-p "/src/" (buffer-file-name))))
    (let ((src-file (s-replace "/test/" "/src/" (buffer-file-name))))
      (find-file-other-window (s-replace "_test.clj" ".clj" src-file)))))


(el-get-bundle s)
(el-get-bundle f)
(el-get-bundle pos-tip)

Hot keys and Aliases

;; aliases
(defalias 'yes-or-no-p 'y-or-n-p)
(defalias 'gt 'kgoto-test-file)
(defalias 'gs 'kgoto-src-file)
;; Hot keys
(global-set-key (kbd "C-x o") 'knext-w)
(global-set-key (kbd "M-,") 'pop-global-mark)
(global-set-key (kbd "C-\\") 'compile)
(global-set-key (kbd "C-x 1") 'ktoggle-single-window)
(global-set-key (kbd "<f12>") 'kshell)
(global-set-key (kbd "<f5>") 'krun)
(global-set-key (kbd "C-c s") 'google)
(global-set-key (kbd "C-c m") 'magit-status)
(global-set-key (kbd "M-i") 'avy-goto-char-timer)
(global-set-key (kbd "C-<escape>") 'undo)

;; escape
(global-set-key [escape] 'keyboard-escape-quit)
(define-key isearch-mode-map [escape] 'isearch-abort)


(defun kset-default-font (&optional name size)
  (set-default-font (format "%s %s"
                            (or name
                                "Essential Pragmatapro")
                            (or size

(defun kchange-font-size (&optional p)
  (interactive "P")
  (let ((size (if p
                  (- (aref (query-font (kcurrent-font)) 2) 1)
                (+ (aref (query-font (kcurrent-font)) 2) 1))))
    (kset-default-font nil size)))

 ;; Macbook
 ((and (= (x-display-pixel-height) 800)
       (= (x-display-pixel-width) 1280))
  (kset-default-font nil 15))
 ;; BenQ 24
 ((and (= (x-display-pixel-height) 1080)
         (= (x-display-pixel-width) 3286))
  (kset-default-font nil 13))

 ;; 27 inch HD and Macbook Pro
 ((and (= (x-display-pixel-height) 1980)
       (= (x-display-pixel-width) 1920))
  (kset-default-font nil 15))

  ;; x220/x230
 ((and (= (x-display-pixel-height) 768 )
       (= (x-display-pixel-width) 1366))
  (kset-default-font nil 12))

 (t (kset-default-font)))

;; (kset-default-font nil 14)
;; (kset-default-font nil 16)
;; (kset-default-font nil 17)
;; (kset-default-font nil 18)
;; (kset-default-font "Consolas" 15)
;; (kset-default-font "Fira Code" 15)
;; (kset-default-font "Iosevka" 15)
;; (kset-default-font "Menlo" 13)

;; do not litter init.el with custom vars and faces
(setq custom-file (make-temp-file "emacs-custom"))
;; modes off
(defvar *modes-off* '(tool-bar-mode scroll-bar-mode menu-bar-mode))
(ktoggle-modes *modes-off* -1)
;; modes on
(defvar *modes-on*
  '(global-font-lock-mode winner-mode global-auto-revert-mode
                          superword-mode global-hl-line-mode
                          column-number-mode delete-selection-mode
(ktoggle-modes *modes-on* +1)

;; colors
(setq blink-cursor-interval 0.4)
(set-cursor-color "red")
(set-foreground-color "black")
(set-background-color "white")
(set-face-attribute 'region nil :background "grey")

;; flags and features
(setq compilation-scroll-output t)
(setq inhibit-startup-message t)
(setq ring-bell-function 'ignore)
(setq uniquify-buffer-name-style 'forward)
(setq windmove-wrap-around t)
(when window-system
  (set-fringe-mode '(1 . 1))) ;; set it minimal
(setq require-final-newline t)
(setq make-backup-files nil)
(setq comint-prompt-read-only 1)
(setq ibuffer-default-sorting-mode 'major-mode)
(setq-default ediff-forward-word-function 'forward-char)
(setq save-interprogram-paste-before-kill t)

;; show canonical file name
(setq frame-title-format
      '("[emacs -"(:eval (projectile-project-name)) "] " "%b"))

;; mode line
 '(mode-line ((t (:background "black"
                              :foreground "white"
                              :inverse-video nil)))))

;; battery mode
(when (not (string= system-name "birkeyz"))
  (display-battery-mode 1))

(defun kbat-advice (battery-update-fn)
  (if (string-match-p "AC"
                      (battery-format "%L"
                                      (funcall battery-status-function)))
      (setq battery-mode-line-format "[%L:%p%%]")
    (setq battery-mode-line-format "[%L:%t]"))
  (funcall battery-update-fn))

(advice-add 'battery-update :around #'kbat-advice)

(setq display-time-string-forms
      '((propertize (concat " " 24-hours ":" minutes " ")
                    'face 'bold)))
(display-time-mode 1)

;; show project name and git branch name in vc-mode line
(setcdr (assq 'vc-mode mode-line-format)
        '((:eval (format "[%s:%s]"
                         (replace-regexp-in-string "^ Git-" "" vc-mode)))))

(run-with-idle-timer 1 t '(lambda () (get-buffer-create "*scratch*")))
(require 'midnight)
(setq clean-buffer-list-delay-general 7)

(setq mac-command-modifier 'meta) ;; osx command as meta

Built-in modes


;; configs
(setq ido-enable-flex-matching t
      ido-everywhere t
      ;; ido-use-filename-at-point 'guess
      ido-use-filename-at-point nil
      ido-create-new-buffer 'always
      ido-ignore-extensions t
      ido-ignore-directories nil
      ido-enable-dot-prefix t
      ido-case-fold t
      ido-auto-merge-work-directories-length -1)
;; enable ido globally
(ido-mode 1)


(defun make-my-shell-output-read-only (text)
  "Add to comint-output-filter-functions to make stdout read only in my shells."
  (let ((inhibit-read-only t)
        (output-end (process-mark (get-buffer-process (current-buffer)))))
    (put-text-property comint-last-output-start output-end 'read-only t)))

(setq tramp-default-method "ssh"          ; uses ControlMaster
      comint-scroll-to-bottom-on-input t  ; always insert at the bottom
      comint-scroll-to-bottom-on-output nil ; always add output at the bottom
      comint-scroll-show-maximum-output t ; scroll to show max possible output
      comint-completion-autolist t        ; show completion list when ambiguous
      comint-input-ignoredups t           ; no duplicates in command history
      comint-buffer-maximum-size 20000    ; max length of the buffer in lines
      comint-get-old-input (lambda () "") ; what to run when i press enter on a
                                        ; line above the current prompt
      comint-input-ring-size 5000         ; max shell history size
(setenv "PAGER" "cat")

(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'shell-mode-hook (lambda ()
                             (define-key shell-mode-map (kbd "<delete>")
(add-to-list 'comint-output-filter-functions 'shell-strip-ctrl-m)
(add-to-list 'comint-output-filter-functions 'comint-truncate-buffer)
(add-hook 'comint-output-filter-functions 'make-my-shell-output-read-only)


  (require 'dired-x)
  (set-default 'dired-omit-mode t)
  (setq dired-listing-switches "-alh")
  (setq dired-omit-files (concat dired-omit-files "\\|^\\..+$"))
  (define-key dired-mode-map (kbd "k") 'dired-kill-subdir)
  (define-key dired-mode-map (kbd ">") 'dired-omit-mode)
  (define-key dired-mode-map (kbd "<C-return>") 'kdired-open-file)
  (define-key dired-mode-map (kbd "C-x C-j") 'dired-jump)
  (set-default 'dired-omit-mode t)
  (setq dired-listing-switches "-alh")
  (setq dired-omit-files (concat dired-omit-files "\\|^\\..+$")))


  (require 'ibuffer)
  (global-set-key (kbd "C-c b") 'ibuffer)
  (setq ibuffer-show-empty-filter-groups nil)
  (setq ibuffer-expert t)
  (setq ibuffer-formats
      '((mark modified read-only " "
              (name 50 50 :left :elide) ; change: 30s were originally 18s
              " "
              (size 9 -1 :right)
              " "
              (mode 16 16 :left :elide)
              " " filename-and-process)
        (mark " "
              (name 16 -1)
              " " filename)))
  (add-hook 'ibuffer-hook
            (lambda ()
              (ibuffer-auto-mode 1)
              (unless (eq ibuffer-sorting-mode 'alphabetic)


  (require 'ansi-color)


  (require 'compile)
  (add-to-list 'compilation-finish-functions 'knotify-compilation-result)
  (setq compilation-skip-threshold 2) ;; skip anyting less important than error
  (setq compilation-error-regexp-alist
        (append (list '("^FAIL in (.*) (\\([^:]*\\):\\([0-9]+\\)" 1 2) ;; clojure
                      '("^ERROR in(.*) (\\([^:]*\\):\\([0-9]+\\)" 1 2) ;; clojure
                      '("^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):" 1 2)) ;; javac


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; my web related configs here ;;;;;;;;;;;;;;;;;;;;;;
;;set default browser to chromium
(setq browse-url-browser-function
      (if (equal system-type 'darwin)

;;quick access hacker news
(defun hn ()
  (browse-url "http://news.ycombinator.com"))

(defun lobster ()
  (browse-url "http://lobste.rs"))

(defun search-site-for-term (site-url term)
  (browse-url (format site-url term)))

(defun wikipedia (&optional p)
  (interactive "P")
  (search-site-for-term "http://en.m.wikipedia.org/w/index.php?search=%s"
                        (dwim-term p "Wikipedia: ")))

(defun stackoverflow (&optional p)
  (interactive "P")
  (search-site-for-term "http://stackoverflow.com/search?q=%s"
                        (dwim-term p "StackOverflow: ")))

(defun google (&optional p)
  (interactive "P")
  (search-site-for-term "http://google.com/search?q=%s"
                        (dwim-term p "Google: ")))

(defun kurl (&optional p)
  (interactive "P")
  (browse-url (dwim-term p "URL: ")))


  (require 'ediff)
  (setq ediff-window-setup-function 'ediff-setup-windows-plain)
  (setq ediff-split-window-function 'split-window-horizontally)
  (add-hook 'ediff-after-quit-hook-internal 'winner-undo))


The best feature of Emacs since Uyghur Girde

Common settings

(setq org-ellipsis " ")
(setq org-src-fontify-natively t)
(setq org-src-tab-acts-natively t)
(setq org-confirm-babel-evaluate nil)
(setq org-export-with-smart-quotes t)
(setq org-src-window-setup 'current-window)

Syntax highlighting for documents exported to HTML

(el-get-bundle htmlize)

Line wrapping

(add-hook 'org-mode-hook
          '(lambda ()
             (visual-line-mode 1)))


(global-set-key (kbd "C-c '") 'org-edit-src-code)

Org Bullets

Makes it all look a bit nicer, I hate looking at asterisks.

(el-get-bundle org-bullets
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode))))


Hitting tab after an “<el” in an org-mode file will create a template for elisp insertion.

(add-to-list 'org-structure-template-alist
             '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))

(add-to-list 'org-structure-template-alist
               '("clj" "#+BEGIN_SRC clojure\n?\n#+END_SRC"))
(add-to-list 'org-structure-template-alist
               '("sh" "#+BEGIN_SRC shell\n?\n#+END_SRC"))


(global-set-key (kbd "C-c c") 'org-capture)
(global-set-key (kbd "C-c a") 'org-agenda)

(defun karchive-when-done ()
  "Archive current entry if it is marked as DONE (see `org-done-keywords')."
  (when (org-entry-is-done-p)

(add-hook 'org-after-todo-state-change-hook

(setq org-agenda-files '("~/gdrive/gtd/inbox.org"

(setq org-capture-templates '(("t" "Todo [inbox]" entry
                               (file+headline "~/gdrive/gtd/inbox.org" "Tasks")
                               "* TODO %i%?")
                              ("T" "Tickler" entry
                               (file+headline "~/gdrive/gtd/tickler.org" "Tickler")
                               "* %i%? \n %U")))

(setq org-refile-targets '(("~/gdrive/gtd/gtd.org" :maxlevel . 3)
                           ("~/gdrive/gtd/someday.org" :level . 1)
                           ("~/gdrive/gtd/tickler.org" :maxlevel . 2)))

(setq org-todo-keywords
      '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))


(require 'ob-clojure)
   (shell . t)
   ;; Include other languages here...


(el-get-bundle smartparens
    (require 'smartparens-config)




(el-get-bundle exec-path-from-shell
    (setq exec-path-from-shell-check-startup-files nil)
    (exec-path-from-shell-copy-env "HISTFILE")
(el-get-bundle bash-completion
    (require 'bash-completion)
    (add-hook 'shell-mode-hook
              (lambda ()
                (company-mode -1)))))


(el-get-bundle shx
    (require 'shx)
    (add-hook 'shell-mode-hook
              (lambda ()
                (setq comint-input-ring-file-name
                      (getenv "HISTFILE"))
                (comint-read-input-ring 'silent)))
    (define-key shell-mode-map (kbd "C-r") 'kshell-history)
    (global-set-key (kbd "<f12>") 'kshell)))


(el-get-bundle keychain-environment)


(el-get-bundle projectile
    (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
    ;; Create test files if not exists
    (setq projectile-create-missing-test-files t)
    ;; Use commander to run when switching projects
    (setq projectile-switch-project-action #'projectile-commander)
    (require 'projectile)

    (def-projectile-commander-method ?c
      "Run `compile' in the project."
      (projectile-compile-project nil))

    ;; use backspace to switch projects
    (def-projectile-commander-method ?s
      "Open bash shell in project root"

    (def-projectile-commander-method ?F
      "Git fetch."
      (if (fboundp 'magit-fetch-from-upstream)
          (call-interactively #'magit-fetch-from-upstream)
        (call-interactively #'magit-pull)))))


(el-get-bundle markdown-mode
    (setq markdown-command "multimarkdown")
    (autoload 'markdown-mode "markdown-mode"
      "Major mode for editing Markdown files" t)
    (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
    (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))

    (autoload 'gfm-mode "markdown-mode"
      "Major mode for editing GitHub Flavored Markdown files" t)
    (add-to-list 'auto-mode-alist '("README\\.md\\'" . gfm-mode))))



(el-get-bundle transient)
(el-get-bundle magit)



(el-get-bundle git-timemachine)
(el-get-bundle git-link)


(el-get-bundle plantuml-mode)


(el-get-bundle company
    (require 'company)
    ;; allows me to just use number to select candidates
    (defun kcompany-number ()
      "Forward to `company-complete-number'.
       Unless the number is potentially part of the candidate.  In that
       case, insert the number."
      (let* ((k (this-command-keys))
             (re (concat "^" company-prefix k)))
        (if (or (cl-find-if (lambda (s) (string-match re s))
                (> (string-to-number k)
                   (length company-candidates)))
            (self-insert-command 1)
           (if (equal k "0")
             (string-to-number k))))))

    (let ((map company-active-map))
      (mapc (lambda (x) (define-key map (format "%d" x) 'kcompany-number))
            (number-sequence 0 9))
      (define-key map " " (lambda ()
                            (self-insert-command 1)))
      (define-key map (kbd "<return>") nil))

    (setq company-tooltip-align-annotations t
          ;; Easy navigation to candidates with M-<n>
          company-show-numbers t)
    (setq company-dabbrev-downcase t)
    ;; setup company mode for autocomplete
    (setq company-idle-delay 0.5)
    (setq company-tooltip-limit 10)
    (setq company-minimum-prefix-length 2)  
    (add-hook 'after-init-hook 'global-company-mode)
    (with-eval-after-load 'company
      (dolist (extension '(".gz" ".blg" ".aux" ".pdf"))
        (push extension completion-ignored-extensions)))))


(el-get-bundle highlight-symbol
  (progn (add-hook 'prog-mode-hook
            (lambda ()
              (local-set-key (kbd "M-n") 'highlight-symbol-next)
              (local-set-key (kbd "M-p") 'highlight-symbol-prev)))))


(defun kcounsel-git-grep (&optional p)
  (interactive "P")
  (let ((term (format "%s"
                      (if p
                          (or (symbol-at-point)
    (counsel-git-grep nil term)))

(defun kswiper (&optional p)
  (interactive "P")
  (if p
      (swiper (format "%s"
                      (or (symbol-at-point)

(el-get-bundle ivy)

(el-get-bundle swiper)

(el-get-bundle ivy-hydra)

(el-get-bundle counsel
    (require 'ivy)
    (ivy-mode 1)
    (global-set-key (kbd "C-s") 'kswiper)
    (global-set-key (kbd "M-x") 'counsel-M-x)
    (global-set-key (kbd "C-x f") 'counsel-find-file)
    (global-set-key (kbd "C-x b") 'ivy-switch-buffer)
    (global-set-key (kbd "M-o") 'ivy-switch-buffer)
    (global-set-key (kbd "C-c f") 'counsel-git)
    (global-set-key (kbd "C-c g") 'kcounsel-git-grep)
    (global-set-key (kbd "C-c l") 'counsel-locate)
    (global-set-key (kbd "C-c y") 'counsel-yank-pop)
    (global-set-key (kbd "s-d") 'counsel-linux-app)
    ;; add ‘recentf-mode’ and bookmarks to ‘ivy-switch-buffer’.
    (setq ivy-use-virtual-buffers t)
    ;; number of result lines to display
    (setq ivy-height 10)
    ;; does not count candidates
    (setq ivy-count-format "")
    ;; no regexp by default
    (setq ivy-initial-inputs-alist nil)
    ;; configure regexp engine.
    (setq ivy-re-builders-alist
          ;; allow input not in order
          '((t   . ivy--regex-ignore-order)))
    ;; do not show ./ and ../
    (setq ivy-extra-directories nil)
    (define-key ivy-minibuffer-map (kbd "RET") #'ivy-alt-done)
    ;; IDO-style directory navigation
    (dolist (k '("C-j" "C-RET"))
      (define-key ivy-minibuffer-map (kbd k) #'ivy-immediate-done))
    (define-key ivy-minibuffer-map (kbd "<up>") #'ivy-previous-line-or-history)))


(el-get-bundle avy  
    (require 'avy)
    (global-set-key (kbd "C-c i") 'avy-goto-char-timer)
    (setq avy-timeout-seconds 1)))


(el-get-bundle s3ed
  (progn (require 's3ed)


;; (el-get-bundle pdf-tools
;;   (progn
;;     (pdf-tools-install)
;;     (add-hook 'doc-view-mode-hook
;;            (lambda ()
;;              (when (s-ends-with-p ".pdf" (buffer-file-name))
;;                (pdf-view-mode))))
;;     (add-hook 'pdf-view-mode-hook (lambda ()
;;                                  (pdf-tools-enable-minor-modes)))
;;     (define-key pdf-view-mode-map (kbd "/") 'isearch-forward)))


(el-get-bundle smex)


(el-get-bundle paren-face
  (progn   (show-paren-mode t)
           (paren-face-mode t)
           (global-paren-face-mode t)
           (set-face-attribute 'show-paren-match nil :weight 'ultra-bold)))


(el-get-bundle  minions
  (minions-mode 1))


;;; package --- My hydras to make me remember things
;;; Commentary:
;;; Code:
(el-get-bundle hydra)

(defhydra ksmerge (:hint nil)
  _b_ keep base    _d_ diff     _n_ next
  _m_ keep mine    _e_ ediff    _p_ previous
  _o_ keep other   _h_ refine
  _a_ keep all
  ("b" smerge-keep-base)
  ("m" smerge-keep-mine)
  ("o" smerge-keep-other)
  ("a" smerge-keep-all)
  ("n" smerge-next)
  ("p" smerge-prev)
  ("h" smerge-refine)
  ("e" smerge-ediff :color blue)
  ("d" (call-interactively
        (pcase (read-char-choice
                "< base-mine, > base-other, = mine-other"
                (list ?< ?> ?=))
          (?< #'smerge-diff-base-mine)
          (?> #'smerge-diff-base-other)
          (?= #'smerge-diff-mine-other))))
  ("l" recenter-top-bottom "recenter")
  ("u" undo "undo")
  ("q" nil "quit"))
(global-set-key (kbd "C-c h s") 'ksmerge/body)


(defun exec! (command)
  (interactive (list (read-shell-command "$ ")))
  (let* ((program-and-args (if (stringp command)
                               (split-string command)
         (program (car program-and-args))
         (args (cdr program-and-args))
         (console (get-buffer-create "*Console*"))
         (pt (with-current-buffer console
               (goto-char (point-max))
               (insert "$ "
                       (mapconcat 'identity program-and-args " ")
         (ret (apply 'call-process program nil console t args))
         (out (with-current-buffer console
                (buffer-substring-no-properties pt (point)))))
    (if (and (numberp ret) (= 0 ret))
      (throw 'exec!-error (list ret out)))))

(defun spawn& (command)
  (interactive (list (read-shell-command "$ ")))
  (let* ((program-and-args (if (stringp command)
                               (split-string command)
         (program (car program-and-args))
         (program-name (file-name-nondirectory program))
         (program-buffer (concat " *" program-name))
         (args (cdr program-and-args)))
    (apply 'start-process program-name program-buffer program args)))

(defun kexwm-input-set-simulation-keys (keys)
  (dolist (k keys)
    (exwm-input-set-simulation-key (car k) (cdr k))))

(defun kexwm-simulation-keys ()
   '(([?\C-b] . left)
     ([?\C-f] . right)
     ([?\C-p] . up)
     ([?\C-n] . down)
     ([?\C-a] . home)
     ([?\C-e] . end)
     ([?\M-v] . prior)
     ([?\C-v] . next)
     ([?\C-d] . delete)
     ([?\C-m] . return)
     ([?\C-i] . tab)
     ([?\C-g] . escape)
     ([?\C-s] . ?\C-f)
     ([?\C-y] . ?\C-v)
     ([?\M-w] . ?\C-c)
     ([?\M-<] . C-home)
     ([?\M->] . C-end)
     ([?\C-\M-h] . C-backspace))))

(defun set-xbacklit (percent)
  (exec! (format "xbacklight -set %s" percent)))

(defun kexwm-init ()
  (spawn& "xbanish")
  (spawn& "cbatticon")
  (spawn& "locker.sh")
  (spawn& "kkeymap.sh")
  (set-xbacklit 20)

(defun start-redshift ()
  (let ((redshift-proc (get-process "redshift")))
    (unless (and redshift-proc
                 (process-live-p redshift-proc))
      (spawn& "redshift"))))

(defun start-synergyc ()
  (let ((synergyc-proc (get-process "synergyc")))
    (unless (and synergyc-proc
                 (process-live-p synergyc-proc))
      (spawn& "synergyc -f --debug INFO --name birkey-x230 --enable-crypto birkeyz:24800"))))

(defun stop-redshift ()
  (let ((redshift-proc (get-process "redshift")))
    (when (and redshift-proc (process-live-p redshift-proc))
      (kill-process redshift-proc)
      (exec! "redshift -x"))))

(defun start-insync ()
  (let ((insync-proc (get-process "insync")))
    (unless (and insync-proc
                 (process-live-p insync-proc))
      (exec! "/home/kasim/rcfiles/bin/insync_start.sh"))))

(defun start-connman-gtk ()
  (let ((nm-proc (get-process "connman-gtk")))
    (unless (and nm-proc
                 (process-live-p nm-proc))
      (spawn& "connman-gtk"))))

(defun kmount-usb ()
  (let ((devmon-proc (get-process "devmon")))
    (unless (and devmon-proc
                 (process-live-p devmon-proc))
      (spawn& "devmon"))))

(defun kunmount ()
  (exec! "devmon --unmount-recent"))

(defun kwifi-name ()
  (message (exec! "iwgetid -r")))

(defmacro setup-exwm-input-set-keys (&rest key-bindings)
  `(dolist (kb ',key-bindings)
     (destructuring-bind (key cmd)
       (exwm-input-set-key (kbd key) cmd))))

(defun dired-home-dir ()
  (dired (expand-file-name "~/")))

(defun setup-exwm-bind-keys ()
  (define-key exwm-mode-map "\C-c\C-k" nil)
  (define-key exwm-mode-map "\C-c!" 'exec!)
   ("s-!" exec!)
   ("s-&" spawn&)
   ("<XF86Explorer>" dired-home-dir)))

(defun kwhich-distro ()
  (message (shell-command-to-string "lsb_release -sd")))

(defun klower-volume ()
  (exec! "amixer sset Master 5%-"))

(defun kraise-volume ()
  (exec! "amixer sset Master unmute")
  (exec! "amixer sset Master 5%+"))

(defun kmute ()
  (exec! "amixer sset Master mute"))

(defun change-brightness (amount)
  (exec! (concat "xbacklight "
                 (if (< 0 amount) "-inc" "-dec")
                 " "
                 (prin1-to-string (abs amount))))
  (let ((v (with-temp-buffer
             (call-process "xbacklight" nil (current-buffer) nil "-get")
             (goto-char (point-min))
             (read (current-buffer)))))
    (message "brightness: %S%%" (round v))))

(defun decrease-brightness (&optional arg)
  (interactive "p")
  (change-brightness (* -1 (or arg 1))))

(defun increase-brightness (&optional arg)
  (interactive "p")
  (change-brightness (* 1 (or arg 1))))

(defun exwm-update-title-hook ()
  (exwm-workspace-rename-buffer exwm-title))

(add-hook 'exwm-update-title-hook 'exwm-update-title-hook)

;; (defun exwm-manage-finish-hook ()
;;   (when (or (and exwm-class-name (string-match "Chromium" exwm-class-name))
;;          (and exwm-class-name (string-match "Terminator" exwm-class-name)))
;;     (exwm-layout-hide-mode-line)))

;; (add-hook 'exwm-manage-finish-hook 'exwm-manage-finish-hook)

(defvar single-window--last-configuration nil
  "Last window configuration before calling `delete-other-windows'.")

(defun ktoggle-single-window ()
  "Un-maximize current window.
    If multiple windows are active, save window configuration and
    delete other windows.  If only one window is active and a window
    configuration was previously save, restore that configuration."
  (if (= (count-windows) 1)
      (when single-window--last-configuration
        (set-window-configuration single-window--last-configuration))
    (setq single-window--last-configuration (current-window-configuration))

(defun kchrome-new-windwow (&optional p)
  (interactive "P")
  (if p
      (spawn& "chromium --new-window --incognito")
    (exec! "~/rcfiles/bin/run-or-raise chromium")))

(defun exwm-session-p ()
  (or (equal "dot-xsession" (getenv "DESKTOP_SESSION"))
      (equal "exwm" (getenv "DESKTOP_SESSION"))))

(defun kterminator (&optional p)
  (interactive "P")
  (if p
      (let ((title (read-string "Enter terminator title: ")))
        (spawn& (format "terminator -m -T %s" title)))
    (if (exwm-session-p)
        (if (get-buffer "/bin/bash")
            (pop-to-buffer "/bin/bash")
          (spawn& "terminator"))
      (exec! "~/rcfiles/bin/run-or-raise terminator"))))

(when (exwm-session-p)
  (el-get-bundle exwm
    (progn (require 'exwm)
           (require 'exwm-config)
           (require 'exwm-systemtray)
           (setq exwm-workspace-number 1
                 exwm-workspace-show-all-buffers t
                 exwm-layout-show-all-buffers t)
            ("<f12>" kshell)
            ("M-O" knext-w)
            ("s-u" winner-undo)
            ("s-d" counsel-linux-app)
            ("s-2" kchrome-new-windwow)
            ("s-1" ktoggle-single-window)
            ("M-o" ivy-switch-buffer)
            ("M-I" avy-goto-char-timer)
            ("<XF86AudioMute>" kmute)
            ("<XF86AudioLowerVolume>" klower-volume)
            ("<XF86AudioRaiseVolume>" kraise-volume)
            ("<XF86MonBrightnessUp>" increase-brightness)
            ("<XF86MonBrightnessDown>" decrease-brightness)))))



(el-get-bundle sesman)
(el-get-bundle clojure-mode
    (require 'clojure-mode)
      (defsc :defn)
      (specification :defn)
      (behavior :defn)
      (provided :defn)
      (assertions :defn)
      (:require :defn)
      (:use :defn)
      (:import :defn)
      (html :defn)
      (div :defn)
      (action :defn))))

(defun mycider-setup ()
    (require 'cider)
    (require 'cider-mode)
    (setq org-babel-clojure-backend 'cider)
    (setq cider-font-lock-dynamically nil)
    (setq cider-repl-history-file "~/.cider-repl-history")
    (add-hook 'cider-mode-hook #'eldoc-mode)
    (add-hook 'cider-mode-hook #'imenu-add-menubar-index)
    (add-hook 'cider-mode-hook '(lambda ()
                                  (local-set-key (kbd "RET") 'newline-and-indent)))
    (add-hook 'cider-repl-mode-hook #'company-mode)
    (add-hook 'cider-mode-hook #'company-mode)
    (define-key cider-repl-mode-map (kbd "C-r")
      '(lambda (term)
         (interactive (list
         (insert term)))))

(if (or (string= "birkey" (system-name))
        (string= "birkeyz" (system-name))
        (string= "ak-mbp" (system-name)))
    (el-get-bundle cider
  (el-get-bundle cider
    :checkout "v0.18.0"

(el-get-bundle format-all
  (add-hook 'clojure-mode-hook 'format-all-mode))


(el-get-bundle alchemist
    (require 'alchemist)
    (setq alchemist-hooks-compile-on-save t)
    (add-hook 'elixir-mode-hook
              (lambda () (add-hook 'before-save-hook 'elixir-format nil t)))))


(el-get-bundle robe
    ;; This is needed so the rails console command is `rails c`
    (defun inf-ruby-console-rails (dir)
      "Run Rails console in DIR."
      (interactive (list (inf-ruby-console-read-directory 'rails)))
      (let* ((default-directory (file-name-as-directory dir))
             (env (inf-ruby-console-rails-env))
             (with-bundler (file-exists-p "Gemfile")))
         (concat (when with-bundler "bundle exec ")
                 "rails c "
    (add-hook 'ruby-mode-hook 'robe-mode)))

(el-get-bundle crystal-mode)


(el-get-bundle ivy-rich
  (progn (require 'ivy-rich)
         (setq ivy-rich-display-transformers-list
                  ((ivy-rich-candidate (:width 80))
                   (ivy-rich-switch-buffer-project (:width 30 :face success))
                     (lambda (x)
                       (ivy-rich-switch-buffer-shorten-path x
                                                            (ivy-rich-minibuffer-width 0.3))))))
                  (lambda (cand) (get-buffer cand)))))
         (ivy-rich-mode 1)))


  (el-get-bundle org-static-blog
    ;; -----------------------------------------------------------------------------
    ;; Set up blogging in Emacs
    ;; -----------------------------------------------------------------------------

      (setq org-static-blog-publish-title "BirkeyCo")
      (setq org-static-blog-publish-url "https://www.birkey.co/")
      (setq org-static-blog-publish-directory "~/github/oneness.github.io/")
      (setq org-static-blog-posts-directory "~/github/oneness.github.io/posts/")
      (setq org-static-blog-drafts-directory "~/github/oneness.github.io/drafts/")
      (setq org-static-blog-enable-tags t)
      (setq org-export-with-toc nil)
      (setq org-export-with-section-numbers nil)
      (add-to-list 'auto-mode-alist
                   (cons (concat org-static-blog-posts-directory ".*\\.org\\'") 'org-static-blog-mode))

      (setq org-static-blog-page-header
            "<meta name=\"author\" content=\"Kasim Tuman\">
  <meta name=\"referrer\" content=\"no-referrer\">
  <link href= \"static/style.css\" rel=\"stylesheet\" type=\"text/css\" />
  <link rel=\"icon\" href=\"static/favicon.ico\">
  <link rel=\"apple-touch-icon-precomposed\" href=\"static/birkey_logo.png\">
  <link rel=\"msapplication-TitleImage\" href=\"static/birkey_logo.png\">
  <link rel=\"msapplication-TitleColor\" href=\"#0141ff\">
  <script src=\"static/katex.min.js\"></script>
  <script src=\"static/auto-render.min.js\"></script>
  <link rel=\"stylesheet\" href=\"static/katex.min.css\">
  <script>document.addEventListener(\"DOMContentLoaded\", function() { renderMathInElement(document.body); });</script>
  <meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=UTF-8\">
  <meta name=\"viewport\" content=\"initial-scale=1,width=device-width,minimum-scale=1\">")

      (setq org-static-blog-page-preamble
            "<div class=\"header\">
    <a href=\"https://www.birkey.co\">Code, Data and Network</a>
    <div class=\"sitelinks\">
      <a href=\"https://twitter.com/KasimTuman\">Twitter</a> | <a href=\"https://github.com/oneness\">Github</a> | <a href=\"https://www.birkey.co/resume/resume.html\">About</a>

      (setq org-static-blog-page-postamble
            "<div id=\"archive\">
    <a href=\"https://www.birkey.co/archive.html\">Other posts</a>
  <div id=\"wpac-comment\"></div>
<script type=\"text/javascript\">
wpac_init = window.wpac_init || [];
wpac_init.push({widget: 'Comment', id: 14053});
(function() {
    if ('WIDGETPACK_LOADED' in window) return;
    var mc = document.createElement('script');
    mc.type = 'text/javascript';
    mc.async = true;
    mc.src = 'https://embed.widgetpack.com/widget.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
  <center><a rel=\"license\" href=\"https://creativecommons.org/licenses/by-sa/3.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-sa/3.0/88x31.png\" /></a><br /><span xmlns:dct=\"https://purl.org/dc/terms/\" href=\"https://purl.org/dc/dcmitype/Text\" property=\"dct:title\" rel=\"dct:type\">birkey.co</span> by <a xmlns:cc=\"https://creativecommons.org/ns#\" href=\"https://www.birkey.co\" property=\"cc:attributionName\" rel=\"cc:attributionURL\">Kasim Tuman</a> is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</center>")

      ;; This slows down org-publish to a crawl, and it is not needed since
      ;; I use magit anyway.
      (remove-hook 'find-file-hooks 'vc-find-file-hook))


(el-get-bundle wgrep
  (require 'wgrep))


(el-get-bundle undo-tree)
(el-get-bundle goto-chg
  (global-set-key (kbd "C-,") 'goto-last-change))


(el-get-bundle eacl
  (eval-after-load 'grep
       (dolist (v '("node_modules"
         (add-to-list 'grep-find-ignored-directories v))
       (dolist (v '("*.min.js"
         (add-to-list 'grep-find-ignored-files v))))
  (require 'eacl))


(el-get-bundle expand-region
    (require 'expand-region)
    (global-set-key (kbd "C-=") 'er/expand-region)))


(el-get-bundle json-navigator)


(el-get-bundle zop-to-char
  (global-set-key [remap zap-to-char] 'zop-to-char))

Date: 2018-09-20 Thu 00:00

Author: Kasim

Created: 2019-08-04 Sun 16:41