Sunday, April 14, 2013

Re: help! ab multiple line abbreviations MacVIm

On 15/04/13 02:48, zwu002@ucr.edu wrote:
> Hi all,
> I try to ab several multiple line commands by following the instruction on vim wiki http://vim.wikia.com/wiki/Using_abbreviations
> However, when copy and paste this line into my vimrc file, I didn't get the expected result (I sourced the vimrc file before my test). Below is the line:
> :ab mul Multiple<CR>lines
>
> open test.c file and type "mul", I got "Multiple<CR>lines" rather than
> "
> Multiple
> lines
> "
>
> The problem seems like the <CR> is not recognized. I'm using newest version of MacVim and vim.
>
> :version
> IM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 4 2013 13:43:24)
> MacOS X (unix) version
> Included patches: 1-244, 246-754
>
>
> If more information is needed, please let me know. Thanks.
>
>
> Zhigang
>

Works for me with gvim 7.3.892 with GTK2/GNOME2 GUI on Linux, both after
typing the command at the command-line

:ab <buffer> mul Multiple<CR>lines

and after adding them to my vimrc.

Quite a number of patches have been applied between your version and
mine, see http://ftp.vim.org/pub/vim/patches/7.3/README , but I can't
seem to find one which would be likely to have fixed your problem.

However, patch 7.3.754 was published on 6 December 2012; on 4 April the
latest patch was 7.3.877. I wonder why your MacVim was already 123
patchlevels late when it was built.

But wait -- if the < flag is present in 'cpoptions', <> keycodes are not
recognised in mappings, abbreviations, and the {rhs} of menu commands.
The default for 'cpoptions' is aABceFs in 'nocompatible' mode but it's
all flags on in 'compatible' mode. Try the following:

:verbose set cp? cpo?

and don't forget the question marks, at least for 'cp' ('compatible')
which is a Boolean option: if you omit the question mark for a Boolean
option it means "set it to TRUE", with it it means "display the value".
For non-boolean options both are synonymous, but I've trained myself to
always add a question mark when I want to display an option setting, so
I will never forget it when it's important.



Best regards,
Tony.
--
Living in Hollywood is like living in a bowl of granola. What ain't
fruits and nuts is flakes.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: