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.
|
|
#+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
|