summaryrefslogtreecommitdiff
path: root/nemacs-personal.el
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-05-29 07:40:54 -0700
committerChristian Cunningham <cc@localhost>2024-05-29 07:40:54 -0700
commitc5a06aa3b3c6954b806db030900b89428fc05143 (patch)
treeb5fb67d46a926ef66bc57f3fcb410e4507a4fed3 /nemacs-personal.el
parentc0fea7f9182139bb7ba5d3e59c8111f620e95fae (diff)
QoL ChangesHEADmaster
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 ()