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.

136 lines
3.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #+TITLE: Projects
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle projects.el :comments org
  5. #+PROPERTY: header-args:shell :tangle no
  6. #+PROPERTY: header-args :results silent :eval no-export :comments org
  7. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  8. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  9. #+ATTR_ORG: :width 420px
  10. #+ATTR_HTML: :width 420px
  11. #+ATTR_LATEX: :width 420px
  12. [[../docs/images/2021-02-13-example-ccls.gif]]
  13. An *IDE*[fn:1] like experience or better can be achieved within Emacs using two *Microsoft*[fn:2] open-source initiatives:
  14. + *Debug Adapter Protocol*[fn:3]
  15. + *Language Server Protocol*[fn:4]
  16. * Code snippets
  17. #+begin_src emacs-lisp
  18. (use-package yasnippet
  19. :ensure t)
  20. #+end_src
  21. * Debug adapters
  22. *Dap mode*[fn:5] provides support for the *Debug Adapter Protocol*[fn:3] inside of Emacs.
  23. #+begin_src emacs-lisp
  24. (use-package dap-mode
  25. :commands (dap-debug))
  26. #+end_src
  27. * Language servers
  28. Support for the *Language Server Protocol*[fn:4] is added to Emacs through the *Lsp mode*[fn:6] package.
  29. #+begin_src emacs-lisp
  30. (use-package lsp-mode
  31. :commands (lsp lsp-deferred)
  32. :custom (lsp-idle-delay (* 5 dotfiles/idle))
  33. (lsp-prefer-flymake t))
  34. #+end_src
  35. ** UI integration
  36. *Lsp ui*[fn:7] provides user interface improvements for *Lsp mode*[fn:6].
  37. #+begin_src emacs-lisp
  38. (use-package lsp-ui
  39. :after lsp
  40. :custom (lsp-ui-doc-position 'at-point)
  41. (lsp-ui-doc-delay 0.500))
  42. #+end_src
  43. ** Code completion
  44. Text completion via *Company*[fn:8] =AKA= *Complete Anything*.
  45. #+begin_src emacs-lisp
  46. (use-package company
  47. :after lsp)
  48. #+end_src
  49. Integrate with *Lsp mode*[fn:6] to provide completion candidates through the *Language Server Protocol*[fn:4].
  50. + Specify the repository
  51. + Use asynchronous completion
  52. #+begin_src emacs-lisp
  53. (use-package company-lsp
  54. :after (lsp company)
  55. :custom (company-lsp-async t)
  56. (company-backend 'company-lsp)
  57. :straight (company-lsp :type git
  58. :host github
  59. :repo "tigersoldier/company-lsp"))
  60. #+end_src
  61. * Docker containers
  62. Manage *Docker*[fn:9] containers with *Docker.el*[fn:10].
  63. #+begin_src emacs-lisp
  64. (use-package docker
  65. :commands (docker))
  66. #+end_src
  67. Open the container management screen with =SPC k=.
  68. #+begin_src emacs-lisp
  69. (dotfiles/leader
  70. "k" '(docker :which-key "Docker"))
  71. #+end_src
  72. * Project management
  73. Configure *Projectile*[fn:11], a project interaction library for Emacs. It provides a nice set of features for operating on a project level without introducing external dependencies.
  74. #+begin_src emacs-lisp
  75. (use-package projectile
  76. :custom (projectile-project-search-path '("~/.local/source"))
  77. :config (projectile-mode))
  78. #+end_src
  79. * Footnotes
  80. [fn:1] https://en.wikipedia.org/wiki/Integrated_development_environment
  81. [fn:2] https://en.wikipedia.org/wiki/Microsoft_and_open_source
  82. [fn:3] https://microsoft.github.io/debug-adapter-protocol
  83. [fn:4] https://microsoft.github.io/language-server-protocol
  84. [fn:5] https://emacs-lsp.github.io/dap-mode/
  85. [fn:6] https://emacs-lsp.github.io/lsp-mode/
  86. [fn:7] https://emacs-lsp.github.io/lsp-ui/
  87. [fn:8] https://company-mode.github.io/
  88. [fn:9] https://docker.com
  89. [fn:10] https://github.com/Silex/docker.el
  90. [fn:11] https://projectile.mx
  91. [fn:12] https://git.zx2c4.com/password-store/tree/contrib/emacs
  92. [fn:13] https://passwordstore.org