diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 15:07:07 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 15:07:07 +0200 |
commit | 6156f86dd5797de5ea4f912b70d38963c6cf4ad4 (patch) | |
tree | d578204262209695d995e3f639076e91dcb85354 /.emacs.d/jd/jd-dev.el | |
parent | ef565a486511cbbb86e0d1f80264b3b57d2ac88a (diff) | |
download | dotfiles-6156f86dd5797de5ea4f912b70d38963c6cf4ad4.tar.gz dotfiles-6156f86dd5797de5ea4f912b70d38963c6cf4ad4.zip |
New Emacs config and change location of Emacs home dir.
Diffstat (limited to '.emacs.d/jd/jd-dev.el')
-rwxr-xr-x | .emacs.d/jd/jd-dev.el | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/.emacs.d/jd/jd-dev.el b/.emacs.d/jd/jd-dev.el new file mode 100755 index 0000000..d69313e --- /dev/null +++ b/.emacs.d/jd/jd-dev.el | |||
@@ -0,0 +1,173 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (setq c-default-style "linux" | ||
7 | c-basic-offset 8) | ||
8 | |||
9 | (setq gdb-many-windows t) | ||
10 | |||
11 | (jd/use-package lsp-mode "emacs-lsp-mode" | ||
12 | :commands (lsp lsp-deferred) | ||
13 | :init | ||
14 | (setq lsp-headerline-breadcrumb-enable nil) | ||
15 | (setq lsp-diagnostics-provider :none) | ||
16 | (setq lsp-modeline-diagnostics-enable nil) | ||
17 | (setq lsp-keymap-prefix "C-c l") | ||
18 | :config | ||
19 | (lsp-enable-which-key-integration t)) | ||
20 | |||
21 | (jd/use-package lsp-ivy "emacs-lsp-ivy" | ||
22 | :after lsp) | ||
23 | |||
24 | (jd/use-package paredit "emacs-paredit") | ||
25 | ;; (jd/use-package evil-paredit "emacs-evil-paredit" | ||
26 | ;; :config | ||
27 | ;; (defun jd/lisp-mode-setup () | ||
28 | ;; (rainbow-delimiters-mode) | ||
29 | ;; (evil-paredit-mode) | ||
30 | ;; (paredit-mode)) | ||
31 | ;; (add-hook 'emacs-startup-hook | ||
32 | ;; (lambda () | ||
33 | ;; (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) | ||
34 | ;; (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) | ||
35 | ;; (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) | ||
36 | ;; (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) | ||
37 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g h") 'paredit-forward-barf-sexp) | ||
38 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g l") 'paredit-forward-slurp-sexp) | ||
39 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g H") 'paredit-backward-slurp-sexp) | ||
40 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g L") 'paredit-backward-barf-sexp)) | ||
41 | (jd/use-package rainbow-delimiters "emacs-rainbow-delimiters") | ||
42 | |||
43 | (jd/use-package geiser "emacs-geiser") | ||
44 | (jd/use-package geiser-guile "emacs-geiser-guile") | ||
45 | |||
46 | ;; (defun jd/python-mode-setup () | ||
47 | ;; (let ((project-venv-path (concat (projectile-project-root) "venv/"))) | ||
48 | ;; (when (projectile--directory-p project-venv-path) | ||
49 | ;; (pyvenv-activate project-venv-path) | ||
50 | ;; (pyvenv-mode)))) | ||
51 | |||
52 | ;; (jd/use-package python-mode ;;TODO: find alternative | ||
53 | ;; :hook (python-mode . lsp-deferred) | ||
54 | ;; :hook (python-mode . jd/python-mode-setup) | ||
55 | ;; :config | ||
56 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
57 | |||
58 | (jd/use-package pyvenv "emacs-pyvenv" | ||
59 | :after python-mode) | ||
60 | |||
61 | (jd/use-package typescript-mode "emacs-typescript-mode" | ||
62 | :mode ("\\.ts\\'") | ||
63 | :config | ||
64 | (setq typescript-indent-level 2)) | ||
65 | |||
66 | ;; (defun jd/activate-tide-mode () | ||
67 | ;; (when (and (stringp buffer-file-name) | ||
68 | ;; (string-match "\\.[tj]sx?\\'" buffer-file-name)) | ||
69 | ;; (tide-setup) | ||
70 | ;; (tide-hl-identifier-mode))) | ||
71 | |||
72 | (jd/use-package tide "emacs-tide" | ||
73 | :after (typescript-mode company web-mode)) | ||
74 | |||
75 | (jd/use-package flycheck "emacs-flycheck" | ||
76 | :hook ((after-init . global-flycheck-mode))) | ||
77 | |||
78 | (jd/use-package web-mode "emacs-web-mode" | ||
79 | :hook ((web-mode . jd/activate-tide-mode)) | ||
80 | :mode | ||
81 | ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") | ||
82 | :config | ||
83 | (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'"))) | ||
84 | (setq web-mode-markup-indent-offset 2) | ||
85 | (setq web-mode-css-indent-offset 2) | ||
86 | (setq web-mode-code-indent-offset 2) | ||
87 | (setq web-mode-script-padding 2) | ||
88 | (setq web-mode-block-padding 2) | ||
89 | (setq web-mode-style-padding 2) | ||
90 | (setq web-mode-enable-auto-pairing t) | ||
91 | (setq web-mode-enable-auto-closing t) | ||
92 | (setq web-mode-enable-current-element-highlight t)) | ||
93 | |||
94 | (jd/use-package yaml-mode "emacs-yaml-mode") | ||
95 | |||
96 | (jd/use-package docker "emacs-docker" | ||
97 | :config | ||
98 | (jd/leader-key-def | ||
99 | "d" '(:ignore t :which-key "Docker") | ||
100 | "dc" '(docker-containers :which-key "Docker containers") | ||
101 | "dd" '(docker :which-key "Docker"))) | ||
102 | |||
103 | (jd/use-package company "emacs-company" | ||
104 | :after lsp-mode | ||
105 | :hook (lsp-mode . company-mode) | ||
106 | :bind (:map company-active-map | ||
107 | ("<tab>" . company-complete-selection)) | ||
108 | (:map lsp-mode-map | ||
109 | ("<tab>" . company-indent-or-complete-common)) | ||
110 | :custom | ||
111 | (company-minimum-prefix-length 1) | ||
112 | (company-idle-delay 0.0) | ||
113 | :config | ||
114 | (global-company-mode)) | ||
115 | |||
116 | (jd/use-package company-box "emacs-company-box" | ||
117 | :hook (company-mode . company-box-mode)) | ||
118 | |||
119 | (jd/use-package projectile "emacs-projectile" | ||
120 | :diminish projectile-mode | ||
121 | :init | ||
122 | (when (file-directory-p "~/Documents/code") | ||
123 | (setq projectile-project-search-path '("~/Documents/code/"))) | ||
124 | :custom ((projectile-Completion-system 'ivy)) | ||
125 | :config | ||
126 | (setq projectile-switch-project-action #'projectile-dired) | ||
127 | (projectile-mode) | ||
128 | |||
129 | (jd/leader-key-def | ||
130 | "p" '(projectile-command-map :which-key "Project") | ||
131 | "p <ESC>" '() | ||
132 | "SPC" '(projectile-find-file :which-key "Find file in project"))) | ||
133 | |||
134 | (jd/use-package neotree "emacs-neotree" | ||
135 | :init | ||
136 | (setq neo-theme 'icons) | ||
137 | :config | ||
138 | |||
139 | ;; (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) | ||
140 | ;; (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look) | ||
141 | ;; (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) | ||
142 | ;; (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) | ||
143 | ;; (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) | ||
144 | ;; (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) | ||
145 | ;; (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) | ||
146 | |||
147 | (jd/leader-key-def | ||
148 | "op" '(jd/neotree-project-dir :which-key "Open neotree")) | ||
149 | |||
150 | (defun jd/neotree-project-dir () | ||
151 | "Open NeoTree using the git root." | ||
152 | (interactive) | ||
153 | (let ((project-dir (projectile-project-root)) | ||
154 | (file-name (buffer-file-name))) | ||
155 | (neotree-toggle) | ||
156 | (if project-dir | ||
157 | (if (neo-global--window-exists-p) | ||
158 | (progn | ||
159 | (neotree-dir project-dir) | ||
160 | (neotree-find file-name))) | ||
161 | (message "Could not find git project root."))))) | ||
162 | |||
163 | (jd/use-package magit "emacs-magit" | ||
164 | :custom | ||
165 | (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) | ||
166 | |||
167 | (jd/leader-key-def | ||
168 | "g" '(:ignore t :which-key "Git") | ||
169 | "gg" '(magit-status-here :which-key "Magit status"))) | ||
170 | |||
171 | (provide 'jd-dev) | ||
172 | |||
173 | ;;; jd-dev.el ends here | ||