From 44bc65ecc9865ffb3c62faa669f2d5e6bb44ecc4 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 28 Dec 2011 00:00:00 +0000 Subject: [PATCH] Version 10.6.4: New release with some small changes, see :help atp-news --- autoload/atplib/compiler.vim | 8 ++- autoload/atplib/complete.vim | 10 ++-- autoload/atplib/motion.vim | 52 +++++++++-------- autoload/atplib/various.vim | 71 ++++++++-------------- doc/automatic-tex-plugin.txt | 60 +++++++++++++------ ftplugin/ATP_files/mappings.vim | 81 ++++++++++++++++++++++---- ftplugin/ATP_files/motion.vim | 8 +-- ftplugin/ATP_files/options.vim | 12 ++-- ftplugin/ATP_files/packages/memoir.vim | 6 +- ftplugin/ATP_files/project.vim | 8 ++- ftplugin/ATP_files/various.vim | 2 +- ftplugin/tex_atp.vim | 4 +- 12 files changed, 204 insertions(+), 118 deletions(-) diff --git a/autoload/atplib/compiler.vim b/autoload/atplib/compiler.vim index 2eec072..0577acc 100644 --- a/autoload/atplib/compiler.vim +++ b/autoload/atplib/compiler.vim @@ -50,6 +50,7 @@ function! atplib#compiler#ViewOutput(bang,...) let g:global_options = global_options let g:local_options = local_options let g:viewer = viewer + let g:outfile = outfile endif let view_cmd = viewer." ".global_options." ".local_options." ".shellescape(outfile)." &" @@ -83,14 +84,16 @@ function! atplib#compiler#ViewOutput(bang,...) if fwd_search let msg = "[SyncTex:] waiting for the viewer " let i=1 - while !atplib#compiler#IsRunning(viewer, outfile) && i<10 + let max=20 + while !atplib#compiler#IsRunning(b:atp_Viewer, outfile) && i<=max echo msg sleep 100m redraw let msg.="." let i+=1 endwhile - if i<15 + exe "sleep ".g:atp_OpenAndSyncSleepTime + if i<=max call atplib#compiler#SyncTex("", 0) else echohl WarningMsg @@ -237,6 +240,7 @@ function! atplib#compiler#SyncTex(bang, mouse, ...) let sync_cmd_page = "xpdf -remote " . shellescape(b:atp_XpdfServer) . " -exec 'gotoPage(".page_nr.")'" let sync_cmd_y = "xpdf -remote " . shellescape(b:atp_XpdfServer) . " -exec 'scrollDown(".y_coord.")'" let sync_cmd_x = "xpdf -remote " . shellescape(b:atp_XpdfServer) . " -exec 'scrollRight(".x_coord.")'" +" let sync_cmd = "xpdf -remote " . shellescape(b:atp_XpdfServer) . " -exec 'gotoPage(".page_nr.")'"." -exec 'scrollDown(".y_coord.")'"." -exec 'scrollRight(".x_coord.")'" " There is a bug in xpdf. We need to sleep between sending commands: let sleep = ( g:atp_XpdfSleepTime ? 'sleep '.string(g:atp_XpdfSleepTime).'s;' : '' ) let sync_cmd = "(".sync_cmd_page.";".sleep.sync_cmd_y.")&" diff --git a/autoload/atplib/complete.vim b/autoload/atplib/complete.vim index a65b35e..6c93830 100644 --- a/autoload/atplib/complete.vim +++ b/autoload/atplib/complete.vim @@ -1915,8 +1915,7 @@ function! atplib#complete#TabCompletion(expert_mode,...) call atplib#Log("TabCompletion.log", "b:comp_method=".b:comp_method) "{{{3 --------- inputfiles elseif (l =~ '\\input\%([^{}]*\|\s*{[^}]*\)$'|| - \ l =~ '\\include\s*{[^}]*$' || - \ l =~ '\\includeonly\s*{[^}]*$') && !normal_mode && + \ l =~ '\\include\s*{[^}]*$') && !normal_mode && \ index(g:atp_completion_active_modes, 'input files') != -1 if begin =~ 'input' let begin=substitute(begin,'.*\%(input\|include\%(only\)\?\)\s\?','','') @@ -2505,7 +2504,10 @@ function! atplib#complete#TabCompletion(expert_mode,...) endif if exists("g:atp_".package."_command_values") && - \ ( atplib#search#SearchPackage(package) || test || atplib#search#DocumentClass(b:atp_MainFile) == package ) + \ ( + \ atplib#search#SearchPackage(package) || test || + \ atplib#search#DocumentClass(b:atp_MainFile) == package || package == "common" + \ ) for key in keys({"g:atp_".package."_command_values"}) " uncomment this to debug in which package file there is a mistake. if command =~ key @@ -2539,7 +2541,7 @@ function! atplib#complete#TabCompletion(expert_mode,...) " {{{3 ------------ LABELS /are done later only the completions variable / elseif completion_method == 'labels' let completion_list = [] - " {{{3 ------------ TEX INPUTFILES + " {{{3 ------------ INPUTFILES elseif completion_method == 'inputfiles' let completion_list=[] call extend(completion_list, atplib#search#KpsewhichGlobPath('tex', b:atp_OutDir . ',' . g:atp_texinputs, '*.tex', ':t:r', '^\%(\/home\|\.\|.*users\)', '\%(^\\usr\|texlive\|miktex\|kpsewhich\|generic\)')) diff --git a/autoload/atplib/motion.vim b/autoload/atplib/motion.vim index c571b43..84dfaf4 100644 --- a/autoload/atplib/motion.vim +++ b/autoload/atplib/motion.vim @@ -1487,36 +1487,42 @@ endfunction " Note: the 's' search flag is passed by the associated commands. " This can be extended: " (1) skip empty lines between comments -function! atplib#motion#SkipComment(flag, mode, ...) +function! atplib#motion#SkipComment(flag, mode, count, ...) let flag = ( a:flag =~ 'b' ? 'b' : '' ) let nr = ( a:flag =~ 'b' ? -1 : 1 ) - call search('^\zs\s*%', flag) - call cursor(line("."), ( nr == -1 ? 1 : len(getline(line("."))))) - let line = getline(line(".")) - " find previous line - let pline_nr=min([line("$"), max([1,line(".")+nr])]) - let pline = getline(pline_nr) + for c in range(1, a:count) + let test = search('^\zs\s*%', flag) + if !test + return + endif + call cursor(line("."), ( nr == -1 ? 1 : len(getline(line("."))))) - while pline =~ '^\s*%' - call cursor(line(".")+nr, ( nr == -1 ? 1 : len(getline(line(".")+nr)))) + let line = getline(line(".")) + " find previous line let pline_nr=min([line("$"), max([1,line(".")+nr])]) let pline = getline(pline_nr) - endwhile - if a:mode == 'n' && ( !g:atp_VimCompatible || g:atp_VimCompatible =~? '\' ) - if a:flag =~# 'b' - call cursor(line(".")-1,1) - else - call cursor(line(".")+1,1) + + while pline =~ '^\s*%' && line(".") != line("$") && line(".") != 1 + call cursor(line(".")+nr, ( nr == -1 ? 1 : len(getline(line(".")+nr)))) + let pline_nr=min([line("$"), max([1,line(".")+nr])]) + let pline = getline(pline_nr) + endwhile + if a:mode == 'n' && ( !g:atp_VimCompatible || g:atp_VimCompatible =~? '\' ) + if a:flag =~# 'b' + call cursor(line(".")-1,1) + else + call cursor(line(".")+1,1) + endif endif - endif - if a:mode == 'v' - let end_pos = [ line("."), col(".") ] - " Go where visual mode started - exe "normal `" . ( nr == 1 ? '<' : '>' ) - exe "normal " . visualmode() - call cursor(end_pos) - endif + if a:mode == 'v' + let end_pos = [ line("."), col(".") ] + " Go where visual mode started + exe "normal `" . ( nr == 1 ? '<' : '>' ) + exe "normal " . visualmode() + call cursor(end_pos) + endif + endfor endfunction " Syntax motion diff --git a/autoload/atplib/various.vim b/autoload/atplib/various.vim index e140bab..e8e2306 100644 --- a/autoload/atplib/various.vim +++ b/autoload/atplib/various.vim @@ -2,49 +2,11 @@ " Descriptiion: These are various editting tools used in ATP. " Note: This file is a part of Automatic Tex Plugin for Vim. " Language: tex -" Last Change: Mon Dec 05, 2011 at 20:31:38 +0000 +" Last Change: Mon Dec 26, 2011 at 12:01:47 +0000 let s:sourced = exists("s:sourced") ? 1 : 0 " Replace function (like :normal! r) -function! atplib#various#Replace() "{{{ - " It will not work with <:> since with the default settings "normal %" is not - " working with <:>, possibly because g:atp_bracket_dict doesn't contain this - " pair. - let char = nr2char(getchar()) - let f_char = getline(line("."))[col(".")-1] - if f_char =~ '^[(){}\[\]]$' - if f_char =~ '^[({\[]$' - let bracket_dict = { '{' : '}', - \ '(' : ')', - \ '[' : ']',} - else - let bracket_dict = { '}' : '{', - \ ')' : '(', - \ ']' : '[',} - endif - let c_bracket = get(bracket_dict,char, "") - if c_bracket == "" - exe "normal! r".char - return - endif - let [b_line, b_col] = [line("."), col(".")] - exe "normal! %" - let [e_line, e_col] = [line("."), col(".")] - if b_line == e_line && b_col == e_col - exe "normal! r".char - return - endif - call cursor(b_line, b_col) - exe "normal! r".char - call cursor(e_line, e_col) - exe "normal! r".c_bracket - call cursor(b_line, b_col) - return - else - exe "normal! r".char - endif -endfunction "}}} " This is the wrap selection function. @@ -388,7 +350,8 @@ function! atplib#various#TexAlign(bang) let save_pos = getpos(".") let synstack = map(synstack(line("."), col(".")), 'synIDattr( v:val, "name")') - let balign=searchpair('\\begin\s*{\s*array\s*}', '', '\\end\s*{\s*array\s*}', 'bnW') + let barray=searchpair('\\begin\s*{\s*array\s*}', '', '\\end\s*{\s*array\s*}', 'bnW', '',max([1,line('.')-500])) + let bsmallmatrix=searchpair('\\begin\s*{\s*smallmatrix\s*}', '', '\\end\s*{\s*smallmatrix\s*}', 'bnW', '',max([1,line('.')-500])) " let [bmatrix, bmatrix_col]=searchpairpos('\\matrix\s*\%(\[[^]]*\]\s*\)\=\zs{', '', '}', 'bnW', '', max([1, (line(".")-g:atp_completion_limits[2])])) let [bmatrix, bmatrix_col]=searchpos('^\%([^%]\|\\%\)*\\matrix\s*\%(\[[^]]*\]\s*\)\=\zs{', 'bW', max([1, (line(".")-g:atp_completion_limits[2])])) if bmatrix != 0 @@ -403,13 +366,20 @@ function! atplib#various#TexAlign(bang) let AlignCtr = 'l+' let AlignSep = '&\|\\pgfmatrixnextcell' let env = "matrix" - elseif balign + elseif barray let bpat = '\\begin\s*{\s*array\s*}' - let bline = balign+1 + let bline = barray+1 let epat = '\\end\s*{\s*array\s*}' let AlignCtr = 'l+' let AlignSep = '&' let env = "array" + elseif bsmallmatrix + let bpat = '\\begin\s*{\s*smallmatrix\s*}' + let bline = bsmallmatrix+1 + let epat = '\\end\s*{\s*smallmatrix\s*}' + let AlignCtr = 'l+' + let AlignSep = '&' + let env = "smallmatrix" elseif count(synstack, 'texMathZoneA') || count(synstack, 'texMathZoneAS') let bpat = '\\begin\s*{\s*align\*\=\s*}' let epat = '\\end\s*{\s*align\*\=\s*}' @@ -950,8 +920,8 @@ function! atplib#various#OpenLog() nnoremap [c :call atplib#various#Search('\CLaTeX Warning: Citation', 'bW') nnoremap ]r :call atplib#various#Search('\CLaTeX Warning: Reference', 'W') nnoremap [r :call atplib#various#Search('\CLaTeX Warning: Reference', 'bW') - nnoremap ]e :call atplib#various#Search('^[^!].*\n\zs!', 'W') - nnoremap [e :call atplib#various#Search('^[^!].*\n\zs!', 'bW') + nnoremap ]e :call atplib#various#Search('^!', 'W') + nnoremap [e :call atplib#various#Search('^!', 'bW') nnoremap ]f :call atplib#various#Search('\CFont \%(Info\\|Warning\)', 'W') nnoremap [f :call atplib#various#Search('\CFont \%(Info\\|Warning\)', 'bW') nnoremap ]p :call atplib#various#Search('\CPackage', 'W') @@ -1674,8 +1644,16 @@ function! atplib#various#Dictionary(word) let cmd=g:atp_Python." ".shellescape(URLquery_path)." ".shellescape(url)." ".shellescape(wget_file) call system(cmd) let loclist = getloclist(0) - exe 'lvimgrep /\CMathematical English Usage - a Dictionary/j '.fnameescape(wget_file) - let entry=readfile(wget_file)[getloclist(0)[0]['lnum']+1] + exe 'silent! lvimgrep /\CMathematical English Usage - a Dictionary/j '.fnameescape(wget_file) + let entry=get(readfile(wget_file),get(get(getloclist(0),0,{}),'lnum',-1)+1, -1) + if entry == -1 + call delete(wget_file) + redraw + echohl WarningMsg + echomsg "[ATP:] internet connection seems to be broken." + echohl Normal + return + endif call setloclist(0, loclist) let entry = substitute(entry, '

', "\n", 'g') let entry = substitute(entry, '

\zs\([0-9]\+\)\ze

', "\n\\1", 'g') @@ -1718,6 +1696,7 @@ function! atplib#various#Dictionary(word) endif let i+=1 endfor + call delete(wget_file) endfunction function! atplib#various#Complete_Dictionary(ArgLead, CmdLine, CursorPos) diff --git a/doc/automatic-tex-plugin.txt b/doc/automatic-tex-plugin.txt index 08643c8..f6e7f05 100644 --- a/doc/automatic-tex-plugin.txt +++ b/doc/automatic-tex-plugin.txt @@ -1,6 +1,6 @@ -*automatic-tex-plugin.txt* LaTeX filetype plugin Last change: 11 December 2011 +*automatic-tex-plugin.txt* LaTeX filetype plugin Last change: 28 December 2011 - An Introduction to AUTOMATIC (La)TeX PLUGIN (ver. 10.6.3) + An Introduction to AUTOMATIC (La)TeX PLUGIN (ver. 10.6.4) by Marcin Szamotulski mszamot [AT] gmail [DOT] com ----------------------------------------------------------------------------- @@ -163,6 +163,23 @@ for all the defined functions :help atp*()CTRL-d, mappings: :help atp-mapCTRL-d ================================================================================ NEWS *atp-news* +> + ====================== + Changes in version 10.6.4 +< + ATP normal r map is working better, that is |.| works well with |atp-r| map. + + |g:atp_OpenAndSyncSleepTime| = "500m" -- sleep time between the time when + ATP finds the viewer working and syncing (forward searching) for the command + |atp-:View|! (with bang) (this is time left for the viewer to open the file). + + Plus some new package files for completion: showidx, makeidx, syntonly and + a better completion for the \includeonly{} command (which removes items from + completion menu which are already included). + + Count added to |atp-]%| and |atp-[%|. + + |atp-:TexAlign| works with smallmatrix environment. > ====================== Changes in version 10.6.3 @@ -1146,6 +1163,10 @@ map v,map , imap With bang (and maps) opens viewer at the cursor position in vim (forward search). This will only work for viewers that support forward searching (xpdf, xdvi, okular, skim). + *g:atp_OpenAndSyncSleepTime* +let |g:atp_OpenAndSyncSleepTime|="500m" + Give 500 milliseconds for the viewer to read the file, before + |atp-:View|! command will do a forward search. :SyncTex[!] *atp-:SyncTex* *atp-\f* map f, map @@ -1341,11 +1362,12 @@ map , imap map =d This is an interface to http://www.impan.pl/Dictionary/. Type a [word] and you will get quotes from mathematical articles or books written by - native speakers of English. The command has a completion for words. + native speakers of English. The command has a completion for words List of words is hard coded in ATP (it is too slow to get it), since the - dictionary evolves it might contain new entries. + dictionary evolves it might contain new entries (note: if this is the + case, please inform me). - The map takes the || under the cursor as an argument. + The map takes the || under the cursor as an argument. :Delete[!] *atp-:Delete* map d @@ -1799,12 +1821,16 @@ nmap -p *atp-:SkipCommentForward* *atp-]star* *atp-]%* *atp-gc* -:SkipCommentForward -nmap ]* ]% gc - Go to end of current/next comment group. +:[count]SkipCommentForward +nmap [count]]* [count]]% [count]gc + Go to end of current/next comment group. Do this [count] times. The + default [count] is 1. Note: if |g:atp_VimCompatible|=1 (the default) it goes one line below the last commented line, if it is 0 it goes to the end of the comment. + + Note: This commands wraps around the begining/end of the file. The + 'wrapscan' option applies. *atp-:SkipCommentBackward* *atp-[star* *atp-[%* *atp-gC* :SkipCommentBackward @@ -4655,15 +4681,15 @@ nmaps: g>, g<, 2g>, ..., 6g> A normal map to m`vipg>`` (or m`vip2g>``). *atp-r* -nmap r - If |g:atp_VimCompatible| is 0 then the normal command |r| will be over written - with an ATP function with the following feature: if you do |atp-r| - over one of the brackets: (:), {:}, [:] then r(, r{, r[ (and r), r}, - r]) will change both: the opening and the closing bracket. Otherwise, - i.e. over any other character, or |atp-r| over a bracket with - replacing character other than opening bracket at opening position or - closing bracket at closing position, |atp-r| will work the same as |r|. - +nmap r{char} + Over any charackter which is not a bracket: (:), [:], {:} it acts as + |r| command. Over a bracket which has a closing bracket and if {char} + is another bracket it replaces both opening and closing bracket. When + replacing brackets it will not remember the changing bracket for the + |.| command, so you cannot use |.| to change more brackets, but if + |atp-r| was used for changing text (non-brackets, or not-closed/opened + brackets) then the action can be repeated with |.|. + ================================================================================ REQUIREMENTS *atp-requirements* diff --git a/ftplugin/ATP_files/mappings.vim b/ftplugin/ATP_files/mappings.vim index db30390..c5c769b 100644 --- a/ftplugin/ATP_files/mappings.vim +++ b/ftplugin/ATP_files/mappings.vim @@ -2,7 +2,7 @@ " Description: This file contains mappings defined by ATP. " Note: This file is a part of Automatic Tex Plugin for Vim. " Language: tex -" Last Change: Sun Dec 11, 2011 at 08:51:00 +0000 +" Last Change: Sun Dec 18, 2011 at 17:17:50 +0000 " Add maps, unless the user didn't want them. if exists("g:no_plugin_maps") && g:no_plugin_maps || @@ -19,17 +19,78 @@ else let s:backslash="\\\\" let s:bbackslash="\\\\\\\\" endif -let g:backslash=s:backslash " Dicronary map if !hasmapto("Dictionray") nmap =d Dictionary endif -" Replace map -if !g:atp_VimCompatible && !hasmapto("Replace") - nmap r Replace -endif +" Replace map (is not working -> use :Repace command) +" if !g:atp_VimCompatible && !hasmapto("Replace") +" nnoremap r Replace +" endif +nn r :call Replace("") +nn InputRestore :call inputrestore() +function! Replace(sid,...) "{{{ + " It will not work with <:> since with the default settings "normal %" is not + " working with <:>, possibly because g:atp_bracket_dict doesn't contain this + " pair. + let sid = eval('"\'.a:sid.'"') + if !a:0 + let char = nr2char(getchar()) + else + let char = a:1 + endif + let g:char = char + let f_char = getline(line("."))[col(".")-1] + let g:f_char = f_char + if f_char =~ '^[(){}\[\]]$' + if f_char =~ '^[({\[]$' + let bracket_dict = { '{' : '}', + \ '(' : ')', + \ '[' : ']',} + else + let bracket_dict = { '}' : '{', + \ ')' : '(', + \ ']' : '[',} + endif + let c_bracket = get(bracket_dict,char, "") + if c_bracket == "" + exec printf("nn ReplaceCmd %sr%s", (v:count>=1 ? v:count : ""), char) + call inputsave() + call feedkeys(sid."ReplaceCmd". sid."InputRestore") + return + endif + let [b_line, b_col] = [line("."), col(".")] + exe "normal! %" + let [e_line, e_col] = [line("."), col(".")] + if b_line == e_line && b_col == e_col + exec printf("nn ReplaceCmd %sr%s", (v:count>=1 ? v:count : ""), char) + call inputsave() + call feedkeys(sid."ReplaceCmd". sid."InputRestore") + return + endif + + call cursor(b_line, b_col) + exe "normal! r".char + + call cursor(e_line, e_col) + exe "normal! r".c_bracket + call cursor(b_line, b_col) + return + else + exec printf("nn ReplaceCmd %sr%s", (v:count>=1 ? v:count : ""), char) + call inputsave() + call feedkeys(sid."ReplaceCmd". sid."InputRestore") + call cursor(line("."), col(".")) + endif +endfunction "}}} +" fun! Dot() +" nunmap r +" normal! . +" nmap r Replace +" endfun +" nmap . call Dot() " Unwrap map if !hasmapto("Unwrap") @@ -1208,13 +1269,13 @@ endif \ "g:atp_imap_define_diacritics", '\b{}' ], \ [ 'inoremap', ' ', g:atp_imap_over_leader, 'd', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' ))[1] == "bad" && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' )."''d")[1] == "bad" ? "vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'d{\"}" : "''d" )', \ "g:atp_imap_define_diacritics", '\d{}' ], - \ [ 'inoremap', ' ', g:atp_imap_over_leader, '`', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' ? "vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'`{\"}" : "`''" )', + \ [ 'inoremap', ' ', g:atp_imap_over_leader, '`', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' ))[1] == "bad" ? "vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'`{\"}" : "''`" )', \ "g:atp_imap_define_diacritics", '\`{}' ], - \ [ 'inoremap', ' ', g:atp_imap_over_leader, 'H', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' ? "vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'H{\"}" : "''H" )', + \ [ 'inoremap', ' ', g:atp_imap_over_leader, 'H', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' ))[1] == "bad" ? "vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'H{\"}" : "''H" )', \ "g:atp_imap_define_diacritics", '\H{}' ], - \ [ 'inoremap', ' ', g:atp_imap_over_leader, '~', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' ?"vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'~{\"}" : "''~" )', + \ [ 'inoremap', ' ', g:atp_imap_over_leader, '~', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' ))[1] == "bad" ?"vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'~{\"}" : "''~" )', \ "g:atp_imap_define_diacritics", '\~{}' ], - \ [ 'inoremap', ' ', g:atp_imap_over_leader, '.', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' ?"vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'.{\"}" : "''." )', + \ [ 'inoremap', ' ', g:atp_imap_over_leader, '.', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' ))[1] == "bad" ?"vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'.{\"}" : "''." )', \ "g:atp_imap_define_diacritics", '\.{}' ], \ [ 'inoremap', ' ', g:atp_imap_over_leader, 'c', '(getline(line("."))[col(".")-2] =~? ''[a-z]'' && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' ))[1] == "bad" && spellbadword(matchstr(strpart(getline(line(".")), 0, col(".")-1), ''\S*$'' )."''c")[1] == "bad" ?"vx".(col(".")<=len(getline("."))? "i" : "a" )."'.s:bbackslash.'c{\"}" : "''c" )', \ "g:atp_imap_define_diacritics", '\c{}' ], diff --git a/ftplugin/ATP_files/motion.vim b/ftplugin/ATP_files/motion.vim index 9cd484f..1640d61 100644 --- a/ftplugin/ATP_files/motion.vim +++ b/ftplugin/ATP_files/motion.vim @@ -131,10 +131,10 @@ command! -buffer -count=1 Sec :call atplib#motion#ggGotoSection(, 'sec command! -buffer -count=1 SSec :call atplib#motion#ggGotoSection(, 'subsection') command! -buffer -nargs=1 -complete=custom,atplib#motion#CompleteDestinations GotoNamedDest :call atplib#motion#GotoNamedDestination() -command! -buffer SkipCommentForward :call atplib#motion#SkipComment('fs', 'n') -command! -buffer SkipCommentBackward :call atplib#motion#SkipComment('bs', 'n') -vmap SkipCommentForward :call atplib#motion#SkipComment('fs', 'v') -vmap SkipCommentBackward :call atplib#motion#SkipComment('bs', 'v', col(".")) +command! -buffer -count=1 SkipCommentForward :call atplib#motion#SkipComment('fs', 'n', v:count1) +command! -buffer -count=1 SkipCommentBackward :call atplib#motion#SkipComment('bs', 'n', v:count1) +vmap SkipCommentForward :call atplib#motion#SkipComment('fs', 'v', v:count1) +vmap SkipCommentBackward :call atplib#motion#SkipComment('bs', 'v', , v:count1, col(".")) imap TexSyntaxMotionForward :call atplib#motion#TexSyntaxMotion(1,1,1)a imap TexSyntaxMotionBackward :call atplib#motion#TexSyntaxMotion(0,1,1)a diff --git a/ftplugin/ATP_files/options.vim b/ftplugin/ATP_files/options.vim index dfb8e00..14fc41b 100644 --- a/ftplugin/ATP_files/options.vim +++ b/ftplugin/ATP_files/options.vim @@ -2,7 +2,7 @@ " Description: This file contains all the options defined on startup of ATP " Note: This file is a part of Automatic Tex Plugin for Vim. " Language: tex -" Last Change: Sun Dec 11, 2011 at 08:52:46 +0000 +" Last Change: Tue Dec 27, 2011 at 10:06:34 +0000 " NOTE: you can add your local settings to ~/.atprc.vim or " ftplugin/ATP_files/atprc.vim file @@ -388,6 +388,9 @@ lockvar b:atp_autex_wait " Global Variables: (almost all) " {{{ global variables +if !exists("g:atp_OpenAndSyncSleepTime") + let g:atp_OpenAndSyncSleepTime = "750m" +endif if !exists("g:atp_tab_map") let g:atp_tab_map = 0 endif @@ -1891,7 +1894,7 @@ nnoremap ToggleTab :call ATP_ToggleTab() inoremap ToggleTab :call ATP_ToggleTab() "}}} -" Tab Completion Variables: +" TabCompletion Variables: " {{{ TAB COMPLETION variables " ( functions are in autoload/atplib.vim ) " @@ -2044,6 +2047,7 @@ endif \ "\\medskip", "\\smallskip", "\\vskip", "\\vfil", "\\vfill", "\\vspace{", "\\vbox", \ "\\hrule", "\\hrulefill", "\\dotfill", "\\hbox", \ "\\thispagestyle{", "\\mathnormal", "\\markright{", "\\markleft{", "\\pagestyle{", "\\pagenumbering{", + \ "\\addtocounter{", \ "\\author{", "\\address{", "\\date{", "\\thanks{", "\\title{", \ "\\maketitle", \ "\\marginpar", "\\indent", "\\par", "\\sloppy", "\\pagebreak", "\\nopagebreak", @@ -2066,7 +2070,7 @@ endif \ "\\bibliography{", "\\bibliographystyle{", "\\baselineskip", \ "\\flushbottom", "\\onecolumn", "\\raggedbottom", "\\twocolumn", \ "\\alph{", "\\Alph{", "\\arabic{", "\\fnsymbol{", "\\reversemarginpar", - \ "\\exhyphenpenalty", + \ "\\exhyphenpenalty", "\\frontmatter", "\\mainmatter", "\\backmatter", \ "\\topmargin", "\\oddsidemargin", "\\evensidemargin", "\\headheight", "\\headsep", \ "\\textwidth", "\\textheight", "\\marginparwidth", "\\marginparsep", "\\marginparpush", "\\footskip", "\\hoffset", \ "\\voffset", "\\paperwidth", "\\paperheight", "\\columnsep", "\\columnseprule", @@ -2199,8 +2203,6 @@ endif \ "\\chaptermark", "\\sectionmark", "\\subsectionmark", \ "\\fancyheadoffset", "\\fancyfootoffset", "\\fancyhfoffset"] - let g:atp_makeidx_commands=[ "\\makeindex", "\\index{", "\\printindex" ] - " ToDo: remove tikzpicture from above and integrate the " tikz_envirnoments variable diff --git a/ftplugin/ATP_files/packages/memoir.vim b/ftplugin/ATP_files/packages/memoir.vim index 4079754..2c88cf7 100644 --- a/ftplugin/ATP_files/packages/memoir.vim +++ b/ftplugin/ATP_files/packages/memoir.vim @@ -22,8 +22,12 @@ let g:atp_memoir_commands = [ \ '\spinemargin', '\foremargin', '\uppermargin', '\headmargin', \ '\typeoutlayout', '\typeoutstandardlayout', '\settypeoutlayoutunit{', \ '\fixpdflayout', '\fixdvipslayout', '\medievalpage', '\isopage', - \ '\semiisopage' + \ '\semiisopage', + \ '\contentsname', '\listfigurename', 'listtablename' \ ] +let g:atp_memoir_command_values = { + \ '\\\%(this\)\=pagestyle\s*{' : [ 'cleared', 'chapter', 'titlingpagestyle' ] + \ } " Additional commands which seems to be rare and thus not included by default. " Uncomment this line to get them. " call extend(g:atp_memoir_commands, [ diff --git a/ftplugin/ATP_files/project.vim b/ftplugin/ATP_files/project.vim index 8229881..83f545d 100644 --- a/ftplugin/ATP_files/project.vim +++ b/ftplugin/ATP_files/project.vim @@ -539,8 +539,9 @@ function! WriteProjectScript(bang, project_script, cached_variables, type, let save_loclist = getloclist(0) try silent! exe 'lvimgrep /^\s*\\s\+[bg]:/j ' . fnameescape(a:project_script) - catch E486: - catch E480: + catch /^Vim\%((\a\+)\)\=:E480/ + catch /^Vim\%((\a\+)\)\=:E486/ + catch /^Vim\%((\a\+)\)\=:E21/ endtry let defined_variables = getloclist(0) call map(defined_variables, 'matchstr(v:val["text"], ''^\s*let\s\+\zs[bg]:[^[:blank:]=]*'')') @@ -622,7 +623,8 @@ function! WriteProjectScript(bang, project_script, cached_variables, type, try exe 'silent! keepjumps %g/^\s*let\s\+' . var . '\>/d_' - catch /E486:/ + catch /^Vim\%((\a\+)\)\=:E486/ + catch /^Vim\%((\a\+)\)\=:E21/ endtry keepjumps call append('$', 'let ' . var . ' = ' . string({lvar})) endif diff --git a/ftplugin/ATP_files/various.vim b/ftplugin/ATP_files/various.vim index eb405b6..e3f1eef 100644 --- a/ftplugin/ATP_files/various.vim +++ b/ftplugin/ATP_files/various.vim @@ -2,7 +2,7 @@ " Descriptiion: These are various editting tools used in ATP. " Note: This file is a part of Automatic Tex Plugin for Vim. " Language: tex -" Last Change: Fri Nov 18, 2011 at 09:05:44 +0000 +" Last Change: Sun Dec 18, 2011 at 20:15:05 +0000 let s:sourced = exists("s:sourced") ? 1 : 0 "{{{ ATP_strlen() diff --git a/ftplugin/tex_atp.vim b/ftplugin/tex_atp.vim index ceafff7..6f7d8e1 100644 --- a/ftplugin/tex_atp.vim +++ b/ftplugin/tex_atp.vim @@ -2,7 +2,7 @@ " Author: Marcin Szamotulski " Mailing List: atp-vim-list [AT] lists.sourceforge.net " Do NOT DELETE the line just below, it is used by :UpdateATP (':help atp-:UpdateATP') -" Time Stamp: 11-12-11_09-05 +" Time Stamp: 28-12-11_17-03 " (but you can edit, if there is a reason for doing this. The format is dd-mm-yy_HH-MM) " Language: tex " Last Change: Sat Oct 15, 2011 at 15:36:11 +0100 @@ -32,7 +32,7 @@ if exists("g:no_atp") && g:no_atp == 1 endif let b:did_ftplugin = 1 -let g:loaded_AutomaticLatexPlugin = "10.6.3" +let g:loaded_AutomaticLatexPlugin = "10.6.4" if !exists("g:atp_reload_functions") let g:atp_reload_functions = 0