From 008ce842e78d905b95841c92859b57be0e921569 Mon Sep 17 00:00:00 2001 From: Ian Griffin Date: Sat, 29 Jun 2024 23:46:09 +0800 Subject: [PATCH] added python venv and some EShell customizations --- init.org.d/70-lang.org | 51 ++++++++++++++++++++++---------------- init.org.d/80-misc-end.org | 9 +++++-- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/init.org.d/70-lang.org b/init.org.d/70-lang.org index 738abe7..7607b4b 100644 --- a/init.org.d/70-lang.org +++ b/init.org.d/70-lang.org @@ -58,25 +58,24 @@ 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")) ("tsx-ts-mode" . ("typescript-language-server""--stdio"))))) (setq eglot-server-programs (append server-programs eglot-server-programs)))) - - (use-package typescript-mode - :mode ("\\.ts\\'" ("\\.tsx" . typescript-tsx-mode)) - :config - (define-derived-mode typescript-tsx-mode typescript-mode "TypeScriptReact") - (dolist (mode '(typescript-mode typescript-tsx-mode)) - (add-to-list 'eglot-server-programs `(,mode . ("typescript-language-server", "--stdio")))) - :hook - (typescript-mode . (lambda () (lang-default-settings) - (let ((custom-tab-size 2)) - (setq-default default-tab-width custom-tab-sizen - tab-width custom-tab-size - c-basic-offset custom-tab-size)))) - (typescript-tsx-mode . (lambda () - (lang-default-settings) - (let ((custom-tab-size 4)) - (setq-default default-tab-width custom-tab-size - tab-width custom-tab-size - c-basic-offset custom-tab-size)))))) + (use-package typescript-mode + :mode ("\\.ts\\'" ("\\.tsx" . typescript-tsx-mode)) + :config + (define-derived-mode typescript-tsx-mode typescript-mode "TypeScriptReact") + (dolist (mode '(typescript-mode typescript-tsx-mode)) + (add-to-list 'eglot-server-programs `(,mode . ("typescript-language-server", "--stdio")))) + :hook + (typescript-mode . (lambda () (lang-default-settings) + (let ((custom-tab-size 2)) + (setq-default default-tab-width custom-tab-size + tab-width custom-tab-size + c-basic-offset custom-tab-size)))) + (typescript-tsx-mode . (lambda () + (lang-default-settings) + (let ((custom-tab-size 4)) + (setq-default default-tab-width custom-tab-size + tab-width custom-tab-size + c-basic-offset custom-tab-size)))))) #+end_src ** Markdown @@ -85,8 +84,7 @@ No longer using typescript-mode, as there's a builtin typescript-ts mode in Emac :commands (markdown-mode gfm-mode) :mode (("\\.md\\'". markdown-mode) ("\\.markdown\\'" . markdown-mode)) - :init - (setq markdown-command "multimarkdown")) + :custom ((markdown-command "multimarkdown" "set the markdown command"))) #+end_src ** JSON @@ -97,7 +95,6 @@ No longer using typescript-mode, as there's a builtin typescript-ts mode in Emac #+end_src ** LaTeX (AUCTeX) - #+begin_src emacs-lisp (use-package tex :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)))) #+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 Python code is recomendded to set the tab size to 4 diff --git a/init.org.d/80-misc-end.org b/init.org.d/80-misc-end.org index 4442bbb..bdd85fc 100644 --- a/init.org.d/80-misc-end.org +++ b/init.org.d/80-misc-end.org @@ -59,12 +59,18 @@ do presentations in Org mode #+end_src * Emacs Shell - ** History #+begin_src emacs-lisp (add-hook 'eshell-expand-input-functions 'eshell-expand-history-references) #+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 This sets the prompt to a lambda, for aesthetic reasons #+begin_src emacs-lisp @@ -84,7 +90,6 @@ This sets the prompt to a lambda, for aesthetic reasons (setq eshell-highlight-prompt nil) #+end_src - * Undo Tree a visualizer for Emacs' cool but confusing undo/history system