Last active
September 26, 2016 23:50
-
-
Save gizak/272ab7a66f74e0315eea to your computer and use it in GitHub Desktop.
My dotEmacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.org/packages/") t) | |
(when (< emacs-major-version 24) | |
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) | |
;; Added by Package.el. This must come before configurations of | |
;; installed packages. Don't delete this line. If you don't want it, | |
;; just comment it out by adding a semicolon to the start of the line. | |
;; You may delete these explanatory comments. | |
(package-initialize) | |
(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. | |
'(custom-safe-themes | |
(quote | |
("3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "c1390663960169cd92f58aad44ba3253227d8f715c026438303c09b9fb66cdfb" "bb08c73af94ee74453c90422485b29e5643b73b05e8de029a6909af6a3fb3f58" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default))) | |
'(indent-tabs-mode t) | |
'(inhibit-startup-screen t) | |
'(initial-scratch-message nil) | |
'(package-selected-packages | |
(quote | |
(twilight-bright-theme shell-pop color-theme-sanityinc-tomorrow company smartparens tide rainbow-delimiters rainbow-mode paradox paredit anzu auto-complete auto-highlight-symbol hl-line+ ido-vertical-mode indent-guide magit markdown-mode mic-paren neotree sml-modeline which-key yaml-mode auctex yasnippet))) | |
'(paradox-execute-asynchronously t) | |
'(paradox-github-token t) | |
'(scroll-bar-mode nil) | |
'(size-indication-mode t) | |
'(tab-width 4) | |
'(tool-bar-mode nil)) | |
(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. | |
'(default ((t (:family "SF Mono" :foundry "outline" :slant normal :weight normal :height 120 :width normal))))) | |
(prefer-coding-system 'utf-8) | |
(set-default-font "SF Mono 12") | |
;;(setq frame-title-format '("%f")) | |
(global-visual-line-mode t) | |
(global-linum-mode -1) | |
(indent-guide-global-mode) | |
(global-auto-revert-mode t) | |
(global-subword-mode t) | |
;; (global-hl-line-mode t) | |
(rainbow-mode t) | |
(global-set-key (kbd "s-b") 'ibuffer) | |
(setq ibuffer-expert t) | |
(load-theme 'sanityinc-tomorrow-night) | |
(fset 'yes-or-no-p 'y-or-n-p) | |
(setq confirm-nonexistent-file-or-buffer nil) | |
(setq kill-buffer-query-functions | |
(remq 'process-kill-buffer-query-function | |
kill-buffer-query-functions)) | |
(require 'mic-paren) | |
(paren-activate) | |
(require 'smartparens-config) | |
(smartparens-global-mode t) | |
(require 'popwin) | |
(popwin-mode 1) | |
(require 'auto-highlight-symbol) | |
(global-auto-highlight-symbol-mode t) | |
(require 'highlight-parentheses) | |
(global-highlight-parentheses-mode 1) | |
;; time | |
(display-time-mode t) | |
(setq display-time-24hr-format t) | |
(ido-vertical-mode) | |
(setq ido-vertical-define-keys 'C-n-C-p-up-down-left-right) | |
(global-anzu-mode +1) | |
(when (display-graphic-p) | |
(which-key-mode t)) | |
;; desktop mode | |
(desktop-save-mode 1) | |
(add-to-list 'desktop-modes-not-to-save 'dired-mode) | |
(add-to-list 'desktop-modes-not-to-save 'Info-mode) | |
(add-to-list 'desktop-modes-not-to-save 'info-lookup-mode) | |
(add-to-list 'desktop-modes-not-to-save 'fundamental-mode) | |
;; my macro | |
(fset 'cl | |
[?\C-a ?\C-@ ?\C-e ?\M-w return ?\C-y tab]) | |
(global-set-key "\C-cc" 'cl) | |
; ido and smex | |
(ido-mode 'both) | |
(ido-everywhere t) | |
(setq ido-ignore-buffers '("^ " "^\*" "Async Shell Command")) | |
(global-set-key (kbd "M-x") 'smex) | |
(setq ido-create-new-buffer 'always) | |
;; backup files dir | |
(setq backup-directory-alist (quote (("." . "~/.emacs.backups")))) | |
;; ac-mode | |
(require 'auto-complete) | |
(require 'auto-complete-config) | |
;;(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict") | |
(ac-config-default) | |
;; markdown-mode | |
;(autoload 'markdown-mode "markdown-mode" | |
; "Major mode for editing Markdown files" t) | |
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode)) | |
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) | |
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) | |
;(require 'yaml-mode) | |
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.yaml$" . yaml-mode)) | |
(add-hook 'before-save-hook 'delete-trailing-whitespace) | |
(global-set-key (kbd "s-n") 'next-buffer) | |
(global-set-key (kbd "s-p") 'previous-buffer) | |
(windmove-default-keybindings 'super) | |
(sml/setup) | |
;; neotree | |
(setq neo-show-hidden-files t) | |
(setq neo-vc-integration '(char)) | |
(setq neo-show-updir-line t) | |
(setq neo-theme 'ascii) | |
(setq neo-smart-open t) | |
(global-set-key [f8] 'neotree-toggle) | |
;; tide typescript | |
(defun setup-tide-mode () | |
(interactive) | |
(tide-setup) | |
(flycheck-mode +1) | |
(setq flycheck-check-syntax-automatically '(save mode-enabled)) | |
(eldoc-mode +1) | |
;; company is an optional dependency. You have to | |
;; install it separately via package-install | |
;; `M-x package-install [ret] company` | |
(company-mode +1)) | |
;; aligns annotation to the right hand side | |
(setq company-tooltip-align-annotations t) | |
;; formats the buffer before saving | |
(add-hook 'before-save-hook 'tide-format-before-save) | |
(add-hook 'typescript-mode-hook #'setup-tide-mode) | |
;; format options | |
(setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil)) | |
(setq w32-pass-lwindow-to-system nil) | |
(setq w32-pass-apps-to-system nil) | |
(setq w32-apps-modifier 'super) | |
(setq w32-lwindow-modifier 'super) ; Left Windows key | |
(when (fboundp 'windmove-default-keybindings) | |
(windmove-default-keybindings 'super)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment