summaryrefslogtreecommitdiff
path: root/init.el
blob: 23851e874548409e0e450ac854f5400b39127fde (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
 
; compatibility with some strange packages that were not updated for emacs 24
 
(defalias 'make-local-hook 'ignore)
 
(add-to-list 'load-path (expand-file-name "~/.emacs-lisp") t) ; my path at the end
 
(load "/usr/share/emacs/site-lisp/site-gentoo")
 
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ack-command "ack --nopager ")
 '(auth-source-save-behavior nil)
 '(auto-coding-alist
   '(("\\.\\(arc\\|zip\\|lzh\\|zoo\\|jar\\|tar\\|tgz\\)\\'" . no-conversion)
     ("\\.\\(gz\\|Z\\|bz\\|bz2\\|gpg\\)\\'" . no-conversion)
     ("^/home/dakkar/.claws-mail/tmp" . utf-8)))
 '(browse-url-browser-function 'browse-url-generic)
 '(browse-url-generic-program "/usr/bin/firefox")
 '(browse-url-lynx-input-attempts 10 t)
 '(browse-url-netscape-program "/usr/bin/firefox")
 '(c-cleanup-list
   '(brace-else-brace brace-elseif-brace brace-catch-brace empty-defun-braces scope-operator))
 '(c-echo-syntactic-information-p t)
 '(c-tab-always-indent nil)
 '(calendar-week-start-day 1)
 '(case-fold-search t)
 '(column-number-mode t)
 '(confluence-default-space-alist
   '(("https://confluence.nap/rpc/xmlrpc" . "TA")
     ("https://confluence.nap/rpc/xmlrpc" . "BAK")))
 '(confluence-url "https://confluence.nap/rpc/xmlrpc")
 '(cperl-close-paren-offset -4)
 '(cperl-continued-statement-offset 4)
 '(cperl-font-lock t)
 '(cperl-indent-level 4)
 '(cperl-indent-parens-as-block t)
 '(cperl-under-as-char nil)
 '(current-language-environment "English")
 '(default-frame-alist
    '((tool-bar-lines . 0)
      (width . 80)
      (height . 25)
      (right-fringe)
      (left-fringe)
      (fullscreen . fullheight)))
 '(desktop-load-locked-desktop t)
 '(desktop-save t)
 '(desktop-save-mode t)
 '(diary-date-forms
   '((month "/" day "[^/0-9]")
     (month "/" day "/" year "[^0-9]")
     (monthname " *" day "[^,0-9]")
     (monthname " *" day ", *" year "[^0-9]")
     (dayname "\\W")
     (year "-" month "-" day "[^0-9]")))
 '(ecb-cedet-url "http://belnet.dl.sourceforge.net/sourceforge/ecb/")
 '(ecb-download-url "http://belnet.dl.sourceforge.net/sourceforge/ecb/")
 '(ecb-options-version "2.27")
 '(emacs-wiki-charset-default "utf-8")
 '(emacs-wiki-coding-default 'utf-8)
 '(emacs-wiki-grep-command
   "find %D -type f ! -name '*~' | xargs grep -E -n -e \"\\<%W\\>\"")
 '(emacs-wiki-mode-hook
   '(emacs-wiki-use-font-lock footnote-mode highlight-changes-mode))
 '(enable-local-variables t)
 '(espresso-indent-level 2)
 '(file-coding-system-alist
   '(("\\.po\\'\\|\\.po\\." . po-find-file-coding-system)
     ("\\.dz\\'" no-conversion . no-conversion)
     ("\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'" no-conversion . no-conversion)
     ("\\.tgz\\'" no-conversion . no-conversion)
     ("\\.tbz\\'" no-conversion . no-conversion)
     ("\\.bz2\\'" no-conversion . no-conversion)
     ("\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'" no-conversion . no-conversion)
     ("\\.elc\\'" emacs-mule . emacs-mule)
     ("\\.utf\\(-8\\)?\\'" . utf-8)
     ("\\(\\`\\|/\\)loaddefs.el\\'" raw-text . raw-text-unix)
     ("\\.tar\\'" no-conversion . no-conversion)
     ("\\.po[tx]?\\'\\|\\.po\\." . po-find-file-coding-system)
     ("\\.\\(tex\\|ltx\\|dtx\\|drv\\)\\'" . latexenc-find-file-coding-system)
     ("" undecided . utf-8)))
 '(file-name-coding-system 'utf-8 t)
 '(flymake-allowed-file-name-masks
   '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init nil nil)
     ("\\.xml\\'" flymake-xml-init nil nil)
     ("\\.html?\\'" flymake-xml-init nil nil)
     ("\\.cs\\'" flymake-simple-make-init nil nil)
     ("\\.p[ml]\\'" flymake-perl-init nil nil)
     ("\\.php[345]?\\'" flymake-php-init nil nil)
     ("\\.h\\'" flymake-master-make-header-init flymake-master-cleanup nil)
     ("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup nil)
     ("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup nil)
     ("\\.tex\\'" flymake-simple-tex-init nil nil)
     ("\\.idl\\'" flymake-simple-make-init nil nil)
     ("\\.ino\\'" flymake-simple-make-init nil nil)))
 '(flymake-log-level 0)
 '(flymake-master-file-dirs '("." "./src" "./lib" "./t/lib"))
 '(flymake-proc-allowed-file-name-masks
   '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init nil nil)
     ("\\.xml\\'" flymake-xml-init nil nil)
     ("\\.html?\\'" flymake-xml-init nil nil)
     ("\\.cs\\'" flymake-simple-make-init nil nil)
     ("\\.p[ml]\\'" flymake-perl-init nil nil)
     ("\\.php[345]?\\'" flymake-php-init nil nil)
     ("\\.h\\'" flymake-master-make-header-init flymake-master-cleanup nil)
     ("\\.java\\'" flymake-simple-make-java-init flymake-simple-java-cleanup nil)
     ("[0-9]+\\.tex\\'" flymake-master-tex-init flymake-master-cleanup nil)
     ("\\.tex\\'" flymake-simple-tex-init nil nil)
     ("\\.idl\\'" flymake-simple-make-init nil nil)
     ("\\.ino\\'" flymake-simple-make-init nil nil)))
 '(flymake-proc-master-file-dirs '("." "./src" "./lib" "./t/lib"))
 '(footnote-section-tag-regexp "Notes?\\(\\[.\\]\\)?: ")
 '(footnote-spaced-footnotes nil)
 '(global-font-lock-mode t nil (font-lock))
 '(gnus-default-charset 'iso-8859-15)
 '(gnus-default-posting-charset 'iso-8859-15)
 '(gnus-group-charset-alist
   '(("^hk\\>\\|^tw\\>\\|\\<big5\\>" cn-big5)
     ("^cn\\>\\|\\<chinese\\>" cn-gb-2312)
     ("^fj\\>\\|^japan\\>" iso-2022-jp-2)
     ("^tnn\\>\\|^pin\\>\\|^sci.lang.japan" iso-2022-7bit)
     ("^relcom\\>" koi8-r)
     ("^fido7\\>" koi8-r)
     ("^\\(cz\\|hun\\|pl\\|sk\\|hr\\)\\>" iso-8859-2)
     ("^israel\\>" iso-8859-15)
     ("^han\\>" euc-kr)
     ("^alt.chinese.text.big5\\>" chinese-big5)
     ("^soc.culture.vietnamese\\>" vietnamese-viqr)
     ("^\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-15)
     (".*" iso-8859-15)))
 '(gnus-group-posting-charset-alist
   '(("^\\(no\\|fr\\)\\.[^,]*\\(,[ 
]*\\(no\\|fr\\)\\.[^,]*\\)*$" iso-8859-15
 (iso-8859-15))
     ("^\\(fido7\\|relcom\\)\\.[^,]*\\(,[ 
]*\\(fido7\\|relcom\\)\\.[^,]*\\)*$" koi8-r
 (koi8-r))
     (message-this-is-mail nil nil)
     (message-this-is-news nil t)))
 '(gnus-ignored-headers
   '("^Path:" "^Expires:" "^Date-Received:" "^References:" "^Xref:" "^Lines:" "^Relay-Version:" "^Message-ID:" "^Approved:" "^Sender:" "^Received:" "^X-UIDL:" "^MIME-Version:" "^Return-Path:" "^In-Reply-To:" "^Content-Transfer-Encoding:" "^X-WebTV-Signature:" "^X-MimeOLE:" "^X-MSMail-Priority:" "^X-Priority:" "^X-Loop:" "^X-Authentication-Warning:" "^X-MIME-Autoconverted:" "^X-Face:" "^X-Attribution:" "^X-Originating-IP:" "^Delivered-To:" "^NNTP-[-A-Za-z]+:" "^Distribution:" "^X-no-archive:" "^X-Trace:" "^X-Complaints-To:" "^X-NNTP-Posting-Host:" "^X-Orig.*:" "^Abuse-Reports-To:" "^Cache-Post-Path:" "^X-Article-Creation-Date:" "^X-Poster:" "^X-Mail2News-Path:" "^X-Server-Date:" "^X-Cache:" "^Originator:" "^X-Problems-To:" "^X-Auth-User:" "^X-Post-Time:" "^X-Admin:" "^X-UID:" "^Resent-[-A-Za-z]+:" "^X-Mailing-List:" "^Precedence:" "^Original-[-A-Za-z]+:" "^X-filename:" "^X-Orcpt:" "^Old-Received:" "^X-Pgp" "^X-Auth:" "^X-From-Line:" "^X-Gnus-Article-Number:" "^X-Majordomo:" "^X-Url:" "^X-Sender:" "^MBOX-Line" "^Priority:" "^X-Pgp" "^X400-[-A-Za-z]+:" "^Status:" "^X-Gnus-Mail-Source:" "^Cancel-Lock:" "^X-FTN" "^X-EXP32-SerialNo:" "^Encoding:" "^Importance:" "^Autoforwarded:" "^Original-Encoded-Information-Types:" "^X-Ya-Pop3:" "^X-Face-Version:" "^X-Vms-To:" "^X-ML-NAME:" "^X-ML-COUNT:" "^Mailing-List:" "^X-finfo:" "^X-md5sum:" "^X-md5sum-Origin:" "^X-Sun-Charset:" "^X-Accept-Language:" "^X-Envelope-Sender:" "^List-[A-Za-z]+:" "^X-Listprocessor-Version:" "^X-Received:" "^X-Distribute:" "^X-Sequence:" "^X-Juno-Line-Breaks:" "^X-Notes-Item:" "^X-MS-TNEF-Correlator:" "^x-uunet-gateway:" "^X-Received:" "^Content-length:" "X-precedence:"))
 '(gnus-large-newsgroup 2000)
 '(gnus-select-method '(nntp "news.ngi.it"))
 '(icomplete-mode t nil (icomplete))
 '(indent-tabs-mode nil)
 '(ledger-clear-whole-transactions t)
 '(ledger-reconcile-default-commodity "GBP")
 '(ledger-reconcile-default-date-format "%Y-%m-%d")
 '(ledger-use-iso-dates t)
 '(lpr-command "gtklp")
 '(lpr-switches nil)
 '(lsp-clients-clangd-executable "clangd")
 '(lsp-prefer-flymake nil)
 '(magit-default-tracking-name-function 'magit-default-tracking-name-branch-only)
 '(magit-diff-refine-hunk 'all)
 '(markdown-command "markdown_py")
 '(menu-bar-mode nil)
 '(message-signature-file "~/.signature/news.sig")
 '(message-signature-separator "^-- [  ]*$")
 '(message-subject-re-regexp "^[  ]*\\([Rr][Ee]?:[  ]*\\)*[  ]*")
 '(mouse-wheel-follow-mouse t)
 '(mouse-yank-at-point t)
 '(msb-mode t nil (msb))
 '(next-line-add-newlines nil)
 '(nxml-auto-insert-xml-declaration-flag t)
 '(nxml-char-ref-display-glyph-flag nil)
 '(nxml-child-indent 1)
 '(nxml-default-buffer-file-coding-system 'utf-8)
 '(nxml-slash-auto-complete-flag t)
 '(package-archives
   '(("gnu" . "https://elpa.gnu.org/packages/")
     ("melpa" . "https://melpa.org/packages/")))
 '(package-selected-packages
   '(yasnippet lsp-mode lsp-ui go-mode magit magit-filenotify magit-gh-pulls magit-gitflow magit-vcsh gnu-elpa-keyring-update wgrep web-mode unicode-fonts perl6-mode markdown-mode magit-tramp magit-find-file ledger-mode))
 '(pov-external-viewer-command "display")
 '(pov-help-file "povuser.txt")
 '(reftex-extra-bindings nil)
 '(reftex-label-alist '(AMSTeX))
 '(rst-adornment-faces-alist
   '((1 . rst-level-1-face)
     (2 . rst-level-2-face)
     (3 . rst-level-3-face)
     (4 . rst-level-4-face)
     (5 . rst-level-5-face)
     (6 . rst-level-6-face)
     (t . font-lock-keyword-face)
     (nil . font-lock-keyword-face)))
 '(rst-directive-face 'font-lock-constant-face)
 '(rst-mode-lazy nil)
 '(ruby-deep-indent-paren nil)
 '(select-enable-primary t)
 '(sendmail-coding-system nil t)
 '(server-kill-new-buffers t)
 '(server-raise-frame nil)
 '(server-temp-file-regexp
   "^/home/dakkar/\\.claws-mail/tmp\\|/tmp/\\(Re\\|mutt\\)\\|/draft$")
 '(sgml-balanced-tag-edit t t)
 '(sgml-catalog-files
   '("catalog" "/usr/local/lib/sgml/catalog" "/home/dakkar/.emacs-lisp/catalog") t)
 '(sgml-indent-data t t)
 '(sgml-indent-step 1 t)
 '(sgml-insert-end-tag-on-new-line t t)
 '(sgml-live-element-indicator t t)
 '(sgml-local-catalogs nil t)
 '(sgml-markup-faces
   '((start-tag . font-lock-builtin-face)
     (end-tag . font-lock-builtin-face)
     (comment . font-lock-comment-face)
     (pi . bold)
     (sgml . bold)
     (doctype . bold)
     (entity . italic)
     (shortref . bold)) t)
 '(sgml-name-8bit-mode nil)
 '(sgml-set-face t t)
 '(sgml-slash-distance nil)
 '(smiley-regexp-alist nil)
 '(speedbar-show-unknown-files nil)
 '(speedbar-supported-extension-expressions
   '(".[ch]\\(\\+\\+\\|pp\\|c\\|h\\|xx\\)?" ".tex\\(i\\(nfo\\)?\\)?" ".el" ".emacs" ".l" ".lsp" ".p" ".java" ".f\\(90\\|77\\|or\\)?" ".ada" ".pl" ".tcl" ".m" ".scm" ".pm" ".py" ".s?html" "Makefile\\(\\.in\\)?" ".x[ms]l"))
 '(strokes-use-strokes-buffer nil)
 '(tex-default-mode 'latex-mode)
 '(tex-dvi-view-command "xdvi")
 '(tool-bar-mode nil nil (tool-bar))
 '(tooltip-delay 1.5)
 '(tooltip-short-delay 0.2)
 '(tramp-default-proxies-alist nil)
 '(truncate-partial-width-windows nil)
 '(uniquify-buffer-name-style 'forward nil (uniquify))
 '(url-be-asynchronous t)
 '(url-external-retrieval-args nil)
 '(url-external-retrieval-program "wget")
 '(w3-display-frames t)
 '(w3-do-incremental-display t)
 '(w3-use-terminal-characters nil)
 '(w3-user-colors-take-precedence t)
 '(web-mode-attr-indent-offset nil)
 '(web-mode-code-indent-offset 2)
 '(web-mode-css-indent-offset 2)
 '(web-mode-markup-indent-offset 2)
 '(which-func-mode-global t nil (which-func))
 '(widget-use-overlay-change t t)
 '(x-stretch-cursor t))
 
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(cperl-array-face ((((class color) (background dark)) (:bold t :foreground "yellow"))))
 '(cperl-hash-face ((((class color) (background dark)) (:bold t :italic t :foreground "green"))))
 '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "LightGreen"))))
 '(font-lock-comment-face ((((class color) (background dark)) (:italic t :foreground "Gray"))))
 '(message-cited-text-face ((((class color) (background dark)) (:box (:line-width 1 :color "grey75" :style pressed-button) :slant italic))) t)
 '(message-header-cc-face ((t (:foreground "green3" :weight bold))) t)
 '(message-header-name-face ((((class color) (background dark)) (:foreground "#00f0ff" :weight bold))) t)
 '(message-header-newsgroups-face ((t (:foreground "yellow3" :slant italic :weight bold))) t)
 '(message-header-other-face ((((class color) (background dark)) (:foreground "#b0b000"))) t)
 '(message-mml-face ((((class color) (background dark)) (:foreground "#00f00f"))) t)
 '(nxml-attribute-colon-face ((t (:inherit nxml-element-colon-face))))
 '(nxml-attribute-prefix-face ((t (:inherit nxml-element-prefix-face))))
 '(nxml-comment-content-face ((t (:foreground "darkgray" :slant italic))))
 '(nxml-delimited-data-face ((t (:foreground "#f0a040"))))
 '(nxml-element-colon-face ((t (:inherit nxml-name-face :weight light))))
 '(nxml-element-prefix-face ((t (:inherit nxml-name-face :underline t))))
 '(nxml-name-face ((t (:foreground "#00dAa5"))))
 '(nxml-namespace-attribute-colon-face ((t (:inherit nxml-attribute-colon-face))))
 '(nxml-namespace-attribute-prefix-face ((t (:inherit nxml-attribute-prefix-face))))
 '(nxml-namespace-attribute-xmlns-face ((t (:inherit nxml-name-face :foreground "blue"))))
 '(nxml-ref-face ((t (:foreground "#b2b2e9"))))
 '(rst-level-1-face ((t (:background "grey85" :foreground "black"))) t)
 '(rst-level-2-face ((t (:background "grey78" :foreground "gray15"))) t)
 '(rst-level-3-face ((t (:background "grey71" :foreground "gray25"))) t)
 '(rst-level-4-face ((t (:background "grey64" :foreground "gray35"))) t)
 '(rst-level-5-face ((t (:background "grey57" :foreground "gray70"))) t)
 '(rst-level-6-face ((t (:background "grey50" :foreground "gray90"))) t))
 
(defun autoformat-region ()
  "Runs perl Text::Autoformat on region, replacing it with the output"
  (interactive)
  (shell-command-on-region (region-beginning) (region-end)
   "perl -MText::Autoformat -e 'autoformat {all=>1}'"
   "" ""
   shell-command-default-error-buffer)
)
 
(setq frame-title-format "%b")
 
; -------- reStructuredText section --------
; some of my files have more than one "extension"
(add-to-list 'auto-mode-alist '("\\.re?st\\.tx?t\\'" . rst-mode))
; I want auto-fill and fly-spell
(add-hook 'rst-mode-hook (lambda ()
                           (progn
                             (auto-fill-mode 1)
                             (flyspell-mode)
                             )))
(add-hook 'rst-adjust-hook 'rst-toc-insert-update)
; one of the "extensions" can be a language code: use it
(add-hook 'flyspell-mode-hook (lambda ()
                                (let ((filename (buffer-file-name)))
                                  (when (and filename
                                             (string-match "\\.\\(it\\|en\\)\\..*\\.\\(txt\\|tt\\)$" filename))
                                    (ispell-change-dictionary (match-string 1 filename))))))
; I write my e-mails in Claws, and I want rst-mode enabled for them
(set-variable 'find-file-hooks (cons 
  (lambda ()
    (if (or
                 (string-match "^/home/dakkar/\\.claws-mail/tmp" buffer-file-name)
                 (string-match "^/home/dakkar/\\.mozilla/firefox/.*/italltext/" buffer-file-name)
                 )
(progn
                  (rst-mode)
                  )
      ))
  find-file-hooks))
 
; -------- other modes --------
; CPerl-mode instead of perl-mode
(defalias 'perl-mode 'cperl-mode)
 
(add-to-list 'auto-mode-alist '("\\.tt$" . html-mode))
(add-to-list 'auto-mode-alist '("\\.t$" . perl-mode))
 
; help perl6-mode recognise the new name
(add-to-list 'auto-mode-alist '("\\.rakumod\\'" . perl6-mode))
(add-to-list 'auto-mode-alist '("\\.raku\\'" . perl6-mode))
(add-to-list 'interpreter-mode-alist '("raku" . perl6-mode))
 
 
(autoload 'arduino-mode "arduino-mode" "mode to edit arduino sketches" t)
(add-to-list 'auto-mode-alist '("\\.pde\\'" . arduino-mode))
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
 
(add-to-list 'auto-mode-alist '("\\.md$" . markdown-mode))
(add-hook 'markdown-mode-hook (lambda ()
                           (progn
                             (auto-fill-mode 1)
                             (flyspell-mode)
                             )))
 
; I use references in my LaTeX files
(add-hook 'latex-mode-hook 'turn-on-reftex)
; sometimes I edit POVRay files (mode from http://www.xahlee.org/3d/povray_emacs.html )
(autoload 'pov-mode "pov-mode" "Major mode to edit POV-Ray files." t )
(add-to-list 'auto-mode-alist '("\\.pov$" . pov-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . pov-mode))
; Haskell mode configuration
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(add-hook 'haskell-mode-hook 'imenu-add-menubar-index)
; calendar mode configuration
(setq mark-holidays-in-calendar t)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
(setq mark-diary-entries-in-calendar t)
(setq calendar-date-display-form '(year "-" month "-" day))
(setq calendar-time-display-form '(24-hours ":" minutes
               (if time-zone " (") time-zone (if time-zone ")")))
; org mode
(add-to-list 'auto-mode-alist  '("TODO$" . org-mode))
 
; -------- use the function keys! --------
(global-set-key [f13] 'universal-argument)
; change dictionary with a single key
(global-set-key [f14] (lambda () (interactive) (ispell-change-dictionary "italiano")))
(global-set-key [f15] (lambda () (interactive) (ispell-change-dictionary "en_GB")))
(global-set-key [XF86Launch6] (lambda () (interactive) (ispell-change-dictionary "en_GB")))
(global-set-key (kbd "M-ยง") 'magit-status)
(global-set-key (kbd "M-`") 'magit-status)
 
; -------- different keyboard, different keys --------
(global-set-key [XF86Tools] 'universal-argument)
; change dictionary with a single key
(global-set-key [XF86Launch5] (lambda () (interactive) (ispell-change-dictionary "italiano")))
(global-set-key [XF86MenuKB] (lambda () (interactive) (ispell-change-dictionary "en_GB")))
 
(global-set-key [(meta control return)] 'find-file-at-point)
 
; ELPA packages are loaded after init.el, so we can't call a function
; from one of those packages here; see also
; https://www.emacswiki.org/emacs/ELPA
(add-hook 'after-init-hook 'unicode-fonts-setup)
(add-hook 'after-init-hook 'gnu-elpa-keyring-update)
 
(defun dakkar/perl-indent (beg end)
  (interactive "r")
  (if (use-region-p)
      (cond ((get-text-property beg 'in-pod)
             (let* (
                    (text (buffer-substring beg end))
                    (indented-text (with-temp-buffer
                                     (insert text)
                                     (cperl-mode)
                                     (cperl-indent-region 0 (buffer-size))
                                     (indent-rigidly 0 (buffer-size) cperl-indent-level)
                                     (buffer-string))))
               (delete-region beg end)
               (insert indented-text)))
            (t (cperl-indent-region beg end)))))
 
(defun dakkar/setup-cperl-mode ()
  (setq indent-region-function 'dakkar/perl-indent)
  (substitute-key-definition
   'indent-region 'dakkar/perl-indent
   cperl-mode-map global-map))
 
(add-hook 'cperl-mode-hook 'dakkar/setup-cperl-mode)
 
(require 'lsp-mode)
(add-hook 'go-mode-hook 'lsp-deferred)
(add-hook 'lsp-mode-hook (lambda()
                          (progn
                            (lsp-ui-mode)
                            (yas-minor-mode))))