~dricottone/vim-spss

41b737c32c9f818ee7192dbc7d646bf3675990d9 — Dominic Ricottone 2 years ago 89f84f4 dev
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.
1 files changed, 16 insertions(+), 17 deletions(-)

M syntax/spss.vim
M syntax/spss.vim => syntax/spss.vim +16 -17
@@ 1,12 1,16 @@
" spss.vim -- Vim syntax file for SPSS command files (.sps).
" Language:	SPSS command syntax
" Maintainer:	Karel Asselberghs <k.asselberghs@gmail.com>
" 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 <k.asselberghs@gmail.com>
" 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*\<ACF\>/


@@ 331,7 335,7 @@ syntax match spssCommand /^\s*\<FREQ\>/               " frequencies
syntax match spssCommand /^\s*\<FRE\>/                " 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 /\/\<ZCOMPRESSED\>/hs=s+1
syntax match spssSubCommand /\/\<ZCOMPRESSION\>/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"