[patch] Add support of C++0x in cpp.vim

1,239 views
Skip to first unread message

Michael Tsang

unread,
Dec 15, 2009, 6:19:37 AM12/15/09
to vim...@vim.org
diff -ur vim-7.2.245.orig/runtime/syntax/cpp.vim
vim-7.2.245/runtime/syntax/cpp.vim
--- vim-7.2.245.orig/runtime/syntax/cpp.vim 2009-12-15 19:17:48.000000000
+0800
+++ vim-7.2.245/runtime/syntax/cpp.vim 2009-12-15 19:18:04.000000000 +0800
@@ -33,6 +33,14 @@
syn keyword cppNumber NPOS
syn keyword cppBoolean true false

+if !exists("cpp_no_cpp0x") " ISO C++0x
+ syn keyword cppOperator alignof
+ syn keyword cppType char16_t char32_t decltype
+ syn keyword cppStorageClass constexpr thread_local
+ syn keyword cppConstant nullptr
+ syn keyword cppStatement static_assert
+endif
+
" The minimum and maximum operators in GNU C++
syn match cppMinMax "[<>]?"

@@ -54,6 +62,7 @@
HiLink cppStructure Structure
HiLink cppNumber Number
HiLink cppBoolean Boolean
+ HiLink cppConstant Constant
delcommand HiLink
endif

signature.asc

Ricardo

unread,
Jun 8, 2012, 8:25:04 PM6/8/12
to vim...@googlegroups.com, vim...@vim.org

Sorry

Apologies for reviving such an old post, but this patch seems useful now that C++ 11 is on the streets and it was never applied. Seems like a small change no too much intrusive. Maybe the variable "cpp_no_cpp0x" should be renamed to "cpp_no_cpp11" but apart from that, seems nice.


Best regards

Bram Moolenaar

unread,
Jun 9, 2012, 7:06:13 AM6/9/12
to Ricardo, vim...@vim.org
The maintainer of the C++ file, Ken Shan, has not contacted us for
almost ten years. We need someone else to maintain this syntax file.

--
Now it is such a bizarrely improbable coincidence that anything as
mind-bogglingly useful as the Babel fish could have evolved purely by chance
that some thinkers have chosen to see it as a final and clinching proof of the
NON-existence of God.
The argument goes something like this: 'I refuse to prove that I exist,' says
God, 'for proof denies faith, and without faith I am nothing.'
'But,' says Man, 'the Babel fish is a dead giveaway, isn't it? It could not
have evolved by chance. It proves you exist, and so therefore, by your own
arguments, you don't. QED.'
'Oh dear,' says God, 'I hadn't thought of that,' and promptly vanishes in a
puff of logic.
'Oh, that was easy,' says Man, and for an encore goes on to prove that black
is white and gets himself killed on the next pedestrian crossing.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Ricardo Catalinas Jiménez

unread,
Jun 9, 2012, 7:13:57 AM6/9/12
to Bram Moolenaar, vim...@vim.org
On Sat, Jun 09, 2012 at 01:06:13PM +0200, Bram Moolenaar wrote:
> The maintainer of the C++ file, Ken Shan, has not contacted us for
> almost ten years. We need someone else to maintain this syntax file.

Well, I'm not C++ expert, but I would like to submit an improved version
of this patch. I think it would be useful for many users.


Best regards
--
Ricardo (http://r.untroubled.be/)

Ricardo Catalinas Jiménez

unread,
Jun 9, 2012, 8:17:33 AM6/9/12
to Bram Moolenaar, vim...@vim.org
On Sat, Jun 09, 2012 at 01:06:13PM +0200, Bram Moolenaar wrote:
> The maintainer of the C++ file, Ken Shan, has not contacted us for
> almost ten years. We need someone else to maintain this syntax file.

Here it is an improved patch for C++11 keywords support in the syntax
file.

I added some previously missing keywords and removed other already
present in c.vim which has C11 support.
cpp11.patch

mattn

unread,
Jun 11, 2012, 9:08:57 PM6/11/12
to vim...@googlegroups.com, Ricardo, vim...@vim.org
Hi

I'm managing vim-jp.

vim-jp is working group that hope to make developer's network in japan, and fix vim bugs, provide binary packages for MacOSX/Windows, writing blog entries about vim, provide useful plugins.

http://vim-jp.org/

We discuss in japanese and send many patches to vim-dev. We are decided to provide c/cpp syntax files support C++0x/C+11.

https://github.com/vim-jp/cpp-vim

Currently, it's applied as 'after' plugins. If you allow, We'll maintenance it from now if possible.

License of those files are VIM license.

Best Regards, Thanks.

- Yasuhiro Matsumoto

Bram Moolenaar

unread,
Jun 13, 2012, 6:22:07 AM6/13/12
to mattn, vim...@googlegroups.com, Ricardo, vim...@vim.org

Yasuhiro Matsumoto wrote:

> I'm managing vim-jp.
>
> vim-jp is working group that hope to make developer's network in
> japan, and fix vim bugs, provide binary packages for MacOSX/Windows,
> writing blog entries about vim, provide useful plugins.
>
> http://vim-jp.org/
>
> We discuss in japanese and send many patches to vim-dev. We are
> decided to provide c/cpp syntax files support C++0x/C+11.
>
> https://github.com/vim-jp/cpp-vim
>
> Currently, it's applied as 'after' plugins. If you allow, We'll
> maintenance it from now if possible.
>
> License of those files are VIM license.

Sounds good to me. If you have bigger changes, please first send a
version to vim-dev for others to make comments on. If that looks OK
then please email me the version to be included in the distribution.

Please update the header of the file accordingly, moving the maintainer
to previous maintainer.

--
'Well, here's something to occupy you and keep your mind off things.'
'It won't work, I have an exceptionally large mind.'

mattn

unread,
Jun 13, 2012, 9:51:30 PM6/13/12
to vim...@googlegroups.com, mattn, Ricardo, vim...@vim.org
> Sounds good to me. If you have bigger changes, please first send a
> version to vim-dev for others to make comments on. If that looks OK
> then please email me the version to be included in the distribution.
>
> Please update the header of the file accordingly, moving the maintainer
> to previous maintainer.

Thanks for your agreement.
To add support C++0x/C+11, we should modify c.vim also. Do you do maintenance c.vim yourself? If it is, I'll send a patch of c.vim, and update header of the file for only cpp.vim.

Thanks.

Bram Moolenaar

unread,
Jun 14, 2012, 3:08:41 PM6/14/12
to mattn, Ricardo, vim...@vim.org
Yes, I maintain c.vim. Patches are welcome.

--
Micro$oft: where do you want to go today?
Linux: where do you want to go tomorrow?
FreeBSD: are you guys coming, or what?
Reply all
Reply to author
Forward
0 new messages