vim-latex-cvs Mailing List for Vim-Latex (Page 31)
Brought to you by:
srinathava,
tmaas
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(82) |
Dec
(124) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(104) |
Feb
(3) |
Mar
(6) |
Apr
(48) |
May
(34) |
Jun
(62) |
Jul
(33) |
Aug
(24) |
Sep
(32) |
Oct
(16) |
Nov
(36) |
Dec
(39) |
| 2004 |
Jan
|
Feb
(3) |
Mar
(8) |
Apr
|
May
(29) |
Jun
(13) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(6) |
Dec
(9) |
| 2006 |
Jan
(9) |
Feb
(2) |
Mar
(16) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(17) |
Sep
(3) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2010 |
Jan
(25) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(8) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
(1) |
| 2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(15) |
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
|
From: <sri...@us...> - 2002-12-27 21:22:48
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv9280
Modified Files:
Tag: b-newpackages
packages.vim
Log Message:
. trying to collapse all the tex-supporting functions into one function
Tex_pack_one. This function is designed to be called via the <C-r>=
method. If called with one or more arguments, it will insert
\usepackage{} lines. Otherwise, it prompts the user to choose from
amongst those found in the packages/ directory.
TODO: As of now, this function is not amenable to being called from a
command. i.e in the present version ':TPackage' doesnt work although
':TPackage packname' does work.
. The Tex_MakeSubMenu() now also takes an optional argument to filter
each element by an "extract" function before creating the menu item. This
enables the list items to be pretty complex and the menu display itself to
be pretty simple
Also a bunch of simplifications etc. This version of packages.vim should be
fully feature compatible with the original packages.vim with the additional
bug fixes for placeholder settings and such.
Index: packages.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -C2 -d -r1.16.2.1 -r1.16.2.2
*** packages.vim 22 Dec 2002 11:02:05 -0000 1.16.2.1
--- packages.vim 27 Dec 2002 21:22:45 -0000 1.16.2.2
***************
*** 3,7 ****
" Author: Mikolaj Machowski
" Created: Tue Apr 23 06:00 PM 2002 PST
! " Last Change: Sun Dec 22 02:00 AM 2002 PST
"
" Description: handling packages from within vim
--- 3,7 ----
" Author: Mikolaj Machowski
" Created: Tue Apr 23 06:00 PM 2002 PST
! " Last Change: Tue Dec 24 11:00 PM 2002 PST
"
" Description: handling packages from within vim
***************
*** 9,14 ****
" avoid reinclusion.
- " TODO: This is no longer true. A package does more things than just make
- " menus.
" if !g:Tex_PackagesMenu || exists('s:doneOnce')
" finish
--- 9,12 ----
***************
*** 16,26 ****
" let s:doneOnce = 1
- " Level of Packages menu:
- let s:p_menu_lev = g:Tex_PackagesMenuLocation
-
let s:path = expand("<sfile>:p:h")
let s:menu_div = 20
! com! -nargs=* TPackage call Tex_pack_one(<f-args>)
com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall()
com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall()
--- 14,22 ----
" let s:doneOnce = 1
let s:path = expand("<sfile>:p:h")
+
let s:menu_div = 20
! com! -nargs=* TPackage :normal! i<C-r>=Tex_pack_one(<f-args>)<CR>
com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall()
com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall()
***************
*** 38,42 ****
exe 'source ' . s:path . '/packages/' . a:package
if has("gui_running")
- " TODO: Didn't we hav an option for the menus here...
call Tex_pack(a:package)
endif
--- 34,37 ----
***************
*** 46,52 ****
exe 'setlocal dict+='.s:path.'/dictionaries/'.a:package
if !has("gui_running") && filereadable(s:path.'/dictionaries/'.a:package)
let g:Tex_package_supported = g:Tex_package_supported.','.a:package
- " TODO: This means that the list contains dupes if the package and
- " the dictionary both exist...
endif
endif
--- 41,46 ----
exe 'setlocal dict+='.s:path.'/dictionaries/'.a:package
if !has("gui_running") && filereadable(s:path.'/dictionaries/'.a:package)
+ \ && g:Tex_package_supported !~ a:package
let g:Tex_package_supported = g:Tex_package_supported.','.a:package
endif
endif
***************
*** 58,62 ****
function! Tex_pack_uncheck(package)
if has("gui_running") && filereadable(s:path.'/packages/'.a:package)
! exe 'silent! aunmenu '.s:p_menu_lev.'&'.a:package
endif
if filereadable(s:path.'/dictionaries/'.a:package)
--- 52,58 ----
function! Tex_pack_uncheck(package)
if has("gui_running") && filereadable(s:path.'/packages/'.a:package)
! exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.'-sep'.a:package.'-'
! exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.a:package.'\ Options'
! exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.a:package.'\ Commands'
endif
if filereadable(s:path.'/dictionaries/'.a:package)
***************
*** 66,70 ****
" }}}
! " Tex_pack_updateall: {{{
function! Tex_pack_updateall()
if exists('g:Tex_package_supported')
--- 62,66 ----
" }}}
! " Tex_pack_updateall: updates the TeX-Packages menu {{{
function! Tex_pack_updateall()
if exists('g:Tex_package_supported')
***************
*** 87,124 ****
" }}}
! " Tex_pack_one: {{{
! " Reads command-line and adds appropriate \usepackage lines
function! Tex_pack_one(...)
! if a:0 == 0
let pwd = getcwd()
exe 'cd '.s:path.'/packages'
let packname = Tex_ChooseFile('Choose a package: ')
exe 'cd '.pwd
! call Tex_pack_check(packname)
! return Tex_pack_supp(packname)
! elseif a:0 == 1
! if filereadable(s:path.'/packages/'.a:1)
! return Tex_pack_supp(a:1)
endif
else
! " TODO: What does this while loop do?
! " Are we actually searching for things like
! " s:path/packages/1
! " etc?!!
! let i = a:0
let omega = 1
! while omega <= i
! exe 'let packname = a:'.omega
if filereadable(s:path.'/packages/'.packname)
call Tex_pack_check(packname)
! exe 'normal ko\usepackage{'.packname."}\<Esc>"
! let omega = omega + 1
endif
endwhile
endif
endfunction
" }}}
! " Tex_pack_all: scans the current file for \\usepackage{ lines {{{
! " and loads the corresponding package options as menus.
function! Tex_pack_all()
--- 83,128 ----
" }}}
! " Tex_pack_one: supports each package in the argument list.{{{
! " Description:
! " If no arguments are supplied, then the user is asked to choose from the
! " packages found in the packages/ directory
function! Tex_pack_one(...)
! if a:0 == 0 || (a:0 > 0 && a:1 == '')
let pwd = getcwd()
exe 'cd '.s:path.'/packages'
let packname = Tex_ChooseFile('Choose a package: ')
exe 'cd '.pwd
! if packname != ''
! return Tex_pack_one(packname)
! else
! return ''
endif
else
! " Support the packages supplied. This function can be called with
! " multiple arguments in which case, support each of them in turn.
! let retVal = ''
let omega = 1
! while omega <= a:0
! let packname = a:{omega}
if filereadable(s:path.'/packages/'.packname)
call Tex_pack_check(packname)
! if exists('g:TeX_package_option_'.packname)
! \ && g:TeX_package_option_{packname} != ''
! let retVal = retVal.'\usepackage[<++>]{'.packname.'}<++>'
! else
! let retVal = retVal.'\usepackage{'.packname.'}'."\<CR>"
! endif
! else
! let retVal = retVal.'\usepackage{'.packname.'}'."\<CR>"
endif
+ let omega = omega + 1
endwhile
+ return IMAP_PutTextWithMovement(substitute(retVal, "\<CR>$", '', ''), '<+', '+>')
endif
endfunction
" }}}
! " Tex_pack_all: scans the current file for \usepackage{} lines {{{
! " and if supported, loads the options and commands found in the
! " corresponding package file.
function! Tex_pack_all()
***************
*** 127,141 ****
if Tex_GetMainFileName() != ''
! let cwd = getcwd()
! let fname = Tex_GetMainFileName()
! " TODO: Change Tex_GetMainFileName to return file name with extension.
! " (maybe in the presence of an optional argument)
! if glob(fname.'.tex') != ''
! let fname = fname.'.tex'
! elseif glob(fname) != ''
! let fname = ''
! else
! let fname = currfile
! endif
else
let fname = currfile
--- 131,135 ----
if Tex_GetMainFileName() != ''
! let fname = Tex_GetMainFileName(':p:r')
else
let fname = currfile
***************
*** 172,181 ****
endif
let g:Tex_package_detected = g:Tex_package_detected.' '.pname
! call Tex_pack_check(pname)
let i = i + 1
endwhile
elseif oldpack != packname
let g:Tex_package_detected = g:Tex_package_detected.' '.packname
! call Tex_pack_check(packname)
endif
let oldpack = packname
--- 166,175 ----
endif
let g:Tex_package_detected = g:Tex_package_detected.' '.pname
! call Tex_pack_one(pname)
let i = i + 1
endwhile
elseif oldpack != packname
let g:Tex_package_detected = g:Tex_package_detected.' '.packname
! call Tex_pack_one(packname)
endif
let oldpack = packname
***************
*** 189,194 ****
" }}}
! " Tex_pack_supp_menu: sets up a menu for packages found in packages/ {{{
! " groups the packages thus found into groups of 20...
function! Tex_pack_supp_menu()
--- 183,189 ----
" }}}
! " Tex_pack_supp_menu: sets up a menu for package files {{{
! " found in the packages directory groups the packages thus found into groups
! " of 20...
function! Tex_pack_supp_menu()
***************
*** 201,221 ****
call Tex_MakeSubmenu(suplist, g:Tex_PackagesMenuLocation.'Supported.',
! \ '<plug><C-r>=Tex_pack_supp("', '")<CR>')
endfunction
" }}}
" Tex_MakeSubmenu: makes a submenu given a list of items {{{
" Description:
! function! Tex_MakeSubmenu(menuList, MainMenuName, HandlerFuncLHS, HandlerFuncRHS, ...)
- let extractPattern = ''
- if a:0 > 0
- let extractPattern = a:1
- endif
- let menuList = a:menuList
- if menuList !~ ',$'
- let menuList = menuList.','
- endif
let doneMenuSubmenu = 0
--- 196,252 ----
call Tex_MakeSubmenu(suplist, g:Tex_PackagesMenuLocation.'Supported.',
! \ '<plug><C-r>=Tex_pack_one("', '")<CR>')
! endfunction
!
! " }}}
! " Tex_pack: loads the options (and commands) for the given package {{{
! function! Tex_pack(pack)
! if exists('g:TeX_package_'.a:pack)
!
! exec 'amenu '.g:Tex_PackagesMenuLocation.'-sep'.a:pack.'- <Nop>'
! let optionList = g:TeX_package_option_{a:pack}.','
!
! if optionList != ''
!
! let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'\ Options.'
! call s:GroupPackageMenuItems(optionList, mainMenuName,
! \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>')
!
! endif
!
! let commandList = g:TeX_package_{a:pack}
! if commandList != ''
!
! let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'\ Commands.'
! call s:GroupPackageMenuItems(commandList, mainMenuName,
! \ '<plug><C-r>=Tex_ProcessPackageCommand("', '")<CR>',
! \ '<SID>FilterPackageMenuLHS')
! endif
! endif
endfunction
" }}}
+ " ==============================================================================
+ " Menu Functions
+ " Creating menu items for the all the package files found in the packages/
+ " directory as well as creating menus for each supported package found in the
+ " preamble.
+ " ==============================================================================
" Tex_MakeSubmenu: makes a submenu given a list of items {{{
" Description:
! " This function takes a comma seperated list of menu items and creates a
! " 'grouped' menu. i.e, it groups the items into s:menu_div items each and
! " puts them in submenus of the given mainMenu.
! " Each menu item is linked to the HandlerFunc.
! " If an additional argument is supplied, then it is used to filter each of
! " the menu items to generate better names for the menu display.
! "
! function! Tex_MakeSubmenu(menuList, mainMenuName,
! \ handlerFuncLHS, handlerFuncRHS, ...)
!
! let extractFunction = (a:0 > 0 ? a:1 : '' )
! let menuList = substitute(a:menuList, '[^,]$', ',', '')
let doneMenuSubmenu = 0
***************
*** 224,228 ****
" Extract upto s:menu_div menus at once.
let menuBunch = matchstr(menuList, '\v(.{-},){,'.s:menu_div.'}')
- " echomsg 'bunch = '.menuBunch
" The remaining menus go into the list.
--- 255,258 ----
***************
*** 233,241 ****
" therefore put these menu items into a submenu.
if strlen(menuList) || doneMenuSubmenu
! let firstMenu = matchstr(menuBunch, '\v^.{-}\ze,')
! let lastMenu = matchstr(menuBunch, '\v[^,]{-}\ze,$')
! let submenu = substitute(firstMenu, extractPattern, '\1', '').
! \ '\ -\ '.substitute(lastMenu, extractPattern, '\1', '').'.'
let doneMenuSubmenu = 1
--- 263,270 ----
" therefore put these menu items into a submenu.
if strlen(menuList) || doneMenuSubmenu
! exec 'let firstMenu = '.extractFunction."(matchstr(menuBunch, '\\v^.{-}\\ze,'))"
! exec 'let lastMenu = '.extractFunction."(matchstr(menuBunch, '\\v[^,]{-}\\ze,$'))"
! let submenu = firstMenu.'\ \-\ '.lastMenu.'.'
let doneMenuSubmenu = 1
***************
*** 246,252 ****
let menuName = Tex_Strntok(menuBunch, ',', i)
while menuName != ''
! let menuItem = substitute(menuName, extractPattern, '\1', '')
! execute 'amenu '.a:MainMenuName.submenu.menuItem
! \ ' '.a:HandlerFuncLHS.menuName.a:HandlerFuncRHS
let i = i + 1
--- 275,281 ----
let menuName = Tex_Strntok(menuBunch, ',', i)
while menuName != ''
! exec 'let menuItem = '.extractFunction.'(menuName)'
! execute 'amenu '.a:mainMenuName.submenu.menuItem
! \ ' '.a:handlerFuncLHS.menuName.a:handlerFuncRHS
let i = i + 1
***************
*** 257,309 ****
" }}}
! " Tex_pack: loads the options (and commands) for the given package {{{
! function! Tex_pack(pack)
! let basic_nu_p_list = ''
! let nu_p_list = ''
!
! if exists('g:TeX_package_'.a:pack)
!
! let g:p_list = g:TeX_package_{a:pack}
! let g:p_o_list = g:TeX_package_option_{a:pack}
!
! let optionList = g:TeX_package_option_{a:pack}.','
! let doneOptionSubmenu = 0
!
! if optionList != ''
! let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'.Options.'
! call Tex_MakeSubmenu(optionList, mainMenuName,
! \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>')
endif
! let commandList = g:TeX_package_{a:pack}
!
! while matchstr(commandList, 'sbr:') != ''
!
! call Tex_Debug('command list = '.commandList)
!
! let groupName = matchstr(commandList, '\v^sbr:\zs.{-}\ze,')
! let commandList = strpart(commandList, strlen('sbr:'.groupName) + 1)
! if matchstr(commandList, 'sbr:') != ''
! let commandGroup = matchstr(commandList, '\v^.{-},\zesbr:')
! else
! let commandGroup = commandList
! endif
!
! let menuName = g:Tex_PackagesMenuLocation.a:pack.'.Commands.'
! let menuName = menuName.groupName.'.'
! call Tex_MakeSubmenu(commandGroup, menuName, "<plug><C-r>=Tex_ProcessPackageCommand('", "')<CR>", '\w\+:\(\w\+\).*')
!
! let commandList = strpart(commandList, strlen(commandGroup))
! endwhile
! call Tex_MakeSubmenu(commandList, g:Tex_PackagesMenuLocation.a:pack.'.Commands.',
! \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>', '\w\+:\(\w\+\).*')
! endif
! endfunction
! " }}}
" Definition of what to do for various package commands {{{
let s:CommandSpec_bra = '\<+replace+>{<++>}<++>'
--- 286,323 ----
" }}}
! " GroupPackageMenuItems: uses the sbr: to split menus into groups {{{
! " Description:
! " This function first splits up the menuList into groups based on the
! " special sbr: tag and then calls Tex_MakeSubmenu
! "
! function! <SID>GroupPackageMenuItems(menuList, menuName,
! \ handlerFuncLHS, handlerFuncRHS,...)
! if a:0 > 0
! let extractFunction = a:1
! else
! let extractFunction = ''
! endif
! let menuList = a:menuList
+ while matchstr(menuList, 'sbr:') != ''
+ let groupName = matchstr(menuList, '\v^sbr:\zs.{-}\ze,')
+ let menuList = strpart(menuList, strlen('sbr:'.groupName.','))
+ if matchstr(menuList, 'sbr:') != ''
+ let menuGroup = matchstr(menuList, '\v^.{-},\zesbr:')
+ else
+ let menuGroup = menuList
endif
! call Tex_MakeSubmenu(menuGroup, a:menuName.groupName.'.',
! \ a:handlerFuncLHS, a:handlerFuncRHS, extractFunction)
! let menuList = strpart(menuList, strlen(menuGroup))
! endwhile
! call Tex_MakeSubmenu(menuList, a:menuName,
! \ a:handlerFuncLHS, a:handlerFuncRHS, extractFunction)
! endfunction " }}}
" Definition of what to do for various package commands {{{
let s:CommandSpec_bra = '\<+replace+>{<++>}<++>'
***************
*** 311,315 ****
let s:CommandSpec_brd = '\<+replace+>{<++>}{<++>}<++>'
let s:CommandSpec_env = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>'
! let s:CommandSpec_ens = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>'
let s:CommandSpec_eno = '\begin[<++>]{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}'
let s:CommandSpec_nor = '\<+replace+>'
--- 325,329 ----
let s:CommandSpec_brd = '\<+replace+>{<++>}{<++>}<++>'
let s:CommandSpec_env = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>'
! let s:CommandSpec_ens = '\begin{<+replace+>}<+extra+>'."\<CR><++>\<CR>".'\end{<+replace+>}<++>'
let s:CommandSpec_eno = '\begin[<++>]{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}'
let s:CommandSpec_nor = '\<+replace+>'
***************
*** 319,365 ****
let s:CommandSpec_ = '\<+replace+>'
" }}}
" Tex_ProcessPackageCommand: processes a command from the package menu {{{
" Description:
function! Tex_ProcessPackageCommand(command)
! let commandType = matchstr(a:command, '^\w\+\ze:')
! let commandName = strpart(a:command, strlen(commandType.':'))
!
! return IMAP_PutTextWithMovement(
! \ substitute(s:CommandSpec_{commandType}, '<+replace+>', commandName, 'g'))
! endfunction
! " }}}
! " Tex_pack_supp: "supports" the package... {{{
! function! Tex_pack_supp(supp_pack)
! call Tex_pack_check(a:supp_pack)
! exe 'let g:s_p_o = g:TeX_package_option_'.a:supp_pack
! if exists('g:s_p_o') && g:s_p_o != ''
! return IMAP_PutTextWithMovement('\usepackage[<++>]{'.a:supp_pack.'}<++>', '<+', '+>')
! else
! return IMAP_PutTextWithMovement('\usepackage{'.a:supp_pack.'}<++>', '<+', '+>')
! endif
! if g:Tex_package_supported == ''
! let g:Tex_package_supported = a:supp_pack
else
! let g:Tex_package_supported = g:Tex_package_supported.','.a:supp_pack
endif
- endfunction
" }}}
! " Tex_PutPackage: inserts package from line {{{
! " (see Tex_package_from_line in envmacros.vim)
! function! Tex_PutPackage(package)
! if filereadable(s:path.'/packages/'.a:package)
! return Tex_pack_supp(a:package)
else
! return IMAP_PutTextWithMovement('\usepackage{'.a:package.'}')
endif
- call Tex_pack_updateall()
- endfunction " }}}
! if g:Tex_Menus
! exe 'amenu '.s:p_menu_lev.'&UpdatePackage :call Tex_pack(expand("<cword>"))<cr>'
! exe 'amenu '.s:p_menu_lev.'&UpdateAll :call Tex_pack_updateall()<cr>'
call Tex_pack_supp_menu()
--- 333,384 ----
let s:CommandSpec_ = '\<+replace+>'
+ let s:MenuLHS_bra = '\\&<+replace+>{}'
+ let s:MenuLHS_brs = '\\&<+replace+>{}'
+ let s:MenuLHS_brd = '\\&<+replace+>{}{}'
+ let s:MenuLHS_env = '&<+replace+>\ (E)'
+ let s:MenuLHS_ens = '&<+replace+>\ (E)'
+ let s:MenuLHS_eno = '&<+replace+>\ (E)'
+ let s:MenuLHS_nor = '\\&<+replace+>'
+ let s:MenuLHS_noo = '\\&<+replace+>[]'
+ let s:MenuLHS_nob = '\\&<+replace+>[]{}{}'
+ let s:MenuLHS_spe = '&<+replace+>'
+ let s:MenuLHS_sep = '-sep<+replace+>-'
+ let s:MenuLHS_ = '\\&<+replace+>'
" }}}
" Tex_ProcessPackageCommand: processes a command from the package menu {{{
" Description:
function! Tex_ProcessPackageCommand(command)
! if a:command =~ ':'
! let commandType = matchstr(a:command, '^\w\+\ze:')
! let commandName = matchstr(a:command, '^\w\+:\zs[^:]\+\ze:\?')
! let extrapart = strpart(a:command, strlen(commandType.':'.commandName.':'))
else
! let commandType = ''
! let commandName = a:command
! let extrapart = ''
endif
+ let command = s:CommandSpec_{commandType}
+ let command = substitute(command, '<+replace+>', commandName, 'g')
+ let command = substitute(command, '<+extra+>', extrapart, 'g')
+ return IMAP_PutTextWithMovement(command)
+ endfunction
" }}}
! " FilterPackageMenuLHS: filters the command description to provide a better menu item {{{
! " Description:
! function! <SID>FilterPackageMenuLHS(command)
! let commandType = matchstr(a:command, '^\w\+\ze:')
! if commandType != ''
! let commandName = strpart(a:command, strlen(commandType.':'))
else
! let commandName = a:command
endif
! return substitute(s:MenuLHS_{commandType}, '<+replace+>', commandName, 'g')
! endfunction " }}}
! if g:Tex_Menus
! exe 'amenu '.g:Tex_PackagesMenuLocation.'&UpdatePackage :call Tex_pack(expand("<cword>"))<cr>'
! exe 'amenu '.g:Tex_PackagesMenuLocation.'&UpdateAll :call Tex_pack_updateall()<cr>'
call Tex_pack_supp_menu()
|
|
From: <sri...@us...> - 2002-12-27 20:53:38
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv1524
Modified Files:
Tag: b-newpackages
main.vim
Log Message:
. Tex_GetMainFileName now uses an optional argument. If this argument is
supplied, then it uses this to modify the mainfilename (instead of
':p:r:r'). The default returns 'thesis' if the main file is named
'thesis.tex.latexmain', i.e the .tex extension is lost. Sometimes, we might
actually want the extension.
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** main.vim 22 Dec 2002 03:00:44 -0000 1.17
--- main.vim 27 Dec 2002 20:53:34 -0000 1.17.2.1
***************
*** 4,8 ****
" Email: sr...@fa...
" URL:
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
"
" Help:
--- 4,8 ----
" Email: sr...@fa...
" URL:
! " Last Change: Tue Dec 24 02:00 AM 2002 PST
"
" Help:
***************
*** 374,383 ****
" i.e if main.tex.latexmain exists, then returns:
" d:/path/to/main
! function! Tex_GetMainFileName()
let curd = getcwd()
exe 'cd '.expand('%:p:h')
let lheadfile = glob('*.latexmain')
if lheadfile != ''
! let lheadfile = fnamemodify(lheadfile, ':p:r:r')
endif
exe 'cd '.curd
--- 374,388 ----
" i.e if main.tex.latexmain exists, then returns:
" d:/path/to/main
! function! Tex_GetMainFileName(...)
! if a:0 > 0
! let modifier = a:1
! else
! let modifier = ':p:r:r'
! endif
let curd = getcwd()
exe 'cd '.expand('%:p:h')
let lheadfile = glob('*.latexmain')
if lheadfile != ''
! let lheadfile = fnamemodify(lheadfile, modifier)
endif
exe 'cd '.curd
***************
*** 429,432 ****
--- 434,464 ----
let s:incnum = a:val
endfunction " }}}
+ " Functions for debugging {{{
+ " Tex_Debug: appends the argument into s:debugString {{{
+ " Description:
+ "
+ function! Tex_Debug(str)
+ if !exists('s:debugString')
+ let s:debugString = ''
+ endif
+ let s:debugString = s:debugString.a:str."\n"
+ endfunction " }}}
+ " Tex_PrintDebug: prings s:debugString {{{
+ " Description:
+ "
+ function! Tex_PrintDebug()
+ if exists('s:debugString')
+ echo s:debugString
+ endif
+ endfunction " }}}
+ " Tex_ClearDebug: clears the s:debugString string {{{
+ " Description:
+ "
+ function! Tex_ClearDebug()
+ if exists('s:debugString')
+ let s:debugString = ''
+ endif
+ endfunction " }}}
+ " }}}
" source all the relevant files.
|
|
From: <sri...@us...> - 2002-12-27 20:41:45
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv31146
Modified Files:
Tag: b-newpackages
envmacros.vim
Log Message:
Using the Tex_pack_one function instead of the Tex_Put function.
Index: envmacros.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -C2 -d -r1.13 -r1.13.2.1
*** envmacros.vim 22 Dec 2002 03:00:43 -0000 1.13
--- envmacros.vim 27 Dec 2002 20:41:42 -0000 1.13.2.1
***************
*** 3,7 ****
" Author: Mikolaj Machowski
" Created: Tue Apr 23 08:00 PM 2002 PST
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
"
" Description: mappings/menus for environments.
--- 3,7 ----
" Author: Mikolaj Machowski
" Created: Tue Apr 23 08:00 PM 2002 PST
! " Last Change: Tue Dec 24 02:00 AM 2002 PST
"
" Description: mappings/menus for environments.
***************
*** 665,678 ****
let l = getline(".")
let pack = matchstr(l, '^\s*\zs.*')
! if pack == ''
! let pack = input('Package? ')
! if pack != ''
! return Tex_PutPackage(pack)
! endif
! return 0
! else
! normal 0D
! return Tex_PutPackage(pack)
! endif
endfunction " }}}
" Tex_ChangeEnvironments: calls Change() to change the environment {{{
--- 665,670 ----
let l = getline(".")
let pack = matchstr(l, '^\s*\zs.*')
! normal! 0"_D
! return Tex_pack_one(pack)
endfunction " }}}
" Tex_ChangeEnvironments: calls Change() to change the environment {{{
|
|
From: <sri...@us...> - 2002-12-27 01:50:01
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv27054
Modified Files:
custommacros.vim
Log Message:
. the menu commands didn't work. Fixed that problem. However, now the
commands will be a problem... This has been a long standing problem for me.
Will write a better log message later using 'cvs admin -m'
Index: custommacros.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/custommacros.vim,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** custommacros.vim 22 Dec 2002 03:00:37 -0000 1.9
--- custommacros.vim 27 Dec 2002 01:49:58 -0000 1.10
***************
*** 4,8 ****
" Version: 1.0
" Created: Tue Apr 23 05:00 PM 2002 PST
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
"
" Description: functions for processing custom macros in the
--- 4,8 ----
" Version: 1.0
" Created: Tue Apr 23 05:00 PM 2002 PST
! " Last Change: Thu Dec 26 05:00 PM 2002 PST
"
" Description: functions for processing custom macros in the
***************
*** 27,31 ****
exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fnameshort." :call <SID>DeleteMacro('".fnameshort."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fnameshort." :call <SID>EditMacro('".fnameshort."')<CR>"
! exe "amenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fnameshort." :call <SID>ReadMacro('".fnameshort."')<CR>"
let i = i + 1
endwhile
--- 27,32 ----
exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fnameshort." :call <SID>DeleteMacro('".fnameshort."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fnameshort." :call <SID>EditMacro('".fnameshort."')<CR>"
! exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fnameshort." <C-r>=<SID>ReadMacro('".fnameshort."')<CR>"
! exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fnameshort." i<C-r>=<SID>ReadMacro('".fnameshort."')<CR>"
let i = i + 1
endwhile
***************
*** 102,127 ****
endif
let _a = @a
! let fname = glob(s:path."/macros/".filename)
! silent! exec "normal! o¡!¡Temp Line¡!¡\<ESC>k"
silent! exec "read ".fname
! silent! exec "normal! V/^¡!¡Temp Line¡!¡$/-1\<CR>\"ax"
call Tex_CleanSearchHistory()
-
- silent! exec "normal! i\<C-r>='¡!¡Start here¡!¡'.IMAP_PutTextWithMovement(@a)\<CR>"
- let pos = line('.').'| normal! '.virtcol('.').'|'
! call search('^¡!¡Temp Line¡!¡$')
! . d _
! call search('¡!¡Start here¡!¡')
! silent! normal! v15l"_x
! call Tex_pack_all()
- silent! exe pos
- if col('.') < strlen(getline('.'))
- silent! normal! l
- endif
- silent! startinsert
endfunction
--- 103,129 ----
endif
+ let fname = s:path.'/macros/'.filename
+
+ let markerString = '<---- Latex Suite End Macro ---->'
let _a = @a
! let position = line('.').' | normal! '.virtcol('.').'|'
! silent! call append(line('.'), markerString)
silent! exec "read ".fname
! silent! exec "normal! V/^".markerString."$/-1\<CR>\"ax"
! " This is kind of tricky: At this stage, we are one line after the one we
! " started from with the marker text on it. We need to
! " 1. remove the marker and the line.
! " 2. get focus to the previous line.
! " 3. not remove anything from the previous line.
! silent! exec "normal! $v0k$\"_x"
!
call Tex_CleanSearchHistory()
! let @a = substitute(@a, '['."\n\r\t ".']*$', '', '')
! let textWithMovement = IMAP_PutTextWithMovement(@a)
! let @a = _a
! return textWithMovement
endfunction
|
|
From: <sri...@us...> - 2002-12-26 23:51:28
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv31382
Modified Files:
main.vim
Log Message:
. removing "other miscellaneous stuff taken from imaps.vim". This stuff was
a remenant of my personal ftplugin/tex.vim.
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** main.vim 23 Dec 2002 02:04:50 -0000 1.20
--- main.vim 26 Dec 2002 23:51:25 -0000 1.21
***************
*** 4,8 ****
" Email: sr...@fa...
" URL:
! " Last Change: Sun Dec 22 05:00 PM 2002 PST
"
" Help:
--- 4,8 ----
" Email: sr...@fa...
" URL:
! " Last Change: Thu Dec 26 03:00 PM 2002 PST
"
" Help:
***************
*** 114,137 ****
call IMAP (g:Tex_Leader.'|', '\Big|', "tex")
call IMAP (g:Tex_Leader.'I', "\\int_{<++>}^{<++>}<++>", 'tex')
- " }}}
- " other miscellaneous stuff taken from imaps.vim. {{{
- call IMAP ("vb".s:ml, "\\verb|<++>|<++>", "tex")
- call IMAP ("bf".s:ml, "{\\bf <++>}<++>", "tex")
- call IMAP ("em".s:ml, "{\\em <++>}<++>", "tex")
- call IMAP ("it".s:ml, "{\\it <++>}<++>", "tex")
- call IMAP ("mb".s:ml, "\\mbox{<++>}<++>", "tex")
- call IMAP ("frac".s:ml, "\\frac{<++>}{<++>}<++>", "tex")
- call IMAP ("sq".s:ml, "\\sqrt{<++>}<++>", "tex")
- call IMAP ("eps".s:ml, "\\psfig{figure=<++>.eps}<++>", "tex")
- call IMAP ("sum".s:ml, "\\sum{<++>}{<++>}<++>", "tex")
- call IMAP ("suml".s:ml, "\\sum\\limits_{<++>}^{<++>}<++>", "tex")
- call IMAP ("int".s:ml, "\\int_{<++>}^{<++>}<++>", "tex")
- call IMAP ("intl".s:ml, "\\int\\limits_{<++>}^{<++>}<++>", "tex")
- call IMAP ("bbr".s:ml, "\\left( <++> \\right)<++>", "tex")
- call IMAP ("bbc".s:ml, "\\left\\{ <++> \\right\\}<++>", "tex")
- call IMAP ("bbs".s:ml, "\\left[ <++> \\right]<++>", "tex")
- call IMAP ("rr".s:ml, "\\right", "tex")
- call IMAP ("ll".s:ml, "\\left", "tex")
- call IMAP ("part".s:ml, "\\partial", "tex")
" }}}
" Greek Letters {{{
--- 114,117 ----
|
|
From: <sri...@us...> - 2002-12-24 19:56:40
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages
In directory sc8-pr-cvs1:/tmp/cvs-serv23653
Modified Files:
Tag: b-newpackages
ifthen
Log Message:
. the global variable which defines commands was mistakenly written as
g:TeX_package_color in the ifthen package file causing the ifthen
commands not to appear in the packages menu.
Developers: Henceforth please note the branch on which commits are made.
Index: ifthen
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/ifthen,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** ifthen 22 Dec 2002 03:01:02 -0000 1.2
--- ifthen 24 Dec 2002 19:56:37 -0000 1.2.2.1
***************
*** 1,5 ****
let g:TeX_package_option_ifthen = ''
! let g:TeX_package_color =
\ 'brs:ifthenelse{<++>}{<++>}{<++>},'
\.'brd:equal,'
--- 1,5 ----
let g:TeX_package_option_ifthen = ''
! let g:TeX_package_ifthen =
\ 'brs:ifthenelse{<++>}{<++>}{<++>},'
\.'brd:equal,'
|
|
From: <sri...@us...> - 2002-12-24 12:51:10
|
Update of /cvsroot/vim-latex/vimfiles/plugin
In directory sc8-pr-cvs1:/tmp/cvs-serv24249
Modified Files:
imaps.vim
Log Message:
Bug: The mappings in latex-suite effect only the first .tex file being
edited.
Cause: In a recent chage, when IMAP(lhs, rhs, ft) is called with a
a:ft != '', then it sets the mapping to be buffer local. This
breaks latex-suite which calls the IMAP() functions only once when
it is first started, not for every buffer. Changing things so that
the mappings are called with every filetype event will be
1. quite time consuming
2. kind of inefficient in that a _lot_ of lines will need to be
resourced with every filetype event.
So until a better solution presents itself, make all maps created by
IMAP() global (not buffer-local).
Index: imaps.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** imaps.vim 23 Dec 2002 02:01:49 -0000 1.13
--- imaps.vim 24 Dec 2002 12:51:06 -0000 1.14
***************
*** 8,12 ****
" while preserving filetype indentation.
"
! " Last Change: Sun Dec 22 05:00 PM 2002 PST
"
" Documentation: {{{
--- 8,12 ----
" while preserving filetype indentation.
"
! " Last Change: Tue Dec 24 04:00 AM 2002 PST
"
" Documentation: {{{
***************
*** 179,183 ****
let lastLHSChar = '<space>'
end
! exe 'inoremap <silent>' (a:ft== '' ? '' : '<buffer>')
\ escape(lastLHSChar, '|')
\ '<C-r>=<SID>LookupCharacter("' .
--- 179,183 ----
let lastLHSChar = '<space>'
end
! exe 'inoremap <silent>'
\ escape(lastLHSChar, '|')
\ '<C-r>=<SID>LookupCharacter("' .
|
|
From: <sri...@us...> - 2002-12-23 02:11:52
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates
In directory sc8-pr-cvs1:/tmp/cvs-serv27771
Modified Files:
report.tex report_two_column.tex
Log Message:
. There was a problem with the last commit. The special characters were not
changed and one of the Last Change: Sun Dec 22 06:00 PM 2002 P
because of my lastchange.vim plugin !
Index: report.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report.tex,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** report.tex 23 Dec 2002 02:07:42 -0000 1.3
--- report.tex 23 Dec 2002 02:11:49 -0000 1.4
***************
*** 1,6 ****
<+ +> !comp! !exe!
! % File: ¡expand("%")¡
! % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper]{report}
--- 1,6 ----
<+ +> !comp! !exe!
! % File: !comp!expand("%")!comp!
! % Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
! % Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper]{report}
Index: report_two_column.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report_two_column.tex,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** report_two_column.tex 23 Dec 2002 02:07:42 -0000 1.3
--- report_two_column.tex 23 Dec 2002 02:11:49 -0000 1.4
***************
*** 1,6 ****
<+ +> !comp! !exe!
! % File: ¡expand("%:p:t")¡
! % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper,twocolumn]{report}
--- 1,6 ----
<+ +> !comp! !exe!
! % File: !comp!expand("%:p:t")!comp!
! % Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
! % Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper,twocolumn]{report}
|
|
From: <sri...@us...> - 2002-12-23 02:07:44
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates
In directory sc8-pr-cvs1:/tmp/cvs-serv26921
Modified Files:
article.tex report.tex report_two_column.tex
Log Message:
. Added a first line to these files containing the specification of the
placeholder characters and the other special characters used for dynamic
content as a tab delimited list.
Index: article.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/article.tex,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** article.tex 22 Dec 2002 03:01:06 -0000 1.2
--- article.tex 23 Dec 2002 02:07:42 -0000 1.3
***************
*** 1,5 ****
! % File: ¡expand("%:p:t")¡
! % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: Sat Dec 14 02:00 AM 2002 PST
%
\documentclass[a4paper]{article}
--- 1,6 ----
! <+ +> !comp! !exe!
! % File: !comp!expand("%:p:t")!comp!
! % Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
! % Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper]{article}
Index: report.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report.tex,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** report.tex 22 Dec 2002 03:01:07 -0000 1.2
--- report.tex 23 Dec 2002 02:07:42 -0000 1.3
***************
*** 1,5 ****
% File: ¡expand("%")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: Sat Dec 14 02:00 AM 2002 PST
%
\documentclass[a4paper]{report}
--- 1,6 ----
+ <+ +> !comp! !exe!
% File: ¡expand("%")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper]{report}
Index: report_two_column.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report_two_column.tex,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** report_two_column.tex 22 Dec 2002 03:01:07 -0000 1.2
--- report_two_column.tex 23 Dec 2002 02:07:42 -0000 1.3
***************
*** 1,5 ****
% File: ¡expand("%:p:t")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: Sat Dec 14 02:00 AM 2002 PST
%
\documentclass[a4paper,twocolumn]{report}
--- 1,6 ----
+ <+ +> !comp! !exe!
% File: ¡expand("%:p:t")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper,twocolumn]{report}
|
|
From: <sri...@us...> - 2002-12-23 02:04:54
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv26272
Modified Files:
main.vim
Log Message:
. added 3 functions for debugging, Tex_Debug, Tex_PrintDebug and
Tex_ClearDebug. echmosg cannot be used in certain places because it leads
to hit enter prompts. Also the messages dissapear with time.
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** main.vim 22 Dec 2002 14:38:10 -0000 1.19
--- main.vim 23 Dec 2002 02:04:50 -0000 1.20
***************
*** 4,8 ****
" Email: sr...@fa...
" URL:
! " Last Change: Sun Dec 22 09:00 AM 2002 EST
"
" Help:
--- 4,8 ----
" Email: sr...@fa...
" URL:
! " Last Change: Sun Dec 22 05:00 PM 2002 PST
"
" Help:
***************
*** 433,436 ****
--- 433,463 ----
let s:incnum = a:val
endfunction " }}}
+ " Functions for debugging {{{
+ " Tex_Debug: appends the argument into s:debugString {{{
+ " Description:
+ "
+ function! Tex_Debug(str)
+ if !exists('s:debugString')
+ let s:debugString = ''
+ endif
+ let s:debugString = s:debugString.a:str."\n"
+ endfunction " }}}
+ " Tex_PrintDebug: prings s:debugString {{{
+ " Description:
+ "
+ function! Tex_PrintDebug()
+ if exists('s:debugString')
+ echo s:debugString
+ endif
+ endfunction " }}}
+ " Tex_ClearDebug: clears the s:debugString string {{{
+ " Description:
+ "
+ function! Tex_ClearDebug()
+ if exists('s:debugString')
+ let s:debugString = ''
+ endif
+ endfunction " }}}
+ " }}}
" source all the relevant files.
|
|
From: <sri...@us...> - 2002-12-23 02:01:56
|
Update of /cvsroot/vim-latex/vimfiles/plugin
In directory sc8-pr-cvs1:/tmp/cvs-serv25673
Modified Files:
imaps.vim
Log Message:
. changed the script local s:PlaceHolderStart/End() functions to global
IMAP_GetPlaceHolderStart/End() functions. They need to be visible to
templates.vim.
. changed fun! and endfun to function! and endfunction
(another one of those consistent coding thingies)
Index: imaps.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** imaps.vim 22 Dec 2002 14:12:02 -0000 1.12
--- imaps.vim 23 Dec 2002 02:01:49 -0000 1.13
***************
*** 8,12 ****
" while preserving filetype indentation.
"
! " Last Change: Sun Dec 22 08:00 AM 2002 EST
"
" Documentation: {{{
--- 8,12 ----
" while preserving filetype indentation.
"
! " Last Change: Sun Dec 22 05:00 PM 2002 PST
"
" Documentation: {{{
***************
*** 187,195 ****
" }}}
-
" IMAP_list: list the rhs and place holders corresponding to a:lhs {{{
"
" Added mainly for debugging purposes, but maybe worth keeping.
! fun! IMAP_list(lhs)
let char = a:lhs[strlen(a:lhs)-1]
let charHash = s:Hash(char)
--- 187,194 ----
" }}}
" IMAP_list: list the rhs and place holders corresponding to a:lhs {{{
"
" Added mainly for debugging purposes, but maybe worth keeping.
! function! IMAP_list(lhs)
let char = a:lhs[strlen(a:lhs)-1]
let charHash = s:Hash(char)
***************
*** 204,210 ****
return "rhs = " . s:Map_{ft}_{hash} . " place holders = " .
\ s:phs_{ft}_{hash} . " and " . s:phe_{ft}_{hash}
! endfun
" }}}
-
" LookupCharacter: inserts mapping corresponding to this character {{{
"
--- 203,208 ----
return "rhs = " . s:Map_{ft}_{hash} . " place holders = " .
\ s:phs_{ft}_{hash} . " and " . s:phe_{ft}_{hash}
! endfunction
" }}}
" LookupCharacter: inserts mapping corresponding to this character {{{
"
***************
*** 266,271 ****
" The user's placeholder settings.
! let phsUser = s:PlaceHolderStart()
! let pheUser = s:PlaceHolderEnd()
" A very rare string: Do not use any special characters here. This is used
--- 264,269 ----
" The user's placeholder settings.
! let phsUser = IMAP_GetPlaceHolderStart()
! let pheUser = IMAP_GetPlaceHolderEnd()
" A very rare string: Do not use any special characters here. This is used
***************
*** 344,349 ****
" The user's placeholder settings.
! let phsUser = s:PlaceHolderStart()
! let pheUser = s:PlaceHolderEnd()
let searchOpts = a:direction
--- 342,347 ----
" The user's placeholder settings.
! let phsUser = IMAP_GetPlaceHolderStart()
! let pheUser = IMAP_GetPlaceHolderEnd()
let searchOpts = a:direction
***************
*** 572,578 ****
endfun
"" }}}
! " PlaceHolderStart and PlaceHolderEnd: return the buffer-local " {{{
! " variable, or the global one, or the default.
! fun! s:PlaceHolderStart()
if exists("b:Imap_PlaceHolderStart") && strlen(b:Imap_PlaceHolderEnd)
return b:Imap_PlaceHolderStart
--- 570,576 ----
endfun
"" }}}
! " IMAP_GetPlaceHolderStart and IMAP_GetPlaceHolderEnd: "{{{
! " return the buffer local placeholder variables, or the global one, or the default.
! function! IMAP_GetPlaceHolderStart()
if exists("b:Imap_PlaceHolderStart") && strlen(b:Imap_PlaceHolderEnd)
return b:Imap_PlaceHolderStart
***************
*** 582,586 ****
return "<+"
endfun
! fun! s:PlaceHolderEnd()
if exists("b:Imap_PlaceHolderEnd") && strlen(b:Imap_PlaceHolderEnd)
return b:Imap_PlaceHolderEnd
--- 580,584 ----
return "<+"
endfun
! function! IMAP_GetPlaceHolderEnd()
if exists("b:Imap_PlaceHolderEnd") && strlen(b:Imap_PlaceHolderEnd)
return b:Imap_PlaceHolderEnd
|
|
From: <sri...@us...> - 2002-12-23 01:59:21
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv24780
Modified Files:
templates.vim
Log Message:
Problem: The original mechanism did not account for the placeholder settings
being changed.
Changed the templates such that the first line contains a tab delimited
list of placeholder specifications used in the file as well as the special
characters for computing and executing things within the templates.
ReadTemplate() reads in these specs from the first line and
ProcessTemplates() uses them to process the template file. This allows for
the template maker to not have to bother with the users placeholder
settings.
Index: templates.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates.vim,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** templates.vim 22 Dec 2002 03:00:49 -0000 1.7
--- templates.vim 23 Dec 2002 01:59:18 -0000 1.8
***************
*** 5,9 ****
" Version: 1.0
" Created: Tue Apr 23 05:00 PM 2002 PST
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
"
" Description: functions for handling templates in latex-suite/templates
--- 5,9 ----
" Version: 1.0
" Created: Tue Apr 23 05:00 PM 2002 PST
! " Last Change: Sun Dec 22 05:00 PM 2002 PST
"
" Description: functions for handling templates in latex-suite/templates
***************
*** 30,34 ****
\":call <SID>ReadTemplate('".fnameshort."')<CR>".
\":call <SID>ProcessTemplate()<CR>:0<CR>".
! \"i<C-r>=IMAP_Jumpfunc()<CR>"
let i = i + 1
endwhile
--- 30,34 ----
\":call <SID>ReadTemplate('".fnameshort."')<CR>".
\":call <SID>ProcessTemplate()<CR>:0<CR>".
! \"i<C-r>=IMAP_Jumpfunc('', 1)<CR>"
let i = i + 1
endwhile
***************
*** 42,46 ****
" ReadTemplate: reads in the template file from the template directory. {{{
function! <SID>ReadTemplate(...)
-
if a:0 > 0
let filename = a:1.'.*'
--- 42,45 ----
***************
*** 54,57 ****
--- 53,70 ----
let fname = glob(s:path."/templates/".filename)
exe "0read ".fname
+ " The first line of the file contains the specifications of what the
+ " placeholder characters and the other special characters are.
+ let pattern = '\v(\S+)\t(\S+)\t(\S+)\t(\S+)'
+
+ let s:phsTemp = substitute(getline(1), pattern, '\1', '')
+ let s:pheTemp = substitute(getline(1), pattern, '\2', '')
+ let s:exeTemp = substitute(getline(1), pattern, '\3', '')
+ let s:comTemp = substitute(getline(1), pattern, '\4', '')
+
+ call Tex_Debug('phs = '.s:phsTemp.', phe = '.s:pheTemp.', exe = '.s:exeTemp.', com = '.s:comTemp)
+
+ " delete the first line into ze blackhole.
+ 0 d _
+
call Tex_pack_all()
endfunction
***************
*** 63,83 ****
" http://vim.sourceforge.net/scripts/script.php?script_id=222
function! <SID>ProcessTemplate()
! silent! %s/^¿\(\_.[^¿]*\)¿$/\=<SID>Compute(submatch(1))/ge
! silent! %s/¡\([^¡]*\)¡/\=<SID>Exec(submatch(1))/ge
! silent! g/¿¿/d
! call Tex_CleanSearchHistory()
! call Tex_CleanSearchHistory()
! call Tex_CleanSearchHistory()
endfunction
function! <SID>Exec(what)
! exec 'return '.a:what
endfunction
" Back-Door to trojans !!!
function! <SID>Compute(what)
! exe a:what
! return "¿¿"
endfunction
--- 76,107 ----
" http://vim.sourceforge.net/scripts/script.php?script_id=222
function! <SID>ProcessTemplate()
! if exists('s:phsTemp') && s:phsTemp != ''
! exec 'silent! %s/^'.s:comTemp.'\(\_.\{-}\)'.s:comTemp.'$/\=<SID>Compute(submatch(1))/ge'
! exec 'silent! %s/'.s:exeTemp.'\(.\{-}\)'.s:exeTemp.'/\=<SID>Exec(submatch(1))/ge'
! exec 'silent! g/'.s:comTemp.s:comTemp.'/d'
!
! let phsUser = IMAP_GetPlaceHolderStart()
! let pheUser = IMAP_GetPlaceHolderEnd()
!
! exec 'silent! %s/'.s:phsTemp.'\(.\{-}\)'.s:pheTemp.'/'.phsUser.'\1'.pheUser.'/ge'
!
! " A function only puts one item into the search history...
! call Tex_CleanSearchHistory()
! endif
endfunction
function! <SID>Exec(what)
! exec 'return '.a:what
endfunction
" Back-Door to trojans !!!
function! <SID>Compute(what)
! exe a:what
! if exists('s:comTemp')
! return s:comTemp.s:comTemp
! else
! return ''
! endif
endfunction
***************
*** 85,92 ****
com! -nargs=? TTemplate :call <SID>ReadTemplate(<f-args>)
! \| :call <SID>ProcessTemplate()
! \| :0
! \| :exec "normal! i\<C-r>=IMAP_Jumpfunc()\<CR>"
! \| :startinsert
" vim:fdm=marker:ts=4:sw=4:noet
--- 109,116 ----
com! -nargs=? TTemplate :call <SID>ReadTemplate(<f-args>)
! \| :call <SID>ProcessTemplate()
! \| :0
! \| :exec "normal! i\<C-r>=IMAP_Jumpfunc('', 1)\<CR>"
! \| :startinsert
" vim:fdm=marker:ts=4:sw=4:noet
|
|
From: <ma...@us...> - 2002-12-22 14:38:13
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv27527
Modified Files:
main.vim
Log Message:
Second attempt at modifying s:TexQuotes(). The renaining problem was not
with IMAP_Jumpfunc() but with the interaction of the :imap that calls
s:TexQuotes() with the various functions that get called. This hack is not
too bad, and it seems to work.
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** main.vim 22 Dec 2002 14:12:02 -0000 1.18
--- main.vim 22 Dec 2002 14:38:10 -0000 1.19
***************
*** 4,8 ****
" Email: sr...@fa...
" URL:
! " Last Change: Sun Dec 22 08:00 AM 2002 EST
"
" Help:
--- 4,8 ----
" Email: sr...@fa...
" URL:
! " Last Change: Sun Dec 22 09:00 AM 2002 EST
"
" Help:
***************
*** 273,277 ****
" Return to line l, column c:
execute restore_cursor
! return q
endfunction
--- 273,278 ----
" Return to line l, column c:
execute restore_cursor
! " Start with <Del> to remove the " put in by the :imap .
! return "\<Del>" . q
endfunction
***************
*** 466,470 ****
" smart functions
if g:Tex_SmartKeyQuote
! inoremap <buffer> <silent> " "<Left><C-R>=<SID>TexQuotes()<CR><Del>
endif
if g:Tex_SmartKeyBS
--- 467,471 ----
" smart functions
if g:Tex_SmartKeyQuote
! inoremap <buffer> <silent> " "<Left><C-R>=<SID>TexQuotes()<CR>
endif
if g:Tex_SmartKeyBS
|
|
From: <ma...@us...> - 2002-12-22 14:12:05
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv20094/ftplugin/latex-suite
Modified Files:
main.vim
Log Message:
I modified s:TexQuotes() so that empty quotation marks add place holders:
by default, "``''<++>" . This does not yet work, and I think the problem is
in IMAP_Jumpfunc(). I fixed one error in this function; I am still working on
it.
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** main.vim 22 Dec 2002 03:00:44 -0000 1.17
--- main.vim 22 Dec 2002 14:12:02 -0000 1.18
***************
*** 4,8 ****
" Email: sr...@fa...
" URL:
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
"
" Help:
--- 4,8 ----
" Email: sr...@fa...
" URL:
! " Last Change: Sun Dec 22 08:00 AM 2002 EST
"
" Help:
***************
*** 262,267 ****
" and open quote?
if ( line(".") < l || line(".") == l && col(".") < c )
! if strlen(getline("."))
! if ( getline(".")[col(".")-1] == open[0] )
let q = close
endif
--- 262,270 ----
" and open quote?
if ( line(".") < l || line(".") == l && col(".") < c )
! if strlen(getline(".")) && (getline(".")[col(".")-1] == open[0])
! if line(".") == l && col(".") + strlen(open) == c
! " Insert "<++>''<++>" instead of just "''".
! let q = IMAP_PutTextWithMovement("<++>".close."<++>")
! else
let q = close
endif
|
|
From: <ma...@us...> - 2002-12-22 14:12:05
|
Update of /cvsroot/vim-latex/vimfiles/plugin
In directory sc8-pr-cvs1:/tmp/cvs-serv20094/plugin
Modified Files:
imaps.vim
Log Message:
I modified s:TexQuotes() so that empty quotation marks add place holders:
by default, "``''<++>" . This does not yet work, and I think the problem is
in IMAP_Jumpfunc(). I fixed one error in this function; I am still working on
it.
Index: imaps.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** imaps.vim 22 Dec 2002 03:39:06 -0000 1.11
--- imaps.vim 22 Dec 2002 14:12:02 -0000 1.12
***************
*** 8,12 ****
" while preserving filetype indentation.
"
! " Last Change: Sat Dec 21 10:00 PM 2002 EST
"
" Documentation: {{{
--- 8,12 ----
" while preserving filetype indentation.
"
! " Last Change: Sun Dec 22 08:00 AM 2002 EST
"
" Documentation: {{{
***************
*** 358,362 ****
" current cursor position does not contain a placeholder character, then
" search for the placeholder characters.
! if !a:inclusive || strpart(getline('.'), col('.')-1) !~ '\V^'.phsUser
let searchString = '\V'.phsUser.'\.\{-}'.pheUser
endif
--- 358,362 ----
" current cursor position does not contain a placeholder character, then
" search for the placeholder characters.
! if !a:inclusive || strpart(getline('.'), col('.')-1) !~ '\V\^'.phsUser
let searchString = '\V'.phsUser.'\.\{-}'.pheUser
endif
|
|
From: Srinath A. <sr...@fa...> - 2002-12-22 11:08:12
|
Hello Mikolaj,
Sorry for starting a branch on packages.vim before consulting you first.
Note that this is on a side branch, so if you want, I am willing to
completeley ignore this branch and never get it into the main trunk.
Having said that, I would like it if packages.vim was simplified in
places and cleaned up. As of now, whenever I look at packages.vim, I can
hardly understand it. There are many places which look like we are doing
the wrong thing, but I am not sure since its not commented...
In any case, let me know what you think. If you want, we can give up on
this branch.
Srinath
On Sun, 22 Dec 2002 sri...@us... wrote:
> Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
> In directory sc8-pr-cvs1:/tmp/cvs-serv11026
>
> Modified Files:
> Tag: b-newpackages
> packages.vim
> Log Message:
> . This is a reworking of most of packages.vim in an attempt to simplify it.
> I noticed that there was a lot of duplicated effort in a lot of functions
> adn that the placeholder settings were not respected in a lot of places
> by using things such as
> normal! 'i\usepackage{...
> instead of
> return IMAP_PutText...
>
|
|
From: <sri...@us...> - 2002-12-22 11:02:11
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv11026
Modified Files:
Tag: b-newpackages
packages.vim
Log Message:
. This is a reworking of most of packages.vim in an attempt to simplify it.
I noticed that there was a lot of duplicated effort in a lot of functions
adn that the placeholder settings were not respected in a lot of places
by using things such as
normal! 'i\usepackage{...
instead of
return IMAP_PutText...
. Created a new function Tex_MakeSubMenu which takes a comma seperated list
and creates a 'bunched' menu, i.e breaks up the items into groups of 20.
. made Tex_pack_supp_menu and another function use this function.
NOTE: This commit is on a new branch called b-newpackages rooted at the
head of the main branch as of tonight, not the main branch. The main branch
packages.vim has not changed.
Index: packages.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -C2 -d -r1.16 -r1.16.2.1
*** packages.vim 22 Dec 2002 03:00:47 -0000 1.16
--- packages.vim 22 Dec 2002 11:02:05 -0000 1.16.2.1
***************
*** 3,7 ****
" Author: Mikolaj Machowski
" Created: Tue Apr 23 06:00 PM 2002 PST
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
"
" Description: handling packages from within vim
--- 3,7 ----
" Author: Mikolaj Machowski
" Created: Tue Apr 23 06:00 PM 2002 PST
! " Last Change: Sun Dec 22 02:00 AM 2002 PST
"
" Description: handling packages from within vim
***************
*** 9,16 ****
" avoid reinclusion.
! if !g:Tex_PackagesMenu || exists('s:doneOnce')
! finish
! endif
! let s:doneOnce = 1
" Level of Packages menu:
--- 9,18 ----
" avoid reinclusion.
! " TODO: This is no longer true. A package does more things than just make
! " menus.
! " if !g:Tex_PackagesMenu || exists('s:doneOnce')
! " finish
! " endif
! " let s:doneOnce = 1
" Level of Packages menu:
***************
*** 24,27 ****
--- 26,32 ----
com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall()
+ imap <silent> <plug> <Nop>
+ nmap <silent> <plug> i
+
let g:Tex_package_supported = ''
let g:Tex_package_detected = ''
***************
*** 33,36 ****
--- 38,42 ----
exe 'source ' . s:path . '/packages/' . a:package
if has("gui_running")
+ " TODO: Didn't we hav an option for the menus here...
call Tex_pack(a:package)
endif
***************
*** 41,44 ****
--- 47,52 ----
if !has("gui_running") && filereadable(s:path.'/dictionaries/'.a:package)
let g:Tex_package_supported = g:Tex_package_supported.','.a:package
+ " TODO: This means that the list contains dupes if the package and
+ " the dictionary both exist...
endif
endif
***************
*** 94,97 ****
--- 102,109 ----
endif
else
+ " TODO: What does this while loop do?
+ " Are we actually searching for things like
+ " s:path/packages/1
+ " etc?!!
let i = a:0
let omega = 1
***************
*** 117,120 ****
--- 129,134 ----
let cwd = getcwd()
let fname = Tex_GetMainFileName()
+ " TODO: Change Tex_GetMainFileName to return file name with extension.
+ " (maybe in the presence of an optional argument)
if glob(fname.'.tex') != ''
let fname = fname.'.tex'
***************
*** 178,204 ****
" groups the packages thus found into groups of 20...
function! Tex_pack_supp_menu()
! let g:suplist = glob(s:path."/packages/*")
! let g:suplist = substitute(g:suplist, "\n", ',', 'g')
! let nu_s_list = GetListCount(g:suplist)
! if nu_s_list <= s:menu_div
! let SupMenu = ''
! let NotSupMenu = 1
! endif
! let basic_nu_s_list = 0
! let OptMenu = ''
! while basic_nu_s_list < nu_s_list
! let s_item = GetListItem(g:suplist, basic_nu_s_list)
! let fptr = fnamemodify(s_item, ':p:t:r')
! let fpt = fnamemodify(s_item, ':p:t')
! if !exists('NotSupMenu') && basic_nu_s_list % s:menu_div == 0
! let s_index = strpart(fptr, 0, 5)
! if strlen(s_item) > 5
! let OptMenu = '.'.s_index.'\.\.\.\ -'
! else
! let OptMenu = '.'.s_index.'\ -'
! endif
endif
! exe 'amenu '.s:p_menu_lev.'&Supported'.OptMenu.'.&'.fptr." :call Tex_pack_supp('".fpt."')<CR>"
! let basic_nu_s_list = basic_nu_s_list + 1
endwhile
endfunction
--- 192,256 ----
" groups the packages thus found into groups of 20...
function! Tex_pack_supp_menu()
!
! let pwd = getcwd()
! exec 'cd '.s:path.'/packages'
! let suplist = glob("*")
! exec 'cd '.pwd
!
! let suplist = substitute(suplist, "\n", ',', 'g').','
!
! call Tex_MakeSubmenu(suplist, g:Tex_PackagesMenuLocation.'Supported.',
! \ '<plug><C-r>=Tex_pack_supp("', '")<CR>')
! endfunction
!
! " }}}
!
! " Tex_MakeSubmenu: makes a submenu given a list of items {{{
! " Description:
! function! Tex_MakeSubmenu(menuList, MainMenuName, HandlerFuncLHS, HandlerFuncRHS, ...)
!
! let extractPattern = ''
! if a:0 > 0
! let extractPattern = a:1
! endif
! let menuList = a:menuList
! if menuList !~ ',$'
! let menuList = menuList.','
! endif
! let doneMenuSubmenu = 0
!
! while menuList != ''
!
! " Extract upto s:menu_div menus at once.
! let menuBunch = matchstr(menuList, '\v(.{-},){,'.s:menu_div.'}')
! " echomsg 'bunch = '.menuBunch
!
! " The remaining menus go into the list.
! let menuList = strpart(menuList, strlen(menuBunch))
!
! let submenu = ''
! " If there is something remaining, then we got s:menu_div items.
! " therefore put these menu items into a submenu.
! if strlen(menuList) || doneMenuSubmenu
! let firstMenu = matchstr(menuBunch, '\v^.{-}\ze,')
! let lastMenu = matchstr(menuBunch, '\v[^,]{-}\ze,$')
!
! let submenu = substitute(firstMenu, extractPattern, '\1', '').
! \ '\ -\ '.substitute(lastMenu, extractPattern, '\1', '').'.'
!
! let doneMenuSubmenu = 1
endif
!
! " Now for each menu create a menu under the submenu
! let i = 1
! let menuName = Tex_Strntok(menuBunch, ',', i)
! while menuName != ''
! let menuItem = substitute(menuName, extractPattern, '\1', '')
! execute 'amenu '.a:MainMenuName.submenu.menuItem
! \ ' '.a:HandlerFuncLHS.menuName.a:HandlerFuncRHS
!
! let i = i + 1
! let menuName = Tex_Strntok(menuBunch, ',', i)
! endwhile
endwhile
endfunction
***************
*** 209,353 ****
let basic_nu_p_list = ''
let nu_p_list = ''
- let g:p_file = s:path . '/packages/' . a:pack
- if filereadable(g:p_file)
- "exe 'source ' . g:p_file
- exe 'let g:p_list = g:TeX_package_' . a:pack
- exe 'let g:p_o_list = g:TeX_package_option_' . a:pack
! " Creating package.Option menu {{{
! if exists('g:p_o_list') && g:p_o_list != ''
! let nu_p_o_list = GetListCount(g:p_o_list)
! if nu_p_o_list <= s:menu_div
! let OptMenu = ''
! let NotOptMenu = 1
! endif
! if nu_p_o_list == 1
! let p_o_delimiter = ''
! else
! let p_o_delimiter = ','
! endif
! let basic_nu_p_o_list = 0
! let o_loop_nu = 0
! while basic_nu_p_o_list < nu_p_o_list
! let p_o_item = GetListItem(g:p_o_list, basic_nu_p_o_list)
! let p_o_item_def = strpart(p_o_item, 0, 3)
! let p_o_item_name = substitute(p_o_item, '^...:', '', '')
! if !exists('NotOptMenu') && (o_loop_nu % s:menu_div == 0 || p_o_item_def == 'sbr')
! if p_o_item_def == 'sbr'
! let OptMenu = '.&'.p_o_item_name
! let o_loop_nu = 1
! let basic_nu_p_o_list = basic_nu_p_o_list + 1
! let p_o_item = GetListItem(g:p_o_list, basic_nu_p_o_list)
! else
! let ost_index = strpart(p_o_item_name, 0, 4)
! if strlen(p_o_item_name) > 5
! let OptMenu = '.'.ost_index.'\.\.\.\ -'
! else
! let OptMenu = '.'.ost_index.'\ -'
! endif
! endif
! endif
! let l_m_p_o_item = '&'.substitute(p_o_item, '<++>', '', '')
! let p_o_end = p_o_item[strlen(p_o_item) - 1]
! if p_o_end !~ "[a-zA-Z}]"
! let r_m_p_o_item = "<plug><C-r>=IMAP_PutTextWithMovement('".p_o_item.'<++>'.p_o_delimiter."<++>')<cr>"
! elseif p_o_end == '}'
! let r_m_p_o_item = "<plug><C-r>=IMAP_PutTextWithMovement('".p_o_item.p_o_delimiter."<++>')<cr>"
! else
! let r_m_p_o_item = '<plug>'.p_o_item.p_o_delimiter
! endif
! exe 'amenu '.s:p_menu_lev.'&'.a:pack.'.&Options'.OptMenu.'.'.l_m_p_o_item.' '.r_m_p_o_item
! let basic_nu_p_o_list = basic_nu_p_o_list + 1
! let o_loop_nu = o_loop_nu + 1
! endwhile
! endif " }}}
! " Creating package.Command menu {{{
! let nu_p_list = GetListCount(g:p_list)
! if nu_p_list <= s:menu_div
! let ComMenu = ''
! let NotComMenu = 1
endif
! let basic_nu_p_list = 0
! let loop_nu = 0
! while basic_nu_p_list < nu_p_list
! let p_item = GetListItem(g:p_list, basic_nu_p_list)
! let p_item_def = strpart(p_item, 0, 3)
! let p_item_name = substitute(p_item, '^...:', '', '')
! if !exists('NotComMenu') && p_item_def == 'sbr'
! let ComMenu = '.&'.p_item_name
! let loop_nu = 1
! let basic_nu_p_list = basic_nu_p_list + 1
! let p_item = GetListItem(g:p_list, basic_nu_p_list)
! let p_item_def = strpart(p_item, 0, 3)
! let p_item_name = substitute(p_item, '^...:', '', '')
! endif
! " testing command type {{{
! if p_item_def == 'bra'
! let com_type = '{}'
! let l_m_item = '\\&'.p_item_name.'{}'
! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."{<++>}<++>')<cr>"
! elseif p_item_def == 'brs'
! let com_type = '{}'
! let l_m_item = '\\&'.substitute(p_item_name, "[<++><++>]", '', 'g')
! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."<++>')<cr>"
! elseif p_item_def == 'brd'
! let com_type = '{}{}'
! let l_m_item = '\\&'.p_item_name.'{}{}'
! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."{<++>}{<++>}<++>')<cr>"
! elseif p_item_def == 'sep'
! let com_type = ''
! let l_m_item = '-packsep'.basic_nu_p_list.'-'
! let r_m_item = ':'
! elseif p_item_def == 'env'
! let com_type = '(E)'
! let l_m_item = '&'.p_item_name.'(E)'
! let r_m_item = '<plug>\begin{'.p_item_name.'}<cr> <cr>\end{'.p_item_name.'}<++><Up><Left>'
! elseif p_item_def == 'ens'
! let com_type = '(E)'
! let p_env_spec = substitute(p_item_name, '.*:', '', '')
! let p_env_name = matchstr(p_item_name, '^[^:]*')
! let l_m_item = '&'.p_env_name.'(E)'
! let r_m_item = '<plug>\begin{'.p_env_name.'}'.p_env_spec.'<cr><++><cr>\end{'.p_env_name.'}<++><Up><Up><C-j>'
! elseif p_item_def == 'eno'
! let com_type = '(E)'
! let l_m_item = '&'.p_item_name.'(E)'
! let r_m_item = '<plug>\begin[<++>]{'.p_item_name.'}<cr><++><cr>\end{'.p_item_name.'}<++><Up><Up><C-j>'
! elseif p_item_def == 'nor'
! let com_type = "\\\\'"
! let l_m_item = '\\&'.p_item_name."'"
! let r_m_item = "<plug>\\".p_item_name.' '
! elseif p_item_def == 'noo'
! let com_type = '\\[]'
! let l_m_item = '\\&'.p_item_name.'[]'
! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."[<++>]<++>')<cr>"
! elseif p_item_def == 'nob'
! let com_type = '[]{}'
! let l_m_item = '\\&'.p_item_name.'[]{}'
! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."[<++>]{<++>}<++>')<cr>"
! elseif p_item_def == 'pla'
! let com_type = '(p)'
! let l_m_item = '&'.p_item_name."'"
! let r_m_item = '<plug>'.p_item_name.' '
! elseif p_item_def == 'spe'
! let com_type = '(s)'
! let l_m_item = '&'.p_item_name
! let r_m_item = '<plug>'.p_item_name
else
! let com_type = '\\'
! let l_m_item = '\\&'.p_item_name
! let r_m_item = "<plug>\\".p_item_name
! endif " }}}
! if !exists('NotComMenu') && loop_nu % s:menu_div == 0
! let st_index = strpart(p_item_name, 0, 4)
! if strlen(p_item_name) > 4
! let ComMenu = '.'.com_type.'&'.st_index.'\.\.\.\ -'
! else
! let ComMenu = '.'.com_type.'&'.st_index.'\ -'
! endif
endif
! exe 'amenu '.s:p_menu_lev.'&'.a:pack.ComMenu.'.'.l_m_item.' '.r_m_item
! let basic_nu_p_list = basic_nu_p_list + 1
! let loop_nu = loop_nu + 1
! endwhile " }}}
endif
--- 261,304 ----
let basic_nu_p_list = ''
let nu_p_list = ''
! if exists('g:TeX_package_'.a:pack)
!
! let g:p_list = g:TeX_package_{a:pack}
! let g:p_o_list = g:TeX_package_option_{a:pack}
!
! let optionList = g:TeX_package_option_{a:pack}.','
! let doneOptionSubmenu = 0
!
! if optionList != ''
!
! let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'.Options.'
! call Tex_MakeSubmenu(optionList, mainMenuName,
! \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>')
!
endif
!
! let commandList = g:TeX_package_{a:pack}
!
! while matchstr(commandList, 'sbr:') != ''
!
! call Tex_Debug('command list = '.commandList)
!
! let groupName = matchstr(commandList, '\v^sbr:\zs.{-}\ze,')
! let commandList = strpart(commandList, strlen('sbr:'.groupName) + 1)
! if matchstr(commandList, 'sbr:') != ''
! let commandGroup = matchstr(commandList, '\v^.{-},\zesbr:')
else
! let commandGroup = commandList
endif
!
! let menuName = g:Tex_PackagesMenuLocation.a:pack.'.Commands.'
! let menuName = menuName.groupName.'.'
! call Tex_MakeSubmenu(commandGroup, menuName, "<plug><C-r>=Tex_ProcessPackageCommand('", "')<CR>", '\w\+:\(\w\+\).*')
!
! let commandList = strpart(commandList, strlen(commandGroup))
! endwhile
!
! call Tex_MakeSubmenu(commandList, g:Tex_PackagesMenuLocation.a:pack.'.Commands.',
! \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>', '\w\+:\(\w\+\).*')
endif
***************
*** 355,358 ****
--- 306,333 ----
" }}}
+ " Definition of what to do for various package commands {{{
+ let s:CommandSpec_bra = '\<+replace+>{<++>}<++>'
+ let s:CommandSpec_brs = '\<+replace+><++>'
+ let s:CommandSpec_brd = '\<+replace+>{<++>}{<++>}<++>'
+ let s:CommandSpec_env = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>'
+ let s:CommandSpec_ens = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>'
+ let s:CommandSpec_eno = '\begin[<++>]{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}'
+ let s:CommandSpec_nor = '\<+replace+>'
+ let s:CommandSpec_noo = '\<+replace+>[<++>]'
+ let s:CommandSpec_nob = '\<+replace+>[<++>]{<++>}{<++>}<++>'
+ let s:CommandSpec_spe = '<+replace+>'
+ let s:CommandSpec_ = '\<+replace+>'
+
+ " }}}
+ " Tex_ProcessPackageCommand: processes a command from the package menu {{{
+ " Description:
+ function! Tex_ProcessPackageCommand(command)
+ let commandType = matchstr(a:command, '^\w\+\ze:')
+ let commandName = strpart(a:command, strlen(commandType.':'))
+
+ return IMAP_PutTextWithMovement(
+ \ substitute(s:CommandSpec_{commandType}, '<+replace+>', commandName, 'g'))
+ endfunction
+ " }}}
" Tex_pack_supp: "supports" the package... {{{
function! Tex_pack_supp(supp_pack)
***************
*** 360,367 ****
exe 'let g:s_p_o = g:TeX_package_option_'.a:supp_pack
if exists('g:s_p_o') && g:s_p_o != ''
! exe 'normal i\usepackage{'.a:supp_pack.'}<++>'
! exe 'normal F{i[]'."\<Right>"
else
! exe 'normal i\usepackage{'.a:supp_pack."}\<cr>"
endif
if g:Tex_package_supported == ''
--- 335,341 ----
exe 'let g:s_p_o = g:TeX_package_option_'.a:supp_pack
if exists('g:s_p_o') && g:s_p_o != ''
! return IMAP_PutTextWithMovement('\usepackage[<++>]{'.a:supp_pack.'}<++>', '<+', '+>')
else
! return IMAP_PutTextWithMovement('\usepackage{'.a:supp_pack.'}<++>', '<+', '+>')
endif
if g:Tex_package_supported == ''
***************
*** 377,385 ****
function! Tex_PutPackage(package)
if filereadable(s:path.'/packages/'.a:package)
! call Tex_pack_supp(a:package)
else
! exe 'normal i\usepackage{'.a:package."}\<Esc>$"
endif
! call Tex_pack_updateall()
endfunction " }}}
--- 351,359 ----
function! Tex_PutPackage(package)
if filereadable(s:path.'/packages/'.a:package)
! return Tex_pack_supp(a:package)
else
! return IMAP_PutTextWithMovement('\usepackage{'.a:package.'}')
endif
! call Tex_pack_updateall()
endfunction " }}}
***************
*** 389,394 ****
exe 'amenu '.s:p_menu_lev.'&UpdateAll :call Tex_pack_updateall()<cr>'
! call Tex_pack_supp_menu()
! call Tex_pack_all()
endif
--- 363,368 ----
exe 'amenu '.s:p_menu_lev.'&UpdateAll :call Tex_pack_updateall()<cr>'
! call Tex_pack_supp_menu()
! call Tex_pack_all()
endif
|
|
From: <ma...@us...> - 2002-12-22 03:39:08
|
Update of /cvsroot/vim-latex/vimfiles/plugin
In directory sc8-pr-cvs1:/tmp/cvs-serv23303
Modified Files:
imaps.vim
Log Message:
This is an attempt to deal with the encoding problems. If it is
successful, then IMAP() should work, regardless of the encoding, even when the
place holders are funky (i.e., outside the 7-bit ASCII range).
Index: imaps.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** imaps.vim 22 Dec 2002 03:01:11 -0000 1.10
--- imaps.vim 22 Dec 2002 03:39:06 -0000 1.11
***************
*** 8,12 ****
" while preserving filetype indentation.
"
! " Last Change: Fri Dec 20 01:00 AM 2002 PST
"
" Documentation: {{{
--- 8,12 ----
" while preserving filetype indentation.
"
! " Last Change: Sat Dec 21 10:00 PM 2002 EST
"
" Documentation: {{{
***************
*** 187,190 ****
--- 187,210 ----
" }}}
+
+ " IMAP_list: list the rhs and place holders corresponding to a:lhs {{{
+ "
+ " Added mainly for debugging purposes, but maybe worth keeping.
+ fun! IMAP_list(lhs)
+ let char = a:lhs[strlen(a:lhs)-1]
+ let charHash = s:Hash(char)
+ if exists("s:LHS_" . &ft . "_" . charHash)
+ let ft = &ft
+ elseif exists("s:LHS__" . charHash)
+ let ft = ""
+ else
+ return ""
+ endif
+ let hash = s:Hash(a:lhs)
+ return "rhs = " . s:Map_{ft}_{hash} . " place holders = " .
+ \ s:phs_{ft}_{hash} . " and " . s:phe_{ft}_{hash}
+ endfun
+ " }}}
+
" LookupCharacter: inserts mapping corresponding to this character {{{
"
***************
*** 245,253 ****
let text = a:str
- " If there are no place holders, just return the text.
- if text !~ '\V'.phs.'\.\{-}'.phe
- return text
- endif
-
" The user's placeholder settings.
let phsUser = s:PlaceHolderStart()
--- 265,268 ----
***************
*** 255,272 ****
" A very rare string: Do not use any special characters here. This is used
! " for moving to the beginning of the inserted text
let marker = '<!--- @#% Start Here @#% ----!>'
let markerLength = strlen(marker)
" If the user does not want to use place-holders, then remove all but the
! " first placeholder
if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders
" a heavy-handed way to just use the first placeholder and remove the
" rest. Replace the first placeholder with phe ...
! let text = substitute(text, '\V'.phs.'\.\{-}'.phe, phe, '')
" ... delete all the others ...
! let text = substitute(text, '\V'.phs.'\.\{-}'.phe, '', 'g')
" ... and replace the first phe with phsUser.pheUser .
! let text = substitute(text, '\V'.phe, phsUser.pheUser, '')
endif
--- 270,302 ----
" A very rare string: Do not use any special characters here. This is used
! " for moving to the beginning of the inserted text.
let marker = '<!--- @#% Start Here @#% ----!>'
let markerLength = strlen(marker)
+ " Problem: depending on the setting of the 'encoding' option, a character
+ " such as "\xab" may not match itself. We try to get around this by
+ " changing the encoding of all our strings. At the end, we have to
+ " convert back.
+ let textEnc = iconv(text, "latin1", &enc)
+ let phsEnc = iconv(phs, "latin1", &enc)
+ let pheEnc = iconv(phe, "latin1", &enc)
+ let phsUserEnc = iconv(phsUser, "latin1", &enc)
+ let pheUserEnc = iconv(pheUser, "latin1", &enc)
+
+ " If there are no place holders, just return the text.
+ if textEnc !~ '\V'.phs.'\.\{-}'.phe
+ return text
+ endif
+
" If the user does not want to use place-holders, then remove all but the
! " first placeholder.
if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders
" a heavy-handed way to just use the first placeholder and remove the
" rest. Replace the first placeholder with phe ...
! let textEnc = substitute(textEnc, '\V'.phs.'\.\{-}'.phe, pheEnc, '')
" ... delete all the others ...
! let textEnc = substitute(textEnc, '\V'.phs.'\.\{-}'.phe, '', 'g')
" ... and replace the first phe with phsUser.pheUser .
! let textEnc = substitute(textEnc, '\V'.phe, phsUserEnc.pheUserEnc, '')
endif
***************
*** 275,279 ****
" NOTE: There can be more than 1 placeholders here. Therefore use a global
" search and replace.
! let text = substitute(text, '\V'.phs.'\(\.\{-}\)'.phe, phsUser.'\1'.pheUser, 'g')
" Now append the marker (the rare string) to the beginning of the text so
" we know where the expansion started from
--- 305,312 ----
" NOTE: There can be more than 1 placeholders here. Therefore use a global
" search and replace.
! let textEnc = substitute(textEnc, '\V'.phs.'\(\.\{-}\)'.phe,
! \ phsUserEnc.'\1'.pheUserEnc, 'g')
! " The substitutions are done, so convert back.
! let text = iconv(textEnc, &enc, "latin1")
" Now append the marker (the rare string) to the beginning of the text so
" we know where the expansion started from
|
|
From: <sri...@us...> - 2002-12-22 03:15:46
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex
In directory sc8-pr-cvs1:/tmp/cvs-serv19146
Modified Files:
smartspace.vim
Log Message:
. b:tw was initialized only when &tw > 0. Remove this restriction. Also
change it so that when &tw was initially zero, then do not do anything at
all.
TODO: there is still a "bug" where smartspace inserts items into the
history list whenever it has to break lines.
Index: smartspace.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/smartspace.vim,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** smartspace.vim 22 Dec 2002 03:01:10 -0000 1.2
--- smartspace.vim 22 Dec 2002 03:15:44 -0000 1.3
***************
*** 3,7 ****
" Author: Carl Muller
" Created: Fri Dec 06 12:00 AM 2002 PST
! " Last Change: Mon Dec 09 12:00 PM 2002 PST
"
" Description:
--- 3,7 ----
" Author: Carl Muller
" Created: Fri Dec 06 12:00 AM 2002 PST
! " Last Change: Sat Dec 21 07:00 PM 2002 PST
"
" Description:
***************
*** 26,32 ****
" However, normal mode actions which rely on 'tw' such as gqap will be
" broken because of the faulty 'tw' setting.
! if &l:tw > 0
! let b:tw = &l:tw
! endif
setlocal tw=0
--- 26,30 ----
" However, normal mode actions which rely on 'tw' such as gqap will be
" broken because of the faulty 'tw' setting.
! let b:tw = &l:tw
setlocal tw=0
***************
*** 40,90 ****
" TexFormatLine: format line retaining $$'s on the same line.
function! s:TexFill(width) " {{{
! if col(".") > a:width
! exe "normal! a##\<Esc>"
! call <SID>TexFormatLine(a:width)
! exe "normal! ?##\<CR>2s\<Esc>"
! endif
endfunction
" }}}
function! s:TexFormatLine(width) " {{{
! let first = strpart(getline(line(".")),0,1)
! normal! $
! let length = col(".")
! let go = 1
! while length > a:width+2 && go
! let between = 0
! let string = strpart(getline(line(".")),0,a:width)
! " Count the dollar signs
! let number_of_dollars = 0
! let evendollars = 1
! let counter = 0
! while counter <= a:width-1
! if string[counter] == '$' && string[counter-1] != '\' " Skip \$.
! let evendollars = 1 - evendollars
! let number_of_dollars = number_of_dollars + 1
! endif
! let counter = counter + 1
! endwhile
! " Get ready to split the line.
! exe "normal! " . (a:width + 1) . "|"
! if evendollars
! " Then you are not between dollars.
! exe "normal! ?\\$\\| \<CR>W"
! else
! " Then you are between dollars.
! normal! F$
! if col(".") == 1 || strpart(getline(line(".")),col(".")-1,1) != "$"
! let go = 0
! endif
! endif
! if first == '$' && number_of_dollars == 1
! let go = 0
! else
! exe "normal! i\<CR>\<Esc>$"
! let first = strpart(getline(line(".")),0,1)
! endif
let length = col(".")
! endwhile
endfunction
--- 38,88 ----
" TexFormatLine: format line retaining $$'s on the same line.
function! s:TexFill(width) " {{{
! if a:width != 0 && col(".") > a:width
! exe "normal! a##\<Esc>"
! call <SID>TexFormatLine(a:width)
! exe "normal! ?##\<CR>2s\<Esc>"
! endif
endfunction
" }}}
function! s:TexFormatLine(width) " {{{
! let first = strpart(getline(line(".")),0,1)
! normal! $
let length = col(".")
! let go = 1
! while length > a:width+2 && go
! let between = 0
! let string = strpart(getline(line(".")),0,a:width)
! " Count the dollar signs
! let number_of_dollars = 0
! let evendollars = 1
! let counter = 0
! while counter <= a:width-1
! if string[counter] == '$' && string[counter-1] != '\' " Skip \$.
! let evendollars = 1 - evendollars
! let number_of_dollars = number_of_dollars + 1
! endif
! let counter = counter + 1
! endwhile
! " Get ready to split the line.
! exe "normal! " . (a:width + 1) . "|"
! if evendollars
! " Then you are not between dollars.
! exe "normal! ?\\$\\| \<CR>W"
! else
! " Then you are between dollars.
! normal! F$
! if col(".") == 1 || strpart(getline(line(".")),col(".")-1,1) != "$"
! let go = 0
! endif
! endif
! if first == '$' && number_of_dollars == 1
! let go = 0
! else
! exe "normal! i\<CR>\<Esc>$"
! let first = strpart(getline(line(".")),0,1)
! endif
! let length = col(".")
! endwhile
endfunction
|
|
From: <sri...@us...> - 2002-12-22 03:01:46
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv16004/plugin Modified Files: imaps.vim Log Message: This is a merge from the b-newimaps branch. The branch was started when a need to robustify imaps.vim was felt. Before, it had a big dependence on "funky" characters. Since imaps.vim affected a lot of files, this commit has a lot of modified files. Briefly, it changes the <<, >> and the <a-umlaut> characters throughout latex-suite to 'unfunky' characters. << --- <+ >> --- +> <a-umlaut> --- <++> The syntax of IMAP and IMAP_PutTextWithMovement was also changed to accept 2 new optional arguments which specify the placeholder characters in the a:rhs. This allows scriptwriters to generate long term maps which will not depend on the internals of imaps.vim The b-newimaps tip at the time of this merge has been tagged as b-newimaps-merge-sa-1 Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** imaps.vim 13 Dec 2002 17:24:36 -0000 1.9 --- imaps.vim 22 Dec 2002 03:01:11 -0000 1.10 *************** *** 1,9 **** " File: imaps.vim ! " Author: Srinath Avadhanula ! " ( sr...@fa... ) ! " WWW: http://robotics.eecs.berkeley.edu/~srinath/vim/.vim/imaps.vim " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Documentation: {{{ --- 1,12 ---- " File: imaps.vim ! " Authors: Srinath Avadhanula <srinath AT fastmail.fm> ! " Benji Fisher <benji AT member.AMS.org> ! " ! " WWW: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/vimfiles/plugin/imaps.vim?only_with_tag=MAIN ! " " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " ! " Last Change: Fri Dec 20 01:00 AM 2002 PST " " Documentation: {{{ *************** *** 46,50 **** " form: " ! " call Tex_IMAP (lhs, rhs, ft) " " Some characters in the RHS have special meaning which help in cursor --- 49,53 ---- " form: " ! " call IMAP (lhs, rhs, ft) " " Some characters in the RHS have special meaning which help in cursor *************** *** 53,57 **** " Example One: " ! " call Tex_IMAP ("bit`", "\\begin{itemize}\<cr>\\item «»\<cr>\\end{itemize}«»", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. --- 56,60 ---- " Example One: " ! " call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. *************** *** 60,71 **** " \begin{itemize} " \item * ! " \end{itemize}«» " " where * shows the cursor position. The cursor position after inserting the " text is decided by the position of the first "place-holder". Place holders " are special characters which decide cursor placement and movement. In the ! " example above, the place holder characters are « and ». After you have typed ! " in the item, press <C-j> and you will be taken to the next set of «»'s. ! " Therefore by placing the «» characters appropriately, you can minimize the " use of movement keys. " --- 63,74 ---- " \begin{itemize} " \item * ! " \end{itemize}<++> " " where * shows the cursor position. The cursor position after inserting the " text is decided by the position of the first "place-holder". Place holders " are special characters which decide cursor placement and movement. In the ! " example above, the place holder characters are <+ and +>. After you have typed ! " in the item, press <C-j> and you will be taken to the next set of <++>'s. ! " Therefore by placing the <++> characters appropriately, you can minimize the " use of movement keys. " *************** *** 80,84 **** " Example Two: " You can use the <C-r> command to insert dynamic elements such as dates. ! " call Tex_IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') " " sets up the map for date` to insert the current date. --- 83,87 ---- " Example Two: " You can use the <C-r> command to insert dynamic elements such as dates. ! " call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') " " sets up the map for date` to insert the current date. *************** *** 88,99 **** " '----%<----' above and below the visually selected range of lines. The " length of the string is chosen to be equal to the longest line in the range. "--------------------------------------%<-------------------------------------- " }}} ! " Prevent resourcing this file. ! if exists('s:doneImaps') ! finish endif ! let s:doneImaps = 1 " ============================================================================== --- 91,117 ---- " '----%<----' above and below the visually selected range of lines. The " length of the string is chosen to be equal to the longest line in the range. + " Recommended Usage: + " '<,'>Snip "--------------------------------------%<-------------------------------------- " }}} ! " ============================================================================== ! " Script Options / Variables ! " ============================================================================== ! " Options {{{ ! if !exists('g:Imap_StickyPlaceHolders') ! let g:Imap_StickyPlaceHolders = 1 endif ! if !exists('g:Imap_DeleteEmptyPlaceHolders') ! let g:Imap_DeleteEmptyPlaceHolders = 1 ! endif ! " }}} ! " Variables {{{ ! " s:LHS_{ft}_{char} will be generated automatically. It will look like ! " s:LHS_tex_o = 'fo\|foo\|boo' and contain all mapped sequences ending in "o". ! " s:Map_{ft}_{lhs} will be generated automatically. It will look like ! " s:Map_c_foo = 'for(<++>; <++>; <++>)', the mapping for "foo". ! " ! " }}} " ============================================================================== *************** *** 102,106 **** " IMAP: Adds a "fake" insert mode mapping. {{{ " For example, doing ! " Tex_IMAP('abc', 'def' ft) " will mean that if the letters abc are pressed in insert mode, then " they will be replaced by def. If ft != '', then the "mapping" will be --- 120,124 ---- " IMAP: Adds a "fake" insert mode mapping. {{{ " For example, doing ! " IMAP('abc', 'def' ft) " will mean that if the letters abc are pressed in insert mode, then " they will be replaced by def. If ft != '', then the "mapping" will be *************** *** 122,180 **** " the previously typed characters and erased and the right hand side is " inserted - function! Tex_IMAP(lhs, rhs, ft) - let lastLHSChar = a:lhs[strlen(a:lhs)-1] - " s:charLens_<ft>_<char> contains the lengths of the left hand sides of - " the various mappings for filetype <ft> which end in <char>. its a comma - " seperated list of numbers. - " for example if we want to create 2 mappings - " ab --> cd - " lbb --> haha - " for tex type files, then the variable will be: - " s:charLens_tex_b = '2,3,' - let charLenHash = 's:charLens_'.a:ft.'_'.char2nr(lastLHSChar) ! " if this variable doesnt exist before, initialize... ! if !exists(charLenHash) ! exe 'let '.charLenHash.' = ""' ! end ! " get the value of the variable. ! exe "let charLens = ".charLenHash ! " check to see if this length is already there... ! if matchstr(charLens, '\(^\|,\)'.strlen(a:lhs).',') == '' ! " ... if not append. ! " but carefully. sort the charLens array in decreasing order. this way ! " the longest lhs is checked first. i.e if the user has 2 maps ! " ab --> rhs1 ! " csdfb --> rhs2 ! " i.e 2 mappings ending in b, then check to see if the longer mapping ! " is satisfied first. ! " TODO: possible bug. what if the user has a mapping with lhs more ! " than 9 chars? (highly improbable). ! " largest element which is just smaller than the present length ! let idx = match(charLens, '[1-'.strlen(a:lhs).'],') ! if idx == -1 ! let new = charLens.strlen(a:lhs).',' ! else ! let left = strpart(charLens, 0, idx) ! let right = strpart(charLens, idx, 1000) ! let new = left.strlen(a:lhs).','.right ! end ! let charLens = new ! exe "let ".charLenHash." = charLens" ! end ! ! " create a variable corresponding to the lhs. convert all non-word ! " characters into their ascii codes so that a vim variable with that name ! " can be created. this is a way to create hashes in vim. ! let lhsHash = 's:Map_'.a:ft.'_'.substitute(a:lhs, '\(\W\)', '\="_".char2nr(submatch(1))."_"', 'g') ! " store the value of the right-hand side of the mapping in this newly ! " created variable. ! exe "let ".lhsHash." = a:rhs" ! ! " store a token string of this length. this is helpful later for erasing ! " the left-hand side before inserting the right-hand side. ! let tokenLenHash = 's:LenStr_'.strlen(a:lhs) ! exe "let ".tokenLenHash." = a:lhs" " map only the last character of the left-hand side. --- 140,177 ---- " the previously typed characters and erased and the right hand side is " inserted ! " IMAP: set up a filetype specific mapping. ! " Description: ! " "maps" the lhs to rhs in files of type 'ft'. If supplied with 2 ! " additional arguments, then those are assumed to be the placeholder ! " characters in rhs. If unspecified, then the placeholder characters ! " are assumed to be '<+' and '+>' These placeholder characters in ! " a:rhs are replaced with the users setting of ! " [bg]:Imap_PlaceHolderStart and [bg]:Imap_PlaceHolderEnd settings. ! " ! function! IMAP(lhs, rhs, ft, ...) ! " Find the place holders to save for IMAP_PutTextWithMovement() . ! if a:0 < 2 ! let phs = '<+' ! let phe = '+>' ! else ! let phs = a:1 ! let phe = a:2 ! endif ! ! let hash = s:Hash(a:lhs) ! let s:Map_{a:ft}_{hash} = a:rhs ! let s:phs_{a:ft}_{hash} = phs ! let s:phe_{a:ft}_{hash} = phe ! ! " Add a:lhs to the list of left-hand sides that end with lastLHSChar: ! let lastLHSChar = a:lhs[strlen(a:lhs)-1] ! let hash = s:Hash(lastLHSChar) ! if !exists("s:LHS_" . a:ft . "_" . hash) ! let s:LHS_{a:ft}_{hash} = escape(a:lhs, '\') ! else ! let s:LHS_{a:ft}_{hash} = escape(a:lhs, '\') .'\|'. s:LHS_{a:ft}_{hash} ! endif " map only the last character of the left-hand side. *************** *** 182,186 **** let lastLHSChar = '<space>' end ! exe 'inoremap <silent> '.escape(lastLHSChar, '|').' <C-r>=<SID>LookupCharacter("'.escape(lastLHSChar, '\|').'")<CR>' endfunction --- 179,187 ---- let lastLHSChar = '<space>' end ! exe 'inoremap <silent>' (a:ft== '' ? '' : '<buffer>') ! \ escape(lastLHSChar, '|') ! \ '<C-r>=<SID>LookupCharacter("' . ! \ escape(lastLHSChar, '\|') . ! \ '")<CR>' endfunction *************** *** 188,427 **** " LookupCharacter: inserts mapping corresponding to this character {{{ " ! " This function performs a reverse lookup when this character is typed in. It ! " loops over all the possible left-hand side variables ending in this ! " character and then if a possible match exists, erases the left-hand side ! " and inserts the right-hand side instead. ! function! <SID>LookupCharacter(char) ! let charHash = char2nr(a:char) ! if !exists('s:charLens_'.&ft.'_'.charHash) ! \ && !exists('s:charLens__'.charHash) return a:char ! end ! ! let k = 1 ! while k <= 2 ! " first check the filetype specific mappings and then the general ! " purpose mappings. ! if k == 1 ! let ft = &ft ! else ! let ft = '' ! end ! ! " get the lengths of the left-hand side mappings which end in this ! " character. if no mappings ended in this character, then continue... ! if !exists('s:charLens_'.ft.'_'.charHash) ! let k = k + 1 ! continue ! end ! ! exe 'let lens = s:charLens_'.ft.'_'.charHash ! ! let i = 1 ! while 1 ! " get the i^th length. ! let numchars = s:Strntok(lens, ',', i) ! " if there are no more lengths, then skip to the next outer while ! " loop. ! if numchars == '' ! break ! end ! ! if col('.') < numchars ! let i = i + 1 ! continue ! end ! ! " get the corresponding text from before the text. append the present ! " char to complete the (possible) LHS ! let text = strpart(getline('.'), col('.') - numchars, numchars - 1).a:char ! let lhsHash = 's:Map_'.ft.'_'.substitute(text, '\(\W\)', '\="_".char2nr(submatch(1))."_"', 'g') ! ! " if there is no mapping of this length which satisfies the previously ! " typed in characters, then proceed to the next length group... ! if !exists(lhsHash) ! let i = i + 1 ! continue ! end ! ! " ... otherwise insert the corresponding RHS ! " first generate the required number of back-spaces to erase the ! " previously typed in characters. ! exe "let tokLHS = s:LenStr_".numchars ! let bkspc = substitute(tokLHS, '.$', '', '') ! let bkspc = substitute(bkspc, '.', "\<bs>", "g") ! ! " get the corresponding RHS ! exe "let ret = ".lhsHash ! ! return bkspc.Tex_PutTextWithMovement(ret) ! ! endwhile ! ! let k = k + 1 ! endwhile ! ! return a:char endfunction " }}} ! " IMAP_PutTextWithMovement: appends movement commands to a text {{{ ! " This enables which cursor placement. ! function! Tex_PutTextWithMovement(text) ! ! let s:oldenc = &encoding ! if &encoding != 'latin1' ! let &encoding='latin1' endif ! let text = a:text ! " if the user doesnt want to use place-holders, then remove them. ! if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders ! " a heavy-handed way to just use the first placeholder or ä and remove ! " the rest. ! " substitute the placeholders with ä ! let text = substitute(text, '«[^»]*»', 'ä', 'g') ! " substitute the first ä with ë ... ! let text = substitute(text, 'ä', 'ë', '') ! " ... now remove all the ä's. ! let text = substitute(text, 'ä', '', 'g') ! " ... and substitute back the first ë with ä ! let text = substitute(text, 'ë', 'ä', '') endif ! " change the default values of the place-holder variables. ! let phs = '«' ! if exists('b:Imap_PlaceHolderStart') ! let phs = b:Imap_PlaceHolderStart ! elseif exists('g:Imap_PlaceHolderStart') ! let phs = g:Imap_PlaceHolderStart ! endif ! let text = substitute(text, '«', phs, 'g') ! let phe = '»' ! if exists('b:Imap_PlaceHolderEnd') ! let phe = b:Imap_PlaceHolderEnd ! elseif exists('g:Imap_PlaceHolderEnd') ! let phe = g:Imap_PlaceHolderEnd ! endif ! let text = substitute(text, '»', phe, 'g') ! let fc = match(text, 'ä\|'.phs.'[^'.phe.']*'.phe) ! if fc < 0 ! let initial = "" ! let movement = "" ! " if the place to go to is at the very beginning, then a simple back ! " search will do... ! elseif fc == 0 ! let initial = "" ! let movement = "\<C-\>\<C-N>?ä\<cr>" . s:RemoveLastHistoryItem . "\<cr>s" ! " however, if its somewhere in the middle, then we need to go back to the ! " beginning of the pattern and then do a forward lookup from that point. ! else ! " hopefully ¡¡IMAPS_Start!! is rare enough. prepend that to the text. ! let initial = "¡¡IMAPS_Start!!" ! " and then do a backwards lookup. this takes us to the beginning. then ! " delete that dummy part. we are left at the very beginning. ! let movement = "\<C-\>\<C-N>?¡¡IMAPS_Start!!\<cr>v".(strlen(initial)-1)."l\"_x" ! " now proceed with the forward search for cursor placement ! let movement = movement."/ä\\|".phs."[^".phe."]*".phe."\<cr>" ! " we needed 2 searches to get here. remove them from the search ! " history. ! let movement = movement . s:RemoveLastHistoryItem . "\<cr>" ! " if its a ä or «», then just delete it ! if text[fc] == 'ä' ! let movement = movement."\"_s" ! elseif strpart(text, fc, 2) == phs.phe ! let movement = movement."\"_2s" ! " otherwise enter select mode... ! else ! let movement = movement."v/".iconv(phe, 'latin1', s:oldenc)."\<CR>\<C-g>" ! end ! end ! if s:oldenc != 'latin1' ! let &encoding = s:oldenc endif - return initial.text.movement ! endfunction ! ! " }}} ! " IMAP_Jumpfunc: takes user to next «place-holder» {{{ ! " Author: Gergely Kontra ! " taken from mu-template.vim by him This idea is originally ! " from Stephen Riehm's bracketing system. ! " modified by SA to use optional place holder characters. ! function! IMAP_Jumpfunc() ! let s:oldenc = &encoding ! if s:oldenc != 'latin1' ! setglobal encoding=latin1 endif ! let phs = '«' ! let phe = '»' ! if exists('b:Imap_PlaceHolderStart') ! let phs = b:Imap_PlaceHolderStart ! elseif exists('g:Imap_PlaceHolderStart') ! let phs = g:Imap_PlaceHolderStart ! endif ! if exists('b:Imap_PlaceHolderEnd') ! let phe = b:Imap_PlaceHolderEnd ! elseif exists('g:Imap_PlaceHolderEnd') ! let phe = g:Imap_PlaceHolderEnd endif ! let phsc = iconv(phs, 'latin1', s:oldenc) ! let phec = iconv(phe, 'latin1', s:oldenc) - if !search(phsc.'.\{-}'.phec,'W') "no more marks - echomsg "no marks found\n" - return "\<CR>" else ! if strpart ( ! \ getline('.'), ! \ col('.') + strlen(phsc) - 1, ! \ strlen(phec) ! \ ! \ ) == phec - return substitute(phsc.phec, '.', "\<Del>", 'g')."\<C-r>=RestoreEncoding()\<CR>" - else - if col('.') > 1 - return "\<Esc>lv/".phec."\<CR>\<Esc>:call RestoreEncoding()\<CR>gv\<C-g>" - else - return "\<C-\>\<C-n>v/".phe."\<CR>\<Esc>:call RestoreEncoding()\<CR>gv\<C-g>" - endif - endif endif endfunction " map only if there is no mapping already. allows for user customization. if !hasmapto('IMAP_Jumpfunc') ! inoremap <C-J> <c-r>=IMAP_Jumpfunc()<CR> nmap <C-J> i<C-J> end " }}} - " RestoreEncoding: restores file encoding to what it was originally {{{ - " Description: - function! RestoreEncoding() - if s:oldenc != 'latin1' - let &g:encoding = s:oldenc - endif - return '' - endfunction " }}} ! nmap <silent> <script> <plug>«SelectRegion» `<v`> " ============================================================================== --- 189,393 ---- " LookupCharacter: inserts mapping corresponding to this character {{{ " ! " This function extracts from s:LHS_{&ft}_{a:char} or s:LHS__{a:char} ! " the longest lhs matching the current text. Then it replaces lhs with the ! " corresponding rhs saved in s:Map_{ft}_{lhs} . ! " The place-holder variables are passed to IMAP_PutTextWithMovement() . ! function! s:LookupCharacter(char) ! let charHash = s:Hash(a:char) ! if exists("s:LHS_" . &ft . "_" . charHash) ! let ft = &ft ! elseif exists("s:LHS__" . charHash) ! let ft = "" ! else return a:char ! endif ! " Find the longest left-hand side that matches the line so far. ! " Use '\V' (very no-magic) so that only '\' is special, and it was already ! " escaped when building up s:LHS_{ft}_{charHash} . ! let text = strpart(getline("."), 0, col(".")-1) . a:char ! " matchstr() returns the match that starts first. This automatically ! " ensures that the longest LHS is used for the mapping. ! let lhs = matchstr(text, '\V\(' . s:LHS_{ft}_{charHash} . '\)\$') ! if strlen(lhs) == 0 ! return a:char ! endif ! " enough back-spaces to erase the left-hand side; -1 for the last ! " character typed: ! let bs = substitute(strpart(lhs, 1), ".", "\<bs>", "g") ! let hash = s:Hash(lhs) ! return bs . IMAP_PutTextWithMovement(s:Map_{ft}_{hash}, ! \ s:phs_{ft}_{hash}, s:phe_{ft}_{hash}) endfunction " }}} ! " IMAP_PutTextWithMovement: returns the string with movement appended {{{ ! " Description: ! " If a:str contains "placeholders", then appends movement commands to ! " str in a way that the user moves to the first placeholder and enters ! " insert or select mode. If supplied with 2 additional arguments, then ! " they are assumed to be the placeholder specs. Otherwise, they are ! " assumed to be '<+' and '+>'. These placeholder chars are replaced ! " with the users settings of [bg]:Imap_PlaceHolderStart and ! " [bg]:Imap_PlaceHolderEnd. ! function! IMAP_PutTextWithMovement(str, ...) ! ! " The placeholders used in the particular input string. These can be ! " different from what the user wants to use. ! if a:0 < 2 ! let phs = '<+' ! let phe = '+>' ! else ! let phs = escape(a:1, '\') ! let phe = escape(a:2, '\') endif ! let text = a:str ! " If there are no place holders, just return the text. ! if text !~ '\V'.phs.'\.\{-}'.phe ! return text endif ! " The user's placeholder settings. ! let phsUser = s:PlaceHolderStart() ! let pheUser = s:PlaceHolderEnd() ! " A very rare string: Do not use any special characters here. This is used ! " for moving to the beginning of the inserted text ! let marker = '<!--- @#% Start Here @#% ----!>' ! let markerLength = strlen(marker) ! " If the user does not want to use place-holders, then remove all but the ! " first placeholder ! if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders ! " a heavy-handed way to just use the first placeholder and remove the ! " rest. Replace the first placeholder with phe ... ! let text = substitute(text, '\V'.phs.'\.\{-}'.phe, phe, '') ! " ... delete all the others ... ! let text = substitute(text, '\V'.phs.'\.\{-}'.phe, '', 'g') ! " ... and replace the first phe with phsUser.pheUser . ! let text = substitute(text, '\V'.phe, phsUser.pheUser, '') ! endif ! " now replace all occurences of the placeholders here with the users choice ! " of placeholder settings. ! " NOTE: There can be more than 1 placeholders here. Therefore use a global ! " search and replace. ! let text = substitute(text, '\V'.phs.'\(\.\{-}\)'.phe, phsUser.'\1'.pheUser, 'g') ! " Now append the marker (the rare string) to the beginning of the text so ! " we know where the expansion started from ! let text = marker.text ! " This search will move us to the very beginning of the text to be ! " inserted. ! " The steps are: ! " 1. enter escape mode (using <C-\><C-n> so it works in insertmode as ! " well) ! " 2. Search backward for marker text. ! " 3. delete from the beginning to the end of marker into the blackhole ! " register. ! let movement = "\<C-\>\<C-N>" ! \ . "?\\V".marker."\<CR>" ! \ . '"_d/\V'.marker."/e\<CR>" ! " Now enter insert mode and call IMAP_Jumpfunc() to take us to the next ! " placeholder and get us either into visual or insert mode. Since we do ! " at least one search in this function, remove it from the search history ! " first. ! " NOTE: Even if we performed more than one search, vim will only put one ! " of them in the user's search list. ! let movement = movement.':'.s:RemoveLastHistoryItem."\<CR>" ! \ . "i\<C-r>=IMAP_Jumpfunc('', 1)\<CR>" ! return text.movement ! endfunction ! " }}} ! " IMAP_Jumpfunc: takes user to next <+place-holder+> {{{ ! " Author: Luc Hermitte ! " ! function! IMAP_Jumpfunc(direction, inclusive) ! " The user's placeholder settings. ! let phsUser = s:PlaceHolderStart() ! let pheUser = s:PlaceHolderEnd() ! let searchOpts = a:direction ! " If the user has nowrapscan set, then do not make the search wrap around ! " the end (or beginning) of the file. ! if ! &wrapscan ! let searchOpts = direction.'W' endif ! let searchString = '' ! " If this is not an inclusive search or if it is inclusive, but the ! " current cursor position does not contain a placeholder character, then ! " search for the placeholder characters. ! if !a:inclusive || strpart(getline('.'), col('.')-1) !~ '\V^'.phsUser ! let searchString = '\V'.phsUser.'\.\{-}'.pheUser endif + " If we didn't find any placeholders return quietly. + if searchString != '' && !search(searchString, searchOpts) + return '' + endif ! " At this point, we are at the beginning of a placeholder. ! " Remember the position here. ! let position = line('.') . "normal! ".virtcol('.').'|' ! " Open any closed folds and make this part of the text visible. ! silent! foldopen! ! " Calculate if we have an empty placeholder or if it contains some ! " description. ! let template = ! \ matchstr(strpart(getline('.'), col('.')-1), ! \ '\V\^'.phsUser.'\zs\.\{-}\ze'.pheUser) ! let placeHolderEmpty = !strlen(template) ! " This movement command selects the placeholder text. In the forward mode, ! " we select left-right, otherwise right-left. ! if a:direction =~ 'b' ! " If we are going in the backward direction, make the selection from ! " right to left so that a backward search for phsUser doesnt get us ! " back to the same placeholder. ! let movement = "\<C-\>\<C-N>:".position."\<CR>" ! \ . "/\\V".pheUser."/e\<CR>" ! \ . "v?\\V".phsUser."?b\<CR>" ! else ! let movement = "\<C-\>\<C-N>:".position."\<CR>v/\\V".pheUser."/e\<CR>" endif ! if placeHolderEmpty && g:Imap_DeleteEmptyPlaceHolders ! " delete the empty placeholder into the blackhole. ! return movement."\"_c\<C-o>:".s:RemoveLastHistoryItem."\<CR>" else ! return movement."\<C-\>\<C-N>:".s:RemoveLastHistoryItem."\<CR>gv\<C-g>" endif + endfunction + " }}} + " Maps for IMAP_Jumpfunc {{{ " map only if there is no mapping already. allows for user customization. if !hasmapto('IMAP_Jumpfunc') ! inoremap <C-J> <c-r>=IMAP_Jumpfunc('', 0)<CR> ! inoremap <C-K> <c-r>=IMAP_Jumpfunc('b', 0)<CR> nmap <C-J> i<C-J> + nmap <C-K> i<C-K> + if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders + vmap <C-J> <C-\><C-N>i<C-J> + vmap <C-K> <C-\><C-N>i<C-K> + else + vmap <C-J> <Del>i<C-J> + vmap <C-K> <Del>i<C-K> + endif end " }}} ! nmap <silent> <script> <plug><+SelectRegion+> `<v`> " ============================================================================== *************** *** 540,544 **** " `<v`> to avoid problems caused by some of the characters in " '`<v`>' being mapped. ! let gotoc = "\<plug>«SelectRegion»" else let gotoc = '' --- 506,510 ---- " `<v`> to avoid problems caused by some of the characters in " '`<v`>' being mapped. ! let gotoc = "\<plug><+SelectRegion+>" else let gotoc = '' *************** *** 566,569 **** --- 532,561 ---- " }}} + " Hash: Return a version of a string that can be used as part of a variable" {{{ + " name. + fun! s:Hash(text) + return substitute(a:text, '\([^[:alnum:]]\)', + \ '\="_".char2nr(submatch(1))."_"', 'g') + endfun + "" }}} + " PlaceHolderStart and PlaceHolderEnd: return the buffer-local " {{{ + " variable, or the global one, or the default. + fun! s:PlaceHolderStart() + if exists("b:Imap_PlaceHolderStart") && strlen(b:Imap_PlaceHolderEnd) + return b:Imap_PlaceHolderStart + elseif exists("g:Imap_PlaceHolderStart") && strlen(g:Imap_PlaceHolderEnd) + return g:Imap_PlaceHolderStart + else + return "<+" + endfun + fun! s:PlaceHolderEnd() + if exists("b:Imap_PlaceHolderEnd") && strlen(b:Imap_PlaceHolderEnd) + return b:Imap_PlaceHolderEnd + elseif exists("g:Imap_PlaceHolderEnd") && strlen(g:Imap_PlaceHolderEnd) + return g:Imap_PlaceHolderEnd + else + return "+>" + endfun + " }}} " ============================================================================== *************** *** 602,604 **** " }}} ! " vim6:fdm=marker:nowrap --- 594,596 ---- " }}} ! " vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap |
|
From: <sri...@us...> - 2002-12-22 03:01:45
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages
In directory sc8-pr-cvs1:/tmp/cvs-serv16004/ftplugin/latex-suite/packages
Modified Files:
amsmath bar changebar color eqparbox float geometry graphicx
hyperref ifthen moreverbatim multicol newalg polski schedule
Log Message:
This is a merge from the b-newimaps branch. The branch was started when a
need to robustify imaps.vim was felt. Before, it had a big dependence on
"funky" characters. Since imaps.vim affected a lot of files, this commit
has a lot of modified files.
Briefly, it changes the <<, >> and the <a-umlaut> characters throughout
latex-suite to 'unfunky' characters.
<< --- <+
>> --- +>
<a-umlaut> --- <++>
The syntax of IMAP and IMAP_PutTextWithMovement was also changed to accept
2 new optional arguments which specify the placeholder characters in the
a:rhs. This allows scriptwriters to generate long term maps which will not
depend on the internals of imaps.vim
The b-newimaps tip at the time of this merge has been tagged as
b-newimaps-merge-sa-1
Index: amsmath
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/amsmath,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** amsmath 25 Nov 2002 23:00:25 -0000 1.2
--- amsmath 22 Dec 2002 03:00:54 -0000 1.3
***************
*** 74,78 ****
\.'brd:dbinom,'
\.'brd:tbinom,'
! \.'brs:genfrac{«ldelim»}{«rdelim»}{«thick»}{«style»}{«numer»}{«denom»}«»,'
\.'sbr:Commands,'
\.'nob:smash,'
--- 74,78 ----
\.'brd:dbinom,'
\.'brd:tbinom,'
! \.'brs:genfrac{<+ldelim+>}{<+rdelim+>}{<+thick+>}{<+style+>}{<+numer+>}{<+denom+>}<++>,'
\.'sbr:Commands,'
\.'nob:smash,'
***************
*** 94,98 ****
\.'bra:uproot,'
\.'bra:boxed,'
! \.'brs:DeclareMathSymbol{«»}{«»}{«»}{«»}«»,'
\.'bra:eqref'
" vim:ft=vim
--- 94,98 ----
\.'bra:uproot,'
\.'bra:boxed,'
! \.'brs:DeclareMathSymbol{<++>}{<++>}{<++>}{<++>}<++>,'
\.'bra:eqref'
" vim:ft=vim
Index: bar
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/bar,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bar 25 Nov 2002 23:00:25 -0000 1.2
--- bar 22 Dec 2002 03:00:55 -0000 1.3
***************
*** 2,19 ****
let g:TeX_package_bar =
\ 'env:barenv,'
! \.'brs:bar{«height»}{«index»}[«desc»],'
\.'hlineon,'
! \.'brs:legend{«index»}{«text»},'
\.'bra:setdepth,'
\.'bra:sethspace,'
! \.'brs:setlinestyle{«solid-dotted»},'
! \.'brs:setnumberpos{«empty-axis-down-inside-outside-up»},'
\.'bra:setprecision,'
\.'bra:setstretch,'
\.'bra:setstyle,'
\.'bra:setwidth,'
! \.'brs:setxaxis{«w1»}{«w2»}{«step»},'
! \.'brs:setyaxis[«n»]{«w1»}{«w2»}{«step»},'
! \.'brs:setxname[«lrbt»]{«etiquette»},'
! \.'brs:setyname[«lrbt»]{«etiquette»},'
! \.'brs:setxvaluetyp{«day-month»}'
--- 2,19 ----
let g:TeX_package_bar =
\ 'env:barenv,'
! \.'brs:bar{<+height+>}{<+index+>}[<+desc+>],'
\.'hlineon,'
! \.'brs:legend{<+index+>}{<+text+>},'
\.'bra:setdepth,'
\.'bra:sethspace,'
! \.'brs:setlinestyle{<+solid-dotted+>},'
! \.'brs:setnumberpos{<+empty-axis-down-inside-outside-up+>},'
\.'bra:setprecision,'
\.'bra:setstretch,'
\.'bra:setstyle,'
\.'bra:setwidth,'
! \.'brs:setxaxis{<+w1+>}{<+w2+>}{<+step+>},'
! \.'brs:setyaxis[<+n+>]{<+w1+>}{<+w2+>}{<+step+>},'
! \.'brs:setxname[<+lrbt+>]{<+etiquette+>},'
! \.'brs:setyname[<+lrbt+>]{<+etiquette+>},'
! \.'brs:setxvaluetyp{<+day-month+>}'
Index: changebar
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/changebar,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** changebar 25 Nov 2002 23:00:25 -0000 1.2
--- changebar 22 Dec 2002 03:00:56 -0000 1.3
***************
*** 18,22 ****
let g:TeX_package_changebar =
! \ 'ens:changebar:[«thickness»],'
\.'noo:cbstart,'
\.'cbend,'
--- 18,22 ----
let g:TeX_package_changebar =
! \ 'ens:changebar:[<+thickness+>],'
\.'noo:cbstart,'
\.'cbend,'
Index: color
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/color,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** color 13 Dec 2002 17:58:11 -0000 1.1
--- color 22 Dec 2002 03:00:57 -0000 1.2
***************
*** 23,36 ****
let g:TeX_package_color =
! \ 'brs:definecolor{«»}{«»}{«»},'
! \.'brs:DefineNamedColor{«»}{«»}{«»}{«»},'
\.'bra:color,'
\.'nob:color,'
\.'brd:textcolor,'
! \.'brs:textcolor[«»]{«»}{«»},'
\.'brd:colorbox,'
! \.'brs:colorbox[«»]{«»}{«»},'
! \.'brs:fcolorbox{«»}{«»}{«»},'
! \.'brs:fcolorbox[«»]{«»}{«»}{«»},'
\.'brd:pagecolor,'
\.'nob:pagecolor'
--- 23,36 ----
let g:TeX_package_color =
! \ 'brs:definecolor{<++>}{<++>}{<++>},'
! \.'brs:DefineNamedColor{<++>}{<++>}{<++>}{<++>},'
\.'bra:color,'
\.'nob:color,'
\.'brd:textcolor,'
! \.'brs:textcolor[<++>]{<++>}{<++>},'
\.'brd:colorbox,'
! \.'brs:colorbox[<++>]{<++>}{<++>},'
! \.'brs:fcolorbox{<++>}{<++>}{<++>},'
! \.'brs:fcolorbox[<++>]{<++>}{<++>}{<++>},'
\.'brd:pagecolor,'
\.'nob:pagecolor'
Index: eqparbox
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/eqparbox,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** eqparbox 23 Nov 2002 17:18:00 -0000 1.1
--- eqparbox 22 Dec 2002 03:00:57 -0000 1.2
***************
*** 2,6 ****
let g:TeX_package_eqparbox =
! \ 'brs:eqparbox[«pos»][«height»][«inner-pos»]{«tag»}{«text»}«»,'
\.'bra:eqboxwidth'
--- 2,6 ----
let g:TeX_package_eqparbox =
! \ 'brs:eqparbox[<+pos+>][<+height+>][<+inner-pos+>]{<+tag+>}{<+text+>}<++>,'
\.'bra:eqboxwidth'
Index: float
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/float,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** float 13 Dec 2002 17:58:13 -0000 1.1
--- float 22 Dec 2002 03:00:58 -0000 1.2
***************
*** 3,7 ****
let g:TeX_package_float =
\ 'bra:floatstyle,'
! \.'brs:newfloat{«»}{«»}{«»}[«»],'
\.'brd:floatname,'
\.'brd:listof,'
--- 3,7 ----
let g:TeX_package_float =
\ 'bra:floatstyle,'
! \.'brs:newfloat{<++>}{<++>}{<++>}[<++>],'
\.'brd:floatname,'
\.'brd:listof,'
Index: geometry
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/geometry,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** geometry 25 Nov 2002 23:00:25 -0000 1.2
--- geometry 22 Dec 2002 03:00:59 -0000 1.3
***************
*** 69,85 ****
\.'footnotesep=,'
\.'sbr:TwoValueOptions,'
! \.'papersize={ä},'
! \.'total={ä},'
! \.'body={ä},'
! \.'text={ä},'
! \.'scale={ä},'
! \.'hmargin={ä},'
! \.'vmargin={ä},'
! \.'margin={ä},'
! \.'offset={ä},'
\.'sbr:ThreeValueOptions,'
! \.'hdivide={ä},'
! \.'vdivide={ä},'
! \.'divide={ä}'
let g:TeX_package_geometry =
--- 69,85 ----
\.'footnotesep=,'
\.'sbr:TwoValueOptions,'
! \.'papersize={<++>},'
! \.'total={<++>},'
! \.'body={<++>},'
! \.'text={<++>},'
! \.'scale={<++>},'
! \.'hmargin={<++>},'
! \.'vmargin={<++>},'
! \.'margin={<++>},'
! \.'offset={<++>},'
\.'sbr:ThreeValueOptions,'
! \.'hdivide={<++>},'
! \.'vdivide={<++>},'
! \.'divide={<++>}'
let g:TeX_package_geometry =
Index: graphicx
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/graphicx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** graphicx 13 Dec 2002 17:58:10 -0000 1.1
--- graphicx 22 Dec 2002 03:01:00 -0000 1.2
***************
*** 49,53 ****
\.'spe:command=,'
\.'sbr:Rotatebox,'
! \.'brs:rotatebox[«»]{«»}{«»},'
\.'spe:origin=,'
\.'spe:x=,'
--- 49,53 ----
\.'spe:command=,'
\.'sbr:Rotatebox,'
! \.'brs:rotatebox[<++>]{<++>}{<++>},'
\.'spe:origin=,'
\.'spe:x=,'
***************
*** 55,63 ****
\.'spe:units=,'
\.'sbr:Rest,'
! \.'brs:scalebox{«»}[«»]{«»},'
! \.'brs:resizebox{«»}{«»}{«»},'
! \.'brs:resizebox*{«»}{«»}{«»},'
\.'bra:DeclareGraphicsExtensions,'
! \.'brs:DeclareGraphicsRule{«»}{«»}{«»}{«»},'
\.'bra:graphicspath'
--- 55,63 ----
\.'spe:units=,'
\.'sbr:Rest,'
! \.'brs:scalebox{<++>}[<++>]{<++>},'
! \.'brs:resizebox{<++>}{<++>}{<++>},'
! \.'brs:resizebox*{<++>}{<++>}{<++>},'
\.'bra:DeclareGraphicsExtensions,'
! \.'brs:DeclareGraphicsRule{<++>}{<++>}{<++>}{<++>},'
\.'bra:graphicspath'
Index: hyperref
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/hyperref,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hyperref 25 Nov 2002 23:00:25 -0000 1.2
--- hyperref 22 Dec 2002 03:01:00 -0000 1.3
***************
*** 9,13 ****
\.'b5paper,'
\.'backref=,'
! \.'baseurl={ä},'
\.'bookmarks=,'
\.'bookmarksnumbered=,'
--- 9,13 ----
\.'b5paper,'
\.'backref=,'
! \.'baseurl={<++>},'
\.'bookmarks=,'
\.'bookmarksnumbered=,'
***************
*** 50,60 ****
\.'pagebordercolor=,'
\.'pagecolor=,'
! \.'pdfauthor={ä},'
\.'pdfborder=,'
\.'pdfcenterwindow=,'
! \.'pdfcreator={ä},'
\.'pdffitwindow,'
\.'pdfhighlight=,'
! \.'pdfkeywords={ä},'
\.'pdfmenubar=,'
\.'pdfnewwindow=,'
--- 50,60 ----
\.'pagebordercolor=,'
\.'pagecolor=,'
! \.'pdfauthor={<++>},'
\.'pdfborder=,'
\.'pdfcenterwindow=,'
! \.'pdfcreator={<++>},'
\.'pdffitwindow,'
\.'pdfhighlight=,'
! \.'pdfkeywords={<++>},'
\.'pdfmenubar=,'
\.'pdfnewwindow=,'
***************
*** 64,73 ****
\.'pdfpagescrop=,'
\.'pdfpagetransition=,'
! \.'pdfproducer={ä},'
! \.'pdfstartpage={ä},'
! \.'pdfstartview={ä},'
! \.'pdfsubject={ä},'
\.'pdftex,'
! \.'pdftitle={ä},'
\.'pdftoolbar=,'
\.'pdfusetitle=,'
--- 64,73 ----
\.'pdfpagescrop=,'
\.'pdfpagetransition=,'
! \.'pdfproducer={<++>},'
! \.'pdfstartpage={<++>},'
! \.'pdfstartview={<++>},'
! \.'pdfsubject={<++>},'
\.'pdftex,'
! \.'pdftitle={<++>},'
\.'pdftoolbar=,'
\.'pdfusetitle=,'
***************
*** 92,125 ****
\.'sbr:Links,'
\.'bra:hyperbaseurl,'
! \.'brs:href{«URL»}{«text»},'
\.'bra:hyperimage,'
! \.'brs:hyperdef{«category»}{«name»}{«text»},'
! \.'brs:hyperref{«URL»}{«category»}{«name»}{«text»},'
! \.'brs:hyperlink{«name»}{«text»},'
! \.'brs:hypertarget{«name»}{«text»},'
\.'bra:url,'
\.'bra:htmladdnormallink,'
! \.'brs:Acrobatmenu{«option»}{«tekst»},'
! \.'brs:pdfbookmark[ä]{«»}{«»},'
\.'bra:thispdfpagelabel,'
\.'sbr:Forms,'
\.'env:Form,'
\.'sep:Forms1,'
! \.'brs:TextField[«parameters»]{«label»},'
! \.'brs:CheckBox[«parameters»]{«label»},'
! \.'brs:ChoiceMenu[«parameters»]{«label»}{«choices»},'
! \.'brs:PushButton[«parameters»]{«label»},'
! \.'brs:Submit[«parameters»]{«label»},'
! \.'brs:Reset[«parameters»]{«label»},'
\.'sep:Forms2,'
! \.'brs:LayoutTextField{«label»}{«field»},'
! \.'brs:LayoutChoiceField{«label»}{«field»},'
! \.'brs:LayoutCheckboxField{«label»}{«field»},'
\.'sep:Forms3,'
! \.'brs:MakeRadioField{«width»}{«height»},'
! \.'brs:MakeCheckField{«width»}{«height»},'
! \.'brs:MakeTextField{«width»}{«height»},'
! \.'brs:MakeChoiceField{«width»}{«height»},'
! \.'brs:MakeButtonField{«text»},'
\.'sbr:Parameters,'
\.'spe:accesskey,'
--- 92,125 ----
\.'sbr:Links,'
\.'bra:hyperbaseurl,'
! \.'brs:href{<+URL+>}{<+text+>},'
\.'bra:hyperimage,'
! \.'brs:hyperdef{<+category+>}{<+name+>}{<+text+>},'
! \.'brs:hyperref{<+URL+>}{<+category+>}{<+name+>}{<+text+>},'
! \.'brs:hyperlink{<+name+>}{<+text+>},'
! \.'brs:hypertarget{<+name+>}{<+text+>},'
\.'bra:url,'
\.'bra:htmladdnormallink,'
! \.'brs:Acrobatmenu{<+option+>}{<+tekst+>},'
! \.'brs:pdfbookmark[<++>]{<++>}{<++>},'
\.'bra:thispdfpagelabel,'
\.'sbr:Forms,'
\.'env:Form,'
\.'sep:Forms1,'
! \.'brs:TextField[<+parameters+>]{<+label+>},'
! \.'brs:CheckBox[<+parameters+>]{<+label+>},'
! \.'brs:ChoiceMenu[<+parameters+>]{<+label+>}{<+choices+>},'
! \.'brs:PushButton[<+parameters+>]{<+label+>},'
! \.'brs:Submit[<+parameters+>]{<+label+>},'
! \.'brs:Reset[<+parameters+>]{<+label+>},'
\.'sep:Forms2,'
! \.'brs:LayoutTextField{<+label+>}{<+field+>},'
! \.'brs:LayoutChoiceField{<+label+>}{<+field+>},'
! \.'brs:LayoutCheckboxField{<+label+>}{<+field+>},'
\.'sep:Forms3,'
! \.'brs:MakeRadioField{<+width+>}{<+height+>},'
! \.'brs:MakeCheckField{<+width+>}{<+height+>},'
! \.'brs:MakeTextField{<+width+>}{<+height+>},'
! \.'brs:MakeChoiceField{<+width+>}{<+height+>},'
! \.'brs:MakeButtonField{<+text+>},'
\.'sbr:Parameters,'
\.'spe:accesskey,'
Index: ifthen
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/ifthen,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ifthen 13 Dec 2002 17:58:13 -0000 1.1
--- ifthen 22 Dec 2002 03:01:02 -0000 1.2
***************
*** 2,6 ****
let g:TeX_package_color =
! \ 'brs:ifthenelse{«»}{«»}{«»},'
\.'brd:equal,'
\.'bra:boolean,'
--- 2,6 ----
let g:TeX_package_color =
! \ 'brs:ifthenelse{<++>}{<++>}{<++>},'
\.'brd:equal,'
\.'bra:boolean,'
Index: moreverbatim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/moreverbatim,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** moreverbatim 13 Dec 2002 17:58:14 -0000 1.1
--- moreverbatim 22 Dec 2002 03:01:03 -0000 1.2
***************
*** 2,14 ****
let g:TeX_package_moreverbatim =
! \ 'ens:verbatimwrite:{«»},'
! \.'ens:verbatimtab:[«»],'
! \.'ens:listing:[«step»]{«number»},'
! \.'ens:listing*:[«step»]{«number»},'
\.'env:boxedverbatim,'
\.'bra:verbatimtabsize,'
\.'bra:listingoffset,'
! \.'brs:listinginput[«»]{«»}{«»},'
! \.'brs:verbatimtabinput[«»]{«»}'
syn region texZone start="\\begin{verbatimwrite}" end="\\end{verbatimwrite}\|%stopzone\>" fold
--- 2,14 ----
let g:TeX_package_moreverbatim =
! \ 'ens:verbatimwrite:{<++>},'
! \.'ens:verbatimtab:[<++>],'
! \.'ens:listing:[<+step+>]{<+number+>},'
! \.'ens:listing*:[<+step+>]{<+number+>},'
\.'env:boxedverbatim,'
\.'bra:verbatimtabsize,'
\.'bra:listingoffset,'
! \.'brs:listinginput[<++>]{<++>}{<++>},'
! \.'brs:verbatimtabinput[<++>]{<++>}'
syn region texZone start="\\begin{verbatimwrite}" end="\\end{verbatimwrite}\|%stopzone\>" fold
Index: multicol
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/multicol,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** multicol 25 Nov 2002 23:00:26 -0000 1.2
--- multicol 22 Dec 2002 03:01:04 -0000 1.3
***************
*** 1,5 ****
let g:TeX_package_option_multicol = ''
let g:TeX_package_multicol =
! \ 'ens:multicols:{«cols»}[«text»][«sep»],'
\.'columnbreak,'
\.'premulticols,'
--- 1,5 ----
let g:TeX_package_option_multicol = ''
let g:TeX_package_multicol =
! \ 'ens:multicols:{<+cols+>}[<+text+>][<+sep+>],'
\.'columnbreak,'
\.'premulticols,'
Index: newalg
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/newalg,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** newalg 13 Dec 2002 17:58:31 -0000 1.2
--- newalg 22 Dec 2002 03:01:05 -0000 1.3
***************
*** 2,9 ****
let g:TeX_package_newalg =
! \ 'ens:algorithm:{«name»}{«»},'
! \.'ens:IF:{«cond»},'
! \.'ens:FOR:{«loop»},'
! \.'ens:WHILE:{«cond»},'
\.'bra:ERROR,'
\.'nor:ELSE,'
--- 2,9 ----
let g:TeX_package_newalg =
! \ 'ens:algorithm:{<+name+>}{<++>},'
! \.'ens:IF:{<+cond+>},'
! \.'ens:FOR:{<+loop+>},'
! \.'ens:WHILE:{<+cond+>},'
\.'bra:ERROR,'
\.'nor:ELSE,'
Index: polski
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/polski,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** polski 13 Dec 2002 17:24:27 -0000 1.8
--- polski 22 Dec 2002 03:01:05 -0000 1.9
***************
*** 1,5 ****
" Author: Mikolaj Machowski <mi...@wp...>
" (c) Copyright by Mikolaj Machowski 2002
! " Last Change: Fri Dec 13 12:00 PM 2002 EST
" License: Vim Charityware
"
--- 1,5 ----
" Author: Mikolaj Machowski <mi...@wp...>
" (c) Copyright by Mikolaj Machowski 2002
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
" License: Vim Charityware
"
***************
*** 49,53 ****
" u¿ywasz (albo go ¶ci±gnij z http://vim-latex.sf.net)
function! TPackagePolskiTylda()
! call Tex_IMAP (" ---", "~---", "tex")
endfunction
call TPackagePolskiTylda()
--- 49,53 ----
" u¿ywasz (albo go ¶ci±gnij z http://vim-latex.sf.net)
function! TPackagePolskiTylda()
! call IMAP (" ---", "~---", "tex")
endfunction
call TPackagePolskiTylda()
Index: schedule
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/schedule,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** schedule 13 Dec 2002 17:58:32 -0000 1.2
--- schedule 22 Dec 2002 03:01:06 -0000 1.3
***************
*** 2,6 ****
let g:TeX_package_schedule =
! \ 'ens:schedule:[«title»],'
\.'bra:CellHeight,'
\.'bra:CellWidth,'
--- 2,6 ----
let g:TeX_package_schedule =
! \ 'ens:schedule:[<+title+>],'
\.'bra:CellHeight,'
\.'bra:CellWidth,'
***************
*** 11,15 ****
\.'nor:FiveDay,'
\.'nor:SevenDay,'
! \.'brs:NewAppointment{«name»}{«bg»}{«fg»}'
" vim:ft=vim:ff=unix
--- 11,15 ----
\.'nor:FiveDay,'
\.'nor:SevenDay,'
! \.'brs:NewAppointment{<+name+>}{<+bg+>}{<+fg+>}'
" vim:ft=vim:ff=unix
|
|
From: <sri...@us...> - 2002-12-22 03:01:44
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex
In directory sc8-pr-cvs1:/tmp/cvs-serv16004/ftplugin/tex
Modified Files:
brackets.vim smartspace.vim
Log Message:
This is a merge from the b-newimaps branch. The branch was started when a
need to robustify imaps.vim was felt. Before, it had a big dependence on
"funky" characters. Since imaps.vim affected a lot of files, this commit
has a lot of modified files.
Briefly, it changes the <<, >> and the <a-umlaut> characters throughout
latex-suite to 'unfunky' characters.
<< --- <+
>> --- +>
<a-umlaut> --- <++>
The syntax of IMAP and IMAP_PutTextWithMovement was also changed to accept
2 new optional arguments which specify the placeholder characters in the
a:rhs. This allows scriptwriters to generate long term maps which will not
depend on the internals of imaps.vim
The b-newimaps tip at the time of this merge has been tagged as
b-newimaps-merge-sa-1
Index: brackets.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** brackets.vim 13 Dec 2002 17:24:31 -0000 1.5
--- brackets.vim 22 Dec 2002 03:01:08 -0000 1.6
***************
*** 2,6 ****
" Author: Carl Mueller
" (incorporated into latex-suite by Srinath Avadhanula)
! " Last Change: Fri Dec 13 12:00 PM 2002 EST
" Description:
" This ftplugin provides the following maps:
--- 2,6 ----
" Author: Carl Mueller
" (incorporated into latex-suite by Srinath Avadhanula)
! " Last Change: Thu Dec 19 03:00 AM 2002 PST
" Description:
" This ftplugin provides the following maps:
***************
*** 93,97 ****
return "\<BS>".'\mathcal{'.toupper(char).'}'
else
! return Tex_PutTextWithMovement('\cite{«»}«»')
endif
endfunction
--- 93,97 ----
return "\<BS>".'\mathcal{'.toupper(char).'}'
else
! return IMAP_PutTextWithMovement('\cite{<++>}<++>')
endif
endfunction
***************
*** 103,112 ****
" If the character before typing <M-l> is one of '([{|<q', then do the
" following:
! " 1. (<M-l> \left(«»\right«»
" similarly for [, |
! " {<M-l> \left\{«»\right\}«»
! " 2. <<M-l> \langle«»\rangle«»
! " 3. q<M-l> \lefteqn{«»}«»
! " otherwise insert \label{«»}«»
function! Tex_LeftRight()
let line = getline(line("."))
--- 103,112 ----
" If the character before typing <M-l> is one of '([{|<q', then do the
" following:
! " 1. (<M-l> \left(<++>\right<++>
" similarly for [, |
! " {<M-l> \left\{<++>\right\}<++>
! " 2. <<M-l> \langle<++>\rangle<++>
! " 3. q<M-l> \lefteqn{<++>}<++>
! " otherwise insert \label{<++>}<++>
function! Tex_LeftRight()
let line = getline(line("."))
***************
*** 121,131 ****
endif
let rhs = matchstr(matchedbrackets, char.'\zs.\ze')
! return "\<BS>".Tex_PutTextWithMovement('\left'.add.char.'«»\right'.add.rhs.'«»')
elseif char == '<'
! return "\<BS>".Tex_PutTextWithMovement('langle«»\rangle«»')
elseif char == 'q'
! return "\<BS>".Tex_PutTextWithMovement('\lefteqn{«»}«»')
else
! return '\label{«»}«»'
endif
endfunction " }}}
--- 121,131 ----
endif
let rhs = matchstr(matchedbrackets, char.'\zs.\ze')
! return "\<BS>".IMAP_PutTextWithMovement('\left'.add.char.'<++>\right'.add.rhs.'<++>')
elseif char == '<'
! return "\<BS>".IMAP_PutTextWithMovement('langle<++>\rangle<++>')
elseif char == 'q'
! return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{<++>}<++>')
else
! return '\label{<++>}<++>'
endif
endfunction " }}}
Index: smartspace.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/smartspace.vim,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** smartspace.vim 9 Dec 2002 20:17:15 -0000 1.1
--- smartspace.vim 22 Dec 2002 03:01:10 -0000 1.2
***************
*** 3,7 ****
" Author: Carl Muller
" Created: Fri Dec 06 12:00 AM 2002 PST
! " Last Change: Fri Dec 06 12:00 AM 2002 PST
"
" Description:
--- 3,7 ----
" Author: Carl Muller
" Created: Fri Dec 06 12:00 AM 2002 PST
! " Last Change: Mon Dec 09 12:00 PM 2002 PST
"
" Description:
***************
*** 28,33 ****
if &l:tw > 0
let b:tw = &l:tw
- else
- let b:tw = 79
endif
setlocal tw=0
--- 28,31 ----
|
|
From: <sri...@us...> - 2002-12-22 03:01:42
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates
In directory sc8-pr-cvs1:/tmp/cvs-serv16004/ftplugin/latex-suite/templates
Modified Files:
article.tex report.tex report_two_column.tex
Log Message:
This is a merge from the b-newimaps branch. The branch was started when a
need to robustify imaps.vim was felt. Before, it had a big dependence on
"funky" characters. Since imaps.vim affected a lot of files, this commit
has a lot of modified files.
Briefly, it changes the <<, >> and the <a-umlaut> characters throughout
latex-suite to 'unfunky' characters.
<< --- <+
>> --- +>
<a-umlaut> --- <++>
The syntax of IMAP and IMAP_PutTextWithMovement was also changed to accept
2 new optional arguments which specify the placeholder characters in the
a:rhs. This allows scriptwriters to generate long term maps which will not
depend on the internals of imaps.vim
The b-newimaps tip at the time of this merge has been tagged as
b-newimaps-merge-sa-1
Index: article.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/article.tex,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** article.tex 30 Apr 2002 00:03:25 -0000 1.1.1.1
--- article.tex 22 Dec 2002 03:01:06 -0000 1.2
***************
*** 1,8 ****
% File: ¡expand("%:p:t")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper]{article}
\begin{document}
! «»
\end{document}
--- 1,8 ----
% File: ¡expand("%:p:t")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: Sat Dec 14 02:00 AM 2002 PST
%
\documentclass[a4paper]{article}
\begin{document}
! <++>
\end{document}
Index: report.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report.tex,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** report.tex 30 Apr 2002 00:03:25 -0000 1.1.1.1
--- report.tex 22 Dec 2002 03:01:07 -0000 1.2
***************
*** 1,8 ****
% File: ¡expand("%")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper]{report}
\begin{document}
! «»
\end{document}
--- 1,8 ----
% File: ¡expand("%")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: Sat Dec 14 02:00 AM 2002 PST
%
\documentclass[a4paper]{report}
\begin{document}
! <++>
\end{document}
Index: report_two_column.tex
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report_two_column.tex,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** report_two_column.tex 30 Apr 2002 00:03:25 -0000 1.1.1.1
--- report_two_column.tex 22 Dec 2002 03:01:07 -0000 1.2
***************
*** 1,8 ****
% File: ¡expand("%:p:t")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
%
\documentclass[a4paper,twocolumn]{report}
\begin{document}
! «»
\end{document}
--- 1,8 ----
% File: ¡expand("%:p:t")¡
% Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡
! % Last Change: Sat Dec 14 02:00 AM 2002 PST
%
\documentclass[a4paper,twocolumn]{report}
\begin{document}
! <++>
\end{document}
|
|
From: <sri...@us...> - 2002-12-22 03:01:40
|
Update of /cvsroot/vim-latex/vimfiles/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv16004/doc
Modified Files:
latex-suite.txt
Log Message:
This is a merge from the b-newimaps branch. The branch was started when a
need to robustify imaps.vim was felt. Before, it had a big dependence on
"funky" characters. Since imaps.vim affected a lot of files, this commit
has a lot of modified files.
Briefly, it changes the <<, >> and the <a-umlaut> characters throughout
latex-suite to 'unfunky' characters.
<< --- <+
>> --- +>
<a-umlaut> --- <++>
The syntax of IMAP and IMAP_PutTextWithMovement was also changed to accept
2 new optional arguments which specify the placeholder characters in the
a:rhs. This allows scriptwriters to generate long term maps which will not
depend on the internals of imaps.vim
The b-newimaps tip at the time of this merge has been tagged as
b-newimaps-merge-sa-1
Index: latex-suite.txt
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** latex-suite.txt 7 Dec 2002 11:06:53 -0000 1.9
--- latex-suite.txt 22 Dec 2002 03:00:35 -0000 1.10
***************
*** 1,5 ****
*latex-suite* Tools for an enhanced LaTeX environment in Vim
For Vim version 6.0 and above.
! Last Change: Sat Dec 07 03:00 AM 2002 PST
By Srinath Avadhanula <sr...@fa...>,
--- 1,5 ----
*latex-suite* Tools for an enhanced LaTeX environment in Vim
For Vim version 6.0 and above.
! Last Change: Sat Dec 14 02:00 AM 2002 PST
By Srinath Avadhanula <sr...@fa...>,
***************
*** 165,177 ****
\begin{figure}[h]
! \centerline{\psfig{figure=«eps file»}}
! \caption{«caption text»}
! \label{fig:«label»}
! \end{figure}«»
<
! The text «eps file» will be selected and she will be left in |select-mode| so
that she can continue typing straight away. After having typed in the file
name, she can press Control-J (while still in insert-mode). This will take her
! directly to the next "place-holder". i.e, the «caption text» will be visually
selected with vim in select mode again for typing in the caption. This saves
on a lot of key presses.
--- 165,177 ----
\begin{figure}[h]
! \centerline{\psfig{figure=<+eps file+>}}
! \caption{<+caption text+>}
! \label{fig:<+label+>}
! \end{figure}<++>
<
! The text <+eps file+> will be selected and she will be left in |select-mode| so
that she can continue typing straight away. After having typed in the file
name, she can press Control-J (while still in insert-mode). This will take her
! directly to the next "place-holder". i.e, the <+caption text+> will be visually
selected with vim in select mode again for typing in the caption. This saves
on a lot of key presses.
***************
*** 190,195 ****
These mappings insert LaTeX "environments" such as >
\begin{center}
! «»
! \end{center}«»
with the cursor left at the first |placeholder|. There are various ways of
inserting environments into the source file. If the environment is a standard
--- 190,195 ----
These mappings insert LaTeX "environments" such as >
\begin{center}
! <++>
! \end{center}<++>
with the cursor left at the first |placeholder|. There are various ways of
inserting environments into the source file. If the environment is a standard
***************
*** 258,262 ****
These mappings insert font descriptions such as: >
! \textsf{«»}«»
again with the cursor at the first place-holder.
--- 258,262 ----
These mappings insert font descriptions such as: >
! \textsf{<++>}<++>
again with the cursor at the first place-holder.
***************
*** 298,302 ****
Example:
SSE in insert mode inserts >
! \section{«»}«»
< If you select a word or line and press `se, then you get >
\section{section name}
--- 298,302 ----
Example:
SSE in insert mode inserts >
! \section{<++>}<++>
< If you select a word or line and press `se, then you get >
\section{section name}
***************
*** 314,323 ****
Examples: >
! `^ expands to \hat{«»}«»
! `_ expands to \bar{«»}«»
`6 expands to \partial
`8 expands to \infty
! `/ expands to \frac{«»}{«»}«»
! `% expands to \frac{«»}{«»}«»
`@ expands to \circ
`0 expands to ^\circ
--- 314,323 ----
Examples: >
! `^ expands to \hat{<++>}<++>
! `_ expands to \bar{<++>}<++>
`6 expands to \partial
`8 expands to \infty
! `/ expands to \frac{<++>}{<++>}<++>
! `% expands to \frac{<++>}{<++>}<++>
`@ expands to \circ
`0 expands to ^\circ
***************
*** 334,343 ****
`> expands to \ge
`, expands to \nonumber
! `~ expands to \tilde{«»}«»
! `; expands to \dot{«»}«»
! `: expands to \ddot{«»}«»
! `2 expands to \sqrt{«»}«»
`| expands to \Big|
! `I expands to \int_{«»}^{«»}«»"
<
(again, notice the convenient place-holders)
--- 334,343 ----
`> expands to \ge
`, expands to \nonumber
! `~ expands to \tilde{<++>}<++>
! `; expands to \dot{<++>}<++>
! `: expands to \ddot{<++>}<++>
! `2 expands to \sqrt{<++>}<++>
`| expands to \Big|
! `I expands to \int_{<++>}^{<++>}<++>"
<
(again, notice the convenient place-holders)
***************
*** 759,763 ****
Tex-Packages.Supported.SIunits
option. This will insert a line of form: >
! \usepackage[«»]«»{SIunits}«»
at the beginning of the file (with the cursor placed at the first
|placeholder|. You will also notice that the packages menu now contains a
--- 759,763 ----
Tex-Packages.Supported.SIunits
option. This will insert a line of form: >
! \usepackage[<++>]<++>{SIunits}<++>
at the beginning of the file (with the cursor placed at the first
|placeholder|. You will also notice that the packages menu now contains a
***************
*** 789,793 ****
If options are detected, then the inserted line is of the
form:
! \usepackage[«»]{package_name}
A |latex-package-dictionary| might also be created.
--- 789,793 ----
If options are detected, then the inserted line is of the
form:
! \usepackage[<++>]{package_name}
A |latex-package-dictionary| might also be created.
|
|
From: <sri...@us...> - 2002-12-22 03:01:38
|
Update of /cvsroot/vim-latex/vimfiles In directory sc8-pr-cvs1:/tmp/cvs-serv16004 Modified Files: makefile Log Message: This is a merge from the b-newimaps branch. The branch was started when a need to robustify imaps.vim was felt. Before, it had a big dependence on "funky" characters. Since imaps.vim affected a lot of files, this commit has a lot of modified files. Briefly, it changes the <<, >> and the <a-umlaut> characters throughout latex-suite to 'unfunky' characters. << --- <+ >> --- +> <a-umlaut> --- <++> The syntax of IMAP and IMAP_PutTextWithMovement was also changed to accept 2 new optional arguments which specify the placeholder characters in the a:rhs. This allows scriptwriters to generate long term maps which will not depend on the internals of imaps.vim The b-newimaps tip at the time of this merge has been tagged as b-newimaps-merge-sa-1 Index: makefile =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** makefile 20 Nov 2002 06:11:34 -0000 1.8 --- makefile 22 Dec 2002 03:00:33 -0000 1.9 *************** *** 52,55 **** --- 52,58 ---- pscp latexSuite.* $(CVSUSER)@vim-latex.sf.net:/home/groups/v/vi/vim-latex/htdocs/download/ + betaup: + pscp latexSuite.zip $(CVSUSER)@vim-latex.sf.net:/home/groups/v/vi/vim-latex/htdocs/download/latexSuite-beta.zip + # rsync is like cp (copy) on steroids. Here are some useful options: # -C auto ignore like CVS |