Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Cmdv
Created October 30, 2019 21:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Cmdv/27efe12fd2113ec5ffa4ca73de8187b6 to your computer and use it in GitHub Desktop.
Save Cmdv/27efe12fd2113ec5ffa4ca73de8187b6 to your computer and use it in GitHub Desktop.
spacemacs setting 2019
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; 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
'(typescript
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press `SPC f e R' (Vim style) or
;; `M-m f e R' (Emacs style) to install them.
;; ----------------------------------------------------------------
;; (auto-completion :variables
;; auto-completion-return-key-behavior 'complete
;; auto-completion-tab-key-behavior 'cycle
;; auto-completion-complete-with-key-sequence nil
;; auto-completion-complete-with-key-sequence-delay 0.1
;; auto-completion-idle-delay nil
;; auto-completion-private-snippets-directory nil
;; auto-completion-enable-snippets-in-popup nil
;; auto-completion-enable-help-tooltip t
;; auto-completion-enable-sort-by-usage t)
auto-completion
(colors :variables
colors-enable-nyan-cat-progress-bar t)
emacs-lisp
better-defaults
dash
git
(javascript :variables
node-add-modules-path t
js2-basic-offset 2 ;; javascript indent
js-indent-level 2 ;; json indent
;; tern-command '("/Users/cmdv/.nvm/versions/node/v9.8.0/bin/node" "/Users/cmdv/.nvm/versions/node/v9.8.0/lib/node_modules/tern/bin/tern")
)
(haskell :variables
;; haskell-compile-cabal-build-command "stack build --fast --test --bench --no-run-tests --no-run-benchmarks --ghc-options=-ferror-spans ."
;; haskell-compile-command "stack exec ghc -- -Wall -ferror-spans -fforce-recomp -c %sbuild"
haskell-enable-hindent-style "johan-tibell"
haskell-completion-backend 'ghci
haskell-enable-shm-support t
haskell-process-type 'stack-ghci)
;; cabal built projects
;; haskell-enable-ghc-mod-support nil
;; haskell-process-path-cabal "/Users/cmdv/.local/bin//cabal"
;; haskell-process-type 'cabal-new-repl)
;; (haskell :variables
;; ;; haskell-enable-ghc-mod-support nil
;; haskell-completion-backend 'ghci
;; haskell-process-type 'stack-ghci
;; ;; haskell-process-path-ghci "stack"
;; ;; haskell-process-args-ghci '("ghci")
;; ;; haskell-process-args-stack-ghci "-v"
;; ;; haskell-process-args-cabal-repl '("--ghc-option=-ferror-spans")
;; ;; haskell-enable-ghci-ng-support t
;; haskell-enable-hindent-style 'johan-tibell
;; ;; haskell-enable-hindent t
;; haskell-indent-spaces 2
;; haskell-stylish-on-save 't
;; haskell-tags-on-save t
;; ;; haskell-compile-cabal-build-command "stack build"
;; haskell-process-path-stack "/usr/local/bin/stack")
helm
(html :packages (not impatient-mode)
:variables
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
web-mode-sql-indent-offset 2
web-mode-attr-value-indent-offset 2)
;; lsp
markdown
(osx :variables osx-use-option-as-meta nil)
(purescript :variables
purescript-add-import-on-completion nil)
react
search-engine
(shell :variables
shell-default-position 'right
shell-default-term-shell "/bin/zsh")
sql
syntax-checking
themes-megapack
theming
(version-control :variables
version-control-diff-tool 'diff-hl
version-control-diff-side 'left
version-control-global-margin t)
yaml
)
;; 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.
dotspacemacs-additional-packages '(
spaceline-all-the-icons
vue-mode
;; company-lsp
)
dotspacemacs-frozen-packages '()
dotspacemacs-excluded-packages '()
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 then enable support for the portable dumper. You'll need
;; to compile Emacs 27 from source following the instructions in file
;; EXPERIMENTAL.org at to root of the git repository.
;; (default nil)
dotspacemacs-enable-emacs-pdumper nil
;; File path pointing to emacs 27.1 executable compiled with support
;; for the portable dumper (this is currently the branch pdumper).
;; (default "emacs-27.0.50")
dotspacemacs-emacs-pdumper-executable-file "emacs-27.0.50"
;; Name of the Spacemacs dump file. This is the file will be created by the
;; portable dumper in the cache directory under dumps sub-directory.
;; To load it when starting Emacs add the parameter `--dump-file'
;; when invoking Emacs 27.1 executable on the command line, for instance:
;; ./emacs --dump-file=~/.emacs.d/.cache/dumps/spacemacs.pdmp
;; (default spacemacs.pdmp)
dotspacemacs-emacs-dumper-dump-file "spacemacs.pdmp"
dotspacemacs-elpa-https t
dotspacemacs-elpa-timeout 5
dotspacemacs-gc-cons '(100000000 0.1)
dotspacemacs-use-spacelpa nil
dotspacemacs-verify-spacelpa-archives nil
dotspacemacs-check-for-update nil
dotspacemacs-elpa-subdirectory 'emacs-version
dotspacemacs-editing-style 'vim
dotspacemacs-verbose-loading nil
dotspacemacs-startup-banner 'official
dotspacemacs-startup-lists '((recents . 10)
(projects . 7))
dotspacemacs-startup-buffer-responsive t
dotspacemacs-scratch-mode 'text-mode
dotspacemacs-initial-scratch-message nil
dotspacemacs-themes '(doom-city-lights
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 :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 '("Hack"
:size 12
:weight normal
:width normal
:powerline-scale 2.0)
dotspacemacs-leader-key "SPC"
dotspacemacs-emacs-command-key "SPC"
dotspacemacs-ex-command-key ":"
dotspacemacs-emacs-leader-key "M-m"
dotspacemacs-major-mode-leader-key ","
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
dotspacemacs-distinguish-gui-tab nil
dotspacemacs-default-layout-name "Default"
dotspacemacs-display-default-layout nil
dotspacemacs-auto-resume-layouts nil
dotspacemacs-auto-generate-layout-names nil
dotspacemacs-large-file-size 1
dotspacemacs-auto-save-file-location 'cache
;; Maximum number of rollback slots to keep in the cache. (default 5)
dotspacemacs-max-rollback-slots 5
dotspacemacs-enable-paste-transient-state nil
dotspacemacs-which-key-delay 0.1
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
dotspacemacs-loading-progress-bar t
dotspacemacs-fullscreen-at-startup nil
dotspacemacs-fullscreen-use-non-native nil
dotspacemacs-maximized-at-startup nil
dotspacemacs-active-transparency 90
dotspacemacs-inactive-transparency 90
dotspacemacs-show-transient-state-title t
dotspacemacs-show-transient-state-color-guide t
dotspacemacs-mode-line-unicode-symbols t
dotspacemacs-smooth-scrolling nil
;; 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 t
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
dotspacemacs-highlight-delimiters 'all
dotspacemacs-enable-server nil
dotspacemacs-server-socket-dir nil
;; If non-nil, advise quit functions to keep server open when quitting.
;; (default nil)
dotspacemacs-persistent-server nil
dotspacemacs-search-tools '("rg" "ag" "pt" "ack" "grep")
;; 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"
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
dotspacemacs-zone-out-when-idle nil
dotspacemacs-pretty-docs t))
(defun dotspacemacs/user-env ()
"Environment variables setup.
This function defines the environment variables for your Emacs session. By
default it calls `spacemacs/load-spacemacs-env' which loads the environment
variables declared in `~/.spacemacs.env' or `~/.spacemacs.d/.spacemacs.env'.
See the header of this file for more information."
(spacemacs/load-spacemacs-env))
(defun dotspacemacs/user-init ()
"Initialization for user code:
This function is called immediately after `dotspacemacs/init', before layer
configuration.
It is mostly for variables that should be set before packages are loaded.
If you are unsure, try setting them in `dotspacemacs/user-config' first."
;; custom hightlight
(setq
theming-modifications
'((doom-city-lights
(region :background "#316369"
:distant-foreground "#FFFFFF"))))
;; Space between line numbers and the content.
(setq-default nlinum-format "%d ")
;; PSC-IDE
(global-set-key (kbd "C-SPC") 'company-complete)
;; backups
(setq backup-directory-alist `(("." . "~/tmp"))
;; disable lockfiles .#
create-lockfiles nil
)
;; orgmode is so so slow with line number on large file - toggle them off
;; (add-hook 'org-mode-hook 'spacemacs/toggle-line-numbers-off 'append)
;; Hide .DS_Store
(setq
neo-show-hidden-files nil
neo-hidden-regexp-list '("\\.DS_Store$")
)
;; Pretty icons for neotree
(setq neo-theme 'icons)
)
(defun dotspacemacs/user-load ()
"Library to load while dumping.
This function is called only while dumping Spacemacs configuration. You can
`require' or `load' the libraries of your choice that will be included in the
dump."
)
;; (defun turn-off-evil-auto-indent ()
;; (setq-local evil-auto-indent nil))
(defun dotspacemacs/user-config ()
"Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."
;; add exec path
(add-to-list 'exec-path "/usr/local/bin/")
;; dissable stack flycheck
;; (setq-default flycheck-disabled-checkers '(haskell-stack-ghc))
(add-to-list 'exec-path "~/.local/bin/")
;; (add-to-list 'exec-path "/Users/cmdv/.local/bin/")
;; (setq lsp-haskell-process-path-hie "hie-core")
;; (setq lsp-haskell-process-args-hie '())
;; (require 'lsp)
;; (require 'lsp-haskell)
;; (add-hook 'haskell-mode-hook #'lsp)
;; Company completion backend for lsp-mode.
;; (require 'company-lsp)
;; (push 'company-lsp company-backends)
;; (add-hook 'haskell-mode-hook #'turn-off-evil-auto-indent)
;; (add-hook 'purescript-mode-hook #'turn-off-evil-auto-indent)
;; Haskell proper indentation
;; (defun haskell-evil-open-above ()
;; (interactive)
;; (evil-digit-argument-or-evil-beginning-of-line)
;; (haskell-indentation-newline-and-indent)
;; (evil-previous-line)
;; (haskell-indentation-indent-line)
;; (evil-append-line nil))
;; (defun haskell-evil-open-below ()
;; (interactive)
;; (evil-append-line nil)
;; (haskell-indentation-newline-and-indent))
;; (evil-define-key 'normal haskell-mode-map "o" 'haskell-evil-open-below
;; "O" 'haskell-evil-open-above)
;; Favorite indents for various modes.
(setq tab-always-indent t)
(setq c-basic-offset 2
sh-basic-offset 2)
(setq history-length 100)
;; (put 'minibuffer-history 'history-length 50)
;; (put 'evil-ex-history 'history-length 50)
;; (put 'kill-ring 'history-length 25)
(setq mouse-wheel-progressive-speed nil)
(setq projectile-git-submodule-command nil)
;; less resource intensive on larger projects
;; (setq flycheck-check-syntax-automatically '(save mode-enabled))
(setq flycheck-check-syntax-automatically '(save idle-change mode-enabled))
;; (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
;; specify default before save hooks
(add-hook 'before-save-hook
(lambda ()
;; general
(delete-trailing-whitespace)
;; haskell
(when (eq major-mode 'haskell-mode)
(haskell-sort-imports)
;; (haskell-mode-format-imports)
)
;; purscript
(when (eq major-mode 'purescript-mode)
(purescript-sort-imports)
(purescript-mode-format-imports))))
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
(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
(company-lsp company-quickhelp pos-tip helm-dash dash-docs dash-at-point zenburn-theme web-mode solarized-theme kaolin-themes json-navigator gruvbox-theme evil-nerd-commenter doom-modeline diff-hl counsel-projectile counsel swiper ivy ace-link smartparens magit powerline flycheck treemacs pfuture ace-window avy projectile dash visual-fill-column org-plus-contrib zen-and-art-theme yasnippet-snippets yaml-mode xterm-color ws-butler writeroom-mode winum white-sand-theme which-key web-beautify vue-mode volatile-highlights vi-tilde-fringe uuidgen utop use-package unfill underwater-theme ujelly-theme twilight-theme twilight-bright-theme twilight-anti-bright-theme tuareg treemacs-projectile treemacs-evil toxi-theme toc-org tide tao-theme tangotango-theme tango-plus-theme tango-2-theme tagedit symon sunny-day-theme sublime-themes subatomic256-theme subatomic-theme string-inflection sql-indent spaceline-all-the-icons spacegray-theme soothe-theme soft-stone-theme soft-morning-theme soft-charcoal-theme smyx-theme smeargle slim-mode shrink-path shell-pop seti-theme scss-mode sass-mode rjsx-mode reverse-theme reveal-in-osx-finder restart-emacs rebecca-theme rainbow-mode rainbow-identifiers rainbow-delimiters railscasts-theme purple-haze-theme pug-mode psci psc-ide professional-theme prettier-js popwin planet-theme phoenix-dark-pink-theme phoenix-dark-mono-theme persp-mode pcre2el password-generator paradox overseer osx-trash osx-dictionary organic-green-theme org-bullets open-junk-file omtose-phellack-theme oldlace-theme ocp-indent occidental-theme obsidian-theme noctilux-theme naquadah-theme nameless mwim mustang-theme multi-term move-text monokai-theme monochrome-theme molokai-theme moe-theme minimal-theme material-theme markdown-toc majapahit-theme magit-svn magit-gitflow madhat2r-theme macrostep lush-theme lorem-ipsum livid-mode link-hint light-soap-theme launchctl json-mode js2-refactor js-doc jbeans-theme jazz-theme ir-black-theme inkpot-theme indent-guide hungry-delete ht hlint-refactor hl-todo hindent highlight-parentheses highlight-numbers highlight-indentation hierarchy heroku-theme hemisu-theme helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-mode-manager helm-make helm-hoogle helm-gitignore helm-git-grep helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag hc-zenburn-theme haskell-snippets gruber-darker-theme grandshell-theme gotham-theme google-translate golden-ratio gitignore-templates gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe git-gutter-fringe+ gh-md gandalf-theme fuzzy font-lock+ flycheck-pos-tip flycheck-ocaml flycheck-haskell flx-ido flatui-theme flatland-theme fill-column-indicator farmhouse-theme fancy-battery eziam-theme eyebrowse expand-region exotica-theme evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-numbers evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens evil-args evil-anzu eval-sexp-fu espresso-theme eshell-z eshell-prompt-extras esh-help engine-mode emmet-mode elisp-slime-nav eldoc-eval editorconfig dumb-jump dracula-theme dotenv-mode doom-themes django-theme diminish darktooth-theme darkokai-theme darkmine-theme darkburn-theme dakrone-theme cyberpunk-theme company-web company-tern company-statistics company-ghci company-cabal column-enforce-mode color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized color-identifiers-mode cmm-mode clues-theme clean-aindent-mode cherry-blossom-theme centered-cursor-mode busybee-theme bubbleberry-theme browse-at-remote birds-of-paradise-plus-theme badwolf-theme auto-yasnippet auto-highlight-symbol auto-compile apropospriate-theme anti-zenburn-theme ample-zen-theme ample-theme alect-themes aggressive-indent afternoon-theme add-node-modules-path ace-jump-helm-line ac-ispell)))
'(safe-local-variable-values
(quote
((js-indent-level . 2)
(haskell-indent-spaces . 4)
(typescript-backend . tide)
(typescript-backend . lsp)
(javascript-backend . tern)
(javascript-backend . lsp)))))
(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.
'(region ((t (:background "#316369" :distant-foreground "#FFFFFF")))))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment