" Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " Maintainer: Martin Krischik " Neil Bird " $Author: krischik $ " $Date: 2006-05-16 19:32:47 +0200 (Di, 16 Mai 2006) $ " Version: 1.0 " $Revision: 198 $ " $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $ " $Id: ada.vim 198 2006-05-16 17:32:47Z krischik $ " Usage: copy to ftplugin directory " History: " " 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 cpoptions-=C " Ada comments setlocal comments+=O:-- if exists('&omnifunc') setlocal omnifunc=adacomplete#Complete endif set complete=.,w,b,u,t,i " 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 if has("menu") endif " Get this script's unique id map