I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.4 KiB

4 years ago
  1. #+TITLE: Terminal
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle terminal.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. Performing terminal interactions is a must-have for any modern editor. This module introduces *two* means of doing so with [[https://gnu.org/software/emacs/manual/html_node/eshell/index.html][EShell]][fn:1] and [[https://github.com/akermu/emacs-libvterm][VTerm]][fn:2].
  9. * Emacs Lisp shell
  10. *EShell*[fn:1] is a fully *POSIX* compliant shell written entirely in Emacs Lisp. While not a traditional terminal emulator, it provides a native REPL for Emacs Lisp code with everything available in the environment.
  11. + Don't highlight the prompt
  12. + Favour use of system utilities
  13. + Open in the current buffer with =SPC e=
  14. #+begin_src emacs-lisp
  15. (setq eshell-highlight-prompt nil
  16. eshell-prefer-lisp-functions nil)
  17. (dotfiles/leader
  18. "e" '(eshell :which-key "Shell"))
  19. #+end_src
  20. ** Prompt extras
  21. Implement the lambda prompt for aesthetic purposes with the [[https://github.com/zwild/eshell-prompt-extras][EShell Prompt Extras]][fn:3] package.
  22. #+begin_src emacs-lisp
  23. (use-package eshell-prompt-extras
  24. :custom (eshell-prompt-function 'epe-theme-lambda))
  25. #+end_src
  26. Here's an example of what that looks like:
  27. #+begin_example
  28. ~/.emacs.d/modules:main*? λ
  29. #+end_example
  30. * Interactive Terminal
  31. *EShell*[fn:1] isn't enough when needing interactivity from the terminal. Going through [[file:../docs/notes/thinking-in-cpp.org.gpg][Thinking in C++]] for one of my courses required lots of terminal interaction which *Eshell*[fn:1] was unable to handle. *VTerm's*[fn:2] based on an external C library which is blazing fast, and fully interactive.
  32. + Always compile the module
  33. + Open in the current buffer with =SPC v=
  34. #+begin_src emacs-lisp
  35. (use-package vterm
  36. :commands (vterm)
  37. :custom (vterm-always-compile-module t)
  38. :config (dotfiles/leader "v" '(vterm :which-key "Terminal")))
  39. #+end_src
  40. ** Requirements
  41. Install the required packages on *Debian/Ubuntu* based systems.
  42. #+begin_src shell
  43. sudo apt install -y cmake \
  44. libtool \
  45. libtool-bin
  46. #+end_src
  47. * Resources
  48. [fn:1] https://gnu.org/software/emacs/manual/html_node/eshell/index.html
  49. [fn:2] https://github.com/akermu/emacs-libvterm
  50. [fn:3] https://github.com/zwild/eshell-prompt-extras