Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv23878/latex-suite
Modified Files:
Tag: texproject-branch
main.vim texmenuconf.vim
Added Files:
Tag: texproject-branch
texproject.vim projecttemplate.vim
Log Message:
Introduction of texproject:
1. explorer.vim
Changes responsible for showing only files belonging to project
2. texmenuconf.vim
Menu for project
3. main.vim
Sourcing of latex-suite/texproject.vim
4. texviewer.vim
Changes responsible for ref/cite completion from project (if exists)
5. texproject.vim
Functions and command for project actions
6. projecttemplate.vim
Template of project file.
--- NEW FILE: texproject.vim ---
"=============================================================================
" File: texproject.vim
" Author: Mikolaj Machowski
" Version: 1.0
" Created: Wen Apr 16 05:00 PM 2003
"
" Description: Handling tex projects.
"
"=============================================================================
let s:path = expand("<sfile>:p:h")
command! -nargs=0 TProjectEdit :call <SID>Tex_ProjectEdit()
command! -nargs=0 TProjectWrite :call <SID>Tex_ProjectWrite()
command! -nargs=0 TProject :call <SID>Tex_Project()
" Tex_ProjectEdit: Edit project file " {{{
" Description: If project file exists (*.latexmain) open it in window created
" with ':split', if no create ':new' window and read there
" project template
"
function! s:Tex_ProjectEdit()
let file = expand("%:p")
if Tex_GetMainFileName() != ''
exe 'split '.Tex_GetMainFileName(":p")
else
exe 'split '.s:path.'/projecttemplate.vim'
exe 'saveas '.file.'.latexmain'
let g:Tex_ProjectExists = 1
endif
endfunction " }}}
" Tex_ProjectWrite: write project and source it to refresh changed vars {{{
" Description:
"
function! s:Tex_ProjectWrite()
if expand("%") =~ 'latexmain$'
write!
exe 'source '.Tex_GetMainFileName(":p")
q
else
echoerr "Sorry, this is not project file"
return
endif
endfunction " }}}
" Tex_Project: open project view in explorer {{{
" Description:
"
function! s:Tex_Project()
if g:Tex_ProjectExists == 1
new
let w:projView = 1
:Explore
else
echoerr "Sorry, no project file exists"
finish
endif
endfunction " }}}
" Load project file if exists
if Tex_GetMainFileName() != ''
exe 'source '.Tex_GetMainFileName(":p")
let g:Tex_ProjectExists = 1
else
let g:Tex_ProjectExists = 0
endif
" vim:fdm=marker:ff=unix:noet:ts=4:sw=4
--- NEW FILE: projecttemplate.vim ---
" Project name
" let g:projName = ''
"
" Project files
" let g:projFiles = ''
" Vim settings/maps/abbrs specific for this project
" Modeline for this file
" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:ft=vim
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.36
retrieving revision 1.36.2.1
diff -C2 -d -r1.36 -r1.36.2.1
*** main.vim 11 Apr 2003 21:21:50 -0000 1.36
--- main.vim 18 Apr 2003 19:32:04 -0000 1.36.2.1
***************
*** 403,406 ****
--- 403,411 ----
exe 'cd '.expand('%:p:h')
let lheadfile = glob('*.latexmain')
+ " dirty hack to check in dir one level up. TODO: while with ":h" mod.
+ if lheadfile == ''
+ cd ..
+ let lheadfile = glob('*.latexmain')
+ endif
if lheadfile != ''
let lheadfile = fnamemodify(lheadfile, modifier)
***************
*** 526,529 ****
--- 531,535 ----
exe 'source '.s:path.'/bibtex.vim'
exe 'source '.s:path.'/diacritics.vim'
+ exe 'source '.s:path.'/texproject.vim'
" ==============================================================================
Index: texmenuconf.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texmenuconf.vim,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** texmenuconf.vim 14 Apr 2003 17:14:38 -0000 1.11
--- texmenuconf.vim 18 Apr 2003 19:32:04 -0000 1.11.2.1
***************
*** 54,57 ****
--- 54,64 ----
exec 'inoremenu 80.100 '.s:mainmenuname.'C&omplete\ Ref/Cite'.
\' <Esc>:call Tex_viewer("default","text")<CR>'
+ " project
+ exec 'anoremenu 80.105 '.s:mainmenuname.'Project.&Project<tab>:TProject'.
+ \' :TProject<CR>'
+ exec 'anoremenu 80.106 '.s:mainmenuname.'Project.Project&Edit<tab>:TProjectEdit'.
+ \' :TProjectEdit<CR>'
+ exec 'anoremenu 80.107 '.s:mainmenuname.'Project.Project&Write<tab>:TProjectWrite'.
+ \' :TProjectWrite<CR>'
exec 'anoremenu 80.110 '.s:mainmenuname.'-sepsuite1- :'
" refreshing folds
|