~ubuntu-branches/ubuntu/vivid/vim/vivid

« back to all changes in this revision

Viewing changes to runtime/autoload/vimball.vim

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-11-05 11:37:43 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20081105113743-9i4urcsm3n44mhqe
Tags: 2:7.2.025-2ubuntu1
* Merge from debian unstable, remaining changes:
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/debchangelog.vim:
    + Add "jaunty" to the list of valid suites.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
" vimball.vim : construct a file containing both paths and files
2
2
" Author:       Charles E. Campbell, Jr.
3
 
" Date:         Jun 05, 2008
4
 
" Version:      27
 
3
" Date:         Jul 30, 2008
 
4
" Version:      29
5
5
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
6
6
" Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.
7
7
"            The VIM LICENSE applies to Vimball.vim, and Vimball.txt
15
15
 finish
16
16
endif
17
17
let s:keepcpo        = &cpo
18
 
let g:loaded_vimball = "v27"
 
18
let g:loaded_vimball = "v29"
19
19
set cpo&vim
20
20
"DechoTabOn
21
21
 
169
169
   call setline(lastline+1,0)
170
170
 
171
171
   " write the file from the tab
172
 
   let svfilepath= s:Path(svfile,'')
173
 
"   call Decho("exe $r ".fnameescape(svfilepath))
174
 
   exe "$r ".fnameescape(svfilepath)
 
172
"   call Decho("exe $r ".fnameescape(svfile))
 
173
   exe "$r ".fnameescape(svfile)
175
174
 
176
175
   call setline(lastline+1,line("$") - lastline - 1)
177
176
"   call Decho("lastline=".lastline." line$=".line("$"))
186
185
  call s:ChgDir(curdir)
187
186
  setlocal ff=unix
188
187
  if a:writelevel
189
 
   let vbnamepath= s:Path(vbname,'')
190
 
"   call Decho("exe w! ".fnameescape(vbnamepath))
191
 
   exe "w! ".fnameescape(vbnamepath)
 
188
"   call Decho("exe w! ".fnameescape(vbname))
 
189
   exe "w! ".fnameescape(vbname)
192
190
  else
193
 
   let vbnamepath= s:Path(vbname,'')
194
 
"   call Decho("exe w ".fnameescape(vbnamepath))
195
 
   exe "w ".fnameescape(vbnamepath)
 
191
"   call Decho("exe w ".fnameescape(vbname))
 
192
   exe "w ".fnameescape(vbname)
196
193
  endif
197
194
"  call Decho("Vimball<".vbname."> created")
198
195
  echo "Vimball<".vbname."> created"
215
212
fun! vimball#Vimball(really,...)
216
213
"  call Dfunc("vimball#Vimball(really=".a:really.") a:0=".a:0)
217
214
 
218
 
  if v:version < 701 || (v:version == 701 && !has("patch299"))
219
 
   echoerr "This version of vimball requires vim 7.1 with patch 299"
 
215
  if v:version < 701 || (v:version == 701 && !exists('*fnameescape'))
 
216
   echoerr "your vim is missing the fnameescape() function"
220
217
"   call Dret("vimball#Vimball : needs 7.1 with patch 299")
221
218
   return
222
219
  endif
338
335
 
339
336
   " write tab to file
340
337
   if a:really
341
 
    let fnamepath= s:Path(home."/".fname,'')
 
338
    let fnamepath= home."/".fname
342
339
"    call Decho("exe w! ".fnameescape(fnamepath))
343
340
        exe "silent w! ".fnameescape(fnamepath)
344
341
    echo "wrote ".fnamepath
364
361
  " set up help
365
362
"  call Decho("about to set up help: didhelp<".didhelp.">")
366
363
  if didhelp != ""
367
 
   let htpath= s:Path(home."/".didhelp,"")
 
364
   let htpath= home."/".didhelp
368
365
"   call Decho("exe helptags ".htpath)
369
 
   exe "helptags ".htpath
 
366
   exe "helptags ".fnameescape(htpath)
370
367
   echo "did helptags"
371
368
  endif
372
369
 
578
575
endfun
579
576
 
580
577
" ---------------------------------------------------------------------
581
 
" s:Path: prepend and append quotes and do escaping {{{2
582
 
fun! s:Path(cmd,quote)
583
 
"  call Dfunc("Path(cmd<".a:cmd."> quote<".a:quote.">) vimball_path_escape<".g:vimball_path_escape.">")
584
 
  if (has("win32") || has("win95") || has("win64") || has("win16"))
585
 
"   let cmdpath= a:quote.substitute(a:cmd,'/','\\','g').a:quote
586
 
   let cmdpath= a:quote.substitute(a:cmd,'\\','/','g').a:quote
587
 
"   call Decho("cmdpath<".cmdpath."> (win32 mod)")
588
 
  else
589
 
   let cmdpath= a:quote.a:cmd.a:quote
590
 
"   call Decho("cmdpath<".cmdpath."> (not-win32 mod)")
591
 
  endif
592
 
  if a:quote == "" && g:vimball_path_escape !~ ' '
593
 
   let cmdpath= escape(cmdpath,' ')
594
 
"   call Decho("cmdpath<".cmdpath."> (empty quote case)")
595
 
  endif
596
 
  let cmdpath= escape(cmdpath,g:vimball_path_escape)
597
 
"  call Dret("Path <".cmdpath.">")
598
 
  return cmdpath
599
 
endfun
600
 
 
601
 
" ---------------------------------------------------------------------
602
578
" s:RecordInVar: record a un-vimball command in the .VimballRecord file {{{2
603
579
fun! s:RecordInVar(home,cmd)
604
580
"  call Dfunc("RecordInVar(home<".a:home."> cmd<".a:cmd.">)")
719
695
   let s:acdkeep = &acd
720
696
  endif
721
697
  let s:eikeep  = &ei
722
 
  let s:fenkeep = &fen
 
698
  let s:fenkeep = &l:fen
723
699
  let s:hidkeep = &hidden
724
700
  let s:ickeep  = &ic
725
701
  let s:lzkeep  = &lz
726
702
  let s:pmkeep  = &pm
727
703
  let s:repkeep = &report
728
704
  let s:vekeep  = &ve
729
 
  let s:ffkeep  = &ff
 
705
  let s:ffkeep  = &l:ff
730
706
  if exists("&acd")
731
707
   setlocal ei=all ve=all noacd nofen noic report=999 nohid bt= ma lz pm= ff=unix
732
708
  else
745
721
  if exists("&acd")
746
722
   let &acd   = s:acdkeep
747
723
  endif
748
 
  let &fen    = s:fenkeep
 
724
  let &l:fen  = s:fenkeep
749
725
  let &hidden = s:hidkeep
750
726
  let &ic     = s:ickeep
751
727
  let &lz     = s:lzkeep
753
729
  let &report = s:repkeep
754
730
  let &ve     = s:vekeep
755
731
  let &ei     = s:eikeep
756
 
  let &ff     = s:ffkeep
 
732
  let &l:ff   = s:ffkeep
757
733
  if s:makeep[0] != 0
758
734
   " restore mark a
759
735
"   call Decho("restore mark-a: makeep=".string(makeep))