Skip to content

Instantly share code, notes, and snippets.

@oblique63
Last active March 10, 2021 02:17
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save oblique63/ea3024cf77e41f63f8367269db2bece9 to your computer and use it in GitHub Desktop.
Save oblique63/ea3024cf77e41f63f8367269db2bece9 to your computer and use it in GitHub Desktop.
Spacemacs config
;; -*- 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
;; 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
;; 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. If it is the symbol `all' instead
;; of a list then all discovered layers will be installed.
dotspacemacs-configuration-layers
'(
graphviz
;; python
;; agda
auto-completion
;; asciidoc
better-defaults
;; c-c++
colors
;; csharp
dash
deft
;; django
;; elm
emacs-lisp
;; floobits
;; fsharp
git
;; gtags
haskell
;; html
ibuffer
;; idris
;; java
;; javascript
imenu-list
;; latex
markdown
;; nixos
org
;; pandoc
;; php
;; purescript
;; python
;; racket
;; restclient
;; search-engine
semantic
spell-checking
;; sql
syntax-checking
themes-megapack
;; vagrant
version-control
yaml
;;;; Custom
;; hledger
;; math-writing
;; php-stuff
)
;;;; PACKAGES =================================
;; 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'.
dotspacemacs-additional-packages
'(
;;;; Misc.
;; ag
beacon
;; calfw
;; calfw-gcal
cheatsheet
;; cycle-resize
;; default-text-scale
dired-hacks-utils
;; discover
discover-my-major
;; flyspell-lazy
;; flyspell-popup
;; gitconfig-mode
;; gist
;; hackernews
;; helm-chrome
helm-dictionary
helm-fuzzier
helpful
;; hideshowvis
ibuffer-git
;; mode-icons
;; paperless
;; pastebin
;; pocket-mode
;; pocket-reader
;; project-explorer
pt
;; resize-window
;; string-inflection
;; stripe-buffer
swiper
swiper-helm
;; swoop
;; synonymous
;; theme-changer
;; try
vline
;;;; Web / Markup
;; ac-html
;; ac-math
;; chm-view
;; company-math
;; company-web
;; csv-nav
;; dokuwiki
;; dokuwiki-mode
;; flycheck-ledger
;; ham-mode
;; httprepl
;; mkdown
;; markdown-toc
;; mediawiki
;; show-css
;; stylus-mode
;; tern
;; tern-context-coloring
;; toml-mode
;; try
;; web-beautify
;; yaml-mode
;;;; Org-mode
evil-org
;; fauntain-mode
;; helm-org-rifle
;; langtool
;; muse
;; olivetti
;; org-autolist
;; org-ac
;; org-agenda-property
org-beautify-theme
;; org-board
org-bookmark-heading
org-brain
;; org-dashboard
org-mind-map
;; org-page
;; org-preview-html
;; org-ref
;; org-super-agenda
;; org-time-budgets
;; org-toodledo
;; org-transform-tree-table
;; orgnav
outshine
;; ox-asciidoc
;; ox-gfm
;; ox-ioslide
;; ox-mediawiki
;; ox-twiki
;; writegood-mode
;;;; C/C++
;; auto-complete-c-headers
;; auto-complete-clang
;; auto-complete-exuberant-ctags
;; cff
;; clang-format
;; company-c-headers
;; company-irony
;; flycheck-irony
;; ctags
;; function-args
;; irony
;;;; Haskell
;; company-ghci
ebal
;; flycheck-ghcmod
;; flycheck-liquidhs
;; flycheck-stack
;; ghc-imported-from
;; ghci-completion
hasky-extensions
;; helm-ghc
;; helm-hoogle
liquid-types
;;;; Other Languages
;; company-coq
;; dart-mode
;; fish-mode
;; flycheck-plantuml
flycheck-purescript
graphviz-dot-mode
;; fstar-mode
;; plantuml-mode
;; tawny-owl
;;;; Themes
airline-themes
arjen-grey-theme
atom-dark-theme
atom-one-dark-theme
;; aurora-theme
badger-theme
base16-theme
blackboard-theme
caroline-theme
challenger-deep-theme
circadian
creamsody-theme
danneskjold-theme
;; darkone-theme
doom-themes
exotica-theme
eziam-theme
foggy-night-theme
forest-blue-theme
hamburg-theme
idea-darkula-theme
kaolin-themes
kooten-theme
labburn-theme
liso-theme
mandm-theme
melancholy-theme
metalheart-theme
;; moe-theme
nord-theme
nyx-theme
;; oceanic-theme
paganini-theme
peacock-theme
;; per-buffer-theme
prassee-theme
railscasts-reloaded-theme
rebecca-theme
remember-last-theme
rimero-theme
seoul256-theme
snazzy-theme
sourcerer-theme
sublime-themes
sunburn-theme
suscolors-theme
ubuntu-theme
waher-theme
warm-night-theme
yoshi-theme
zerodark-theme
zweilight-theme
;; Local
)
;; A list of packages and/or extensions that will not be install and loaded.
;;dotspacemacs-excluded-packages '(
;; php-extras
;;)
;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
;; are declared in a layer which is not a member of
;; the list `dotspacemacs-configuration-layers'. (default t)
dotspacemacs-delete-orphan-packages t))
(defun dotspacemacs/init ()
"Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration.
You should not put any user code in there besides modifying the variable
values."
;; 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.
dotspacemacs-elpa-timeout 5
;; 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'.
dotspacemacs-elpa-subdirectory nil
;; One of `vim', `emacs' or `hybrid'. Evil is always enabled but if the
;; variable is `emacs' then the `holy-mode' is enabled at startup. `hybrid'
;; uses emacs key bindings for vim's insert mode, but otherwise leaves evil
;; unchanged. (default 'vim)
dotspacemacs-editing-style 'hybrid
;; If non nil output loading progress in `*Messages*' buffer. (default nil)
dotspacemacs-verbose-loading nil
;; 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 '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 . 7)
(projects . 5)
(bookmarks . 10))
;; True if the home buffer should respond to resize events.
dotspacemacs-startup-buffer-responsive t
;; Default major mode of the scratch buffer (default `text-mode')
dotspacemacs-scratch-mode 'org-mode
;; THEMES =====================================
;; 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. Alternatively,
;; press <SPC> T s to show the full list of installed themes to choose from.
dotspacemacs-themes '(
suscolors
alect-dark
exotica
danneskjold
spolsky
snazzy
base16-bright
railscasts-reloaded
niflheim
yoshi
reverse
grandshell
lush
hc-zenburn
zenburn
darkburn
base16-solar-flare
peacock
railscasts
melancholy
arjen-gray
manoj-dark
tsdh-dark
odersky
gruber-darker
toxi
misterioso
kooten
paganini
tangotango
naquadah
inkpot
gruvbox
idea-darkula
wheatgrass
wombat
labburn
sunburn
seoul256
badwolf
rebecca
eziam-dark
waher
ample-zen
base16-harmonic16-dark
base16-hopscotch
base16-darktooth
kaolin-dark
kaolin-ocean
kaolin-eclipse
base16-eighties
base16-apathy
base16-atelier-sulphurpool
base16-atelier-lakeside
base16-solarized-dark
base16-atelier-forest
base16-atelier-estuary
base16-marrakesh-dark
base16-unikitty-dark
oceanic
obsidian
underwater
darktooth
mustang
base16-phd
flatland
ample
base16-isotope
majapahit-dark
sanityinc-tomorrow-eighties
base16-onedark
omtose-softer
omtose-darker
base16-ocean
base16-oceanicnext
base16-ashes
caroline
liso
soft-charcoal
spacemacs-dark
doom-one
doom-one-light
brin
material
base16-materia
base16-monokai
farmhouse-dark
base16-mocha
soothe
jazz
foggy-night
creamsody
hamburg
base16-brewer
base16-atelier-dune
badger
doom-molokai
smyx
base16-paraiso
zerodark
heroku
hemisu-dark
dracula
hickey
zonokai-blue
base16-summerfruit-dark
twilight-anti-bright
clues
molokai
base16-monokai-dark
base16-atelier-estuary
base16-atelier-plateau
base16-atelier-cave
sanityinc-tomorrow-night
atom-one-dark
base16-tomorrow-dark
firebelly
base16-embers
tango-2
base16-default-dark
seti
atom-dark
zerodark
deeper-blue
darkone
ample-flat
soft-charcoal
tango-dark
monokai
gotham
sanityinc-solarized-dark
solarized-dark
subatomic256
)
;; If non nil the cursor color matches the state color in GUI Emacs.
dotspacemacs-colorize-cursor-according-to-state t
;; FONTS ======================================
;; Default font. `powerline-scale' allows to quickly tweak the mode-line
;; size to make separators look not too crappy.
;; Other Fonts:
;; - Pointfree
;; - Fantasque Sans Mono
;; - Iosevka
;; - NovaMono
;; - Hack
;; - Kawkab Mono
;; - Office Code Pro
;; - Consola Mono
;; - Fira Code
;; - Hasklig
;; - Consolas
;; - Source Code Pro
;; - monoOne
;; - Agave
;; - ProFontWindows
;; - Hermit
;; - Sudo
;; - Luculent
;; - saxMono
;; - NanumGothic_coding
;; - Lekton
;; - Roboto Mono
dotspacemacs-default-font '("Fantasque Sans Mono"
:size 20
:weight normal
:width normal
:powerline-scale 1.1)
;; The leader key
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$'. (default t)
dotspacemacs-remap-Y-to-y$ t
;; 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 "Default"
;; 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 resume automatically upon
;; start. (default nil)
dotspacemacs-auto-resume-layouts nil
;; 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 1
;; 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 8
;; If non nil, `helm' will try to minimize the space it uses. (default nil)
dotspacemacs-helm-resize t
;; 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 'always
;; 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 nil
;; 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.5
;; 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 'right-then-bottom
;; 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 nil
;; 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 100
;; 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 75
;; 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 the
;; 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 t
;; Code folding method. Possible values are `evil' and `origami'.
;; (default 'evil)
dotspacemacs-folding-method 'origami
;; 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 'all
;; If non nil advises 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" "pt" "ack" "grep")
;; 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
;; 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 nil
))
(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 ()
"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 you code here."
;; FUNCTIONS ===================================
(defun get-current-file-name ()
(if (buffer-file-name)
(abbreviate-file-name (buffer-file-name))
"%b"))
(cua-selection-mode t)
;; VARIABLES ===================================
(setq-default
;;;; Editing
beacon-mode t
company-idle-delay 2
company-tooltip-idle-delay 2
;; company-tooltip-flip-when-above t
;; cua-enable-cua-keys nil
;; cua-highlight-region-shift-only t
cua-selection-mode t
;; cua-toggle-set-mark nil
global-visual-line-mode t
global-company-mode t
global-subword-mode t
;;;; Project Management
neo-smart-open t
neo-window-position 'right
neo-hidden-regexp-list
'("^\\." "^\\.vagrant$" "^\\.git$" "\\.pyc$" "~$" "^#.*#$" "\\.elc$")
projectile-global-mode t
projectile-switch-project-action 'neotree-projectile-action
;;;; Org-mode, Deft, and Markdown
deft-extensions '("md" "org" "txt" "tex")
deft-directory "p:/Notes"
deft-recursive t
deft-org-mode-title-prefix t
deft-markdown-mode-title-level 1
org-CUA-compatible t
org-directory "p:/Notes/Org"
org-use-sub-superscripts "{}"
org-startup-truncated nil
org-hide-emphasis-markers t
org-list-allow-alphabetical t
org-list-use-circular-motion t
org-tags-column -85
org-pretty-entities t
org-pretty-entities-include-sub-superscripts t
org-display-inline-images t
markdown-command "multimarkdown"
markdown-enable-math t
markdown-italic-underscore t
markdown-asymmetric-header t
;;;; UI
;; golden-ratio-mode t
helm-fuzzier-mode t
pe/side 'right
frame-title-format '(:eval (get-current-file-name))
;;;; Language-specific
ebal-operation-mode 'stack
haskell-process-type 'stack-ghci
;;;; Other
ispell-program-name "aspell"
ispell-personal-dictionary "~/mydict.ispell"
paradox-github-token "edafcc569ba407330ad8d13e809bb90d47fdb4e9"
)
;; HOOKS =======================================
;;;; Org Babel
;; (org-babel-do-load-languages
;; 'org-babel-load-languages
;; '(
;; (latex . t)
;; (ledger . t)
;; ))
;;;; Elm Mode
;; (add-hook 'elm-mode-hook #'flyspell-prog-mode)
;; (add-hook 'elm-mode-hook #'elm-oracle-setup-completion)
;; (add-to-list 'company-backends 'company-elm)
;; Emacs Lisp Mode
(add-hook 'emacs-lisp-mode-hook #'flyspell-prog-mode)
;;;; Haskell Mode
(add-hook 'haskell-mode-hook #'intero-mode)
(add-hook 'haskell-mode-hook #'hindent-mode)
(add-hook 'haskell-mode-hook #'subword-mode)
(add-hook 'haskell-mode-hook #'flyspell-prog-mode)
;; Markdown Mode
(add-hook 'markdown-mode-hook #'flyspell-correct-auto-mode)
;; Org Mode
(add-hook 'org-mode-hook #'org-indent-mode)
(add-hook 'org-mode-hook #'flyspell-correct-auto-mode)
;; Minor Modes
(add-hook 'outline-minor-mode-hook 'outshine-hook-function)
(add-hook 'prog-mode-hook 'outline-minor-mode)
;; KEYBINDINGS =================================
;;;; Global Keybindings
;; UI
(global-set-key (kbd "C-<tab>") #'evil-window-next)
(global-set-key (kbd "C-;") #'resize-window)
;; Editing
(global-set-key (kbd "S-<tab>") #'company-complete)
(global-set-key (kbd "C-c v") #'vline-mode)
(global-set-key (kbd "C-c g") #'glasses-mode)
;;(global-set-key (kbd "C-c C-t") #'origami-toggle-all-nodes)
(global-set-key (kbd "C-c C-w") #'delete-trailing-whitespace)
(global-set-key (kbd "C-c C-r") #'ivy-resume)
;; Evil Mode
;; (define-key evil-insert-state-map (kbd "g j") 'evil-next-visual-line)
;; (define-key evil-insert-state-map (kbd "<SPC> . v") #'vline-mode)
;; (define-key evil-insert-state-map (kbd "<SPC> . g") #'glasses-mode)
(define-key evil-insert-state-map (kbd "z A") #'origami-toggle-all-nodes)
;; Help / Info
(global-set-key (kbd "C-c s") #'cheatsheet-show)
(global-set-key (kbd "C-h C-m") #'discover-my-major)
(global-set-key (kbd "C-h M-m") #'discover-my-mode)
(global-set-key (kbd "C-c f") #'describe-function)
(global-set-key (kbd "C-c i") #'helm-info)
;; Files
(global-set-key (kbd "C-c n") #'deft)
(global-set-key (kbd "C-c C-b") #'helm-bookmarks)
;;;; Default Key Changes
(global-unset-key (kbd "C-x b"))
(global-set-key (kbd "C-x b") #'helm-mini)
(global-unset-key (kbd "C-x C-f"))
(global-set-key (kbd "C-x C-f") #'helm-find-files)
(global-unset-key (kbd "C-s"))
(global-set-key (kbd "C-s") #'swiper)
;;;; Local Keybindings
;; Emacs Lisp Mode
(define-key emacs-lisp-mode-map (kbd "C-c C-v") #'describe-variable)
(define-key emacs-lisp-mode-map (kbd "C-c C-o") #'describe-option)
(define-key emacs-lisp-mode-map (kbd "C-c C-f") #'describe-function)
(define-key emacs-lisp-mode-map (kbd "C-c C-p") #'describe-package)
;; Flyspell Mode
(define-key flyspell-mode-map (kbd "C-c C-<tab>") #'helm-flyspell-correct)
(define-key flyspell-mode-map (kbd "C-;") #'flyspell-popup-correct)
;; Org-mode Keys
(defun set-org-keys ()
(local-set-key (kbd "C-c M-p") #'org-priority)
(local-set-key (kbd "C-c C-x r") #'org-mode-restart)
(local-set-key (kbd "C-c C-<spc>") #'helm-flyspell-correct)
;; Fix window-switching
(local-unset-key (kbd "C-<tab>"))
(local-set-key (kbd "C-<tab>") #'evil-window-next)
)
(add-hook 'org-mode-hook #'set-org-keys)
;; Haskell Mode
(defun set-haskell-keys ()
(local-set-key (kbd "C-c C-x C-f") #'hindent-reformat-decl)
(local-set-key (kbd "C-c C-x C-r") #'hindent-reformat-region)
(local-set-key (kbd "C-c C-x C-b") #'hindent-reformat-buffer)
(local-set-key (kbd "C-c e") #'ebal-execute)
(local-set-key (kbd "C-c l") #'haskell-process-load-file)
(local-set-key (kbd "C-c r") #'haskell-interactive-switch)
(local-set-key (kbd "C-c x") #'hasky-extensions)
;; (local-set-key (kbd "C-c r") #'intero-repl)
)
(add-hook 'haskell-mode-hook #'set-haskell-keys)
;;;; Cheatsheet Notes
(cheatsheet-add :group 'Show-Stuff
:key "C-c s"
:description "Show this cheatsheet")
(cheatsheet-add :group 'Show-Stuff
:key "C-h m"
:description "Describe Modes")
(cheatsheet-add :group 'Show-Stuff
:key "C-c n"
:description "Show notes (deft)")
(cheatsheet-add :group 'Show-Stuff
:key "C-c C-g"
:description "Deft refresh")
(cheatsheet-add :group 'Show-Stuff
:key "C-h C-m"
:description "Show Major-mode keybindings")
(cheatsheet-add :group 'Show-Stuff
:key "C-h M-m"
:description "Show mode keybindings")
(cheatsheet-add :group 'Show-Stuff
:key "<SPC> ?"
:description "Describe keybindings")
(cheatsheet-add :group 'Show-Stuff
:key "<SPC> f t"
:description "Toggle Neotree")
(cheatsheet-add :group 'Show-Stuff
:key "g r"
:description "Neotree: refresh")
(cheatsheet-add :group 'Show-Stuff
:key "R"
:description "Neotree: make root")
(cheatsheet-add :group 'Show-Stuff
:key "K"
:description "Neotree: select parent dir")
(cheatsheet-add :group 'Show-Stuff
:key "C-c c"
:description "Neotree: Select dir")
(cheatsheet-add :group 'Visual
:key "C-;"
:description "Resize window")
(cheatsheet-add :group 'Visual
:key "C-c v"
:description "Column highlight (vline-mode)")
(cheatsheet-add :group 'Visual
:key "C-c t"
:description "Fold node")
(cheatsheet-add :group 'Visual
:key "C-c t"
:description "Fold node")
(cheatsheet-add :group 'Visual
:key "C-c C-t"
:description "Fold all nodes")
(cheatsheet-add :group 'Visual
:key "C-c C-0 [+ -]"
:description "Adjust font size")
(cheatsheet-add :group 'Projects
:key "<SPC> p h"
:description "Select Project")
(cheatsheet-add :group 'Projects
:key "<SPC> p b"
:description "Switch to buffer")
(cheatsheet-add :group 'Org
:key "gl"
:description "Go to Next visible heading")
(cheatsheet-add :group 'Org
:key "gh"
:description "Move Up a heading level")
(cheatsheet-add :group 'Org
:key "gj / gk"
:description "NEXT/PREVIOUS same-level heading")
(cheatsheet-add :group 'Org
:key "^ / $"
:description "START/END of line")
(cheatsheet-add :group 'Org
:key ", h [I i]"
:description "Insert Heading ABOVE/BELOW")
(cheatsheet-add :group 'Org
:key "M-o"
:description "Insert Sub-heading")
(cheatsheet-add :group 'Org
:key "t"
:description "Insert TODO")
(cheatsheet-add :group 'Org
:key "T / M-t"
:description "Insert Heading/Sub-heading with TODO")
(cheatsheet-add :group 'Org
:key "M-h / M-l"
:description "Shift LEFT/RIGHT")
(cheatsheet-add :group 'Org
:key "M-k / M-J"
:description "Shift UP/DOWN")
(cheatsheet-add :group 'Org
:key "C-c -"
:description "Turn into list / cycle list style")
(cheatsheet-add :group 'Org
:key "C-c *"
:description "Turn into heading")
(cheatsheet-add :group 'Org
:key "C-c C-c"
:description "Toggle checkbox")
(cheatsheet-add :group 'Org
:key "C-c #"
:description "Update statistics")
(cheatsheet-add :group 'Org
:key "C-c C-t"
:description "Rotate TODO state")
(cheatsheet-add :group 'Org
:key ", :"
:description "Insert tags")
(cheatsheet-add :group 'Org
:key "C-u C-c C-q"
:description "Re-align tags")
(cheatsheet-add :group 'Org
:key ", [D P]"
:description "Insert Drawer / Property")
(cheatsheet-add :group 'Org
:key ", i [l f]"
:description "Insert Link / Footnote")
(cheatsheet-add :group 'Org
:key ", x [b i u s c]"
:description "Bold (*) / Italic(/) / Underline (_) / Strike (+) / Code (~)")
(cheatsheet-add :group 'Org
:key "C-u C-c C-q"
:description "Re-align Tags")
(cheatsheet-add :group 'Org
:key "C-c M-p [A B C] / <SPC>"
:description "Set/Remove priority")
(cheatsheet-add :group 'Org
:key "C-c C-x r"
:description "Restart Org-mode")
(cheatsheet-add :group 'Bookmarks
:key "C-x r m"
:description "Set bookmark at current location")
(cheatsheet-add :group 'Bookmarks
:key "C-x r b"
:description "Go to bookmark")
(cheatsheet-add :group 'Bookmarks
:key "C-x r l"
:description "List bookmarks")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment