Add Ada config

This commit is contained in:
2021-01-01 00:00:37 +00:00
parent 5364471165
commit 21754206dd
13 changed files with 15404 additions and 0 deletions

View File

@@ -951,6 +951,64 @@
(add-hook 'csharp-mode-hook #'lsp-deferred)
#+end_src
** Ada
*** Old ada-mode
Unfortunately, the =ada-mode= on ELPA is hot garbage. It requires
a custom parser to be built from its sources, and as far as I can
tell it's completely broken: every version I've tried to build has
produced multiple compile errors.
There was a more basic =ada-mode= built in to Emacs, and
thankfully someone else has already done the hard work of bundling
that up -- [[https://tkurtbond.github.io/posts/2022/07/09/using-the-old-version-of-ada-mode-for-emacs/][Using the old version of Ada Mode for Emacs]]. They've
provided a ZIP file with all the neccessary files bundled into it,
which can be grabbed with the following:
#+begin_src shell
cd ~/Downloads
curl -LO https://tkurtbond.github.io/emacs/old-ada-mode.zip
unzip -d ~/.emacs.d old-ada-mode.zip
#+end_src
The directory =~/.emacs.d/ada-mode= than has to be added to
[[help:load-path][load-path]] and autoloaded:
#+begin_src emacs-lisp
(let* ((home (getenv "HOME"))
(path (concat home "/.emacs.d/ada-mode")))
(add-to-list 'load-path path))
(autoload 'ada-mode "ada-mode")
#+end_src
*** LSP
=lsp-mode= with =ada_language_server= provides all the IDE-esque
niceties:
#+begin_src emacs-lisp
(add-hook 'ada-mode-hook #'lsp-deferred)
#+end_src
[[https://github.com/AdaCore/ada_language_server][ada_language_server]] has to be installed manually. There are linux
builds available on the [[https://github.com/AdaCore/ada_language_server/releases][GitHub releases page]].
*** Indentation
Set the indent width to 4:
#+begin_src emacs-lisp
(setq ada-indent 4)
#+end_src
Ada is definitely a tabs language, if you ask me, so we want to
enable smart tabs. Since it's not supported out-of-the-box, Ada
support must be added:
#+begin_src emacs-lisp
(smart-tabs-add-language-support ada ada-mode-hook
((ada-indent-current-function . ada-indent)
(ada-indent-region . ada-indent)))
#+end_src
* Tool Integrations
** Git
=magit= is truly a wonderful creation! Add keybinding for