From 41b737c32c9f818ee7192dbc7d646bf3675990d9 Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Thu, 15 Sep 2022 15:16:14 -0500 Subject: [PATCH] Clean up comments SPSS programmers have a terrible habit of run-on lines since the SPSS IDE wraps lines by default. SPSS programmers also like to include comment characters that don't actually denote a comment in the working file's syntax. Very common to see things like * /* comment */ or * // comment While vim is also rather unique in its choice of comment character, there's no need for the #s. --- syntax/spss.vim | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/syntax/spss.vim b/syntax/spss.vim index 41cbe09..8859cdd 100644 --- a/syntax/spss.vim +++ b/syntax/spss.vim @@ -1,12 +1,16 @@ " spss.vim -- Vim syntax file for SPSS command files (.sps). -" Language: SPSS command syntax -" Maintainer: Karel Asselberghs -" Latest Revision: 22 March 2015 -" Version: 1.0.0 -" Description: This file highlights SPSS commands (including some common command abbreviations), subcommands, comments, and strings, based upon SPSS version 22. +" Language: SPSS command syntax +" Maintainer: Karel Asselberghs +" Latest Revision: 22 March 2015 +" Version: 1.0.0 +" Description: This file highlights SPSS commands (including some common +" command abbreviations), subcommands, comments, and strings, +" based upon SPSS version 22. " TODO: -" - Recognize blank line as command terminator after a comment when there is no period as command terminator. -" - Highlight commands preceded by "-" or "+" in column 1 (used to indent commands in batch mode) +" - Recognize blank line as command terminator after a comment when there is +" no period as command terminator. +" - Highlight commands preceded by "-" or "+" in column 1 (used to indent +" commands in batch mode) if version < 600 @@ -17,7 +21,7 @@ endif syntax case ignore -" # SPSS Commands +" SPSS Commands syntax match spssCommand /^\s*\<2SLS\>/ syntax match spssCommand /^\s*\/ @@ -331,7 +335,7 @@ syntax match spssCommand /^\s*\/ " frequencies syntax match spssCommand /^\s*\/ " frequencies -" # SPSS SubCommands +" SPSS SubCommands syntax match spssSubCommand /\/\<$VARS\>/hs=s+1 syntax match spssSubCommand /\/\<1\>/hs=s+1 @@ -982,7 +986,7 @@ syntax match spssSubCommand /\/\/hs=s+1 syntax match spssSubCommand /\/\/hs=s+1 -" # SPSS Comments +" SPSS Comments " /* */ syntax region spssComment start="/\*" end=/$/ oneline contains=NONE @@ -996,13 +1000,13 @@ syntax region spssComment start="^\*" end="\.\s*$" contains=NONE syntax region spssComment start="^COMMENT" end="\.\s*$" contains=NONE -" # SPSS Strings +" SPSS Strings syntax region spssString matchgroup=Nothing start=/"/ end=/"/ oneline syntax region spssString matchgroup=Nothing start=/'/ end=/'/ oneline -" # highlight groups +" highlight group hi def link spssCommand Statement hi def link spssSubCommand Identifier @@ -1010,10 +1014,5 @@ hi def link spssComment Comment hi def link spssString Constant -" # group colours - -"hi Comment guifg=green - - let b:current_syntax = "spss" -- 2.45.2