Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv1609
Modified Files:
main.vim
Log Message:
. moved over the smart space functions and mappings into a new file called
ftplugin/tex/smartspace.vim
I think this is the way to go as far as extending goes. We do not want to
keep changing core latex-suite files each time some new functionality
needs to be added. The ftplugin file mechanism provides a very robust way
to letting each module take care of redefinition, reinclusion etc.
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** main.vim 25 Nov 2002 01:20:13 -0000 1.12
--- main.vim 6 Dec 2002 08:46:02 -0000 1.13
***************
*** 4,8 ****
" Email: sr...@fa...
" URL:
! " Last Change: pon lis 25 12:00 2002 C
"
" Help:
--- 4,8 ----
" Email: sr...@fa...
" URL:
! " Last Change: Fri Dec 06 12:00 AM 2002 PST
"
" Help:
***************
*** 235,240 ****
return '"'
endif
! let open = exists("s:TeX_open") ? s:TeX_open : "``"
! let close = exists("s:TeX_close") ? s:TeX_close : "''"
let boundary = '\|'
if exists("s:TeX_strictquote")
--- 235,240 ----
return '"'
endif
! let open = exists("g:Tex_SmartQuoteOpen") ? g:Tex_SmartQuoteOpen : "``"
! let close = exists("g:Tex_SmartQuoteClose") ? g:Tex_SmartQuoteClose : "''"
let boundary = '\|'
if exists("s:TeX_strictquote")
***************
*** 318,373 ****
endif
endfunction " }}}
- " 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
- " }}}
- " }}}
" ==============================================================================
--- 318,321 ----
***************
*** 477,491 ****
" Finally set up the folding, options, mappings and quit.
" ==============================================================================
- " Save 'tw'
- let textw = &textwidth
-
" SetTeXOptions: sets options/mappings for this file. {{{
function! <SID>SetTeXOptions()
- " ':' is included because most labels are of the form,
- " fig:label, etc.
- setlocal isk+=:
exe 'setlocal dict+='.s:path.'/dictionaries/dictionary'
- setlocal sw=2
- setlocal ts=2
setlocal foldtext=TexFoldTextFunction()
--- 425,431 ----
***************
*** 505,518 ****
inoremap <buffer> <silent> <BS> <C-R>=<SID>SmartBS(<SID>SmartBS_pat())<CR>
inoremap <buffer> <silent> . <C-R>=<SID>SmartDots()<CR>
- " for FormatLine {{{
- if &l:tw > 0
- let b:tw = &l:tw
- else
- let b:tw = 79
- endif
- " The following is necessary for TexFormatLine() and TexFill()
- setlocal tw=0
- inoremap <buffer> <silent> <Space> <Space><Esc>:call <SID>TexFill(b:tw)<CR>a
- " }}}
" viewing/searching
if !hasmapto('RunLaTeX')
--- 445,448 ----
***************
*** 539,545 ****
" Mappings defined in package files will overwrite all other
exe 'source '.s:path.'/packages.vim'
-
- " Restore 'tw'
- let &textwidth = textw
let &cpo = s:save_cpo
--- 469,472 ----
|