Christopher James Hayward
4 years ago
7 changed files with 146 additions and 105 deletions
-
BINdocs/archive.org.gpg
-
4elisp/options.el
-
45modules/cc.org
-
43modules/conf.org
-
102modules/development.org
-
2modules/keys.org
-
55modules/uml.org
@ -0,0 +1,45 @@ |
|||
#+TITLE: C/C++ |
|||
#+AUTHOR: Christopher James Hayward |
|||
#+EMAIL: chris@chrishayward.xyz |
|||
|
|||
#+PROPERTY: header-args:emacs-lisp :tangle cc.el :comments org |
|||
#+PROPERTY: header-args:shell :tangle no |
|||
#+PROPERTY: header-args :results silent :eval no-export :comments org |
|||
|
|||
#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil |
|||
#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil |
|||
|
|||
#+begin_quote |
|||
The goal of C++ is productivity, this comes in many ways, but the language is designed to aid you as much as possible whiole hindering you as little as possible with arbitrary rules or requirements. |
|||
|
|||
-- Bruce Eckel, Thinking in C++[fn:1] |
|||
#+end_quote |
|||
|
|||
* Setup |
|||
|
|||
Make sure all of the required components are installed, and the ~lsp~ and ~dap~ modules have loaded before loading this module. |
|||
|
|||
#+begin_src shell |
|||
RUN apt install -y gcc gdb ccls libstdc++ |
|||
#+end_src |
|||
|
|||
* Config |
|||
|
|||
Use the ~ccls~[fn:2] language server, and the respective Emacs package to interact with the server inside of Emacs. Load the ~babel~ language module and add structure templates for creating C/C++ code blocks inside ~org-mode~. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package ccls |
|||
:hook ((c-mode c++-mode objc-mode cuda-mode) . |
|||
(lambda () |
|||
(require 'ccls) |
|||
(lsp-deferred))) |
|||
:config (add-to-list 'org-structure-template-alist '("cc" . "src C")) |
|||
(add-to-list 'org-structure-template-alist '("cpp" . "src C++")) |
|||
(org-babel-do-load-languages 'org-babel-load-languages '((C . t)))) |
|||
#+end_src |
|||
|
|||
* Footnotes |
|||
|
|||
[fn:1] https://chrishayward.xyz/notes/thinking-in-cpp/ |
|||
|
|||
[fn:2] https://github.com/MaskRay/ccls |
@ -0,0 +1,43 @@ |
|||
#+TITLE: Conf |
|||
#+AUTHOR: Christopher James Hayward |
|||
#+EMAIL: chris@chrishayward.xyz |
|||
|
|||
#+PROPERTY: header-args:emacs-lisp :tangle conf.el :comments org |
|||
#+PROPERTY: header-args:shell :tangle no |
|||
#+PROPERTY: header-args :results silent :eval no-export :comments org |
|||
|
|||
#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil |
|||
#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil |
|||
|
|||
Support for different configuration languages. |
|||
|
|||
* Config |
|||
|
|||
Add support for different configuration languages, or other modules that don't fit in their own module (yet). |
|||
|
|||
** HTTP |
|||
|
|||
Interact with ~HTTP~ endpoints using the ~ob-http~[fn:1] package. You can see how it works in my post here[fn:2]. It adds interactive ~HTTP~ blocks that can output their results in place, within an ~org-mode~ buffer. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package ob-http |
|||
:after org |
|||
:config (org-babel-do-load-languages |
|||
'org-babel-load-languages '((http . t)))) |
|||
#+end_src |
|||
|
|||
** YAML |
|||
|
|||
Support for YAML[fn:3] files. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package yaml-mode) |
|||
#+end_src |
|||
|
|||
* Footnotes |
|||
|
|||
[fn:1] https://github.com/zweifisch/ob-http |
|||
|
|||
[fn:2] https://chrishayward.xyz/posts/kanye-as-a-service/ |
|||
|
|||
[fn:3] https://emacswiki.org/emacs/YamlMode |
@ -1,102 +0,0 @@ |
|||
#+TITLE: Development |
|||
#+AUTHOR: Christopher James Hayward |
|||
#+EMAIL: chris@chrishayward.xyz |
|||
|
|||
#+PROPERTY: header-args:emacs-lisp :tangle development.el :comments org |
|||
#+PROPERTY: header-args:shell :tangle no |
|||
#+PROPERTY: header-args :results silent :eval no-export :comments org |
|||
|
|||
#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil |
|||
#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil |
|||
|
|||
Support for individual programming languages, has a hard dependency on the [[file:projects.org][Projects]] module for integration with *LSP*[fn:1] / *DAP*[fn:2] |
|||
|
|||
* HTTP |
|||
|
|||
Interactive with *HTTP* endpoints using the *ob-http*[fn:6] package. You can see how it works in my post [[file:../docs/posts/kanye-as-a-service.org.gpg][Kanye as a Service]]. Essentialy it adds interactive *HTTP* blocks that can output their results in place. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package ob-http |
|||
:after org |
|||
:config (org-babel-do-load-languages |
|||
'org-babel-load-languages '((http . t)))) |
|||
#+end_src |
|||
|
|||
* YAML |
|||
|
|||
Support for YAML files. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package yaml-mode) |
|||
#+end_src |
|||
|
|||
* C/C++ |
|||
|
|||
Add support for the *C/C++* family of languages via the *CCLS*[fn:7] language server. |
|||
|
|||
+ Install requirements |
|||
+ Integrate with *LSP*[fn:2] |
|||
+ Integrate with *DAP*[fn:1] |
|||
+ Load babel language modules |
|||
+ Create new structure templates |
|||
* ~<cc~ for *C* |
|||
* ~<cpp~ for *C++* |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package ccls |
|||
:hook ((c-mode c++-mode objc-mode cuda-mode) . |
|||
(lambda () |
|||
(require 'ccls) |
|||
(lsp-deferred))) |
|||
:config (add-to-list 'org-structure-template-alist '("cc" . "src C")) |
|||
(add-to-list 'org-structure-template-alist '("cpp" . "src C++")) |
|||
(org-babel-do-load-languages 'org-babel-load-languages '((C . t)))) |
|||
#+end_src |
|||
|
|||
* PlantUML |
|||
|
|||
Download and install *PlantUML*[fn:8], a text-based markup language for creating UML diagrams. You can read my notes about the tool [[file:../docs/notes/plantuml.org.gpg][PlantUML]] here. Support added through the *plantuml-mode*[fn:9] package. |
|||
|
|||
+ Install requirements |
|||
+ Load the babel module for *PlantUML*[fn:8] |
|||
+ Create a structure template with ~<pl~ |
|||
+ Toggle inline imagines with =SPC t i= |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package plantuml-mode |
|||
:after org |
|||
:custom (plantuml-default-exec-mode 'jar) |
|||
(plantuml-jar-path "~/.local/bin/plantuml.jar") |
|||
(org-plantuml-jar-path (expand-file-name "~/.local/bin/plantuml.jar")) |
|||
(org-startup-with-inline-images t) |
|||
:config (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) |
|||
(add-to-list 'org-structure-template-alist '("pl" . "src plantuml")) |
|||
(org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t))) |
|||
(dotfiles/leader "ti" '(org-toggle-inline-images :which-key "Images"))) |
|||
#+end_src |
|||
|
|||
* Footnotes |
|||
|
|||
[fn:1] https://microsoft.github.io/debug-adapter-protocol |
|||
|
|||
[fn:2] https://microsoft.github.io/language-server-protocol |
|||
|
|||
[fn:3] https://golang.org |
|||
|
|||
[fn:4] https://pkg.go.dev/golang.org/x/tools/gopls |
|||
|
|||
[fn:5] https://emacswiki.org/emacs/GoMode |
|||
|
|||
[fn:6] https://github.com/zweifisch/ob-http |
|||
|
|||
[fn:7] https://github.com/MaskRay/ccls |
|||
|
|||
[fn:8] https://plantuml.com |
|||
|
|||
[fn:9] https://github.com/skuro/plantuml-mode |
|||
|
|||
[fn:10] https://pypi.org/project/python-language-server/ |
|||
|
|||
[fn:11] https://emacswiki.org/emacs/PythonProgrammingInEmacs |
|||
|
|||
[fn:12] https://python.org |
@ -0,0 +1,55 @@ |
|||
#+TITLE: UML |
|||
#+AUTHOR: Christopher James Hayward |
|||
#+EMAIL: chris@chrishayward.xyz |
|||
|
|||
#+PROPERTY: header-args:emacs-lisp :tangle uml.el :comments org |
|||
#+PROPERTY: header-args:shell :tangle no |
|||
#+PROPERTY: header-args :results silent :eval no-export :comments org |
|||
|
|||
#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil |
|||
#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil |
|||
|
|||
Draw UML[fn:1] diagrams inside Emacs. |
|||
|
|||
* Setup |
|||
|
|||
Make sure all of the required components are installed on your system before loading the module. |
|||
|
|||
#+begin_src shell |
|||
RUN apt install -y default-jre |
|||
#+end_src |
|||
|
|||
* Config |
|||
|
|||
Download and install ~PlantUML~[fn:2], a text-based markup language for creating UML[fn:1] diagrams. You can read my notes about using the software here[fn:3]. Support for Emacs is added through the ~plantuml-mode~[fn:4] package. Configure the ~babel~ language module and structure templates to write diagrams in ~org-mode~ buffers. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(use-package plantuml-mode |
|||
:after org |
|||
:custom (plantuml-default-exec-mode 'jar) |
|||
(plantuml-jar-path "~/.local/bin/plantuml.jar") |
|||
(org-plantuml-jar-path (expand-file-name "~/.local/bin/plantuml.jar")) |
|||
(org-startup-with-inline-images t) |
|||
:config (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) |
|||
(add-to-list 'org-structure-template-alist '("pl" . "src plantuml")) |
|||
(org-babel-do-load-languages 'org-babel-load-languages '((plantuml . t)))) |
|||
#+end_src |
|||
|
|||
* Shortcuts |
|||
|
|||
Toggle inline imagines with =SPC t i=. |
|||
|
|||
#+begin_src emacs-lisp |
|||
(dotfiles/leader |
|||
"ti" '(org-toggle-inline-images :which-key "Images")) |
|||
#+end_src |
|||
|
|||
* Footnotes |
|||
|
|||
[fn:1] https://tutorialspoint.com/uml/uml_standard_diagrams.htm |
|||
|
|||
[fn:2] https://plantuml.com |
|||
|
|||
[fn:3] https://chrishayward.xyz/notes/plantuml/ |
|||
|
|||
[fn:4] https://github.com/skuro/plantuml-mode |
Write
Preview
Loading…
Cancel
Save
Reference in new issue