- Cases
- COMP (Completion)
- DOCL (Documentation Lookup)
- EVAL (Evaluate/Quote)
- DEFL (Definition Lookup)
- Alchemist-Server API
- COMP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun my-elixir-do-end-close-action (id action context) | |
| (when (eq action 'insert) | |
| (newline-and-indent) | |
| (forward-line -1) | |
| (indent-according-to-mode))) | |
| (sp-with-modes '(elixir-mode) | |
| (sp-local-pair "->" "end" | |
| :when '(("RET")) | |
| :post-handlers '(:add my-elixir-do-end-close-action) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun alchemist-project-find-lib () | |
| (interactive) | |
| (alchemist-project-find-dir "lib")) | |
| (defun alchemist-project-find-web () | |
| (interactive) | |
| (alchemist-project-find-dir "web")) | |
| (defun alchemist-project-find-views () | |
| (interactive) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Atoms and singleton-like words like true/false/nil. | |
| (,(elixir-rx (group (or atoms "true" "false" "nil")) | |
| (zero-or-more space) | |
| (optional "=")) | |
| 1 elixir-atom-face) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Display alchemist buffers always at the right side | |
| ;; Just change (side . right) with the position you would like 'bottom, 'top, 'right or 'left | |
| ;; Source: http://www.lunaryorn.com/2015/04/29/the-power-of-display-buffer-alist.html | |
| (add-to-list 'display-buffer-alist | |
| `(,(rx bos (or "*alchemist test report*" | |
| "*alchemist mix*" | |
| "*alchemist help*")) | |
| (display-buffer-reuse-window | |
| display-buffer-in-side-window) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun say-hello-when-keyboard-quit () | |
| (if (eq last-command 'keyboard-quit) | |
| (message "YOU PRESSED C-g!") | |
| (message "NOPE"))) | |
| (run-with-idle-timer 0.05 | |
| 0.05 | |
| 'say-hello-when-keyboard-quit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List.flatten( | |
| [12,3,4,5,[2,3,4]], | |
| "[2,4]" | |
| ) | |
| # {{:., [line: 1], [{:__aliases__, [counter: 0, line: 1], [:List]}, :flatten]}, | |
| # [line: 1], [[12, 3, 4, 5, [2, 3, 4]], "[2,4]"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case parse do | |
| { [ help: true ], _, _ } | |
| -> :help | |
| { _, [ user, project, count ], _ } -> | |
| { user, project, count } | |
| { _, [ user, project ], _ } -> { user, project, @default_count } | |
| _ -> :help | |
| end | |
| case parse do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (add-to-list 'display-buffer-alist | |
| `(,(rx bos "*helm" (* not-newline) "*" eos) | |
| (display-buffer-in-side-window) | |
| (inhibit-same-window . t) | |
| (window-height . 0.3))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Summary do | |
| def val do | |
| a = 12 | |
| end | |
| end |