[Vim-latex-cvs] vimfiles/ftplugin/tex brackets.vim,1.9,1.10
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2003-10-23 02:23:07
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv18015 Modified Files: brackets.vim Log Message: Removed Tex_InsertItem from this file to be put into envmacros.vim Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** brackets.vim 9 Oct 2003 23:58:13 -0000 1.9 --- brackets.vim 23 Oct 2003 01:47:20 -0000 1.10 *************** *** 1,5 **** " ============================================================================== ! " Author: Carl Mueller ! " (incorporated into latex-suite by Srinath Avadhanula) " Description: " This ftplugin provides the following maps: --- 1,8 ---- " ============================================================================== ! " History: This was originally part of auctex.vim by Carl Mueller. ! " Srinath Avadhanula incorporated it into latex-suite with ! " significant modifications. ! " Parts of this file may be copyrighted by others as noted. ! " CVS: $Id$ " Description: " This ftplugin provides the following maps: *************** *** 28,41 **** " These functions make it extremeley easy to do all the \left \right stuff in " latex. - " - " NOTE: The insert mode maps are created only if maps are no maps already to - " the relevant functions Tex_MathBF, Tex_MathCal and Tex_LeftRight. This is to - " enable people who might need the alt keys for typing to use some other - " keypress to trigger the same behavior. In order to use some other key, (say - " <C-c>) to use Tex_MathCal(), do the following - " - " inoremap <buffer> <silent> <C-c> <C-r>=Tex_MathCal()<CR> - " " ============================================================================== " Avoid reinclusion. if exists('b:did_brackets') --- 31,36 ---- " These functions make it extremeley easy to do all the \left \right stuff in " latex. " ============================================================================== + " Avoid reinclusion. if exists('b:did_brackets') *************** *** 56,60 **** inoremap <silent> <Plug>Tex_MathCal <C-r>=Tex_MathCal()<CR> inoremap <silent> <Plug>Tex_LeftRight <C-r>=Tex_LeftRight()<CR> - inoremap <Plug>Tex_InsertItem <Esc>a<C-r>=Tex_InsertItem()<CR> " Provide mappings only if the user hasn't provided a map already or if the --- 51,54 ---- *************** *** 71,78 **** imap <buffer> <silent> <M-l> <Plug>Tex_LeftRight endif - if !hasmapto("\<Plug>Tex_InsertItem") - inoremap <M-i> <C-R>=Tex_InsertItem()<CR> - endif - " }}} --- 65,68 ---- *************** *** 165,216 **** endif endfunction " }}} - " Tex_InsertItem: insert item into a list {{{ - " Description: a polymorphic function which inserts various formatted \item - " commands depending on the environment surrounding the cursor. If outside a - " list, then do nothing. - " - " (C) 2003 by Johannes Tanzler, <joh...@ao...> - " modifications by Srinath Avadhanula - function! Tex_InsertItem() - " Remember where we are. - let curpos = line('.').' | normal! |'.virtcol('.') - let curline = line('.') - - " Get one of the relevant environments before this line. - let env_line = search( - \ '^\s*\\begin{\(itemize\|enumerate\|theindex\|description\|labeling\|thebibliography\)', 'bW') - " If none found then return. - if env_line == 0 - return '' - endif - " We are at the beginning of the environment. - let env = matchstr(getline(env_line), '{\zs.\{-}\ze}') - call Tex_Debug("env = ".env, "bra") - " search forward for the end of the environment. If the end of the - " environment occurs before where we originally were, means we were - " outside (after the end) of the environment. In this do nothing. - let env_line_end = search('^\s*\\end{'.env) - - call Tex_Debug("env_line = ".env_line.', env_line_end = '.env_line_end, "bra") - if env_line_end < curline - exec curpos - return '' - endif - - exec curpos - - if env =~ '\(itemize\|enumerate\|theindex\)' - return IMAP_PutTextWithMovement("\\item ") - elseif env =~ '\(description\|labeling\)' - if env =~ 'labeling' | let add = '\sfb ' | else | let add = '' | endif - return IMAP_PutTextWithMovement("\\item[" . add . "<+label+>] <++>") - elseif env =~ '\(thebibliography\)' - return IMAP_PutTextWithMovement("\\item[<+biblabel+>]{<+bibkey+>}<++>") - else - return "" - endif - endfunction - - " }}} " vim:fdm=marker --- 155,158 ---- |