blob: 4482e50ca245a2219179d87d2fb58bd041d86da4 (
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
|
;; Ignore bell
(setq ring-bell-function 'ignore)
(setq python-shell-interpreter "~/.micromamba/envs/emacs-py/bin/ipython"
python-shell-interpreter-args "--pylab")
(defun nm/add-to-pypath (&optional path)
"# Add to python path"
(interactive)
(let* ((fullpath (if path
path
(ido-read-directory-name "Path: "))))
(setenv "PYTHONPATH"
(let ((current (getenv "PYTHONPATH"))
(new fullpath))
(if current
(concat new ":" current)
new)))))
(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
(require 'eglot)
(define-key eglot-mode-map (kbd "C-c l r") 'eglot-rename)
(define-key eglot-mode-map (kbd "C-c l f") 'eglot-format)
(define-key eglot-mode-map (kbd "C-c l d") 'eldoc)
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.8))
(let ((png (cdr (assoc 'dvipng org-preview-latex-process-alist))))
(plist-put png :latex-compiler '("latex -interaction nonstopmode -output-directory %o %F"))
(plist-put png :image-converter '("dvipng -D %D -T tight -o %O %F"))
(plist-put png :transparent-image-converter '("dvipng -D %D -T tight -bg Transparent -o %O %F")))
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)
(gnuplot . t)
(R . t)))
(setq org-babel-python-command python-shell-interpreter)
(setq org-babel-R-command "/usr/local/bin/R --slave --no-save")
(setq org-babel-gnuplot-command "/usr/local/bin/gnuplot")
(setq org-confirm-babel-evaluate nil)
(defun nm/personal/ignore-angle-brackets ()
"Ignore angle brackets in org mode"
(modify-syntax-entry ?< ".")
(modify-syntax-entry ?> "."))
(add-hook 'org-mode-hook 'nm/personal/ignore-angle-brackets)
(add-to-list 'load-path "~/.emacs.d/extras/")
(when (require 'writegood-mode nil t)
(global-set-key (kbd "C-c g") 'writegood-mode))
(with-eval-after-load 'python
(defun python-shell-completion-native-try ()
"Return non-nil if can trigger native completion."
(let ((python-shell-completion-native-enable t)
(python-shell-completion-native-output-timeout
python-shell-completion-native-try-output-timeout))
(python-shell-completion-native-get-completions
(get-buffer-process (current-buffer))
nil "_"))))
(setq sentence-end-double-space nil)
(setq nm/dashboard-file nil)
(setq nm/dashboard-file "~/nemacs/dashboard.org")
(if nm/dashboard-file
(find-file nm/dashboard-file))
(provide 'nemacs-personal)
|