From e833449250e82ce7161fb312bef9fce594619337 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 27 Feb 2018 09:44:08 +0100 Subject: Fixed syntax of C comments --- after/syntax/c.vim | 7 ++++--- doc/shortcuts.txt | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/after/syntax/c.vim b/after/syntax/c.vim index 0fa1fda..d08eabd 100644 --- a/after/syntax/c.vim +++ b/after/syntax/c.vim @@ -13,12 +13,13 @@ syntax match Comment "//.*" contains=Todo " clear default group for a cBlock so we can redefine it without the fold option syn clear cBlock -syn region cBlock start=/{/ end=/}/ transparent +syn region cBlock start=/{/ end=/}/ transparent " multiple single line comments in a row +syn clear cComment syn match cComment /\v\/\/.*(\_.\/\/.*)+/ fold - - +syn region cComment start="\/\*" end="\*\/" +syn region Folded start="^\/\*" end="\*\/" fold " let b:current_syntax = "c" diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 015684e..c3c5ac1 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -184,6 +184,10 @@ viB:sort = sort inner block by name :finish = from within a viml-script: stop sourcing it +[substitutions] +delete all comments: %s/\/\*\*< [^(\*\/)]*\*\///g +remove empty lines: global/^$/d +remove non-empty lines: v/^$/d [programs] gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 to CTRL-ALT-F3) -- cgit v1.2.3