summaryrefslogtreecommitdiff
path: root/nemacs-personal.el
diff options
context:
space:
mode:
authorChristian Cunningham <cc@local.lan>2024-05-29 07:40:54 -0700
committerChristian Cunningham <cc@local.lan>2024-05-29 07:40:54 -0700
commit1f09c1321ef95661803a02b725db59d99725f9d8 (patch)
treeb5fb67d46a926ef66bc57f3fcb410e4507a4fed3 /nemacs-personal.el
parent8e526a83dd5e2afbb5799c7237b31d7e409f7ffc (diff)
QoL Changes
1. Add function to add folder to PYTHON PATH 2. Add Eglot keymap 3. Only open writegood mode if it exists 4. Allow downcasing by default
Diffstat (limited to 'nemacs-personal.el')
-rw-r--r--nemacs-personal.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/nemacs-personal.el b/nemacs-personal.el
index f7e82ad..4482e50 100644
--- a/nemacs-personal.el
+++ b/nemacs-personal.el
@@ -4,16 +4,26 @@
(setq python-shell-interpreter "~/.micromamba/envs/emacs-py/bin/ipython"
python-shell-interpreter-args "--pylab")
-
-;(add-hook 'python-ts-mode-hook #'(lambda () (progn
-; (local-set-key (kbd "C-c l a") 'eglot-code-action-inline)
-; (local-set-key (kbd "C-c l r") 'eglot-rename)
-; (local-set-key (kbd "C-c l f") 'eglot-format)
-; (local-set-key (kbd "C-c l d") 'eldoc))))
-;(add-hook 'python-ts-mode-hook 'eglot-ensure)
+(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"))
@@ -37,8 +47,8 @@
(add-hook 'org-mode-hook 'nm/personal/ignore-angle-brackets)
(add-to-list 'load-path "~/.emacs.d/extras/")
-(require 'writegood-mode)
-(global-set-key (kbd "C-c g") 'writegood-mode)
+(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 ()