diff options
author | Christian Cunningham <cc@localhost> | 2024-05-29 07:40:54 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2024-05-29 07:40:54 -0700 |
commit | c5a06aa3b3c6954b806db030900b89428fc05143 (patch) | |
tree | b5fb67d46a926ef66bc57f3fcb410e4507a4fed3 | |
parent | c0fea7f9182139bb7ba5d3e59c8111f620e95fae (diff) |
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
-rw-r--r-- | nemacs-personal.el | 28 | ||||
-rw-r--r-- | nemacs.el | 1 |
2 files changed, 20 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 () @@ -22,6 +22,7 @@ ;;(require 'nemacs-splash) (put 'narrow-to-region 'disabled nil) +(put 'downcase-region 'disabled nil) (require 'nemacs-personal) (custom-set-faces |