Re: [Vim-latex-cvs] vimfiles/plugin imaps.vim,1.15,1.16
Brought to you by:
srinathava,
tmaas
|
From: Benji F. <be...@me...> - 2002-12-31 16:07:07
|
sri...@us... wrote:
> Update of /cvsroot/vim-latex/vimfiles/plugin
> In directory sc8-pr-cvs1:/tmp/cvs-serv20482
>
> Modified Files:
> imaps.vim
> Log Message:
> 2. Problem: The <C-K> map for jumping back was interfering with the
> dictionary completion mode of vim. Therefore change default mapping for
> jumping back to <S-C-J> instead of <C-K>. Ofcourse this makes it
> invisible to non-gui users (I think).
Does this work for you? For me (gvim on Linux) <C-J> and <C-S-J>
are the same.
:nmap <C-J> :echo "foo"<CR>
:nmap <S-C-J> :echo "bar"<CR>
When I try <C-J> in Normal mode, it echoes "bar".
> 3. Tried to do the "right" thing for mapping. First provide a number of
> mappings using <plug>. These mappings call IMAP_Jumpfunc() in various
> ways. Various <plug> mappings for various modes have been provided.
> After this, we map the default keys to the <plug> mappings checking for
> hasmapto() each time. This provides for a robust and easy user
> customization. Initially, the user had to do something like:
> inoremap <C-J> <C-r>=IMAP_Jumpfunc('', 0)<CR>
> in his .vimrc to be able to override our mapping. Now he will do
> inoremap <C-J> <Plug>IMAP_JumpForward
> Doing this also has the advantage that changes in IMAP_Jumpfunc() will
> not affect the user customization.
> NOTE: This <plug> things were inspired by looking at the excellent
> cvscommand.vim plugin I've begun using...
This can go in texrc instead of vimrc, right?
This is the system recommended in :help write-plugin . I have
always used a simpler system: for most things, do not provide any key
mapping by default. If the user specifies a key binding, use it (and
display it in the menu).
What I do not like about the current system is that it violates
the principle of least surprise: if the user already has a use for
<C-J>, then (s)he has to figure out how to disable this feature (or
change the key binding).
--Benji
|