On Sun, Sep 24, 2006 at 04:37:16PM +0200, Meino Christian Cramer wrote:
>
[snip]
> After I wrote my first TeX-text without Emacs/AucTeX spontaneous I
> would say the following things are missing:
>
> A Keystrokes to insert {\bf X }, {\it X \/} and such where X marks the
> cursor position after doing the keystroke.
>
> B Interface to run TeX and a viewer (configurable) on the file one is
> editing which ensures, that the file on the HD is uptodate.
>
> C Defintions to automatically map "<word>" to ``<word>'' and to remap
> - in my case - german umlauts to the TeX-commandsequences. This
> should be done for any non-ASCII-character. Most of the bugs I had
> to remove while trying to tex my file were of such kind.
>
> I have not proofen that this is not already implemented, I only read
> the few lines of the help text for ft-tex-plugin. And didn't fiddle
> with quickfix and such. May be quickfix can be misused for texing ?
> Dont know.
>
> Keep hacking and TeXing!
> mcc
First, let me make some general remarks. With vim 7.0, we
introduced the file type plaintex. I made this the default, which
annoys some LaTeX users, so I am glad to know that there are still some
people out there who are using plain TeX (and editing with vim). I
maintain the ftplugin files for tex and plaintex, so I could add some
features there; but I try to be conservative, and follow the principle
of least surprise. So I prefer not to add too many key mappings to the
default ftplugin files (even smart quotes, which would be a *pleasantC*
surprise for most users).
A. What keys do you suggest for entering {\bf X } and {\it X \/}, and
do you really want a space after the X (cursor)? Perhaps using the
control or meta (alt) key? (I hope no one flames me for suggesting that
meta and alt are the same thing, when I really know better!) Do you
want a marker added so that you can jump out of the braces and continue
input? Presumably, whatever key you use to do {\bf X} in Insert mode
should also apply in Visual mode to insert "{\bf " before the Visual
selection and append "}" after it.
B. Another reply pointed out how to go in the other direction: from a
viewer (such as Yap) to the tex file. Of course, that depends on the
viewer. Note that you can start vim (not gvim) with the --servername
TEX option, provided that vim is compiled with the +clientserver option.
(This may not be the default if vim is compiled without GUI support.
Check the output of
:version
to see if is is there.)
It is certainly possible to compile using the quickfix commands. I
think the compiler plugin was not updated when the plaintex file type
was introduced, so you may have to do something like
:let b:tex_flavor = 'plain'
:compiler tex
:make %
I will test this, and I may add something to the default
ftplugin/plaintex.vim to make it easier to use.
Calling a viewer from withing vim is not hard to arrange, but it
depends on what OS you are using and what viewer. I think that
latex-suite already does this; maybe I can steal something from there.
C. I wrote a TeXquotes() function years ago, and it has been
incorporated into latex-suite. I will stick this, and some of the other
things I mentioned, into an ftplugin file and post it to vim.org . I
think latex-suite also has something for translating umlauts into teX
sequences.
HTH --Benji Fisher