added python venv and some EShell customizations

This commit is contained in:
Ian Griffin 2024-06-29 23:46:09 +08:00
parent 6221e35733
commit 008ce842e7
2 changed files with 36 additions and 24 deletions

View File

@ -58,7 +58,6 @@ No longer using typescript-mode, as there's a builtin typescript-ts mode in Emac
(let ((server-programs '(("typescript-ts-mode" . ("typescript-language-server" "--stdio")) (let ((server-programs '(("typescript-ts-mode" . ("typescript-language-server" "--stdio"))
("tsx-ts-mode" . ("typescript-language-server""--stdio"))))) ("tsx-ts-mode" . ("typescript-language-server""--stdio")))))
(setq eglot-server-programs (append server-programs eglot-server-programs)))) (setq eglot-server-programs (append server-programs eglot-server-programs))))
(use-package typescript-mode (use-package typescript-mode
:mode ("\\.ts\\'" ("\\.tsx" . typescript-tsx-mode)) :mode ("\\.ts\\'" ("\\.tsx" . typescript-tsx-mode))
:config :config
@ -68,7 +67,7 @@ No longer using typescript-mode, as there's a builtin typescript-ts mode in Emac
:hook :hook
(typescript-mode . (lambda () (lang-default-settings) (typescript-mode . (lambda () (lang-default-settings)
(let ((custom-tab-size 2)) (let ((custom-tab-size 2))
(setq-default default-tab-width custom-tab-sizen (setq-default default-tab-width custom-tab-size
tab-width custom-tab-size tab-width custom-tab-size
c-basic-offset custom-tab-size)))) c-basic-offset custom-tab-size))))
(typescript-tsx-mode . (lambda () (typescript-tsx-mode . (lambda ()
@ -85,8 +84,7 @@ No longer using typescript-mode, as there's a builtin typescript-ts mode in Emac
:commands (markdown-mode gfm-mode) :commands (markdown-mode gfm-mode)
:mode (("\\.md\\'". markdown-mode) :mode (("\\.md\\'". markdown-mode)
("\\.markdown\\'" . markdown-mode)) ("\\.markdown\\'" . markdown-mode))
:init :custom ((markdown-command "multimarkdown" "set the markdown command")))
(setq markdown-command "multimarkdown"))
#+end_src #+end_src
** JSON ** JSON
@ -97,7 +95,6 @@ No longer using typescript-mode, as there's a builtin typescript-ts mode in Emac
#+end_src #+end_src
** LaTeX (AUCTeX) ** LaTeX (AUCTeX)
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package tex (use-package tex
:ensure auctex :ensure auctex
@ -123,6 +120,16 @@ python venv manager
(setenv "WORKON_HOME" (expand-file-name ".local/opt/miniforge3/envs" (safe-getenv "HOME" user-home-path)))) (setenv "WORKON_HOME" (expand-file-name ".local/opt/miniforge3/envs" (safe-getenv "HOME" user-home-path))))
#+end_src #+end_src
*** Jupyter
#+begin_src emacs-lisp
(use-package ein
:config
(add-to-list 'org-babel-load-languages '(ein . t)))
;; :custom
;; (ein:jupyter-server-use-subcommand "server" "use jupyterlab instead of jupyter notebook")
;; :mode (("\\.ipynb\\'". ein:notebook-mode)))
#+end_src
*** Tab Size *** Tab Size
Python code is recomendded to set the tab size to 4 Python code is recomendded to set the tab size to 4

View File

@ -59,12 +59,18 @@ do presentations in Org mode
#+end_src #+end_src
* Emacs Shell * Emacs Shell
** History ** History
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-hook 'eshell-expand-input-functions 'eshell-expand-history-references) (add-hook 'eshell-expand-input-functions 'eshell-expand-history-references)
#+end_src #+end_src
** Autocomplete
setup EShell's tab completion to be like bash's
#+begin_src emacs-lisp
(add-hook 'eshell-mode-hook (lambda () (setq pcomplete-cycle-completions nil)))
(setq eshell-cmpl-cycle-completions nil)
#+end_src
** Prompt ** Prompt
This sets the prompt to a lambda, for aesthetic reasons This sets the prompt to a lambda, for aesthetic reasons
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -84,7 +90,6 @@ This sets the prompt to a lambda, for aesthetic reasons
(setq eshell-highlight-prompt nil) (setq eshell-highlight-prompt nil)
#+end_src #+end_src
* Undo Tree * Undo Tree
a visualizer for Emacs' cool but confusing undo/history system a visualizer for Emacs' cool but confusing undo/history system