*ft_ada.txt* Nvim
ADA FILE TYPE PLUG-INS REFERENCE MANUAL~
ADA *ada.vim*
1. Syntax Highlighting |ft-ada-syntax|
2. File type Plug-in |ft-ada-plugin|
3. Omni Completion |ft-ada-omni|
3.1 Omni Completion with "gnat xref" |gnat-xref|
3.2 Omni Completion with "ctags" |ada-ctags|
4. Compiler Support |ada-compiler|
4.1 GNAT |compiler-gnat|
4.2 Dec Ada |compiler-decada|
5. References |ada-reference|
5.1 Options |ft-ada-options|
5.2 Commands |ft-ada-commands|
5.3 Variables |ft-ada-variables|
5.4 Constants |ft-ada-constants|
5.5 Functions |ft-ada-functions|
6. Extra Plug-ins |ada-extra-plugins|
==============================================================================
1. Syntax Highlighting ~
*ft-ada-syntax*
This mode is designed for the 2005 edition of Ada ("Ada 2005"), which includes
support for objected-programming, protected types, and so on. It handles code
written for the original Ada language ("Ada83", "Ada87", "Ada95") as well,
though code which uses Ada 2005-only keywords will be wrongly colored (such
code should be fixed anyway). For more information about Ada, see
http://www.adapower.com.
The Ada mode handles a number of situations cleanly.
For example, it knows that the "-" in "-5" is a number, but the same character
in "A-5" is an operator. Normally, a "with" or "use" clause referencing
another compilation unit is coloured the same way as C's "#include" is coloured.
If you have "Conditional" or "Repeat" groups coloured differently, then "end
if" and "end loop" will be coloured as part of those respective groups.
You can set these to different colours using vim's "highlight" command (e.g.,
to change how loops are displayed, enter the command ":hi Repeat" followed by
the colour specification; on simple terminals the colour specification
ctermfg=White often shows well).
There are several options you can select in this Ada mode. See |ft-ada-options|
for a complete list.
To enable them, assign a value to the option. For example, to turn one on: >
let g:ada_standard_types = 1
<
To disable them use ":unlet". Example: >
unlet g:ada_standard_types
<
You can just use ":" and type these into the command line to set these
temporarily before loading an Ada file. You can make these option settings
permanent by adding the "let" command(s), without a colon, to your |init.vim|
file.
Even on a slow (90Mhz) PC this mode works quickly, but if you find the
performance unacceptable, turn on |g:ada_withuse_ordinary|.
Syntax folding instructions (|fold-syntax|) are added when |g:ada_folding| is
set.
==============================================================================
2. File type Plug-in ~
*ft-ada-indent* *ft-ada-plugin*
The Ada plug-in provides support for:
- auto indenting (|indent.txt|)
- insert completion (|i_CTRL-N|)
- user completion (|i_CTRL-X_CTRL-U|)
- tag searches (|tagsrch.txt|)
- Quick Fix (|quickfix.txt|)
- backspace handling (|'backspace'|)
- comment handling (|'comments'|, |'commentstring'|)
The plug-in only activates the features of the Ada mode whenever an Ada
file is opened and adds Ada related entries to the main and pop-up menu.
==============================================================================
3. Omni Completion ~
*ft-ada-omni*
The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
by "gnat xref -v" or the "Universal Ctags" (https://ctags.io). The complete
function will automatically detect which tool was used to create the tags
file.
------------------------------------------------------------------------------
3.1 Omni Completion with "gnat xref" ~
*gnat-xref*
GNAT XREF uses the compiler internal information (ali-files) to produce the
tags file. This has the advantage to be 100% correct and the option of deep
nested analysis. However the code must compile, the generator is