blob: 6f2d35556d42dbf7e0822eea341736115ba98080 (
plain) (
blame)
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
|
(use-package lsp-mode
:straight t
:hook ((lsp-mode . lsp-lens-mode)
;; Solves F# buffer out of sync
(lsp-mode . (lambda () (lsp-treemacs-sync-mode -1)))))
(use-package lsp-ui
:straight t
:init
(setq lsp-ui-doc-enable t)
(setq lsp-ui-sideline-diagnostic-max-lines 7)
(setq lsp-ui-sideline-diagnostic-max-line-length 20)
(defun magueta/lsp-ui-doc-toggle ()
"For some reason it is required to do at least once a call to lsp-ui-doc-show in order for this to work. Probably the problem resides on the frame created requiring some preparation before actually being used, so `frame-live-p` doesn't return nil."
(interactive)
(let ((frame (lsp-ui-doc--get-frame)))
(if (frame-live-p frame)
(cond ((frame-visible-p frame) (lsp-ui-doc-hide))
(t (lsp-ui-doc-show)))
(message "Hover with the mouse or call `lsp-ui-doc-show` over some obect first. For why, read doc string."))))
:bind
(("s-?" . 'magueta/lsp-ui-doc-toggle)))
(use-package rainbow-delimiters
:straight t
:hook
(emacs-lisp-mode . rainbow-delimiters-mode))
(use-package nix-mode
:straight t
:init
(defun nix-repl-with-variable ()
(interactive)
(let ((variables (read-string "Nix repl variable to load: ")))
(defcustom nix-repl-executable-args `("repl" ,variables)
"Arguments to provide to nix-repl."
:type '(repeat string))
(nix-repl)))
:hook
(nix-mode . lsp-deferred)
;; (nix-repl-mode . company-mode)
:config
(add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
:major-modes '(nix-mode)
:server-id 'nix)))
(use-package swiper
:straight t
:bind
("\C-s" . swiper))
(use-package display-line-numbers
:straight t
:hook ((prog-mode . (lambda () (progn
(display-line-numbers-mode)
(setq display-line-numbers 'relative))))))
(use-package windmove
:straight t
:bind
("C-c <right>" . windmove-right)
("C-c <left>" . windmove-left)
("C-c <up>" . windmove-up)
("C-c <down>" . windmove-down))
(use-package perspective
:straight t
:bind (("C-x k" . persp-kill-buffer*))
:init
(persp-mode)
:custom (persp-suppress-no-prefix-key-warning t))
(use-package move-text
:straight t
:bind
("M-<up>" . move-text-up)
("M-<down>" . move-text-down))
(use-package corfu
:straight t
:custom ((corfu-auto t)
(corfu-auto-delay 0.25)
(corfu-min-width 15)
(corfu-max-width 70)
(corfu-popupinfo-delay corfu-auto-delay))
:hook ((prog-mode . corfu-mode)
(corfu-mode . corfu-popupinfo-mode)
(eshell-mode . corfu-mode)))
(use-package fsharp-mode
:straight t
:mode (("\\.fs$" . fsharp-mode)
("\\.fsx$" . fsharp-mode)
("\\.fsi$" . fsharp-mode))
:hook ((fsharp-mode . lsp-deferred))
:bind
(("C-c C-," . 'fsharp-shift-region-left)
("C-c C-." . 'fsharp-shift-region-right)
("C-o" . 'fsharp-newline-and-indent)
("C-c C-i" . 'run-fsharp)
("C-c C-a" . 'fsharp-find-alternate-file)
("M-h" . 'fsharp-mark-phrase))
:config
(setq compile-command "dotnet watch run")
(setq inferior-fsharp-program "dotnet fsi"))
(use-package magit
:straight t
:bind
("C-x g" . magit-status)
:config
(use-package diff-hl
:straight t))
(use-package helm
:straight t
:init
(helm-mode t)
(set-face-attribute 'helm-selection nil
:background (color-lighten-name (face-attribute 'default :foreground) 50)
:foreground (color-darken-name (face-attribute 'default :background) 100))
:bind
("M-x" . helm-M-x)
("C-x b" . helm-buffers-list))
(use-package multiple-cursors
:straight t
:bind
("C-c m c" . mc/edit-lines)
("C-<" . mc/mark-previous-like-this)
("C->" . mc/mark-next-like-this))
(use-package projectile
:straight t
:init
(projectile-mode t)
:bind-keymap
("C-c p" . projectile-command-map))
(use-package dashboard
:after projectile
:straight t
:after all-the-icons
;; :diminish dashboard-mode
:config
(dashboard-setup-startup-hook)
(setq dashboard-center-content t)
;; (setq dashboard-set-file-icons t)
;; (setq dashboard-startup-banner "/Users/mmagueta/.emacs.d/sources/emacs.svg")
(setq dashboard-banner-logo-title "Welcome to MageMacs, a magic GNU Emacs customization")
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(projects . 5)))
(setq dashboard-center-content t)
(setq dashboard-footer-messages '("Quod oculus non vidit, nec auris audivit - I Corinthios II,IX")))
(use-package transpose-frame
:straight t)
(use-package copilot
:straight (:host github :repo "copilot-emacs/copilot.el" :files ("dist" "*.el"))
:hook (prog-mode . copilot-mode)
:bind (:map copilot-mode-map
("C-q <tab>" . copilot-accept-completion)
("C-q <right>" . copilot-next-completion)
("C-q <left>" . copilot-previous-completion)))
(provide 'configuration)
;;; configuration.el ends here
|