Skip to content

Commit

Permalink
Alignment fns and prettify customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
tobytripp committed Jul 6, 2017
1 parent 6a54da5 commit 402a9d1
Show file tree
Hide file tree
Showing 18 changed files with 212 additions and 67 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -26,3 +26,4 @@ projectile-bookmarks.eld
/eshell/
/.mc-lists.el
image-dired/
games
5 changes: 4 additions & 1 deletion .gitmodules
Expand Up @@ -3,4 +3,7 @@
url = https://github.com/yjwen/org-reveal.git
[submodule "vendor/tern"]
path = vendor/tern
url = git@github.com:marijnh/tern.git
url = git@github.com:marijnh/tern.git
[submodule "vendor/electric-align"]
path = vendor/electric-align
url = git@github.com:zk-phi/electric-align
31 changes: 28 additions & 3 deletions custom.el
Expand Up @@ -8,6 +8,7 @@
'(aquamacs-additional-fontsets nil t)
'(aquamacs-customization-version-id 211 t)
'(aquamacs-tool-bar-user-customization nil t)
'(aw-ignore-current t)
'(cider-auto-select-error-buffer nil)
'(cider-auto-test-mode t)
'(coffee-args-compile (quote ("-c" "-o js")))
Expand All @@ -25,7 +26,8 @@
'(custom-enabled-themes (quote (smart-mode-line-powerline)))
'(custom-safe-themes
(quote
("84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279" "7086923ce78db059a71e6f428b32a3894c18a3fa586dd182bfade998e66bbc72" "5d01a86960de1eb33cf786e7e4618deff5620796612d3e931549ef4b11301c5b" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "81d4cc8374c164a5ef3d03d2ce95bbc63b63ec9501eb95efcda618ef2be912c7" "288543c0482be3721231ac464e03dea0216f06231ba67b87b19bf8d7c9de8fb9" "bb017d8fde573b632afcc6e6a9bfa97be34b1cedd5302eb25c495e90b91215d4" "25e6c96f73abc907d629bac26145677d283e9d54975f0515adb3c7790b9ed0cd" "633166cd22dfd9661a13b79fa6c93de958fc383546f3d38e2945e064efd89b5d" "01bbac544c1358e1219e453c4f9d46ba7c397292a655977225d17af9f4fe0eaf" "f3b20fa3cb4656c3d683c14e40bdc01a2a65bada81ed7832c39e8875f23a8290" "5ebf86527cdd9a9b5d2e4cfea1da01315a337cf3fecc519b64aada44a4f329d0" "462b3c5f9056d5cddf9b66d96ca5ee5f1f154f155a594fc2fe20d95f6715b627" "58fa5099e00d5ba113a33a2c51e45d5f9b9fe7d1469ed20f947c590a71d0b10a" "46b9c7059d63d2de5f122fc90d5ee303a433ab5d25f482f6dcdebd47de23d2c2" "d2e2792bf4c9e6338663f64165b0948e84a4165465272b7cf814ba7e1b5e6cb2" "137705bce54ded838e45224f0aaa92db6ba6a2128ef7f8d45d5486dfead8e933" "730c625dbb2390df143f0ae74f27ddff6f18c00d15185c35f5c14aedbcf3dc37" "64b6d6eec0935f6150b0748b91dd52e7d47cd7d733352176443651f8e60f67f7" "25dab113b04c1d1152bb1cac0027c47c2cb9c3b860516781feffaf7f3ef95610" "9330df8772bfe8025d061f7d108780f1e10bec8ab63b69f65688fef4b732b641" "26614652a4b3515b4bbbb9828d71e206cc249b67c9142c06239ed3418eff95e2" default)))
("5521a75edb4cf8c883eb739a7644baa38ee356689248f89b309984995fdc8250" "6889aacaf31b2e9c6e983883dbfce9be918689210d08194aef9584c8a9639eee" "84d2f9eeb3f82d619ca4bfffe5f157282f4779732f48a5ac1484d94d5ff5b279" "7086923ce78db059a71e6f428b32a3894c18a3fa586dd182bfade998e66bbc72" "5d01a86960de1eb33cf786e7e4618deff5620796612d3e931549ef4b11301c5b" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "81d4cc8374c164a5ef3d03d2ce95bbc63b63ec9501eb95efcda618ef2be912c7" "288543c0482be3721231ac464e03dea0216f06231ba67b87b19bf8d7c9de8fb9" "bb017d8fde573b632afcc6e6a9bfa97be34b1cedd5302eb25c495e90b91215d4" "25e6c96f73abc907d629bac26145677d283e9d54975f0515adb3c7790b9ed0cd" "633166cd22dfd9661a13b79fa6c93de958fc383546f3d38e2945e064efd89b5d" "01bbac544c1358e1219e453c4f9d46ba7c397292a655977225d17af9f4fe0eaf" "f3b20fa3cb4656c3d683c14e40bdc01a2a65bada81ed7832c39e8875f23a8290" "5ebf86527cdd9a9b5d2e4cfea1da01315a337cf3fecc519b64aada44a4f329d0" "462b3c5f9056d5cddf9b66d96ca5ee5f1f154f155a594fc2fe20d95f6715b627" "58fa5099e00d5ba113a33a2c51e45d5f9b9fe7d1469ed20f947c590a71d0b10a" "46b9c7059d63d2de5f122fc90d5ee303a433ab5d25f482f6dcdebd47de23d2c2" "d2e2792bf4c9e6338663f64165b0948e84a4165465272b7cf814ba7e1b5e6cb2" "137705bce54ded838e45224f0aaa92db6ba6a2128ef7f8d45d5486dfead8e933" "730c625dbb2390df143f0ae74f27ddff6f18c00d15185c35f5c14aedbcf3dc37" "64b6d6eec0935f6150b0748b91dd52e7d47cd7d733352176443651f8e60f67f7" "25dab113b04c1d1152bb1cac0027c47c2cb9c3b860516781feffaf7f3ef95610" "9330df8772bfe8025d061f7d108780f1e10bec8ab63b69f65688fef4b732b641" "26614652a4b3515b4bbbb9828d71e206cc249b67c9142c06239ed3418eff95e2" default)))
'(debug-on-error t)
'(default-frame-alist
(quote
((vertical-scroll-bars)
Expand Down Expand Up @@ -69,6 +71,7 @@
'(fci-rule-color "#073642")
'(feature-cucumber-command
"bundle exec cucumber -p guard CUCUMBER_OPTS=\"{options}\" {feature}")
'(fill-column 78)
'(flycheck-disabled-checkers (quote (ruby-rubocop)))
'(flymake-allowed-file-name-masks
(quote
Expand All @@ -94,6 +97,15 @@
'(global-linum-mode t)
'(haskell-cabal-list-comma-position (quote after))
'(haskell-font-lock-symbols (quote unicode))
'(inf-ruby-default-implementation "pry")
'(inf-ruby-implementations
(quote
(("ruby" . "irb --prompt default --noreadline -r irb/completion -I ./lib")
("jruby" . "jruby -S irb --prompt default --noreadline -r irb/completion")
("rubinius" . "rbx -r irb/completion")
("yarv" . "irb1.9 -r irb/completion")
("macruby" . "macirb -r irb/completion")
("pry" . "pry "))))
'(js-indent-level 2)
'(js2-basic-offset 2)
'(js2-bounce-indent-p t)
Expand All @@ -116,13 +128,13 @@
'(org-src-window-setup (quote other-window))
'(package-selected-packages
(quote
(cl-lib org yasnippet yaml-mode web-mode web-completion-data twittering-mode tt-mode textmate switch-window smex smart-mode-line-powerline-theme sass-mode ruby-tools ruby-end rspec-mode rhtml-mode rbenv rainbow-delimiters psci projectile perl6-mode paredit ox-reveal ocodo-svg-modelines multi-term mmm-mode magit js-comint isearch+ inf-ruby idle-highlight-mode htmlize highlight-indentation haskell-mode fullframe flx-ido feature-mode enh-ruby-mode emmet-mode elixir-mode dockerfile-mode dired+ dash-at-point company-quickhelp column-marker color-identifiers-mode cider-eval-sexp-fu cider bug-hunter browse-kill-ring apache-mode alchemist ag ace-window ace-jump-mode)))
(clj-refactor log4j-mode org-plus-contrib terraform-mode cl-lib org yasnippet yaml-mode web-mode web-completion-data twittering-mode tt-mode textmate switch-window smex smart-mode-line-powerline-theme sass-mode ruby-tools ruby-end rspec-mode rhtml-mode rbenv rainbow-delimiters psci projectile perl6-mode paredit ox-reveal ocodo-svg-modelines multi-term mmm-mode magit js-comint isearch+ inf-ruby idle-highlight-mode htmlize highlight-indentation haskell-mode fullframe flx-ido feature-mode enh-ruby-mode emmet-mode elixir-mode dockerfile-mode dired+ dash-at-point company-quickhelp column-marker color-identifiers-mode cider-eval-sexp-fu cider bug-hunter browse-kill-ring apache-mode alchemist ag ace-window ace-jump-mode)))
'(perltidy-program "~/perl5/bin/perltidy")
'(revert-without-query (quote ("rspec.*")))
'(rspec-compilation-buffer-name "*specs*")
'(rspec-primary-source-dirs (quote ("app")))
'(rspec-rake-command "bundle exec rake")
'(rspec-spec-command " rspec ")
'(rspec-spec-command "rspec ")
'(rspec-use-bundler-when-possible t)
'(rspec-use-rake-flag nil)
'(rspec-use-rake-when-possible nil)
Expand Down Expand Up @@ -255,6 +267,8 @@
(sql-server "localhost")
(sql-port 65432)))))
'(tags-revert-without-query t)
'(tags-table-list (quote ("/Users/toby/Code/reception-desk/.TAGS")))
'(visible-bell t)
'(visual-line-mode nil t)
'(warning-minimum-level :error)
'(web-mode-code-indent-offset 2)
Expand All @@ -267,4 +281,15 @@
;; 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.
'(aw-leading-char-face ((t (:foreground "red" :height 2.0 :width extra-expanded))))
'(ediff-current-diff-B ((t (:background "DarkOliveGreen4"))))
'(ediff-even-diff-A ((t (:background "gray40"))))
'(ediff-even-diff-B ((t (:background "gray40"))))
'(ediff-even-diff-C ((t (:inherit ediff-even-diff-A))))
'(ediff-fine-diff-A ((t (:background "sienna4"))))
'(ediff-fine-diff-Ancestor ((t (:background "wheat4"))))
'(ediff-fine-diff-B ((t (:background "dark green"))))
'(ediff-odd-diff-A ((t (:inherit ediff-odd-diff-B))))
'(ediff-odd-diff-B ((t (:background "gray55"))))
'(ediff-odd-diff-C ((t (:inherit ediff-odd-diff-B))))
'(enh-ruby-op-face ((t (:foreground "gray70")))))
13 changes: 5 additions & 8 deletions env.el
@@ -1,13 +1,10 @@
(setenv "PATH"
(concat
"/usr/local/bin" ":"
"/usr/local/opt/rbenv/shims" ":"
(getenv "PATH") ":"
"/usr/local/git/bin/" ":"
(expand-file-name "~/.cabal/bin")))

(setq exec-path (append '("/usr/local/opt/rbenv/shims") exec-path))
(setq exec-path (append '("/usr/local/bin") exec-path))
(setq exec-path (append exec-path '("/usr/local/git/bin")))
(setq exec-path (append exec-path (expand-file-name "~/.cabal/bin")))

(add-to-list 'exec-path (concat dotfiles-dir "bin"))

(if (not (getenv "TERM_PROGRAM"))
(setenv "PATH"
(shell-command-to-string "source $HOME/.zshrc && printf $PATH")))
7 changes: 7 additions & 0 deletions init.el
@@ -1,3 +1,10 @@

;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(defvar dotfiles-dir user-emacs-directory)
(defvar lib-dir (concat dotfiles-dir "elisp/"))
(add-to-list 'load-path lib-dir)
Expand Down
2 changes: 1 addition & 1 deletion org-init/clojure.org
@@ -1,7 +1,7 @@
#+SETUPFILE: ~/.emacs.d/org-init/level-0.orgsetup
* Clojure Customizations

** Clojure + Cider Keybindings of Interest
** DONE Clojure + Cider Keybindings of Interest

| Key-Chord | Command |
| C-c C-x | Reload the current namespace |
Expand Down
46 changes: 33 additions & 13 deletions org-init/coding-init.org
Expand Up @@ -3,12 +3,18 @@

** I like λ
#+BEGIN_SRC emacs-lisp
(defun pretty-lambdas ()
(font-lock-add-keywords
nil `(("(?\\(lambda\\>\\)"
(0 (progn (compose-region (match-beginning 1) (match-end 1)
,(make-char 'greek-iso8859-7 107))
nil))))))
(defun toby/add-prettified-symbols ()
(setq prettify-symbols-alist
'(
("lambda" . 955)
("->" . 10230)
("=>" . 10233)
)))

(add-hook 'clojure-mode-hook 'toby/add-prettified-symbols)
(add-hook 'haskell-mode-hook 'toby/add-prettified-symbols)

(global-prettify-symbols-mode 1)
#+END_SRC

** 80 Columns is Law
Expand All @@ -35,13 +41,24 @@
(autoload 'highlight-indentation-mode "highlight-indentation")
#+END_SRC

*** EXPERIMENTAL Auto sex-p management
- State "EXPERIMENTAL" from [2017-06-30 Fri 09:58]

#+BEGIN_SRC emacs-lisp
;; Haven't decided between the two yet…
(require-package 'paredit)
(require-package 'smartparens)
(require 'smartparens-config)
(define-key smartparens-mode-map (kbd "C-k") 'sp-kill-sexp)

(if (require 'smartparens nil 'noerror)
(smartparens-mode t)
(paredit-mode t))
#+END_SRC

*** Formatting Hooks/Functions

#+BEGIN_SRC emacs-lisp
(define-key prog-mode-map (kbd "C-<tab>") 'indent-buffer)

(require-package 'rainbow-delimiters)
Expand All @@ -66,19 +83,12 @@

(setq save-place t)

(if (require 'smartparens nil 'noerror)
(smartparens-mode t)
(paredit-mode t))


(tool-bar-mode -1)

(font-lock-add-keywords
nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
1 font-lock-warning-face t)))

(pretty-lambdas)

(idle-highlight-mode t)
(highlight-indentation-current-column-mode)

Expand All @@ -95,6 +105,16 @@
(run-hooks 'prog-mode-hook))
#+END_SRC

*** EXPERIMENTAL electric-align Mode
- State "EXPERIMENTAL" from [2017-06-30 Fri 09:53]

#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (concat vendor-dir "electric-align"))
(autoload 'electric-align-mode "electric-align.el" nil t)

(add-hook 'prog-mode-hook 'electric-align-mode)
#+END_SRC

** Embedded Modes

#+BEGIN_SRC emacs-lisp
Expand Down
11 changes: 11 additions & 0 deletions org-init/emacs-init.org
Expand Up @@ -49,6 +49,17 @@
(setq ns-use-native-fullscreen t)
#+END_SRC

Be less aggressive when vertically splitting my windows: (default 80)
#+BEGIN_SRC emacs-lisp
(setq split-height-threshold 110)
#+END_SRC

#+BEGIN_QUOTE
Minimum height for splitting windows sensibly.
If this is an integer, ‘split-window-sensibly’ may split a window
vertically only if it has at least this many lines.
#+END_QUOTE

** UTF-8

#+BEGIN_SRC emacs-lisp
Expand Down
18 changes: 13 additions & 5 deletions org-init/javascript-init.org
Expand Up @@ -62,11 +62,16 @@
(add-hook 'js-mode-hook 'js2-minor-mode)

(setq js2-highlight-level 3)
(push '("function" . ?𝒇) prettify-symbols-alist)
(push '("QUnit.test" . ?∀) prettify-symbols-alist)
(push '("assert" . ?∃) prettify-symbols-alist)
(push '("===" . ?≣) prettify-symbols-alist)
(push '("==" . ?≈) prettify-symbols-alist)

(defvar toby/js-prettify-alist '())

(add-to-list 'toby/js-prettify-alist '("function" . ?𝒇))
(add-to-list 'toby/js-prettify-alist '("test" . ?∀))
(add-to-list 'toby/js-prettify-alist '("QUnit.test" . ?∀))
(add-to-list 'toby/js-prettify-alist '("assert" . ?∃))
(add-to-list 'toby/js-prettify-alist '("===" . ?≣))
(add-to-list 'toby/js-prettify-alist '("==" . ?≈))


(defun toby/js-init ()
(glasses-mode t)
Expand All @@ -79,6 +84,9 @@
(eval-after-load "js-mode"
'(progn
(add-hook 'js-mode-hook 'toby/js-init)
(setq js--prettify-symbols-alist
(append toby/js-prettify-alist
js--prettify-symbols-alist))
(require 'js-comint)))

(eval-after-load "js2-mode"
Expand Down
2 changes: 2 additions & 0 deletions org-init/keybindings.org
Expand Up @@ -107,6 +107,7 @@
#+BEGIN_SRC emacs-lisp
(define-key global-map (kbd "C-+") 'text-scale-increase)
(define-key global-map (kbd "C--") 'text-scale-decrease)
(define-key global-map (kbd "C-=") 'text-scale-set)
(global-set-key (kbd "C-s-f") 'ns-toggle-fullscreen)
#+END_SRC

Expand Down Expand Up @@ -146,6 +147,7 @@
(require-package 'avy)
(require-package 'ace-window)
(global-set-key (kbd "C-x o") 'ace-window)
(global-set-key (kbd "M-p") 'ace-window)

(setq aw-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s))
#+END_SRC
Expand Down
28 changes: 28 additions & 0 deletions org-init/ldap-init.org
@@ -0,0 +1,28 @@
#+SETUPFILE: ~/.emacs.d/org-init/level-0.orgsetup
#+TITLE: LDAP Settings

* EUDC

#+BEGIN_SRC emacs-lisp
(require 'ldap)
(require 'eudc)

(setq eudc-default-return-attributes nil
eudc-strict-return-matches nil)

(setq ldap-ldapsearch-args (quote ("-tt" "-LLL" "-x")))

(setq ldap-host-parameters-alist
(quote (("198.211.113.142:389"
base "dc=mmtest"
binddn "cn=admin,dc=mmtest"
passwd "2funky4u" auth simple)
("localhost:389"
base "dc=ldap,dc=masterymanager,dc=local"
binddn "cn=admin,dc=ldap,dc=masterymanager,dc=local"
passwd "2funky4u" auth simple))))

(setq eudc-server-hotlist
'(("198.211.113.142:389" . ldap) ("localhost:389" . ldap)))
(setq eudc-inline-expansion-servers 'hotlist)
#+END_SRC
2 changes: 2 additions & 0 deletions org-init/level-0.orgsetup
Expand Up @@ -7,3 +7,5 @@
#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="css/htmlize.css">
#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="css/config.css">
#+HTML_CONTAINER: div
#+STARTUP: content
#+TODO: EXPERIMENTAL(e!) REJECTED(r!) | ADOPTED(a!)
63 changes: 32 additions & 31 deletions org-init/org-mode-init.org
Expand Up @@ -6,37 +6,38 @@

Fontify code blocks in an Org file:
#+BEGIN_SRC emacs-lisp
(setq org-src-fontify-natively t)
(require 'ob)

(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
(add-to-list 'org-babel-tangle-lang-exts '("haskell" . "hs"))

(defun toby/babel-hook ()
(condition-case nil
(org-display-inline-images)
(error nil)))

(add-hook 'org-babel-after-execute-hook
'toby/babel-hook
'append)

(org-babel-do-load-languages
'org-babel-load-languages
'((sh . t)
(ruby . t)
(ditaa . t)
(dot . t)
(sqlite . t)
(sql . t)
(perl . t)))

(add-to-list 'org-structure-template-alist
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))
(add-to-list 'org-structure-template-alist
'("pg" "#+BEGIN_SRC sql :engine postgresql\n?\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))
(add-to-list 'org-structure-template-alist
'("hs" "#+BEGIN_SRC haskell\n?\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))
(setq org-src-fontify-natively t)
(require 'ob)


(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
(add-to-list 'org-babel-tangle-lang-exts '("haskell" . "hs"))

(defun toby/babel-hook ()
(condition-case nil
(org-display-inline-images)
(error nil)))

(add-hook 'org-babel-after-execute-hook
'toby/babel-hook
'append)

(require 'ob-shell)
(require 'ob-ruby)
(require 'ob-sql)
(require 'ob-clojure)
(org-babel-do-load-languages
'org-babel-load-languages
'((sh . t)
(ruby . t)
(sql . t)))

(add-to-list 'org-structure-template-alist
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))
(add-to-list 'org-structure-template-alist
'("pg" "#+BEGIN_SRC sql :engine postgresql\n?\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))
(add-to-list 'org-structure-template-alist
'("hs" "#+BEGIN_SRC haskell\n?\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))
#+END_SRC

This adds syntax highlighting to org-babel html exports.
Expand Down

0 comments on commit 402a9d1

Please sign in to comment.