Skip to content

Instantly share code, notes, and snippets.

@wildskyf
Created April 26, 2017 16:43
Show Gist options
  • Save wildskyf/84fea849d209ab7abaa057b1df70649f to your computer and use it in GitHub Desktop.
Save wildskyf/84fea849d209ab7abaa057b1df70649f to your computer and use it in GitHub Desktop.
wildsky's .spacemacs @ 4/27
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; `+distribution', `spacemacs-base', `spacemacs'
dotspacemacs-distribution 'spacemacs
;; `all', `unused', `nil'.
dotspacemacs-enable-lazy-installation 'unused
dotspacemacs-ask-for-lazy-installation t
dotspacemacs-configuration-layer-path '()
dotspacemacs-configuration-layers
'(
;; <SPC f e R> to reload
emacs-lisp
html
ivy
javascript
markdown
org
osx
ruby
rust
vimscript
yaml
better-defaults
git
(shell :variables
shell-default-height 30
shell-default-position 'bottom)
(auto-completion
:enabled-for javascript rust ruby
:disabled-for org markdown)
)
dotspacemacs-additional-packages '(
monokai-theme
editorconfig
elscreen
)
dotspacemacs-frozen-packages '()
dotspacemacs-excluded-packages '()
dotspacemacs-install-packages 'used-only))
(defun dotspacemacs/init ()
(setq-default
dotspacemacs-elpa-https t
dotspacemacs-elpa-timeout 5
dotspacemacs-check-for-update nil
dotspacemacs-elpa-subdirectory nil
;; vim, emacs, hybrid
dotspacemacs-editing-style 'vim
dotspacemacs-verbose-loading nil
dotspacemacs-startup-banner 'random
;; 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))
dotspacemacs-startup-buffer-responsive t
dotspacemacs-scratch-mode 'text-mode
dotspacemacs-themes '(monokai
spacemacs-light)
dotspacemacs-colorize-cursor-according-to-state t
dotspacemacs-default-font '("Input"
:size 13
:weight normal
:width normal
:powerline-scale 1.1)
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-remap-Y-to-y$ nil
dotspacemacs-retain-visual-state-on-shift t
dotspacemacs-visual-line-move-text nil
dotspacemacs-ex-substitute-global nil
dotspacemacs-default-layout-name "Default"
dotspacemacs-display-default-layout nil
dotspacemacs-auto-resume-layouts nil
dotspacemacs-large-file-size 1
dotspacemacs-auto-save-file-location 'cache
dotspacemacs-max-rollback-slots 5
dotspacemacs-helm-resize nil
dotspacemacs-helm-no-header t
dotspacemacs-helm-position 'bottom
dotspacemacs-helm-use-fuzzy 'always
dotspacemacs-enable-paste-transient-state nil
dotspacemacs-which-key-delay 0.4
dotspacemacs-which-key-position 'bottom
dotspacemacs-loading-progress-bar nil
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 t
dotspacemacs-line-numbers t
dotspacemacs-folding-method 'evil
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 'all
dotspacemacs-persistent-server nil
dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
dotspacemacs-default-package-repository nil
;; `all', `trailing', `changed', `nil'
dotspacemacs-whitespace-cleanup 'changed
))
(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 dotspacemacs/user-config ()
;; fix for helm-help stuck
(setq helm-echo-input-in-header-line nil)
;; def function
(defun copy-to-clipboard ()
"Copies selection to x-clipboard."
(interactive)
(if (display-graphic-p)
(progn
(message "Yanked region to x-clipboard!")
(call-interactively 'clipboard-kill-ring-save)
)
(if (region-active-p)
(progn
(shell-command-on-region (region-beginning) (region-end) "pbcopy")
(message "Yanked region to clipboard!")
(deactivate-mark))
(message "No region active; can't yank to clipboard!")))
)
(defun move-line-up ()
(interactive)
(transpose-lines 1)
(forward-line -2))
(defun move-line-down ()
(interactive)
(forward-line 1)
(transpose-lines 1)
(forward-line -1))
;; linum padding
(unless (display-graphic-p)
(setq linum-format "%3d "))
;; general settings
(display-time-mode 1)
(add-hook 'prog-mode-hook #'fci-mode) ;; Indicate fill column.
(setq make-backup-files nil)
(setq-default indent-tabs-mode nil)
(setq-default default-tab-width 2)
(setq scroll-margin 3
scroll-conservatively 9999
scroll-step 1)
(setq evil-emacs-state-cursor '("red" box))
(setq evil-normal-state-cursor '("green" box))
(setq evil-visual-state-cursor '("orange" box))
(setq evil-insert-state-cursor '("red" bar))
(setq evil-replace-state-cursor '("red" bar))
(setq evil-operator-state-cursor '("red" hollow))
;; keybinding
(evil-ex-define-cmd "tabe[dit]" 'make-frame)
(evil-leader/set-key "o y" 'copy-to-clipboard)
(global-set-key (kbd "S-<up>") 'move-line-up)
(global-set-key (kbd "S-<down>") 'move-line-down)
(global-set-key (kbd "<mouse-4>") 'previous-line)
(global-set-key (kbd "<mouse-5>") 'next-line)
(global-set-key (kbd "C-<down>") (lambda () (interactive) (next-line 5)))
(global-set-key (kbd "C-<up>") (lambda () (interactive) (previous-line 5)))
(define-key evil-visual-state-map (kbd "S-<up>")
(concat ":m '<-2" (kbd "RET") "gv=gv"))
(define-key evil-visual-state-map (kbd "S-<down>")
(concat ":m '>+1" (kbd "RET") "gv=gv"))
(define-key evil-normal-state-map (kbd "g T") 'next-multiframe-window)
(define-key evil-normal-state-map (kbd "g t") 'previous-multiframe-window)
(define-key evil-normal-state-map (kbd "<down>") 'evil-next-visual-line)
(define-key evil-normal-state-map (kbd "<up>") 'evil-previous-visual-line)
)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
(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
(reveal-in-osx-finder pbcopy osx-trash osx-dictionary launchctl yaml-mode xterm-color web-mode web-beautify vimrc-mode unfill toml-mode tagedit smeargle slim-mode shell-pop scss-mode sass-mode rvm ruby-tools ruby-test-mode rubocop rspec-mode robe rbenv rake racer pug-mode orgit org-projectile org-present org-pomodoro alert log4e gntp org-download mwim multi-term mmm-mode minitest markdown-toc markdown-mode magit-gitflow livid-mode skewer-mode simple-httpd less-css-mode json-mode json-snatcher json-reformat js2-refactor multiple-cursors js2-mode js-doc htmlize haml-mode gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link gh-md fuzzy evil-magit magit magit-popup git-commit with-editor eshell-z eshell-prompt-extras esh-help emmet-mode elscreen editorconfig dactyl-mode company-web web-completion-data company-tern dash-functional tern company-statistics company coffee-mode chruby cargo rust-mode bundler inf-ruby auto-yasnippet yasnippet ac-ispell auto-complete ws-butler winum which-key wgrep volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline powerline smex restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox spinner org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint ivy-hydra info+ indent-guide hydra hungry-delete hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation hide-comnt help-fns+ helm-make helm helm-core google-translate golden-ratio flx-ido flx 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-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg undo-tree eval-sexp-fu highlight elisp-slime-nav dumb-jump popup f s diminish define-word counsel-projectile projectile pkg-info epl counsel swiper ivy column-enforce-mode clean-aindent-mode bind-map bind-key auto-highlight-symbol auto-compile packed dash async aggressive-indent adaptive-wrap ace-window ace-link avy))))
(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.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment