blob: d69313ea2ff302ea9ed88518c220c759d6a00159 (
plain)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
;;; Dotfiles --- Jakub Dlugosz emacs config
;;; Commentary:
;;; Code:
(setq c-default-style "linux"
c-basic-offset 8)
(setq gdb-many-windows t)
(jd/use-package lsp-mode "emacs-lsp-mode"
:commands (lsp lsp-deferred)
:init
(setq lsp-headerline-breadcrumb-enable nil)
(setq lsp-diagnostics-provider :none)
(setq lsp-modeline-diagnostics-enable nil)
(setq lsp-keymap-prefix "C-c l")
:config
(lsp-enable-which-key-integration t))
(jd/use-package lsp-ivy "emacs-lsp-ivy"
:after lsp)
(jd/use-package paredit "emacs-paredit")
;; (jd/use-package evil-paredit "emacs-evil-paredit"
;; :config
;; (defun jd/lisp-mode-setup ()
;; (rainbow-delimiters-mode)
;; (evil-paredit-mode)
;; (paredit-mode))
;; (add-hook 'emacs-startup-hook
;; (lambda ()
;; (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup)
;; (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup)
;; (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup)
;; (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup)))
;; (evil-define-key 'normal paredit-mode-map (kbd "g h") 'paredit-forward-barf-sexp)
;; (evil-define-key 'normal paredit-mode-map (kbd "g l") 'paredit-forward-slurp-sexp)
;; (evil-define-key 'normal paredit-mode-map (kbd "g H") 'paredit-backward-slurp-sexp)
;; (evil-define-key 'normal paredit-mode-map (kbd "g L") 'paredit-backward-barf-sexp))
(jd/use-package rainbow-delimiters "emacs-rainbow-delimiters")
(jd/use-package geiser "emacs-geiser")
(jd/use-package geiser-guile "emacs-geiser-guile")
;; (defun jd/python-mode-setup ()
;; (let ((project-venv-path (concat (projectile-project-root) "venv/")))
;; (when (projectile--directory-p project-venv-path)
;; (pyvenv-activate project-venv-path)
;; (pyvenv-mode))))
;; (jd/use-package python-mode ;;TODO: find alternative
;; :hook (python-mode . lsp-deferred)
;; :hook (python-mode . jd/python-mode-setup)
;; :config
;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)))
(jd/use-package pyvenv "emacs-pyvenv"
:after python-mode)
(jd/use-package typescript-mode "emacs-typescript-mode"
:mode ("\\.ts\\'")
:config
(setq typescript-indent-level 2))
;; (defun jd/activate-tide-mode ()
;; (when (and (stringp buffer-file-name)
;; (string-match "\\.[tj]sx?\\'" buffer-file-name))
;; (tide-setup)
;; (tide-hl-identifier-mode)))
(jd/use-package tide "emacs-tide"
:after (typescript-mode company web-mode))
(jd/use-package flycheck "emacs-flycheck"
:hook ((after-init . global-flycheck-mode)))
(jd/use-package web-mode "emacs-web-mode"
:hook ((web-mode . jd/activate-tide-mode))
:mode
("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'")
:config
(setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'")))
(setq web-mode-markup-indent-offset 2)
(setq web-mode-css-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-script-padding 2)
(setq web-mode-block-padding 2)
(setq web-mode-style-padding 2)
(setq web-mode-enable-auto-pairing t)
(setq web-mode-enable-auto-closing t)
(setq web-mode-enable-current-element-highlight t))
(jd/use-package yaml-mode "emacs-yaml-mode")
(jd/use-package docker "emacs-docker"
:config
(jd/leader-key-def
"d" '(:ignore t :which-key "Docker")
"dc" '(docker-containers :which-key "Docker containers")
"dd" '(docker :which-key "Docker")))
(jd/use-package company "emacs-company"
:after lsp-mode
:hook (lsp-mode . company-mode)
:bind (:map company-active-map
("<tab>" . company-complete-selection))
(:map lsp-mode-map
("<tab>" . company-indent-or-complete-common))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.0)
:config
(global-company-mode))
(jd/use-package company-box "emacs-company-box"
:hook (company-mode . company-box-mode))
(jd/use-package projectile "emacs-projectile"
:diminish projectile-mode
:init
(when (file-directory-p "~/Documents/code")
(setq projectile-project-search-path '("~/Documents/code/")))
:custom ((projectile-Completion-system 'ivy))
:config
(setq projectile-switch-project-action #'projectile-dired)
(projectile-mode)
(jd/leader-key-def
"p" '(projectile-command-map :which-key "Project")
"p <ESC>" '()
"SPC" '(projectile-find-file :which-key "Find file in project")))
(jd/use-package neotree "emacs-neotree"
:init
(setq neo-theme 'icons)
:config
;; (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter)
;; (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look)
;; (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide)
;; (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter)
;; (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh)
;; (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle)
;; (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle)
(jd/leader-key-def
"op" '(jd/neotree-project-dir :which-key "Open neotree"))
(defun jd/neotree-project-dir ()
"Open NeoTree using the git root."
(interactive)
(let ((project-dir (projectile-project-root))
(file-name (buffer-file-name)))
(neotree-toggle)
(if project-dir
(if (neo-global--window-exists-p)
(progn
(neotree-dir project-dir)
(neotree-find file-name)))
(message "Could not find git project root.")))))
(jd/use-package magit "emacs-magit"
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
(jd/leader-key-def
"g" '(:ignore t :which-key "Git")
"gg" '(magit-status-here :which-key "Magit status")))
(provide 'jd-dev)
;;; jd-dev.el ends here
|