-
Notifications
You must be signed in to change notification settings - Fork 1
/
.emacs
104 lines (92 loc) · 2.63 KB
/
.emacs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
;; Global settings
(blink-cursor-mode 0)
(column-number-mode t)
(menu-bar-mode 0)
(scroll-bar-mode 0)
(show-paren-mode t)
(tool-bar-mode 0)
(tooltip-mode 0)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(fset 'yes-or-no-p 'y-or-n-p)
(load-theme 'deeper-blue)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(setq gc-cons-threshold 20000000)
(setq-default indent-tabs-mode nil)
;; Melpa
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; use-package
(eval-when-compile (require 'use-package))
(setq use-package-always-ensure t)
;; Some missing emacs modes
(use-package dockerfile-mode)
(use-package haskell-mode)
(use-package yaml-mode)
;; Emacs wise completions
(use-package smex
:bind ("M-x" . smex))
(use-package flx-ido
:config
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil))
;; Project wise operations (open, find, replace, etc...)
(use-package projectile
:config
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(projectile-mode 1)
(setq projectile-use-git-grep t))
;; Git Integration
(use-package magit
:bind ("C-x g" . magit-status)
:init
(setq magit-repository-directories (quote (("~/projects" . 1))))
(setq initial-buffer-choice (quote magit-list-repositories))
(with-eval-after-load 'transient (transient-bind-q-to-quit)))
;; Code Snippets
(use-package yasnippet
:config
(yas-global-mode 1)
(use-package yasnippet-snippets))
;; Code Completions
(use-package company
:hook (after-init . global-company-mode)
:config
(setq company-idle-delay 0.0)
(setq company-minimum-prefix-length 1)
(use-package company-anaconda
:config
(add-to-list 'company-backends 'company-anaconda)))
;; JavaScript
(use-package rjsx-mode
:mode "\\.js[x]?\\'"
:config
(use-package add-node-modules-path
:hook rjsx-mode)
(use-package prettier-js
:hook (rjsx-mode . prettier-js-mode))
(use-package lsp-mode
:hook (rjsx-mode . lsp)
:config
(setq lsp-diagnostic-package :none)
(setq lsp-eldoc-enable-hover nil)
(setq lsp-enable-folding nil)
(setq lsp-enable-indentation nil)
(setq lsp-enable-on-type-formatting nil)
(setq lsp-enable-snippet nil)
(setq lsp-enable-text-document-color nil)
(setq lsp-flycheck-live-reporting nil)))
;; Python
(use-package python
:config
(use-package anaconda-mode
:hook ((python-mode)
(python-mode . anaconda-eldoc-mode)))
(use-package blacken
:hook (python-mode . blacken-mode))
(use-package isortify
:hook (python-mode . isortify-mode)))