-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_emacs
89 lines (88 loc) · 2.63 KB
/
dot_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
;;; dot_emacs --- minimal
;;;
;;; This is my default .emacs file that sets up very little on its own
;;; as it expects emacs 27+ with prelude being loaded via
;;; .emacs.d/init.el. Learn more at https://github.com/bbatsov/prelude
;; load prelude
(load "~/.emacs.d/init.el")
;; variables
(setq-default cursor-type 'bar)
(setq prelude-flyspell nil)
(setq projectile-enable-caching t)
(set-default 'truncate-lines t)
(setq truncate-partial-width-windows nil)
(setq whitespace-line-column 99)
(setq whitespace-global-modes t)
;; built-in modes
(tool-bar-mode 0)
(scroll-bar-mode 0)
(menu-bar-mode 0)
(add-to-list 'auto-mode-alist '("\\.xml\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.csproj\\'" . nxml-mode))
;; use-package for convenient lazy-loading and installing packages
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)
(package-install 'quelpa-use-package))
(require 'quelpa-use-package)
(setq quelpa-use-package-inhibit-loading-quelpa t)
(quelpa-use-package-activate-advice)
;; theme
(use-package monokai-theme
:ensure t
:config
(load-theme 'monokai t))
;; 3p modes
;; copilot
(use-package copilot
:ensure t
:quelpa (copilot :fetcher github
:repo "zerolfx/copilot.el"
:branch "main"
:files ("dist" "*.el"))
:config
(load "~/.emacs.d/quelpa/build/copilot/copilot-balancer.el")
(load "~/.emacs.d/quelpa/build/copilot/copilot.el")
(add-hook 'prog-mode-hook 'copilot-mode)
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion))
;; elpy-mode for .py files
(use-package elpy
:ensure t
:config
(elpy-enable)
(add-hook 'python-mode-hook
(lambda ()
(elpy-mode)
(setq elpy-rpc-python-command "python3")
(setq elpy-rpc-virtualenv-path "~/.emacs.d/elpy/venv")
(flycheck-mode -1)
(setq flycheck-flake8-maximum-line-length 120)
(flymake-mode 1))))
;; switch-window
(use-package switch-window
:ensure t
:bind
(("C-x o" . switch-window))
:config
(setq switch-window-shortcut-style 'qwerty)
(setq switch-window-timeout nil))
;; better search
(use-package swiper
:ensure t
:bind (("C-s" . swiper)))
;; better M-x completion
(use-package smex
:ensure t
:bind
(("M-x" . smex)
("M-X" . smex-major-mode-commands))
:config
(smex-initialize))
;; helm for auto completion
(use-package helm
:ensure t
:config
(helm-mode 1)
(setq projectile-completion-system 'helm))
;;; dot_emacs ends here