Skip to content

Instantly share code, notes, and snippets.

@jkachmar
Last active July 29, 2016 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkachmar/7c050d6a696ebc881acb0a56083be5fe to your computer and use it in GitHub Desktop.
Save jkachmar/7c050d6a696ebc881acb0a56083be5fe to your computer and use it in GitHub Desktop.
Spacemacs dotfile
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-distribution 'spacemacs
dotspacemacs-configuration-layer-path '()
dotspacemacs-configuration-layers
'(
;; core settings
auto-completion
better-defaults
emacs-lisp
git
markdown
syntax-checking
version-control
vim-powerline
;; language layers
haskell
javascript
markdown
react
rust
)
dotspacemacs-additional-packages '(gruvbox-theme)
dotspacemacs-excluded-packages '()
dotspacemacs-delete-orphan-packages t))
(defun dotspacemacs/init ()
(setq-default
dotspacemacs-elpa-https t
dotspacemacs-elpa-timeout 5
dotspacemacs-check-for-update t
dotspacemacs-editing-style 'vim
dotspacemacs-verbose-loading nil
dotspacemacs-startup-banner 'official
dotspacemacs-startup-lists '(recents projects)
dotspacemacs-startup-recent-list-size 5
dotspacemacs-scratch-mode 'text-mode
dotspacemacs-themes '(gruvbox
spacemacs-dark)
dotspacemacs-colorize-cursor-according-to-state t
dotspacemacs-default-font '("Fira Code"
:size 14
:weight normal
:width normal
:powerline-scale 1.1)
dotspacemacs-leader-key "SPC"
dotspacemacs-emacs-leader-key "M-m"
dotspacemacs-major-mode-leader-key ","
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
dotspacemacs-command-key ":"
dotspacemacs-remap-Y-to-y$ t
dotspacemacs-default-layout-name "Default"
dotspacemacs-display-default-layout nil
dotspacemacs-auto-resume-layouts nil
dotspacemacs-auto-save-file-location 'cache
dotspacemacs-max-rollback-slots 5
dotspacemacs-use-ido nil
dotspacemacs-helm-resize nil
dotspacemacs-helm-no-header nil
dotspacemacs-helm-position 'bottom
dotspacemacs-enable-paste-micro-state nil
dotspacemacs-which-key-delay 0.4
dotspacemacs-which-key-position 'bottom
dotspacemacs-loading-progress-bar t
dotspacemacs-fullscreen-at-startup nil
dotspacemacs-fullscreen-use-non-native t
dotspacemacs-maximized-at-startup nil
dotspacemacs-active-transparency 90
dotspacemacs-inactive-transparency 90
;; If non nil unicode symbols are displayed in the mode line. (default t)
dotspacemacs-mode-line-unicode-symbols t
dotspacemacs-smooth-scrolling t
dotspacemacs-line-numbers t
dotspacemacs-smartparens-strict-mode nil
dotspacemacs-highlight-delimiters 'all
dotspacemacs-persistent-server nil
dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
dotspacemacs-default-package-repository nil
dotspacemacs-whitespace-cleanup nil
))
(defun dotspacemacs/user-init ()
)
(defun dotspacemacs/user-config ()
;; use eslint
(setq js2-mode-show-strict-warnings nil)
;; set javascript indentation
(setq-default js2-basic-offset 2)
(setq-default js-indent-level 2)
;; use ligatures (this is reaaaaal hacky, morty)
(when (window-system)
(set-default-font "Fira Code"))
(let ((alist '((33 . ".\\(?:\\(?:==\\|!!\\)\\|[!=]\\)")
(35 . ".\\(?:###\\|##\\|_(\\|[#(?[_{]\\)")
(36 . ".\\(?:>\\)")
(37 . ".\\(?:\\(?:%%\\)\\|%\\)")
(38 . ".\\(?:\\(?:&&\\)\\|&\\)")
(42 . ".\\(?:\\(?:\\*\\*/\\)\\|\\(?:\\*[*/]\\)\\|[*/>]\\)")
(43 . ".\\(?:\\(?:\\+\\+\\)\\|[+>]\\)")
;; (45 . ".\\(?:\\(?:-[>-]\\|<<\\|>>\\)\\|[<>}~-]\\)")
;; (46 . ".\\(?:\\(?:\\.[.<]\\)\\|[.=-]\\)")
(47 . ".\\(?:\\(?:\\*\\*\\|//\\|==\\)\\|[*/=>]\\)")
(48 . ".\\(?:x[a-zA-Z]\\)")
(58 . ".\\(?:::\\|[:=]\\)")
(59 . ".\\(?:;;\\|;\\)")
(60 . ".\\(?:\\(?:!--\\)\\|\\(?:~~\\|->\\|\\$>\\|\\*>\\|\\+>\\|--\\|<[<=-]\\|=[<=>]\\||>\\)\\|[*$+~/<=>|-]\\)")
(61 . ".\\(?:\\(?:/=\\|:=\\|<<\\|=[=>]\\|>>\\)\\|[<=>~]\\)")
(62 . ".\\(?:\\(?:=>\\|>[=>-]\\)\\|[=>-]\\)")
(63 . ".\\(?:\\(\\?\\?\\)\\|[:=?]\\)")
(91 . ".\\(?:]\\)")
(92 . ".\\(?:\\(?:\\\\\\\\\\)\\|\\\\\\)")
(94 . ".\\(?:=\\)")
(119 . ".\\(?:ww\\)")
(123 . ".\\(?:-\\)")
(124 . ".\\(?:\\(?:|[=|]\\)\\|[=>|]\\)")
(126 . ".\\(?:~>\\|~~\\|[>=@~-]\\)")
)
))
(dolist (char-regexp alist)
(set-char-table-range composition-function-table (car char-regexp)
`([,(cdr char-regexp) 0 font-shape-gstring]))))
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment