Created
September 12, 2018 05:49
-
-
Save stingh711/d9172f02ee0c0bca28911d717e5e4597 to your computer and use it in GitHub Desktop.
my emacs configuration
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
(setq gc-cons-threshold 100000000) | |
;; 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. | |
(require 'package) | |
(package-initialize) | |
(setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/") | |
("melpa" . "http://elpa.emacs-china.org/melpa/") | |
("org" . "http://elpa.emacs-china.org/org/"))) | |
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) | |
(eval-when-compile | |
(require 'use-package)) | |
(use-package editorconfig | |
:ensure t | |
:init | |
(editorconfig-mode 1)) | |
(use-package request | |
:ensure t) | |
(use-package yaml-mode | |
:ensure t) | |
(use-package dockerfile-mode | |
:ensure t) | |
(use-package tabbar | |
:ensure t) | |
(use-package rainbow-delimiters | |
:ensure t | |
:init | |
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) | |
(defun django-open () | |
"Open django files in current app." | |
(interactive) | |
(find-file (read-file-name "Enter file name:"))) | |
(use-package evil | |
:ensure t | |
:config | |
(evil-mode 1) | |
(evil-set-initial-state 'calendar-mode 'emacs)) | |
(with-eval-after-load 'evil | |
(defalias #'forward-evil-word #'forward-evil-symbol)) | |
(use-package evil-numbers | |
:ensure t) | |
(use-package evil-surround | |
:ensure t | |
:config | |
(global-evil-surround-mode 1)) | |
(setq sql-postgres-login-params | |
'((user :default "postgres") | |
(database :default "postgres") | |
(server :default "127.0.0.1") | |
(port :default 5433))) | |
(use-package vimish-fold | |
:ensure t) | |
(use-package doom-themes | |
:ensure t | |
) | |
(use-package markdown-mode | |
:ensure t | |
:commands (markdown-mode gfm-mode) | |
:mode (("README\\.md\\'" . gfm-mode) | |
("\\.md\\'" . markdown-mode) | |
("\\.markdown\\'" . markdown-mode)) | |
:init (setq markdown-command "multimarkdown")) | |
(use-package dumb-jump | |
:ensure t) | |
;; (use-package helm | |
;; :ensure t | |
;; :init | |
;; (global-set-key (kbd "M-x") 'helm-M-x) | |
;; (global-set-key (kbd "C-x C-f") 'helm-find-files) | |
;; (setq helm-mode-fuzzy-match t) | |
;; (setq helm-imenu-fuzzy-match t) | |
;; (setq helm-recentf-fuzzy-match t) | |
;; (setq helm-completion-in-region-fuzzy-match t) | |
;; (setq helm-candidate-number-list 50)) | |
(use-package which-key | |
:ensure t | |
:init | |
(setq which-key-separator " ") | |
(setq which-key-prefix-prefix "+") | |
:config | |
(which-key-mode)) | |
(use-package yasnippet | |
:ensure t | |
:init | |
(yas-global-mode 1)) | |
(use-package yasnippet-snippets | |
:ensure t) | |
(use-package company | |
:ensure t | |
:init | |
(setq company-minimum-prefix-length 2) | |
(setq company-tooltip-limit 20) | |
(setq company-idle-delay 0.1) | |
(setq company-show-numbers t) | |
(setq company-tooltip-limit 6) | |
(setq tab-always-indent 'complete) | |
(setq company-dabbrev-downcase nil) | |
(add-to-list 'completion-styles 'initials t) | |
(add-hook 'after-init-hook 'global-company-mode)) | |
(with-eval-after-load 'company | |
(define-key company-active-map (kbd "M-n") nil) | |
(define-key company-active-map (kbd "M-p") nil) | |
(define-key company-active-map (kbd "C-n") #'company-select-next) | |
(define-key company-active-map (kbd "C-p") #'company-select-previous)) | |
(use-package company-statistics | |
:ensure t | |
:init | |
(company-statistics-mode)) | |
(use-package alchemist | |
:ensure t) | |
;; (use-package ycmd | |
;; :ensure t | |
;; :init | |
;; (add-hook 'after-init-hook #'global-ycmd-mode)) | |
;; (set-variable 'ycmd-server-command '("python" "C:/Users/lihon/.vim/bundle/youcompleteme/third_party/ycmd/ycmd/")) | |
;; (use-package company-ycmd | |
;; :ensure t | |
;; :init | |
;; (company-ycmd-setup)) | |
(use-package company-tern | |
:ensure t | |
:init | |
(add-to-list 'company-backends 'company-tern)) | |
(use-package anaconda-mode | |
:ensure t | |
:init | |
(setq python-shell-completion-native-disabled-interpreters '("python"))) | |
(use-package company-anaconda | |
:ensure t) | |
(eval-after-load "company" | |
'(add-to-list 'company-backends 'company-anaconda)) | |
(add-hook 'python-mode-hook 'anaconda-mode) | |
(use-package projectile | |
:ensure t) | |
(add-to-list 'projectile-globally-ignored-directories "node_modules") | |
(add-to-list 'projectile-globally-ignored-directories "__pycache__") | |
(add-to-list 'projectile-globally-ignored-files "*.pyc") | |
;; (use-package helm-projectile | |
;; :ensure t) | |
(use-package org | |
:ensure t) | |
(use-package org-journal | |
:ensure t | |
:init | |
(with-eval-after-load 'ox)) | |
(use-package ox-reveal | |
:ensure t | |
:init | |
(setq org-reveal-root "file:///d:/Applications/reveal.js-3.6.0")) | |
(use-package ox-hugo | |
:ensure t) | |
(use-package magit | |
:ensure t | |
:init | |
(setq magit-refresh-status-buffer nil) | |
(setq auto-revert-buffer-list-filter 'magit-auto-revert-repository-buffer-p)) | |
(use-package ag | |
:ensure t) | |
(add-to-list 'exec-path "c:/Program Files (x86)/Aspell/bin/") | |
(setq ispell-program-name "aspell") | |
(use-package ispell | |
:ensure t) | |
;; (use-package py-yapf | |
;; :ensure t | |
;; :init | |
;; (add-hook 'python-mode-hook 'py-yapf-enable-on-save)) | |
;;Use black to replace yapf | |
(require 'blacken) | |
(add-hook 'python-mode-hook #'blacken-mode) | |
(use-package py-isort | |
:ensure t | |
:init) | |
(use-package js2-mode | |
:ensure t | |
:init | |
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) | |
(add-hook 'js2-mode-hook #'js2-imenu-extras-mode)) | |
(use-package rjsx-mode | |
:ensure t | |
:init | |
(add-to-list 'auto-mode-alist '("routes\\/.*\\.js\\'" . rjsx-mode)) | |
(add-to-list 'auto-mode-alist '("pages\\/.*\\.js\\'" . rjsx-mode)) | |
(add-to-list 'auto-mode-alist '("components\\/.*\\.js\\'" . rjsx-mode)) | |
) | |
(use-package import-js | |
:ensure t) | |
(use-package prettier-js | |
:ensure t | |
:init | |
(add-hook 'rjsx-mode-hook 'prettier-js-mode) | |
(add-hook 'js2-mode-hook 'prettier-js-mode)) | |
(use-package flycheck | |
:ensure t | |
:init | |
(global-flycheck-mode) | |
(setq flycheck-highlighting-mode 'lines)) | |
(use-package define-word | |
:ensure t) | |
(use-package avy | |
:ensure t) | |
(setq-default flycheck-disabled-checkers | |
(append flycheck-disabled-checkers | |
'(javascript-jshint python-flake8))) | |
;(flycheck-add-mode 'javascript-eslint 'rjsx-mode) | |
;(flycheck-add-mode 'javascript-eslint 'js2-mode) | |
(use-package emmet-mode | |
:ensure t) | |
(defun setup-js2-mode () | |
;;(flycheck-select-checker 'javascript-eslint) | |
;;(flycheck-mode) | |
(prettier-js-mode)) | |
(defun setup-rjsx-mode () | |
;;(flycheck-select-checker 'javascript-eslint) | |
;;(flycheck-mode) | |
(prettier-js-mode)) | |
(add-hook 'js2-mode-hook #'setup-js2-mode) | |
(add-hook 'rjsx-mode-hook #'setup-rjsx-mode) | |
(use-package smartparens | |
:ensure t | |
:init | |
(add-hook 'emacs-lisp-mode #'smartparens-mode) | |
(add-hook 'js2-mode #'smartparens-mode) | |
(add-hook 'rjsx-mode #'smartparens-mode) | |
(add-hook 'python-mode #'smartparens-mode)) | |
(use-package restclient | |
:ensure t) | |
(use-package dart-mode | |
:ensure t | |
:init | |
(setq dart-sdk-path "d:/Applications/flutter/bin/cache/dart-sdk/") | |
(setq dart-formatter-command-override "d:/Applications/flutter/bin/cache/dart-sdk/bin/dartfmt.bat")) | |
;; Auto generated by cnfonts | |
;; <https://github.com/tumashu/cnfonts> | |
(set-face-attribute | |
'default nil | |
:font (font-spec :name "-outline-Fantasque Sans Mono-bold-italic-normal-mono-*-*-*-*-c-*-iso10646-1" | |
:weight 'normal | |
:slant 'normal | |
:size 14.0)) | |
(dolist (charset '(kana han symbol cjk-misc bopomofo)) | |
(set-fontset-font | |
(frame-parameter nil 'font) | |
charset | |
(font-spec :name "-outline-FangSong-normal-normal-normal-mono-*-*-*-*-c-*-iso10646-1" | |
:weight 'normal | |
:slant 'normal | |
:size 16.5))) | |
;; (use-package cnfonts | |
;; :ensure t | |
;; :init | |
;; (cnfonts-enable)) | |
(use-package ledger-mode | |
:ensure t) | |
(use-package counsel-projectile | |
:ensure t | |
:init | |
(global-set-key (kbd "M-x") 'counsel-M-x) | |
(global-set-key (kbd "C-s") 'counsel-grep-or-swiper) | |
(global-set-key (kbd "C-x C-f") 'counsel-find-file)) | |
(use-package counsel-etags | |
:ensure t) | |
(use-package smex | |
:ensure t) | |
(defun radian-enter-and-indent-sexp (&rest _ignored) | |
"New line and indent." | |
(newline) | |
(indent-according-to-mode) | |
(forward-line -1) | |
(indent-according-to-mode)) | |
(dolist (mode '(js2-mode rjsx-mode)) | |
(sp-local-pair mode "{" nil :post-handlers | |
'((radian-enter-and-indent-sexp "RET") | |
(radian-enter-and-indent-sexp "<return>")))) | |
(use-package expand-region | |
:ensure t | |
:init | |
(global-set-key (kbd "C-=") 'er/expand-region)) | |
(use-package highlight-indentation | |
:ensure t) | |
(use-package leuven-theme | |
:ensure t) | |
(use-package gruvbox-theme | |
:ensure t) | |
(use-package go-mode | |
:ensure t) | |
(use-package company-go | |
:ensure t) | |
(use-package web-mode | |
:ensure t | |
:init | |
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))) | |
;; Custom keybinding | |
(use-package general | |
:ensure t | |
:config (general-define-key | |
:states '(normal visual insert emacs) | |
:prefix "SPC" | |
:non-normal-prefix "M-SPC" | |
;; "/" '(counsel-rg :which-key "ripgrep") ; You'll need counsel package for this | |
"TAB" '(switch-to-prev-buffer :which-key "previous buffer") | |
"SPC" '(counsel-M-x :which-key "M-x") | |
;; "pf" '(helm-projectile-find-file :which-key "find files") | |
"gd" '(dumb-jump-go :which-key "dumb jump go") | |
"ag" '(counsel-ag :which-key "ag") | |
"rg" '(counsel-rg :which-key "rg") | |
"ff" '(counsel-projectile-find-file :which-key "find files") | |
"si" '(py-isort-buffer :which-key "sort imports") | |
"ss" '(counsel-grep-or-swiper :which-key "swiper") | |
;; "tt" '(helm-etags-select :which-key "select etags") | |
;; "im" '(helm-imenu :which-key "helm imenu") | |
"im" '(counsel-imenu :which-key "helm imenu") | |
;; "rf" '(helm-recentf :which-key "recent files") | |
"rf" '(counsel-recentf :which-key "recent files") | |
"jj" '(org-journal-new-entry :which-key "new journal entry") | |
"aw" '(avy-goto-word-1 :which-key "avy word mode") | |
"al" '(avy-goto-line :which-key "avy line mode") | |
"df" '(django-open :which-key "open file for django") | |
;; Buffers | |
;; "bb" '(helm-buffers-list :which-key "buffers list") | |
"bb" '(counsel-ibuffer :which-key "buffers list") | |
"bd" '(evil-delete-buffer :which-key "delete buffer") | |
;; Window | |
"hh" '(windmove-left :which-key "move left") | |
"wl" '(windmove-right :which-key "move right") | |
"wh" '(windmove-left :which-key "move left") | |
"wk" '(windmove-up :which-key "move up") | |
"wj" '(windmove-down :which-key "move bottom") | |
"w/" '(split-window-right :which-key "split right") | |
"w-" '(split-window-below :which-key "split bottom") | |
"wx" '(delete-window :which-key "delete window") | |
)) | |
(use-package zoom | |
:ensure t | |
:init | |
(custom-set-variables '(zoom-mode t))) | |
(setq make-backup-files nil) | |
(global-linum-mode t) | |
(setq inhibit-startup-message t) | |
(set-terminal-coding-system 'utf-8) | |
(set-keyboard-coding-system 'utf-8) | |
(prefer-coding-system 'utf-8) | |
(set-buffer-file-coding-system 'utf-8) | |
(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. | |
'(ansi-color-faces-vector | |
[default default default italic underline success warning error]) | |
'(custom-enabled-themes (quote (spacemacs-dark))) | |
'(custom-safe-themes | |
(quote | |
("fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "cd736a63aa586be066d5a1f0e51179239fe70e16a9f18991f6f5d99732cabb32" "93a0885d5f46d2aeac12bf6be1754faa7d5e28b27926b8aa812840fe7d0b7983" "2c88b703cbe7ce802bf6f0bffe3edbb8d9ec68fc7557089d4eaa1e29f7529fe1" "ecba61c2239fbef776a72b65295b88e5534e458dfe3e6d7d9f9cb353448a569e" "b4c13d25b1f9f66eb769e05889ee000f89d64b089f96851b6da643cee4fdab08" "fe666e5ac37c2dfcf80074e88b9252c71a22b6f5d2f566df9a7aa4f9bea55ef8" "3a3de615f80a0e8706208f0a71bbcc7cc3816988f971b6d237223b6731f91605" "a566448baba25f48e1833d86807b77876a899fc0c3d33394094cf267c970749f" "a3fa4abaf08cc169b61dea8f6df1bbe4123ec1d2afeb01c17e11fdc31fc66379" "f0dc4ddca147f3c7b1c7397141b888562a48d9888f1595d69572db73be99a024" "6b289bab28a7e511f9c54496be647dc60f5bd8f9917c9495978762b99d8c96a0" default))) | |
'(fci-rule-color "#65737E") | |
'(jdee-db-active-breakpoint-face-colors (cons "#1B2229" "#D08770")) | |
'(jdee-db-requested-breakpoint-face-colors (cons "#1B2229" "#A3BE8C")) | |
'(jdee-db-spec-breakpoint-face-colors (cons "#1B2229" "#4f5b66")) | |
'(js-indent-level 2) | |
'(package-selected-packages | |
(quote | |
(evil-numbers evil-number web-mode alchemist evil-surround yaml-mode dockerfile-mode company-go go-mode rainbow-delimiters rainbow-delimiters-mode tabbar gruvbox-theme leuven-theme spacemacs-theme color-theme-modern highlight-identation expand-region org ox-reveal zoom request request\.el vimish-fold dumb-jump markdown-mode cheat-sh smex counsel-etags pyim true counsel-projectile import-js ledger-mode emmet-mode company-dart dart-mode company-tern define-word flycheck restclient restclien prettier-js py-isort smartparens smartparens-config rjsx-mode ag magit exec-path-from-shell elpy yasnippet-snippets company-jedi ox-hugo org-journal company-anaconda anaconda-mode projectile company yasnippet which-key use-package evil doom-themes))) | |
'(projectile-mode t nil (projectile)) | |
'(smartparens-global-mode t) | |
'(sql-postgres-program "C:\\Program Files\\PostgreSQL\\10\\bin\\psql") | |
'(vc-annotate-background "#2F3841") | |
'(vc-annotate-color-map | |
(list | |
(cons 20 "#A3BE8C") | |
(cons 40 "#bbbe86") | |
(cons 60 "#d3be80") | |
(cons 80 "#ECBE7B") | |
(cons 100 "#e2ab77") | |
(cons 120 "#d99973") | |
(cons 140 "#D08770") | |
(cons 160 "#cc8294") | |
(cons 180 "#c97db8") | |
(cons 200 "#c678dd") | |
(cons 220 "#c370b6") | |
(cons 240 "#c16890") | |
(cons 260 "#BF616A") | |
(cons 280 "#a35f69") | |
(cons 300 "#875e68") | |
(cons 320 "#6b5c67") | |
(cons 340 "#65737E") | |
(cons 360 "#65737E"))) | |
'(vc-annotate-very-old-color nil) | |
'(zoom-mode t nil (zoom))) | |
(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 "Fira Code Retina" :foundry "outline" :slant normal :weight normal :height 203 :width normal))))) | |
(put 'narrow-to-page 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment