summaryrefslogtreecommitdiffstats
path: root/files/.emacs.d/jd/jd-dev.el
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2024-09-20 14:16:56 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2024-09-20 14:16:56 +0200
commit45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a (patch)
treeb564c1c43920def6641cd482a7b4dca453dbc043 /files/.emacs.d/jd/jd-dev.el
parent07dd8e37eb767c3dd6abf63e5e4a720cd778da15 (diff)
downloaddotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.tar.gz
dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.zip
Change dotfiles structure, and add guix-channels declaration.
Diffstat (limited to 'files/.emacs.d/jd/jd-dev.el')
-rwxr-xr-xfiles/.emacs.d/jd/jd-dev.el177
1 files changed, 177 insertions, 0 deletions
diff --git a/files/.emacs.d/jd/jd-dev.el b/files/.emacs.d/jd/jd-dev.el
new file mode 100755
index 0000000..12cd21b
--- /dev/null
+++ b/files/.emacs.d/jd/jd-dev.el
@@ -0,0 +1,177 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6;; (setq c-default-style "linux"
7;; c-basic-offset 8
8;; gdb-many-windows t)
9
10(use-package lsp-mode
11 :guix-package "emacs-lsp-mode"
12 :diminish t
13 :commands (lsp lsp-deferred)
14 :init
15 (setq lsp-headerline-breadcrumb-enable nil)
16 (setq lsp-diagnostics-provider :none)
17 (setq lsp-modeline-diagnostics-enable nil)
18 (setq lsp-keymap-prefix "C-c l")
19 :config
20 (lsp-enable-which-key-integration t)
21
22 (global-set-key (kbd "C-x ]")
23 #'(lambda ()
24 (interactive)
25 (forward-page)
26 (recenter-top-bottom 0)))
27
28 (global-set-key (kbd "C-x [")
29 #'(lambda ()
30 (interactive)
31 (backward-page)
32 (recenter-top-bottom 0)))
33
34 (define-key c-mode-map
35 (kbd "C-c C-c")
36 #'(lambda ()
37 (interactive)
38 (compile compile-command)))
39
40 (define-key c-mode-map
41 (kbd "C-c M-c")
42 'compile))
43
44(use-package lsp-ivy
45 :guix-package "emacs-lsp-ivy"
46 :after lsp)
47
48
49(use-package paredit
50 :guix-package "emacs-paredit")
51
52(defun jd/lisp-mode-setup ()
53 (rainbow-delimiters-mode)
54 (paredit-mode))
55
56(add-hook 'emacs-startup-hook
57 (lambda ()
58 (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup)
59 (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup)
60 (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup)
61 (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup)))
62
63(use-package rainbow-delimiters
64 :guix-package "emacs-rainbow-delimiters")
65
66(use-package sly
67 :guix-package "emacs-sly")
68
69(use-package geiser
70 :guix-package "emacs-geiser")
71
72(use-package geiser-racket
73 :guix-package "emacs-geiser-racket")
74
75(use-package racket-mode
76 :guix-package "emacs-racket-mode")
77
78(use-package geiser-guile
79 :guix-package "emacs-geiser-guile"
80 :config
81 (when jd/guix-p
82 (defun jd/guix-repl ()
83 (interactive)
84 (let ((geiser-guile-binary '("guix" "repl"))
85 (geiser-guile-load-path (cons "~/dotfiles/guix" geiser-guile-load-path)))
86 (geiser 'guile)))))
87
88(use-package pyvenv
89 :guix-package "emacs-pyvenv"
90 :after python-mode)
91
92(use-package typescript-mode
93 :guix-package "emacs-typescript-mode"
94 :mode ("\\.ts\\'")
95 :config
96 (setq typescript-indent-level 2))
97
98(use-package cider
99 :guix-package "emacs-cider")
100
101(use-package tide
102 :guix-package "emacs-tide"
103 :after (typescript-mode company web-mode))
104
105(use-package flycheck
106 :guix-package "emacs-flycheck"
107 :hook ((after-init . global-flycheck-mode)))
108
109(use-package web-mode
110 :guix-package "emacs-web-mode"
111 :mode
112 ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'")
113 :config
114 (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'")))
115 (setq web-mode-markup-indent-offset 2)
116 (setq web-mode-css-indent-offset 2)
117 (setq web-mode-code-indent-offset 2)
118 (setq web-mode-script-padding 2)
119 (setq web-mode-block-padding 2)
120 (setq web-mode-style-padding 2)
121 (setq web-mode-enable-auto-pairing t)
122 (setq web-mode-enable-auto-closing t)
123 (setq web-mode-enable-current-element-highlight t))
124
125(use-package yaml-mode
126 :guix-package "emacs-yaml-mode")
127
128(use-package docker
129 :guix-package "emacs-docker"
130 :bind
131 ("C-c D d" . docker-containers)
132 ("C-c D D" . docker))
133
134(use-package company
135 :guix-package "emacs-company"
136 :diminish t
137 :after lsp-mode
138 :hook (lsp-mode . company-mode)
139 :bind (:map company-active-map
140 ("<tab>" . company-complete-selection))
141 (:map lsp-mode-map
142 ("<tab>" . company-indent-or-complete-common))
143 :custom
144 (company-minimum-prefix-length 1)
145 (company-idle-delay 0.0)
146 :config
147 (global-company-mode))
148
149(use-package projectile
150 :guix-package "emacs-projectile"
151 :diminish projectile-mode
152 :init
153 (when (file-directory-p "~/Documents/code")
154 (setq projectile-project-search-path '("~/Documents/code/")))
155 :custom ((projectile-Completion-system 'ivy))
156 :config
157 (setq projectile-switch-project-action #'projectile-dired)
158 (projectile-mode))
159
160(use-package magit
161 :guix-package "emacs-magit"
162 :custom
163 (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
164
165(use-package restclient
166 :guix-package "emacs-restclient")
167
168(setq sql-connection-alist
169 '(("net47-abaks"
170 (sql-product 'postgres)
171 (sql-user "kuba")
172 (sql-database "net47")
173 (sql-server "net47.abaks.pl"))))
174
175(provide 'jd-dev)
176
177;;; jd-dev.el ends here