aboutsummaryrefslogtreecommitdiff
path: root/spacemacs.el
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2018-03-23 20:38:44 -0300
committerEuAndreh <eu@euandre.org>2018-03-23 20:49:09 -0300
commit4e734232c611890f616194ed5cfade2549e4491b (patch)
tree38e74c5f28aaa8ecc8c6cbff7836d919c8fa7a1b /spacemacs.el
parentInitial commit: add git-crypt .gitattributes file (diff)
downloaddotfiles-4e734232c611890f616194ed5cfade2549e4491b.tar.gz
dotfiles-4e734232c611890f616194ed5cfade2549e4491b.tar.xz
Initial commit: now public (again)
Diffstat (limited to 'spacemacs.el')
-rw-r--r--spacemacs.el750
1 files changed, 750 insertions, 0 deletions
diff --git a/spacemacs.el b/spacemacs.el
new file mode 100644
index 0000000..14ba802
--- /dev/null
+++ b/spacemacs.el
@@ -0,0 +1,750 @@
+;; -*- mode: emacs-lisp -*-
+;; This file is loaded by Spacemacs at startup.
+;; It must be stored in your home directory.
+
+(defun dotspacemacs/layers ()
+ "Layer configuration:
+This function should only modify configuration layer settings."
+ (setq-default
+ ;; Base distribution to use. This is a layer contained in the directory
+ ;; `+distribution'. For now available distributions are `spacemacs-base'
+ ;; or `spacemacs'. (default 'spacemacs)
+ dotspacemacs-distribution 'spacemacs
+
+ ;; Lazy installation of layers (i.e. layers are installed only when a file
+ ;; with a supported type is opened). Possible values are `all', `unused'
+ ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
+ ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
+ ;; lazy install any layer that support lazy installation even the layers
+ ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
+ ;; installation feature and you have to explicitly list a layer in the
+ ;; variable `dotspacemacs-configuration-layers' to install it.
+ ;; (default 'unused)
+ dotspacemacs-enable-lazy-installation 'unused
+
+ ;; If non-nil then Spacemacs will ask for confirmation before installing
+ ;; a layer lazily. (default t)
+ dotspacemacs-ask-for-lazy-installation t
+
+ ;; If non-nil layers with lazy install support are lazy installed.
+ ;; List of additional paths where to look for configuration layers.
+ ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
+ dotspacemacs-configuration-layer-path '()
+
+ ;; List of configuration layers to load.
+ dotspacemacs-configuration-layers
+ '(csv
+ rust
+ react
+ sql
+ perl5
+ perl6
+ purescript
+ windows-scripts
+ lua
+ erlang
+ elixir
+ python
+ ansible
+ yaml
+ ruby
+ swift
+ typescript
+ clojure
+ haskell
+ javascript
+ finance
+ helm
+ auto-completion
+ better-defaults
+ emacs-lisp
+ git
+ markdown
+ org
+ (shell :variables
+ shell-default-height 30
+ shell-default-position 'bottom)
+ (spell-checking :variables
+ spell-checking-enable-by-default nil)
+ syntax-checking
+ version-control
+ elm
+ html
+ common-lisp
+ restclient
+ latex
+ docker
+ pdf-tools
+ ;; media
+ github
+ nixos
+ ;; tabbar
+ selectric)
+
+ ;; List of additional packages that will be installed without being
+ ;; wrapped in a layer. If you need some configuration for these
+ ;; packages, then consider creating a layer. You can also put the
+ ;; configuration in `dotspacemacs/user-config'.
+ ;; To use a local version of a package, use the `:location' property:
+ ;; '(your-package :location "~/path/to/your-package/")
+ ;; Also include the dependencies as they will not be resolved automatically.
+ ;; To use a local version of a package, use the `:location' property:
+ ;; '(your-package :location "~/path/to/your-package/")
+ ;; Also include the dependencies as they will not be resolved automatically.
+ dotspacemacs-additional-packages '(paredit
+ interleave)
+ ;; A list of packages that cannot be updated.
+ dotspacemacs-frozen-packages '()
+
+ ;; A list of packages that will not be installed and loaded.
+ dotspacemacs-excluded-packages '()
+
+ ;; Defines the behaviour of Spacemacs when installing packages.
+ ;; Possible values are `used-only', `used-but-keep-unused' and `all'.
+ ;; `used-only' installs only explicitly used packages and deletes any unused
+ ;; packages as well as their unused dependencies. `used-but-keep-unused'
+ ;; installs only the used packages but won't delete unused ones. `all'
+ ;; installs *all* packages supported by Spacemacs and never uninstalls them.
+ ;; (default is `used-only')
+ dotspacemacs-install-packages 'used-only))
+
+(defun dotspacemacs/init ()
+ "Initialization:
+This function is called at the very beginning of Spacemacs startup,
+before layer configuration.
+It should only modify the values of Spacemacs settings."
+ ;; This setq-default sexp is an exhaustive list of all the supported
+ ;; spacemacs settings.
+ (setq-default
+ ;; If non-nil ELPA repositories are contacted via HTTPS whenever it's
+ ;; possible. Set it to nil if you have no way to use HTTPS in your
+ ;; environment, otherwise it is strongly recommended to let it set to t.
+ ;; This variable has no effect if Emacs is launched with the parameter
+ ;; `--insecure' which forces the value of this variable to nil.
+ ;; (default t)
+ dotspacemacs-elpa-https t
+
+ ;; Maximum allowed time in seconds to contact an ELPA repository.
+ ;; (default 5)
+ dotspacemacs-elpa-timeout 5
+
+ ;; If non-nil then Spacelpa repository is the primary source to install
+ ;; a locked version of packages. If nil then Spacemacs will install the lastest
+ ;; version of packages from MELPA. (default nil)
+ dotspacemacs-use-spacelpa nil
+
+ ;; If non-nil then verify the signature for downloaded Spacelpa archives.
+ ;; (default nil)
+ dotspacemacs-verify-spacelpa-archives nil
+
+ ;; If non-nil then spacemacs will check for updates at startup
+ ;; when the current branch is not `develop'. Note that checking for
+ ;; new versions works via git commands, thus it calls GitHub services
+ ;; whenever you start Emacs. (default nil)
+ dotspacemacs-check-for-update t
+ ;; If non-nil, a form that evaluates to a package directory. For example, to
+ ;; use different package directories for different Emacs versions, set this
+ ;; to `emacs-version'. (default 'emacs-version)
+ dotspacemacs-elpa-subdirectory 'emacs-version
+
+ ;; One of `vim', `emacs' or `hybrid'.
+ ;; `hybrid' is like `vim' except that `insert state' is replaced by the
+ ;; `hybrid state' with `emacs' key bindings. The value can also be a list
+ ;; with `:variables' keyword (similar to layers). Check the editing styles
+ ;; section of the documentation for details on available variables.
+ ;; (default 'vim)
+ dotspacemacs-editing-style 'hybrid
+ ;; If non nil output loading progress in `*Messages*' buffer. (default nil)
+ dotspacemacs-verbose-loading t
+ ;; Specify the startup banner. Default value is `official', it displays
+ ;; the official spacemacs logo. An integer value is the index of text
+ ;; banner, `random' chooses a random text banner in `core/banners'
+ ;; directory. A string value must be a path to an image format supported
+ ;; by your Emacs build.
+ ;; If the value is nil then no banner is displayed. (default 'official)
+ dotspacemacs-startup-banner 'official
+
+ ;; List of items to show in startup buffer or an association list of
+ ;; the form `(list-type . list-size)`. If nil then it is disabled.
+ ;; Possible values for list-type are:
+ ;; `recents' `bookmarks' `projects' `agenda' `todos'.
+ ;; List sizes may be nil, in which case
+ ;; `spacemacs-buffer-startup-lists-length' takes effect.
+ dotspacemacs-startup-lists '((recents . 5)
+ (projects . 7))
+
+ ;; True if the home buffer should respond to resize events. (default t)
+ dotspacemacs-startup-buffer-responsive t
+
+ ;; Default major mode of the scratch buffer (default `text-mode')
+ dotspacemacs-scratch-mode 'text-mode
+
+ ;; Initial message in the scratch buffer, such as "Welcome to Spacemacs!"
+ ;; (default nil)
+ dotspacemacs-initial-scratch-message nil
+
+ ;; List of themes, the first of the list is loaded when spacemacs starts.
+ ;; Press `SPC T n' to cycle to the next theme in the list (works great
+ ;; with 2 themes variants, one dark and one light)
+ dotspacemacs-themes '(spacemacs-dark
+ spacemacs-light)
+
+ ;; Set the theme for the Spaceline. Supported themes are `spacemacs',
+ ;; `all-the-icons', `custom', `vim-powerline' and `vanilla'. The first three
+ ;; are spaceline themes. `vanilla' is default Emacs mode-line. `custom' is a
+ ;; user defined themes, refer to the DOCUMENTATION.org for more info on how
+ ;; to create your own spaceline theme. Value can be a symbol or list with\
+ ;; additional properties.
+ ;; (default '(spacemacs :separator wave :separator-scale 1.5))
+ dotspacemacs-mode-line-theme 'spacemacs ;;'(spacemacs :separator wave :separator-scale 1.5)
+
+ ;; If non-nil the cursor color matches the state color in GUI Emacs.
+ ;; (default t)
+ dotspacemacs-colorize-cursor-according-to-state t
+
+ ;; Default font, or prioritized list of fonts. `powerline-scale' allows to
+ ;; quickly tweak the mode-line size to make separators look not too crappy.
+ dotspacemacs-default-font '("Source Code Pro"
+ :size 13
+ :weight normal
+ :width normal)
+
+ ;; The leader key (default "SPC")
+ dotspacemacs-leader-key "SPC"
+
+ ;; The key used for Emacs commands `M-x' (after pressing on the leader key).
+ ;; (default "SPC")
+ dotspacemacs-emacs-command-key "SPC"
+
+ ;; The key used for Vim Ex commands (default ":")
+ dotspacemacs-ex-command-key ":"
+
+ ;; The leader key accessible in `emacs state' and `insert state'
+ ;; (default "M-m")
+ dotspacemacs-emacs-leader-key "M-m"
+
+ ;; Major mode leader key is a shortcut key which is the equivalent of
+ ;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
+ dotspacemacs-major-mode-leader-key ","
+
+ ;; Major mode leader key accessible in `emacs state' and `insert state'.
+ ;; (default "C-M-m")
+ dotspacemacs-major-mode-emacs-leader-key "C-M-m"
+
+ ;; These variables control whether separate commands are bound in the GUI to
+ ;; the key pairs `C-i', `TAB' and `C-m', `RET'.
+ ;; Setting it to a non-nil value, allows for separate commands under `C-i'
+ ;; and TAB or `C-m' and `RET'.
+ ;; In the terminal, these pairs are generally indistinguishable, so this only
+ ;; works in the GUI. (default nil)
+ dotspacemacs-distinguish-gui-tab nil
+
+ ;; If non-nil `Y' is remapped to `y$' in Evil states. (default nil)
+ dotspacemacs-remap-Y-to-y$ nil
+
+ ;; If non-nil, the shift mappings `<' and `>' retain visual state if used
+ ;; there. (default t)
+ dotspacemacs-retain-visual-state-on-shift t
+
+ ;; If non-nil, `J' and `K' move lines up and down when in visual mode.
+ ;; (default nil)
+ dotspacemacs-visual-line-move-text t
+ ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
+ ;; (default nil)
+ dotspacemacs-ex-substitute-global nil
+
+ ;; Name of the default layout (default "Default")
+ dotspacemacs-default-layout-name "annex+TODOs/dotfiles/global-config"
+ ;; If non nil the default layout name is displayed in the mode-line.
+ ;; (default nil)
+ dotspacemacs-display-default-layout nil
+
+ ;; If non-nil then the last auto saved layouts are resumed automatically upon
+ ;; start. (default nil)
+ dotspacemacs-auto-resume-layouts nil ;; t
+ ;; Size (in MB) above which spacemacs will prompt to open the large file
+ ;; literally to avoid performance issues. Opening a file literally means that
+ ;; no major mode or minor modes are active. (default is 1)
+ dotspacemacs-large-file-size 5
+ ;; Location where to auto-save files. Possible values are `original' to
+ ;; auto-save the file in-place, `cache' to auto-save the file to another
+ ;; file stored in the cache directory and `nil' to disable auto-saving.
+ ;; (default 'cache)
+ dotspacemacs-auto-save-file-location 'cache
+
+ ;; Maximum number of rollback slots to keep in the cache. (default 5)
+ dotspacemacs-max-rollback-slots 5
+
+ ;; If non-nil, `helm' will try to minimize the space it uses. (default nil)
+ dotspacemacs-helm-resize nil
+
+ ;; if non-nil, the helm header is hidden when there is only one source.
+ ;; (default nil)
+ dotspacemacs-helm-no-header t
+ ;; define the position to display `helm', options are `bottom', `top',
+ ;; `left', or `right'. (default 'bottom)
+ dotspacemacs-helm-position 'bottom
+
+ ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching
+ ;; in all non-asynchronous sources. If set to `source', preserve individual
+ ;; source settings. Else, disable fuzzy matching in all sources.
+ ;; (default 'always)
+ dotspacemacs-helm-use-fuzzy 'source
+ ;; If non nil the paste micro-state is enabled. When enabled pressing `p`
+ ;; several times cycle between the kill ring content. (default nil)
+ dotspacemacs-enable-paste-transient-state t
+ ;; Which-key delay in seconds. The which-key buffer is the popup listing
+ ;; the commands bound to the current keystroke sequence. (default 0.4)
+ dotspacemacs-which-key-delay 0.4
+
+ ;; Which-key frame position. Possible values are `right', `bottom' and
+ ;; `right-then-bottom'. right-then-bottom tries to display the frame to the
+ ;; right; if there is insufficient space it displays it at the bottom.
+ ;; (default 'bottom)
+ dotspacemacs-which-key-position 'bottom
+
+ ;; Control where `switch-to-buffer' displays the buffer. If nil,
+ ;; `switch-to-buffer' displays the buffer in the current window even if
+ ;; another same-purpose window is available. If non-nil, `switch-to-buffer'
+ ;; displays the buffer in a same-purpose window even if the buffer can be
+ ;; displayed in the current window. (default nil)
+ dotspacemacs-switch-to-buffer-prefers-purpose nil
+
+ ;; If non-nil a progress bar is displayed when spacemacs is loading. This
+ ;; may increase the boot time on some systems and emacs builds, set it to
+ ;; nil to boost the loading time. (default t)
+ dotspacemacs-loading-progress-bar t
+
+ ;; If non-nil the frame is fullscreen when Emacs starts up. (default nil)
+ ;; (Emacs 24.4+ only)
+ dotspacemacs-fullscreen-at-startup t
+ ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
+ ;; Use to disable fullscreen animations in OSX. (default nil)
+ dotspacemacs-fullscreen-use-non-native nil
+
+ ;; If non-nil the frame is maximized when Emacs starts up.
+ ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
+ ;; (default nil) (Emacs 24.4+ only)
+ dotspacemacs-maximized-at-startup nil
+
+ ;; A value from the range (0..100), in increasing opacity, which describes
+ ;; the transparency level of a frame when it's active or selected.
+ ;; Transparency can be toggled through `toggle-transparency'. (default 90)
+ dotspacemacs-active-transparency 90
+
+ ;; A value from the range (0..100), in increasing opacity, which describes
+ ;; the transparency level of a frame when it's inactive or deselected.
+ ;; Transparency can be toggled through `toggle-transparency'. (default 90)
+ dotspacemacs-inactive-transparency 90
+
+ ;; If non-nil show the titles of transient states. (default t)
+ dotspacemacs-show-transient-state-title t
+
+ ;; If non-nil show the color guide hint for transient state keys. (default t)
+ dotspacemacs-show-transient-state-color-guide t
+
+ ;; If non-nil unicode symbols are displayed in the mode line. (default t)
+ dotspacemacs-mode-line-unicode-symbols t
+
+ ;; If non-nil smooth scrolling (native-scrolling) is enabled. Smooth
+ ;; scrolling overrides the default behavior of Emacs which recenters point
+ ;; when it reaches the top or bottom of the screen. (default t)
+ dotspacemacs-smooth-scrolling t
+
+ ;; Control line numbers activation.
+ ;; If set to `t' or `relative' line numbers are turned on in all `prog-mode' and
+ ;; `text-mode' derivatives. If set to `relative', line numbers are relative.
+ ;; This variable can also be set to a property list for finer control:
+ ;; '(:relative nil
+ ;; :disabled-for-modes dired-mode
+ ;; doc-view-mode
+ ;; markdown-mode
+ ;; org-mode
+ ;; pdf-view-mode
+ ;; text-mode
+ ;; :size-limit-kb 1000)
+ ;; (default nil)
+ dotspacemacs-line-numbers '(:relative t :disabled-for-modes org-mode pdf-view-mode)
+ ;; Code folding method. Possible values are `evil' and `origami'.
+ ;; (default 'evil)
+ dotspacemacs-folding-method 'evil
+
+ ;; If non-nil `smartparens-strict-mode' will be enabled in programming modes.
+ ;; (default nil)
+ dotspacemacs-smartparens-strict-mode nil
+
+ ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
+ ;; over any automatically added closing parenthesis, bracket, quote, etc…
+ ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
+ dotspacemacs-smart-closing-parenthesis nil
+
+ ;; Select a scope to highlight delimiters. Possible values are `any',
+ ;; `current', `all' or `nil'. Default is `all' (highlight any scope and
+ ;; emphasis the current one). (default 'all)
+ dotspacemacs-highlight-delimiters nil
+ ;; If non nil, advise quit functions to keep server open when quitting.
+ ;; (default nil)
+ dotspacemacs-persistent-server nil
+
+ ;; List of search tool executable names. Spacemacs uses the first installed
+ ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
+ ;; (default '("ag" "pt" "ack" "grep"))
+ dotspacemacs-search-tools '("ag")
+ ;; The default package repository used if no explicit repository has been
+ ;; specified with an installed package.
+ ;; Not used for now. (default nil)
+ dotspacemacs-default-package-repository nil
+
+ ;; Format specification for setting the frame title.
+ ;; %a - the `abbreviated-file-name', or `buffer-name'
+ ;; %t - `projectile-project-name'
+ ;; %I - `invocation-name'
+ ;; %S - `system-name'
+ ;; %U - contents of $USER
+ ;; %b - buffer name
+ ;; %f - visited file name
+ ;; %F - frame name
+ ;; %s - process status
+ ;; %p - percent of buffer above top of window, or Top, Bot or All
+ ;; %P - percent of buffer above bottom of window, perhaps plus Top, or Bot or All
+ ;; %m - mode name
+ ;; %n - Narrow if appropriate
+ ;; %z - mnemonics of buffer, terminal, and keyboard coding systems
+ ;; %Z - like %z, but including the end-of-line format
+ ;; (default "%I@%S")
+ dotspacemacs-frame-title-format "%I@%S"
+
+ ;; Format specification for setting the icon title format
+ ;; (default nil - same as frame-title-format)
+ dotspacemacs-icon-title-format nil
+
+ ;; Delete whitespace while saving buffer. Possible values are `all'
+ ;; to aggressively delete empty line and long sequences of whitespace,
+ ;; `trailing' to delete only the whitespace at end of lines, `changed' to
+ ;; delete only whitespace for changed lines or `nil' to disable cleanup.
+ ;; (default nil)
+ dotspacemacs-whitespace-cleanup 'trailing))
+
+(defun dotspacemacs/user-init ()
+ "Initialization function for user code.
+It is called immediately after `dotspacemacs/init', before layer configuration executes.
+ This function is mostly useful for variables that need to be set before packages are loaded. If you are unsure, you should try in setting them in `dotspacemacs/user-config' first.")
+
+
+(defun git-link-pull-requests (remote)
+ (interactive (list (git-link--select-remote)))
+ (let ((remote-host (git-link--remote-host remote)))
+ (if remote-host
+ (git-link--new (format "https://%s/%s/%s"
+ remote-host
+ (git-link--remote-dir remote)
+ (pcase remote-host
+ ("gitlab.com" "merge_requests")
+ ("github.com" "pulls"))))
+ (error "Remote `%s' is unknown or contains an unsupported URL" remote))))
+
+(defun set-custom-nu-clj-indent ()
+ "Reset midje indent to default."
+ (define-clojure-indent
+ (fact 1)
+ (facts 1)
+ (against-background 1)
+ (provided 0)
+ (let-entities 3)
+ (flow 1)
+ (as-customer 1)
+ (for-all 1)
+ (confirmation-button 1)
+ (query 1)
+ (render 1)
+ (view 1)
+ (text 1)
+ (touchable-highlight 1)
+ (image 1)
+ (scroll-view 1)
+ (camera 1)
+ (initial-state 1)
+ (ident 1)
+ (query 1)
+ (li 1)
+ (ul 1)
+ (div 1)
+ (button 1)
+ (span 1)
+ (options 1)
+ (for-all 1)
+ (fdef 1)
+ (as-user 3)
+ (constraint-fn 1)))
+
+(defun midje-load-facts ()
+ "Load current namespace (or their test namespace) facts"
+ (interactive)
+ (cider-ensure-connected)
+ (when (buffer-file-name)
+ (let* ((ns (cider-current-ns))
+ (test-ns (if (or (projectile-test-file-p (buffer-file-name)) (string-prefix-p "postman." ns)) ns (format "%s-test" ns)))
+ (cmd (format "(do (midje.repl/forget-facts *ns* '%s) (midje.repl/load-facts '%s))" test-ns test-ns)))
+ (cider-interactive-eval cmd))))
+
+(defun helm-multi-swoop-projectile-all-files (&optional $query)
+ "Apply all opened buffers of the current project to helm-multi-swoop"
+ (interactive)
+ (setq helm-multi-swoop-query (helm-multi-swoop--get-query $query))
+ (if (require 'projectile nil 'noerror)
+ ;; set filter function that is used in projectile-project-buffers
+ (let ((projectile-buffers-filter-function #'identity))
+ (helm-multi-swoop--exec nil
+ :$query helm-multi-swoop-query
+ :$buflist (mapcar #'buffer-name
+ (projectile-project-buffers))))
+ (error "Package 'projectile' is not available")))
+
+(defun save-and-eval-clojure-buffer (&optional buffer)
+ (interactive)
+ (save-buffer buffer)
+ (cider-eval-buffer buffer))
+
+(defun euandreh/cider-test-run-focused-test (&optional buffer)
+ (interactive)
+ (save-buffer buffer)
+ (spacemacs/cider-test-run-focused-test))
+
+(defun save-and-test-elixir-buffer (&optional buffer)
+ (interactive)
+ (save-buffer buffer)
+ (alchemist-mix-test-this-buffer))
+
+(defun save-and-rerun-last-test (&optional buffer)
+ (interactive)
+ (save-buffer buffer)
+ (alchemist-mix-rerun-last-test))
+
+(defun save-all-buffers-without-always-asking-me-for-confirmation-damn-it ()
+ (interactive)
+ (save-some-buffers t))
+
+(defun euandreh/clear-repl-and-eval ()
+ (interactive)
+ (cider-find-and-clear-repl-output)
+ (cider-eval-defun-at-point))
+
+;; Taken from
+;; https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl
+(defun cider-figwheel-repl ()
+ (interactive)
+ (save-some-buffers)
+ (with-current-buffer (cider-current-repl-buffer)
+ (goto-char (point-max))
+ (insert "(require 'figwheel-sidecar.repl-api)
+ (figwheel-sidecar.repl-api/start-figwheel!) ; idempotent
+ (figwheel-sidecar.repl-api/cljs-repl)")
+ (cider-repl-return)))
+
+(defvar mode-pairs '(("\\.sbclrc$" . lisp-mode)
+ ("\\.tsx$" . typescript-mode)
+ ("\\.json\\.base$" . json-mode)
+ ("\\.lytex$" . latex-mode)
+ ("\\.ly$" . latex-mode)
+ ("rc$" . shell-script-mode)))
+
+(defvar paredit-modes '(lisp-mode
+ lisp-interaction-mode
+ emacs-lisp-mode
+ ;; scheme-mode
+ ielm-mode
+ clojure-mode
+ cider-mode
+ cider-repl-mode
+ clojurec-mode
+ clojurescript-mode
+ clojurex-mode
+ cider-clojure-interaction-mode))
+
+(defvar custom-el-files '("~/dev/nu/nudev/ides/emacs/nu.el"))
+
+(defvar custom-keybindings '(("C-x M-b" . ibuffer)
+ ("M-SPC" . (lambda () (interactive) (just-one-space -1)))
+ ("M-ç" . (lambda () (interactive) (find-file "~/annex/txt/TODOs.org")))
+ ("M-[" . (lambda () (interactive) (find-file "~/tmp/scratch.org")))
+ ("M-p" . interleave-mode)
+ ("C-i" . evil-jump-forward)
+
+ ;; tabbar-mode
+ ("C-<tab>" . tabbar-forward)
+ ("C-<iso-lefttab>" . tabbar-backward)
+
+ ;; Ctrl-Super-*
+ ("C-H-e" . (lambda () (interactive) (insert "∋")))
+ ("C-H-S-e" . (lambda () (interactive) (insert "∌")))
+ ("C-H-3" . (lambda () (interactive) (insert "♯")))
+ ("C-H-b" . (lambda () (interactive) (insert "♭")))
+
+ ;; Ctrl-Super-Alt-*
+ ("C-H-M-a" . (lambda () (interactive) (insert "α")))
+ ("C-H-M-b" . (lambda () (interactive) (insert "β")))
+ ("C-H-M-c" . (lambda () (interactive) (insert "γ")))
+ ("C-H-M-d" . (lambda () (interactive) (insert "δ")))
+ ("C-H-M-f" . (lambda () (interactive) (insert "ε")))))
+
+
+(defun dotspacemacs/user-config ()
+ "Configuration function for user code.
+This function is called at the very end of Spacemacs initialization after layers configuration.
+This is the place where most of your configurations should be done. Unless it is explicitly specified that a variable should be set before a package is loaded, you should place your code here."
+ (require 'git-link) ;; for git-link-*
+ (require 'clojure-mode) ;; for set-nu-clj-indent
+ (require 'org-indent) ;; for org-indent-mode
+ (require 'helm-swoop) ;; for custom helm-multi-swoop-projectile-all-files
+
+ (projectile-cleanup-known-projects)
+
+ (spacemacs/set-leader-keys
+ "fS" 'save-all-buffers-without-always-asking-me-for-confirmation-damn-it ;; 'save-some-buffers
+ "w/" 'split-window-right-and-focus
+ "w-" 'split-window-below-and-focus
+ "d" 'spacemacs/delete-window
+ "sS" 'helm-multi-swoop-projectile-all-files
+ "glh" 'git-link-homepage
+ "glp" 'git-link-pull-requests
+ "W" 'spacemacs/workspaces-transient-state/body)
+
+ (spacemacs/set-leader-keys-for-major-mode 'elixir-mode
+ "tb" 'save-and-test-elixir-buffer
+ "tr" 'save-and-rerun-last-test)
+
+ (spacemacs/set-leader-keys-for-major-mode 'typescript-mode
+ "." 'spacemacs/jump-to-definition
+ "," 'tide-jump-back)
+
+ ;; https://emacs.stackexchange.com/questions/17866/magit-how-to-use-systems-ssh-agent-and-dont-ask-for-password
+ (exec-path-from-shell-initialize)
+ (exec-path-from-shell-copy-env "SSH_AGENT_PID")
+ (exec-path-from-shell-copy-env "SSH_AUTH_SOCK")
+
+ ;; github layer
+ (exec-path-from-shell-copy-env "EMACS_GITHUB_TOKEN")
+
+ ;; https://github.com/syl20bnr/spacemacs/issues/774
+ (unless (file-exists-p (concat spacemacs-cache-directory "undo"))
+ (make-directory (concat spacemacs-cache-directory "undo")))
+
+ (add-hook 'org-mode-hook (lambda ()
+ (org-indent-mode 1)))
+
+ ;; https://emacs.stackexchange.com/questions/3747/how-to-disable-line-wrapping-in-spacemacs
+ (add-hook 'hack-local-variables-hook (lambda ()
+ (spacemacs/toggle-truncate-lines-off)))
+
+ (dolist (mode-pair mode-pairs)
+ (setq auto-mode-alist (cons mode-pair auto-mode-alist)))
+
+ (dolist (path custom-el-files)
+ (when (file-exists-p path)
+ (load path)))
+
+
+ (dolist (mode paredit-modes :done)
+ (let ((mode-hook (intern (concat (symbol-name mode) "-hook")))
+ (mode-map (intern (concat (symbol-name mode) "-map"))))
+ (eval-after-load mode '(set-custom-nu-clj-indent))
+ (eval-after-load mode '(sayid-setup-package))
+ (add-hook mode-hook 'paredit-mode)
+ (add-hook mode-hook (lambda ()
+ (rainbow-delimiters-mode 1)))
+ (spacemacs/set-leader-keys-for-major-mode mode
+ "E" 'euandreh/clear-repl-and-eval
+ "k" 'paredit-copy-as-kill
+ "K" 'paredit-copy-sexps-as-kill
+ "tm" 'midje-load-facts
+ "eb" 'save-and-eval-clojure-buffer
+ "tt" 'euandreh/cider-test-run-focused-test
+ "." 'spacemacs/jump-to-definition
+ "," 'cider-pop-back)))
+
+ ;; From the documentation:
+ ;; https://cider.readthedocs.io/en/latest/code_completion/
+ (global-set-key (kbd "TAB") #'company-indent-or-complete-common)
+ (add-hook 'cider-repl-mode-hook #'cider-company-enable-fuzzy-completion)
+ (add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion)
+
+ (dolist (keybinding custom-keybindings)
+ (global-set-key (kbd (car keybinding)) (cdr keybinding)))
+
+ (setq standard-indent 2
+ git-link-use-commit t
+ vc-follow-symlinks t
+ org-todo-keywords '((sequence "TODO" "NEXT" "WAITING" "INACTIVE" "CANCELLED" "MEETING" "DOING" "|" "DONE"))
+ default-truncate-lines nil
+ magit-diff-refine-hunk t
+
+ ;; Indentation
+ typescript-indent-level 2
+ js2-basic-offset 2
+ js-indent-level 2
+ css-indent-offset 2
+ web-mode-markup-indent-offset 2
+ web-mode-css-indent-offset 2
+ web-mode-code-indent-offset 2
+ web-mode-attr-indent-offset 2
+ perl6-indent-offset 2
+
+ ;; Clojure
+ cljr-warn-on-eval nil
+
+ ;; Common Lisp
+ inferior-lisp-program "ros -L sbcl -Q -l ~/.sbclrc run"
+ common-lisp-hyperspec-root (concat "file:" (expand-file-name "~/annex/docs/programming/hyperspec/HyperSpec/"))
+
+ ;; Persistent undo
+ undo-tree-auto-save-history t
+ undo-tree-history-directory-alist `(("." . ,(concat spacemacs-cache-directory "undo")))
+
+ ;; EMMS
+ emms-source-file-default-directory "~/annex/Banshee/queue/"
+ emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find
+ emms-browser-get-track-field-function #'emms-browser-get-track-field-use-directory-name
+
+ ;; org-mode
+ ;; Taken from:
+ ;; - http://cachestocaches.com/2016/9/my-workflow-org-agenda
+ ;; - http://doc.norang.ca/org-mode.html
+ org-agenda-files '("~/annex/txt/TODOs.org")
+ org-columns-default-format "%50ITEM(Task) %10CLOCKSUM %16TIMESTAMP_IA"
+ org-default-notes-file "~/annex/txt/TODOs.org"
+ org-diary-notes-file "~/annex/txt/Diary.org"
+ org-capture-templates '(("t" "TODO" entry (file org-default-notes-file)
+ "* TODO %?\n%u\n%a\n" :clock-in t :clock-resume t)
+ ("s" "Scratch" entry (file org-default-notes-file)
+ "* Scratch" :clock-in t :clock-resume t)
+ ("m" "Meeting" entry (file org-default-notes-file)
+ "* MEETING with %? :MEETING:\n%t" :clock-in t :clock-resume t)
+ ("d" "Diary" entry (file+datetree org-diary-notes-file)
+ "* %?\n%U\n" :clock-in t :clock-resume t)
+ ("i" "Idea" entry (file org-default-notes-file)
+ "* %? :IDEA: \n%t" :clock-in t :clock-resume t)
+ ("n" "Next Task" entry (file+headline org-default-notes-file "Tasks")
+ "** NEXT %? \nDEADLINE: %t")))
+
+ t)
+
+(defun dotspacemacs/emacs-custom-settings ()
+ "Emacs custom settings.
+This is an auto-generated function, do not modify its content directly, use
+Emacs customize menu instead.
+This function is called at the very end of Spacemacs initialization."
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(package-selected-packages
+ (quote
+ (pipenv yasnippet-snippets yapfify yaml-mode xterm-color ws-butler winum which-key web-mode web-beautify volatile-highlights vi-tilde-fringe uuidgen use-package unfill toml-mode toc-org tide tagedit symon swift-mode string-inflection sql-indent spaceline-all-the-icons smeargle slime-company slim-mode shell-pop selectric-mode scss-mode sayid sass-mode rvm ruby-tools ruby-test-mode ruby-refactor ruby-hash-syntax rubocop rspec-mode robe restclient-helm restart-emacs rbenv rake rainbow-delimiters racer pyvenv pytest pyenv-mode py-isort pug-mode psci psc-ide powershell pippel pip-requirements persp-mode perl6-mode pdf-tools password-generator paradox overseer orgit org-projectile org-present org-pomodoro org-mime org-download org-bullets org-brain open-junk-file ob-restclient ob-http ob-elixir nix-mode neotree nameless mwim multi-term mu4e-maildirs-extension mu4e-alert move-text mmm-mode minitest markdown-toc magit-gitflow magit-gh-pulls lorem-ipsum livid-mode live-py-mode linum-relative link-hint less-css-mode ledger-mode js2-refactor js-doc jinja2-mode intero interleave indent-guide importmagic impatient-mode hy-mode hungry-delete hlint-refactor hl-todo hindent highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-pydoc helm-purpose helm-projectile helm-nixos-options helm-mu helm-mode-manager helm-make helm-hoogle helm-gitignore helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag haskell-snippets google-translate golden-ratio gnuplot github-search github-clone gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe git-gutter-fringe+ gist gh-md fuzzy font-lock+ flyspell-correct-helm flycheck-rust flycheck-pos-tip flycheck-perl6 flycheck-mix flycheck-ledger flycheck-haskell flycheck-elm flycheck-credo flx-ido fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-org evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-exchange evil-escape evil-ediff evil-cleverparens evil-args evil-anzu eshell-z eshell-prompt-extras esh-help erlang emmet-mode elm-mode elisp-slime-nav elfeed-web elfeed-org elfeed-goodies editorconfig dumb-jump dockerfile-mode docker diminish diff-hl define-word dante cython-mode csv-mode counsel-projectile company-web company-tern company-statistics company-restclient company-plsense company-nixos-options company-lua company-ghci company-ghc company-cabal company-auctex company-ansible company-anaconda common-lisp-snippets column-enforce-mode coffee-mode cmm-mode clojure-snippets clojure-cheatsheet clj-refactor clean-aindent-mode cider-eval-sexp-fu chruby centered-cursor-mode cargo bundler browse-at-remote auto-yasnippet auto-highlight-symbol auto-dictionary auto-compile auctex-latexmk ansible-doc ansible alchemist aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line ac-ispell))))
+(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.
+ )
+)