Re: [Vim-latex-devel] Re: Alt mappings
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2003-01-07 23:00:47
|
Mikolaj Machowski wrote: > On Tue, Jan 07, 2003 at 12:02:31PM +0100, Luc Hermitte wrote: > >>the {key}/{sequence_of_keys}. For instance, I like ']em' to insert >>'\emph{}', but what do you prefer ? 'FEM', ']FEM', ']EM' ? > > > I like FEM because: > ]FEM it too long > ]EM can lead to inconsistence. Are we getting rid of F only for \emph{} > or for all font commands? Look for FIT. It is \itshape{}. You can change > it for ]IT but what about EIT (\begin{itemize})? > Existing system of shortcuts is slightly awkward bu at least (I hope) > internally consistent. > Really nice would be something quite different. Possibility for user to > create his own mappings by doing :map ]em FEM (in another words: create > latexSuite API). But I do not know how to do this. This is what <Plug> is for. We already use this in imaps.vim . Just search for "<Plug>" to see the examples. >>Don't worry. >>BTW, it would be nice if we could define mappings aware of the TeX mode. >>For instace, an same mapping would insert '\textbf{}' or '\mathbf{}' >>according to the current TeX mode. > > > This is possible with checking of current syntax. Benji did it for > inserting cdots, and I used it in 'polski' file. > > if synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath\|^texZone' I am familiar with this idea, but I cannot take credit for the ... map. When I met Bram last summer, I suggested that the next Big Thing for vim should be a better way to deal with regions (math in TeX documents, comments in many languages, script languages in HTML-like languages, etc.) We'll see what happens. --Benji |