.vim/plugin/DrawItPlugin.vim
changeset 0 86954f5fc4d2
equal deleted inserted replaced
-1:000000000000 0:86954f5fc4d2
       
     1 " DrawItPlugin.vim: a simple way to draw things in Vim -- just put this file in
       
     2 "             your plugin directory, use \di to start (\ds to stop), and
       
     3 "             just move about using the cursor keys.
       
     4 "
       
     5 "             You may also use visual-block mode to select endpoints and
       
     6 "             draw lines, arrows, and ellipses.
       
     7 "
       
     8 " Date:			Nov 01, 2005
       
     9 " Maintainer:	Charles E. Campbell, Jr.  (Charles.E.Campbell.1@gsfc.nasa.gov)
       
    10 " Copyright:    Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
       
    11 "               Permission is hereby granted to use and distribute this code,
       
    12 "               with or without modifications, provided that this copyright
       
    13 "               notice is copied with it. Like anything else that's free,
       
    14 "               DrawIt.vim is provided *as is* and comes with no warranty
       
    15 "               of any kind, either expressed or implied. By using this
       
    16 "               plugin, you agree that in no event will the copyright
       
    17 "               holder be liable for any damages resulting from the use
       
    18 "               of this software.
       
    19 "
       
    20 " Required:  this script requires Vim 7.0 (or later) {{{1
       
    21 " To Enable: simply put this plugin into your ~/.vim/plugin directory {{{2
       
    22 "
       
    23 " GetLatestVimScripts: 40 1 :AutoInstall: DrawIt.vim
       
    24 "
       
    25 "  Woe to her who is rebellious and polluted, the oppressing {{{1
       
    26 "  city! She didn't obey the voice. She didn't receive correction.
       
    27 "  She didn't trust in Yahweh. She didn't draw near to her God. (Zeph 3:1,2 WEB)
       
    28 
       
    29 " ---------------------------------------------------------------------
       
    30 " Load Once: {{{1
       
    31 if &cp || exists("g:loaded_DrawIt")
       
    32  finish
       
    33 endif
       
    34 let s:keepcpo= &cpo
       
    35 set cpo&vim
       
    36 
       
    37 " ---------------------------------------------------------------------
       
    38 " DrChip Menu Support: {{{1
       
    39 if has("gui_running") && has("menu") && &go =~ 'm'
       
    40  if !exists("g:DrChipTopLvlMenu")
       
    41   let g:DrChipTopLvlMenu= "DrChip."
       
    42  endif
       
    43  exe 'menu '.g:DrChipTopLvlMenu.'DrawIt.Start\ DrawIt<tab>\\di		<Leader>di'
       
    44 endif
       
    45 
       
    46 " ---------------------------------------------------------------------
       
    47 " Public Interface: {{{1
       
    48 if !hasmapto('<Plug>StartDrawIt')
       
    49   map <unique> <Leader>di <Plug>StartDrawIt
       
    50 endif
       
    51 map <silent> <Plug>StartDrawIt  :set lz<cr>:call DrawIt#StartDrawIt()<cr>:set nolz<cr>
       
    52 com! -nargs=0 DIstart set lz|call DrawIt#StartDrawIt()|set nolz
       
    53 
       
    54 if !hasmapto('<Plug>StopDrawIt')
       
    55   map <unique> <Leader>ds <Plug>StopDrawIt
       
    56 endif
       
    57 map <silent> <Plug>StopDrawIt :set lz<cr>:call DrawIt#StopDrawIt()<cr>:set nolz<cr>
       
    58 com! -nargs=0 DIstop set lz|call DrawIt#StopDrawIt()|set nolz
       
    59 
       
    60 " ---------------------------------------------------------------------
       
    61 "  Cleanup And Modelines:
       
    62 "  vim: fdm=marker
       
    63 let &cpo= s:keepcpo
       
    64 unlet s:keepcpo