From 66a292d1d0b5632ee8db593214a115812ae9b64f Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sun, 13 Mar 2016 15:03:05 -0600 Subject: [PATCH 1/2] Enable parsing of chaiscript in raw strings --- syntax/cpp.vim | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/syntax/cpp.vim b/syntax/cpp.vim index aa66cef..b85148f 100644 --- a/syntax/cpp.vim +++ b/syntax/cpp.vim @@ -84,6 +84,37 @@ if version >= 508 || !exists("did_cpp_syntax_inits") delcommand HiLink endif + +function! RawStringEnableCodeSnip(filetype,start,end,textSnipHl) abort + let ft=toupper(a:filetype) + let group='textGroup'.ft + if exists('b:current_syntax') + let s:current_syntax=b:current_syntax + " Remove current syntax definition, as some syntax files (e.g. cpp.vim) + " do nothing if b:current_syntax is defined. + unlet b:current_syntax + endif + execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim' + try + execute 'syntax include @'.group.' after/syntax/'.a:filetype.'.vim' + catch + endtry + if exists('s:current_syntax') + let b:current_syntax=s:current_syntax + else + unlet b:current_syntax + endif + execute 'syntax region textSnip'.ft.' + \ matchgroup='.a:textSnipHl.' + \ start=+'.a:start.'+ end=+'.a:end.'+ + \ contains=@'.group +endfunction + + +call RawStringEnableCodeSnip("chaiscript", 'R"chaiscript(', ')chaiscript"', 'cppRawString') + + + let b:current_syntax = "cpp" " vim: ts=8 From 83469fd71b0b1a8b2e20762814fcc24c7625e2d0 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 14 Mar 2016 11:34:55 -0600 Subject: [PATCH 2/2] Update README.mkd --- README.mkd | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.mkd b/README.mkd index 919c3a3..5c2d8bb 100644 --- a/README.mkd +++ b/README.mkd @@ -1,8 +1,20 @@ # vim-cpp -This is Vim syntax files with C++11 support. `c.vim` is based on Bram Moolenaar +This is Vim syntax files with C++11 support. They are forked from vim-jp/vim-cpp +and have support fo syntax highlighting of embeded ChaiScript. + +To enable syntax highlighting wrap your embedded script in raw string literals as such: + +```cpp +std::string = R"chaiscript( + // some script +)chaiscript"; +``` + +`c.vim` is based on Bram Moolenaar and `cpp.vim` is based on Ken Shan . + ## License License of original files conform to author of them. Enhancement of changes pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy