On Friday 31 July 2009 12:52:19 Raúl Núñez de Arenas Coronado 
wrote:
> You can do that with iabbr, too, but since the iabbr will be
> triggered mostly using <Space> (I mean, "sout<Space>") you
> will end up with an space between the "", which may or may not
> be what you want. The imap is better in that sense.

unless you add the Eatchar function, as documented in

        :help iabbreviation

by adding 

function! Eatchar(pat)
    let c = nr2char(getchar(0))
    return (c =~ a:pat) ? '' : c
endfunction

to your .vimrc, and writing your iabbr like this:

iabbrev ibt #!/usr/bin/tclsh<c-r>=Eatchar('\s')<cr>

then when you hit the space the string is inserted but not with a 
trailing space, but if you trigger it with <Enter> a carriage 
return is inserted

sc

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to