Re: [Vim-latex-devel] Alt mappings
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2003-01-07 03:46:46
|
Srinath Avadhanula wrote: > Hmm... Lets see... What about moving away from "special" keys altogether > and using ']l' ']b' ']c' etc in insert mode (as Luc suggests) and > <M-[lbc]> in normal mode (or maybe even ']b' etc in normal mode as > well)? This way people who want to use <M-c> etc for national characters > can continue to do so... Ofcourse this makes the users of latex-suite > learn yet another "leader" character... Maybe ']' can be reserved for > beginning maps which change the text before them in some way... In the > future, we could have more of such maps... > > Ofcourse, I have still not gotten around to creating a good way to let > the end user over-ride the maps. Benji suggested that a section of texrc > can have things like > > " Pressing <F5> will prompt you for which environment to insert. > " Change <F5> to change the ``hotkey''. > nmap <silent> <F5> <Plug>Tex_FastEnvironmentInsert > > etc. The user needs to change the lhs in these lines to customize... > But texrc or the user's copy of texrc is sourced only once when > latex-suite initializes, not for every BufEnter event... So that might > not be a good place... Actually, I was suggesting something more radical. Something like this: " We do not need much of a comment because we use long, descriptive " variable names. " Key for inserting a TeX environment (duh). " See :help latex-environment for details. " Usually, these :help pointers in the comments will apply to several " options at once. let Tex_FastEnvironmentInsert = '' " '<F5>' is popular. " Either default to empty string as above or else comment it out: " let Tex_FastEnvironmentInsert = '<F5>' Then the TexSetOptions() function (called on each FileType tex event, I think) can test whether g:Tex_FastEnvironmentInsert exists (or is not the empty string) and use it to define a map if so. This is the way I did it way back in texmacros.vim (for vim 5.3+). > Should we just document all the maps created by latex-suite in > latex-suite.txt and then put "Read the docs about how to override > mappings" somewhere in the install instructions? Yes. Each group of related options in texrc should have a comment pointing to the appropriate tag in doc/latex-suite.txt . > Luc, Mikolaj, Fabio any suggestions? The rest of us AFAIK do not use > the meta key anyway... > > I just thought about this? Are things like ']b' etc going to cause the > same kind of problems diacritics caused? Do strings like ']b' occur > often in latex? Closed intervals are pretty common: $[a,b]$. Some authors like to reverse the brackets for open intervals: $]a,b[$ instead of $(a,b)$. (I have to restrain myself: let's not disparage anyone's nationality!) Of course, we could make ']b' do something special in text mode, but not in math mode. Vim modes: Insert (and Replace) Normal (a.k.a. Beep or Escape mode) Command (a.k.a. : or Ex mode) Visual (and Select) TeX modes: Horizontal (a.k.a text or paragraph mode) (and Restricted Horizontal, a.k.a. LR, mode) Vertical (and Internal Vertical) Math Display Math Why do I mention this? Mostly because it is late, but also because I was a little worried that mentioning a TeX mode might lead to confusion because Vim had modes, too. --Benji |