Ada Programming
SearchWiki

VIM (edit)

  • AdaMode
  • WikiConvert
  • Plugins
  • Trace Remover Restorer
  • GNAT Programming System

Articles (edit)

  • Compile gcc
  • Compile GNAT/GPL
  • Compile GNAT/Pro
  • Compile XML/Ada
  • Compile ASIS
  • Compile GPS


Edit Sidebar
  1. Main?
    1. Home Page

  1. General Info
    1. Ada@Krischik

  1. Tutorials
    1. English
    2. Frensh
    3. Spanish

  1. Projects
    1. AdaCL
    2. wikibook-ada
    3. ASIS
    4. GLADE
    5. Florist

  1. PmWiki
    1. Install
    2. Editing
    3. Index
    4. FAQ
    5. Editing
    6. Notes
VIM/
Trace Remover Restorer
Read PageEdit PagePage AttributesPage HistoryUpload
Printable View

Links/AdaCL Trace Remover and Restorer

When used together with the NERD Commenter this script will comment out all Links/AdaCL.Trace procedures or remove the comments in again.

[...PLUGIN]AdaCL.vim

 
"------------------------------------------------------------------------------
"
" Remove traces
" 
:function! <SID>AdaCL_Remove_Trace ()
    :%foldopen!
    :normal \ca
    :silent! %substitute /\v%(--)@<!(with AdaCL.Trace;)/--\1/
    :normal gg 
    :while search("   AdaCL.Trace", "W") > 0
        :execute "normal /\\VAdaCL.Trace\<CR>v/\\V);\<CR>" . g:mapleader .  "cc"
    :endwhile
    :normal \ca
:endfunction

"------------------------------------------------------------------------------
"
" Restore traces
" 
:function! <SID>AdaCL_Restore_Trace ()
    :%foldopen!
    :normal gg 
    :silent! %substitute /\v--(with AdaCL.Trace;)/\1/
    :normal gg 
    :while search("--Trace\.Put_Line", "W") > 0
        :normal h
        :execute "normal /\\V--AdaCL.Trace\<CR>v/\\V);\<CR>" . g:mapleader .  "cu"
    :endwhile
    :normal \ca
:endfunction

:command! AdaCLRemoveTrace  call <SID>AdaCL_Remove_Trace ()
:command! AdaCLRestoreTrace call <SID>AdaCL_Restore_Trace ()

:nnoremap <silent> <Leader>tm :AdaCLRemoveTrace<CR>
:nnoremap <silent> <Leader>ts :AdaCLRestoreTrace<CR>

:47nmenu <silent> Plugin.AdaCL.Remove\ Traces<Tab>\\tm  :AdaCLRemoveTrace<CR>
:47nmenu <silent> Plugin.AdaCL.Restore\ Traces<Tab>\\ts :AdaCLRestoreTrace<CR>

" vim: textwidth=0 tabstop=8 shiftwidth=4 softtabstop=4 expandtab:
 

© 2005 Martin Krischik, Content is available under GNU Free Documentation License.

Page last modified on September 16, 2005, at 04:24 PM
  • Ada programming
  • SearchWiki
  • RecentChanges
  • AllRecentChanges
  • WikiHelp

  1. ▲ Top ▲
  2. Edit:
  3. SideBar
  4. MenuBar
  5. BottomBar
  6. GroupHeader
  7. GroupFooter