From ac44035f4dfc3123f37909282468674c6793ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Thu, 6 Nov 2014 20:30:27 +0100 Subject: [PATCH] Added command and doc for latex#latexmk#toggle --- autoload/latex/latexmk.vim | 11 ++++++----- doc/latex.txt | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/autoload/latex/latexmk.vim b/autoload/latex/latexmk.vim index 03032a1..4c85d70 100644 --- a/autoload/latex/latexmk.vim +++ b/autoload/latex/latexmk.vim @@ -22,11 +22,12 @@ function! latex#latexmk#init(initialized) " {{{1 " " Define commands " - com! -buffer VimLatexCompile call latex#latexmk#compile() - com! -buffer VimLatexStop call latex#latexmk#stop() - com! -buffer VimLatexStopAll call latex#latexmk#stop_all() - com! -buffer VimLatexErrors call latex#latexmk#errors(1) - com! -buffer VimLatexOutput call latex#latexmk#output() + com! -buffer VimLatexCompile call latex#latexmk#compile() + com! -buffer VimLatexCompileToggle call latex#latexmk#toggle() + com! -buffer VimLatexStop call latex#latexmk#stop() + com! -buffer VimLatexStopAll call latex#latexmk#stop_all() + com! -buffer VimLatexErrors call latex#latexmk#errors(1) + com! -buffer VimLatexOutput call latex#latexmk#output() com! -buffer -bang VimLatexClean call latex#latexmk#clean( == "!") com! -buffer -bang VimLatexStatus call latex#latexmk#status( == "!") diff --git a/doc/latex.txt b/doc/latex.txt index 33a4fa7..d774666 100644 --- a/doc/latex.txt +++ b/doc/latex.txt @@ -213,7 +213,7 @@ n lv *@:call latex#view() n lR *@:call latex#reinit() n lt *@:call latex#toc#open() n lT *@:call latex#toc#toggle() -n ll *@:call latex#latexmk#compile() +n ll *@:call latex#latexmk#toggle() n lk *@:call latex#latexmk#stop(1) n lK *@:call latex#latexmk#stop_all() n le *@:call latex#latexmk#errors(1) @@ -242,6 +242,7 @@ Below the commands are listed in alphabetical order. VimLatexClean call latex#latexmk#clean() VimLatexClean! call latex#latexmk#clean(1) VimLatexCompile call latex#latexmk#compile() +VimLatexCompileToggle call latex#latexmk#toggle() VimLatexErrors call latex#latexmk#errors(1) VimLatexHelp call latex#help() VimLatexInfo call latex#info() @@ -628,8 +629,8 @@ LATEXMK *vim-latex-latexmk* interface may be disabled with |g:latex_latexmk_enabled|. The default mappings are: > - nnoremap ll :call latex#latexmk#compile() - nnoremap lk :call latex#latexmk#stop(1) + nnoremap ll :call latex#latexmk#toggle() + nnoremap lk :call latex#latexmk#stop() nnoremap lK :call latex#latexmk#stop_all() nnoremap le :call latex#latexmk#errors(1) nnoremap lo :call latex#latexmk#output() @@ -638,11 +639,11 @@ mappings are: > nnoremap lc :call latex#latexmk#clean(0) nnoremap lC :call latex#latexmk#clean(1) -Compilation is started with |latex#latexmk#compile|. The default behaviour -uses preview continuous mode of `latexmk`, which may be disabled with -|g:latex_latexmk_continuous|. If it is disabled, then the option -|g:latex_latexmk_background| may be used to decide if the single shot -compilation should run in the foreground or the background. +Compilation is started with |latex#latexmk#compile| or may be toggled by +|latex#latexmk#toggle|. The default behaviour uses preview continuous mode of +`latexmk`, which may be disabled with |g:latex_latexmk_continuous|. If it is +disabled, then the option |g:latex_latexmk_background| may be used to decide +if the single shot compilation should run in the foreground or the background. If vim is compiled with the |+clientserver| option and if |g:latex_latexmk_callback| is enabled, then compilation errors are parsed @@ -670,6 +671,7 @@ Functions: |latex#latexmk#status| |latex#latexmk#stop| |latex#latexmk#stop_all| + |latex#latexmk#toggle| ------------------------------------------------------------------------------ Latexmk tricks:~ *vim-latex-latexmk-tricks* @@ -711,8 +713,8 @@ must end with a semicolon in order to allow |vim-latex| to append safely. Latexmk synctex:~ *vim-latex-latexmk-synctex* *vim-latex-synctex* -|vim-latex| does not include automatic support for synctex. First off, it has to -be enabled by adding the line > +|vim-latex| does not include automatic support for synctex. First off, it has +to be enabled by adding the line > $pdflatex = 'pdflatex -synctex=1 %O %S'; @@ -853,6 +855,7 @@ Overview:~ |latex#latexmk#status| |latex#latexmk#stop| |latex#latexmk#stop_all| + |latex#latexmk#toggle| |latex#motion#find_matching_pair| |latex#motion#next_sec| |latex#motion#sel_delimiter| @@ -967,6 +970,10 @@ argument may be given, in which case the function becomes verbose. *latex#latexmk#stop_all* Stops all running `latexmk` processes. + *latex#latexmk#toggle* +Toggle compilation. Calls |latex#latexmk#compile| if `latexmk` is not running +for the current file. Else it calls |latex#latexmk#stop|. + *latex#motion#find_matching_pair* Finds a matching pair of parentheses or begin-end-tags. The functions is used to find the pair closest to the current cursor position.