Movatterモバイル変換


[0]ホーム

URL:


Quick links:help overview ·quick reference ·user manual toc ·reference manual toc·faq
Go to keyword (shortcut:k)
Site search (shortcut:s)
ft_ada.txt  ForVim version 9.2.  Last change: 2026 Feb 14    ADA FILE TYPE PLUG-INS REFERENCE MANUALADAada.vim1.Syntax Highlightingft-ada-syntax2.  File type Plug-inft-ada-plugin3.  Omni Completionft-ada-omni    3.1 Omni Completion with "gnat xref"gnat-xref    3.2 Omni Completion with "ctags"ada-ctags4.  Compiler Supportada-compiler    4.1 GNATcompiler-gnat    4.2 Dec Adacompiler-decada5.  Referencesada-reference    5.1 Optionsft-ada-options    5.2 Commandsft-ada-commands    5.3 Variablesft-ada-variables    5.4 Constantsft-ada-constants    5.5 Functionsft-ada-functions6.  Extra Plug-insada-extra-plugins==============================================================================1. Syntax Highlightingft-ada-syntaxThis modeis designed for the 2005 edition of Ada("Ada 2005"), which includessupport for objected-programming, protected types, and so on.  It handles codewritten for the original Ada language("Ada83", "Ada87", "Ada95")as well,though code which uses Ada 2005-only keywords will be wrongly colored (suchcode should be fixed anyway).  For more information about Ada, seehttp://www.adapower.com.The Ada mode handlesa number of situations cleanly.For example,it knows that the "-" in "-5"isa number, but the same characterin "A-5"is an operator.  Normally,a "with" or "use" clause referencinganother compilation unitis coloured the same wayas C's "#include"is coloured.If you have "Conditional" or "Repeat" groups coloured differently, then "endif" and "end loop" will be colouredas 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 bythe colour specification; on simple terminals the colour specificationctermfg=White often shows well).There are severaloptions you can select in this Ada mode. Seeft-ada-optionsfora complete list.To enable them, assigna value to the option.  For example, to turn one on:let g:ada_standard_types = 1To disable them use ":unlet".  Example:unlet g:ada_standard_typesYou can just use ":" and type these into the command line to set thesetemporarily before loading an Ada file.  You can make these option settingspermanent by adding the "let" command(s), withouta colon, to your "~/.vimrc"file.Even ona slow (90Mhz) PC this mode works quickly, but if you find theperformance unacceptable, turn ong:ada_withuse_ordinary.Syntaxfolding instructions(fold-syntax) are added wheng:ada_foldingisset.==============================================================================2. File type Plug-inft-ada-indentft-ada-pluginThe 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 Adafileis opened and adds Ada related entries to the main and pop-up menu.==============================================================================3. Omni Completionft-ada-omniThe Ada omni-completions(i_CTRL-X_CTRL-O) usestags database created eitherby "gnat xref-v" or the "Universal Ctags" (https://ctags.io).  The completefunction will automatically detect which tool was used to create thetagsfile.------------------------------------------------------------------------------3.1 Omni Completion with "gnat xref"gnat-xrefGNAT XREF uses the compiler internal information (ali-files) to produce thetags file. This has the advantage to be 100% correct and the option of deepnested analysis. However the codemust compile, the generatoris quiteslow and the createdtags file contains only the basic Ctags information foreach entry- not enough for some of the more advanced Vim code browserplug-ins.NOTE: "gnat xref-v"is very tricky to useasit has almost no diagnostic       output- If nothingis printed then usually the parameters are wrong.       Here some important tips:1)  You need to compile your code first and use the "-aO" option to point to    your .ali files.2)  "gnat xref-v ../Include/adacl.ads" won't work- use  the "gnat xref-v    -aI../Include adacl.ads" instead.3)  "gnat xref-v -aI../Include *.ad?" won't work- use "cd ../Include" and    then "gnat xref-v *.ad?"4)  Project manager supportis completely broken- don't even try "gnat xref    -Padacl.gpr".5)  Vimis faster when thetags fileis sorted- use "sort --unique    --ignore-case --output=tagstags".6)  Remember toinsert "!_TAG_FILE_SORTED 2 %sort ui"as first line tomark    the file assorted.------------------------------------------------------------------------------3.2 Omni Completion with "ctags"ada-ctagsUniversal/Exuberant Ctags use their own multi-language code parser.  Theparseris quite fast, producesa lot of extra information and can run on fileswhich currentlydo not compile.There are also lots of other Vim-tools which use Universal/Exuberant Ctags.Universal Ctagsis preferred, Exuberant Ctagsis no longer being developed.You will need toinstall Universal Ctags whichis available fromhttps://ctags.ioThe Ada parser for Universal/Exuberant Ctagsis fairly new- don't expectcomplete support yet.==============================================================================4. Compiler Supportada-compilerThe Ada mode supports more than one Ada compiler and will automatically load thecompiler set ing:ada_default_compiler whenever an Ada sourceis opened. Theprovided compiler plug-ins are split into the actual compiler plug-in andacollection of supportfunctions and variables. This allows theeasydevelopment of specialized compiler plug-ins fine tuned to yourdevelopmentenvironment.------------------------------------------------------------------------------4.1 GNATcompiler-gnatGNATis the only free (beer and speech) Ada compiler available. There areseveral versions available which differ in the licence terms used.The GNAT compiler plug-in will performa compile on pressing<F7> and thenimmediately shows the result. You can set the project file to be used bysetting:call g:gnat.Set_Project_File ('my_project.gpr')Settinga project file will also createa Vim session(views-sessions) so-like with the GPS- opened files,window positions etc. will be rememberedseparately for all projects.gnat_membersGNAT OBJECTg:gnat.Make()g:gnat.Make()Callsg:gnat.Make_Command and displays the result insideaquickfix window.g:gnat.Pretty()g:gnat.Pretty()Callsg:gnat.Pretty_Programg:gnat.Find()g:gnat.Find()Callsg:gnat.Find_Programg:gnat.Tags()g:gnat.Tags()Callsg:gnat.Tags_Commandg:gnat.Set_Project_File()g:gnat.Set_Project_File([{file}])Set gnat project file and load associated session.  An openproject will be closed and the session written.  If calledwithout file name the file selector opens for selection ofaproject file. If called with an emptystring then the projectand associated session are closed.g:gnat.Project_Fileg:gnat.Project_FilestringCurrent project file.g:gnat.Make_Commandg:gnat.Make_CommandstringExternal command used forg:gnat.Make() ('makeprg').g:gnat.Pretty_Programg:gnat.Pretty_ProgramstringExternal command used forg:gnat.Pretty()g:gnat.Find_Programg:gnat.Find_ProgramstringExternal command used forg:gnat.Find()g:gnat.Tags_Commandg:gnat.Tags_CommandstringExternal command used forg:gnat.Tags()g:gnat.Error_Formatg:gnat.Error_FormatstringError format ('errorformat')------------------------------------------------------------------------------4.2 Dec Adacompiler-hpadacompiler-decadacompiler-vaxadacompiler-compaqadaDec Ada (also known by- in chronological order- VAX Ada, Dec Ada, Compaq Adaand HP Ada)isa fairly dated Ada 83 compiler. Supportis basic:<F7> willcompile the current unit.The Dec Ada compiler expects the package name and not the file name to bepassedasa parameter. The compiler plug-in supports the usual file nameconvention to convert the file intoa unit name. Both '-' and '__' are allowedas separators.decada_membersDEC ADA OBJECTg:decada.Make()g:decada.Make()functionCallsg:decada.Make_Command and displays the result insideaquickfix window.g:decada.Unit_Name()g:decada.Unit_Name()functionGet the Unit name for the current file.g:decada.Make_Commandg:decada.Make_CommandstringExternal command used forg:decada.Make() ('makeprg').g:decada.Error_Formatg:decada.Error_FormatstringError format ('errorformat').==============================================================================5. Referencesada-reference------------------------------------------------------------------------------5.1 Optionsft-ada-optionsg:ada_standard_typesg:ada_standard_typesbool (true when exists)Highlight types in package Standard (e.g., "Float").g:ada_space_errorsg:ada_no_trail_space_errorg:ada_no_tab_space_errorg:ada_all_tab_usageg:ada_space_errors bool (true when exists)Highlight extraneouserrors in spaces...g:ada_no_trail_space_error- but ignore trailing spacesat theend ofa lineg:ada_no_tab_space_error- but ignore tabs after spacesg:ada_all_tab_usage- highlight alltab useg:ada_line_errorsg:ada_line_errors  bool (true when exists)Highlight lines which are too long.Note: This highlightingoptionis quite CPU intensive.g:ada_rainbow_colorg:ada_rainbow_color  bool (true when exists)Use rainbow colours for '(' and ')'. You need therainbow_parenthesis for this to work.g:ada_foldingg:ada_folding  set ('sigpft')Usefolding for Ada sources.    's':    activatesyntaxfolding on load'p':    foldpackages'f':    foldfunctions and procedures't':    fold types'c':    fold conditionals    'g':    activate gnat pretty printfolding on load'i':    lone'is' folded with line above'b':lone'begin' folded with line above'p':lone'private' folded with line above'x':lone'exception' folded with line above    'i':    activate indentfolding on loadNote:Syntaxfoldingis in an early (unusable) stage and      indent or gnat prettyfoldingis suggested.For gnat prettyfolding to work the following settings aresuggested: -cl3 -M79 -c2 -c3 -c4 -A1 -A2 -A3 -A4 -A5For indentfolding to work the following settings aresuggested: shiftwidth=3 softtabstop=3g:ada_abbrevg:ada_abbrev  bool (true when exists)Add some abbreviations. This featureis more orless supersededby thevarious completion methods.g:ada_withuse_ordinaryg:ada_withuse_ordinary  bool (true when exists)Show "with" and "use"as ordinary keywords (when used toreference other compilation units they're normally highlightedspecially).g:ada_begin_preprocg:ada_begin_preproc  bool (true when exists)Show all begin-like keywords using the colouring ofCpreprocessor commands.g:ada_omni_with_keywordsg:ada_omni_with_keywordsAdd Keywords, Pragmas, Attributes to omni-completions(compl-omni).Note: You can always complete then with usercompletion(i_CTRL-X_CTRL-U).g:ada_extended_taggingg:ada_extended_taggingenum ('jump','list')use extended tagging, twooptions are available'jump': use tjump to jump.'list': addtags quick fix list.Normal tagging does not support function oroperatoroverloadingas these features are not available inC andtagging was originally developed for C.g:ada_extended_completiong:ada_extended_completionUses extended completion for<C-N> and<C-R> completions(i_CTRL-N). In this mode the '.'is usedas part of theidentifier so that 'Object.Method' or 'Package.Procedure' arecompleted together.g:ada_gnat_extensionsg:ada_gnat_extensions  bool (true when exists) Support GNAT extensions.g:ada_with_gnat_project_filesg:ada_with_gnat_project_files bool (true when exists) Add gnat project file keywords and Attributes.g:ada_default_compilerg:ada_default_compilerstringset default compiler. Currently supported are'gnat' and'decada'.An "exists" typeisaboolean consideredtrue when the variableis defined andfalse when the variableis undefined. The value to which the variableis setmakes no difference.------------------------------------------------------------------------------5.2 Commandsft-ada-commands:AdaRainbow:AdaRainbowToggles rainbow colour(g:ada_rainbow_color) mode for'(' and ')'.:AdaLines:AdaLinesToggles line error(g:ada_line_errors) display.:AdaSpaces:AdaSpacesTogglesspace error(g:ada_space_errors) display.:AdaTagDir:AdaTagDirCreatestags file for the directory of the current file.:AdaTagFile:AdaTagFileCreatestags file for the current file.:AdaTypes:AdaTypesToggles standard types(g:ada_standard_types) colour.:GnatFind:GnatFindCallsg:gnat.Find():GnatPretty:GnatPrettyCallsg:gnat.Pretty():GnatTags:GnatTagsCallsg:gnat.Tags()------------------------------------------------------------------------------5.3 Variablesft-ada-variablesg:gnatg:gnatobjectControlobject which manages GNAT compiles.  Theobjectis created when the first Ada source codeis loaded providedthatg:ada_default_compileris set to'gnat'. Seegnat_members for details.g:decadag:decadaobjectControlobject which manages Dec Ada compiles.Theobjectis created when the first Ada source codeis loaded providedthatg:ada_default_compileris set to'decada'. Seedecada_members for details.------------------------------------------------------------------------------5.4 Constantsft-ada-constantsAll constants are locked. See:lockvar for details.g:ada#WordRegexg:ada#WordRegexstringRegularexpression to search for Ada words.g:ada#DotWordRegexg:ada#DotWordRegexstringRegularexpression to search for Ada words separated by dots.g:ada#Commentg:ada#CommentstringRegularexpression to search for Ada comments.g:ada#Keywordsg:ada#Keywordslist of dictionariesList of keywords, attributes etc. pp. in the format used byomni completion. Seecomplete-items for details.g:ada#Ctags_Kindsg:ada#Ctags_Kindsdictionary of listsDictionary of thevarious kinds of items which the Ada supportfor Ctags generates.------------------------------------------------------------------------------5.5 Functionsft-ada-functionsada#Word([{line},{col}])ada#Word()Return full name of Ada entity under the cursor (orat givenline/column), stripping white space/newlinesas necessary.ada#List_Tag([{line},{col}])ada#Listtags()List all occurrences of the Ada entity under the cursor (oratgiven line/column) inside the quick-fix window.ada#Jump_Tag ({ident},{mode})ada#Jump_Tag()List all occurrences of the Ada entity under the cursor (oratgiven line/column) in thetag jump list. Mode can either be'tjump' or'stjump'.ada#Create_Tags ({option})ada#Create_Tags()Createstag file using Ctags. The option can either be'file'for the current file,'dir' for the directory of the currentfile ora file name.gnat#Insert_Tags_Header()gnat#Insert_Tags_Header()Adds thetag file header (!_TAG_) information to the currentfile which are missing from the GNAT XREF output.ada#Switch_Syntax_Option ({option})ada#Switch_Syntax_Option()Toggles highlightingoptions on or off. Used for the Ada menu.gnat#New()gnat#New ()Createa new gnat object. Seeg:gnat for details.==============================================================================6. Extra Pluginsada-extra-pluginsYou can optionallyinstall the following extra plug-ins. They work well withAda and enhance the ability of the Ada mode:backup.vimhttp://www.vim.org/scripts/script.php?script_id=1537Keepsas many backupsas you like so you don't have to.rainbow_parenthsis.vimhttp://www.vim.org/scripts/script.php?script_id=1561Very helpful since Ada uses only '(' and ')'.nerd_comments.vimhttp://www.vim.org/scripts/script.php?script_id=1218Excellent commenting and uncommenting support for almost anyprogramming language.matchit.vimhttp://www.vim.org/scripts/script.php?script_id=39'%' jumping for any language. The normal '%' jump only works for '{}'style languages. The Ada mode will set the needed search patterns.taglist.vimhttp://www.vim.org/scripts/script.php?script_id=273Source code explorer sidebar. Thereisa patch for Ada available.The GNU Ada Projectdistribution (http://gnuada.sourceforge.net) of Vimcontains all of the above.==============================================================================vim: textwidth=78 nowrap tabstop=8 shiftwidth=4 softtabstop=4 noexpandtabvim: filetype=help

Quick links:help overview ·quick reference ·user manual toc ·reference manual toc·faq


[8]ページ先頭

©2009-2026 Movatter.jp