" Vim Ada plugin file " Language: Ada " Maintainer: Neil Bird " Last Change: 2003 May 11 " Version: $Id: ada.vim,v 1.7 2001/11/06 16:38:45 nabird Exp $ " Look for the latest version at http://vim.sourceforge.net/ " " Perform Ada specific completion & tagging. " " " Provides mapping overrides for tag jumping that figure out the current " Ada object and tag jump to that, not the 'simple' vim word. " Similarly allows matching of full-length ada entities from tags. " Exports 'AdaWord()' function to return full name of Ada entity under the " cursor( or at given line/column), stripping whitespace/newlines as necessary. " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 " Temporarily set cpoptions to ensure the script loads OK let s:cpoptions = &cpoptions set cpo-=C " Ada comments setlocal comments+=O:-- " Make local tag mappings for this buffer (if not already set) if mapcheck('','n') == '' nnoremap :call JumpToTag_ada('') endif if mapcheck('g','n') == '' nnoremap g :call JumpToTag_ada('','stj') endif if mapcheck('','i') == '' inoremap =AdaCompletion("\C-N>") endif if mapcheck('','i') == '' inoremap =AdaCompletion("\C-P>") endif if mapcheck('','i') == '' inoremap =AdaCompletion("\C-X>\C-]>") endif if mapcheck('','i') == '' inoremap =AdaInsertBackspace() endif " Only do this when not done yet for this buffer & matchit is used if ! exists("b:match_words") && exists("loaded_matchit") " The following lines enable the macros/matchit.vim plugin for " Ada-specific extended matching with the % key. let s:notend = '\%(\:\:\:\\s\+\,' . \ s:notend . '\:\:\\s\+\,' . \ '\%(\.*\|\.*\|'.s:notend.'\)\:\\s\+\,' . \ '\%(\\|\\):\:\\s*\%($\|[;A-Z]\),' . \ s:notend . '\:\\s\+\' endif " Prevent re-load of functions if exists('s:id') finish endif " Get this script's unique id map