From 96b0e3125ede20bf784b1b8da36c464a4872d9f4 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 14 Jan 2012 21:04:33 -0600 Subject: [PATCH] Fix line endings --- .hgeol | 2 + ftdetect/ps1.vim | 2 +- ftplugin/ps1.vim | 54 ++++++------ indent/ps1.vim | 36 ++++---- syntax/ps1.vim | 208 +++++++++++++++++++++++------------------------ 5 files changed, 152 insertions(+), 150 deletions(-) create mode 100644 .hgeol diff --git a/.hgeol b/.hgeol new file mode 100644 index 0000000..27668f4 --- /dev/null +++ b/.hgeol @@ -0,0 +1,2 @@ +[patterns] +re:.* = native diff --git a/ftdetect/ps1.vim b/ftdetect/ps1.vim index 7e33b61..5f017f7 100644 --- a/ftdetect/ps1.vim +++ b/ftdetect/ps1.vim @@ -1 +1 @@ -autocmd BufRead,BufNewFile *.ps1 set filetype=ps1 +autocmd BufRead,BufNewFile *.ps1 set filetype=ps1 diff --git a/ftplugin/ps1.vim b/ftplugin/ps1.vim index b23cd18..6101108 100644 --- a/ftplugin/ps1.vim +++ b/ftplugin/ps1.vim @@ -1,27 +1,27 @@ -" Vim filetype plugin file -" Language: Windows PowerShell -" Maintainer: Peter Provost -" Version: 1.0 -" -" $LastChangedDate $ -" $Rev $ - -" Only do this when not done yet for this buffer -if exists("b:did_ftplugin") | finish | endif - -" Don't load another plug-in for this buffer -let b:did_ftplugin = 1 - -setlocal tw=0 -setlocal commentstring=#%s -setlocal formatoptions=tcqro - -" Change the browse dialog on Win32 to show mainly PowerShell-related files -if has("gui_win32") - let b:browsefilter = "PowerShell Files (*.ps1)\t*.ps1\n" . - \ "All Files (*.*)\t*.*\n" -endif - -" Undo the stuff we changed -let b:undo_ftplugin = "setlocal tw< cms< fo<" . - \ " | unlet! b:browsefilter" +" Vim filetype plugin file +" Language: Windows PowerShell +" Maintainer: Peter Provost +" Version: 1.0 +" +" $LastChangedDate $ +" $Rev $ + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") | finish | endif + +" Don't load another plug-in for this buffer +let b:did_ftplugin = 1 + +setlocal tw=0 +setlocal commentstring=#%s +setlocal formatoptions=tcqro + +" Change the browse dialog on Win32 to show mainly PowerShell-related files +if has("gui_win32") + let b:browsefilter = "PowerShell Files (*.ps1)\t*.ps1\n" . + \ "All Files (*.*)\t*.*\n" +endif + +" Undo the stuff we changed +let b:undo_ftplugin = "setlocal tw< cms< fo<" . + \ " | unlet! b:browsefilter" diff --git a/indent/ps1.vim b/indent/ps1.vim index 06b75e6..d936633 100644 --- a/indent/ps1.vim +++ b/indent/ps1.vim @@ -1,18 +1,18 @@ -" Vim indent file -" Language: Windows PowerShell -" Maintainer: Peter Provost -" Version: 1.0 -" -" $LastChangedDate $ -" $Rev $ - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -" PS indenting is like indenting C -setlocal cindent cinoptions& cinoptions+=+0 - -let b:undo_indent = "setl cin<" +" Vim indent file +" Language: Windows PowerShell +" Maintainer: Peter Provost +" Version: 1.0 +" +" $LastChangedDate $ +" $Rev $ + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +" PS indenting is like indenting C +setlocal cindent cinoptions& cinoptions+=+0 + +let b:undo_indent = "setl cin<" diff --git a/syntax/ps1.vim b/syntax/ps1.vim index af1faa6..9bafaa9 100644 --- a/syntax/ps1.vim +++ b/syntax/ps1.vim @@ -1,104 +1,104 @@ -" Vim syntax file -" Language: Windows PowerShell -" Maintainer: Peter Provost -" Version: 2.7 -" Url: http://www.vim.org/scripts/script.php?script_id=1327 -" -" $LastChangedDate: 2007-03-05 21:18:39 -0800 (Mon, 05 Mar 2007) $ -" $Rev: 58 $ -" -" Contributions by: -" Jared Parsons -" Heath Stewart - -" Compatible VIM syntax file start -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" PowerShell doesn't care about case -syn case ignore - -" Sync-ing method -syn sync minlines=100 - -" Comments and special comment words -syn keyword ps1CommentTodo TODO FIXME XXX TBD HACK contained -syn match ps1Comment /#.*/ contains=ps1CommentTodo - -" Language keywords and elements -syn keyword ps1Conditional if else elseif switch -syn keyword ps1Repeat while default for do until break continue -syn match ps1Repeat /\/ nextgroup=ps1Cmdlet -syn keyword ps1Keyword return filter in trap throw param begin process end -syn match ps1Keyword /\/ nextgroup=ps1Cmdlet - -" Functions and Cmdlets -syn match ps1Cmdlet /\w\+-\w\+/ -syn keyword ps1Keyword function nextgroup=ps1Function skipwhite -syn match ps1Function /\w\+-*\w*/ contained - -" Type declarations -syn match ps1Type /\[[a-z0-9_:.]\+\(\[\]\)\?\]/ -syn match ps1StandaloneType /[a-z0-9_.]\+/ contained -syn keyword ps1Scope global local private script contained - -" Variables and other user defined items -syn match ps1Variable /\$\w\+/ -syn match ps1Variable /\${\w\+:\\\w\+}/ -syn match ps1ScopedVariable /\$\w\+:\w\+/ contains=ps1Scope -syn match ps1VariableName /\w\+/ contained - -" Operators all start w/ dash -syn match ps1OperatorStart /-c\?/ nextgroup=ps1Operator -syn keyword ps1Operator eq ne ge gt lt le like notlike match notmatch replace /contains/ notcontains contained -syn keyword ps1Operator ieq ine ige igt ile ilt ilike inotlike imatch inotmatch ireplace icontains inotcontains contained -syn keyword ps1Operator ceq cne cge cgt clt cle clike cnotlike cmatch cnotmatch creplace ccontains cnotcontains contained -syn keyword ps1Operator is isnot as -syn keyword ps1Operator and or band bor not -syn keyword ps1Operator f - -" Regular Strings -syn region ps1String start=/"/ skip=/`"/ end=/"/ -syn region ps1String start=/'/ end=/'/ - -" Here-Strings -syn region ps1String start=/@"$/ end=/^"@$/ -syn region ps1String start=/@'$/ end=/^'@$/ - -" Numbers -syn match ps1Number /\<[0-9]\+/ - -" Setup default color highlighting -if version >= 508 || !exists("did_ps1_syn_inits") - if version < 508 - let did_ps1_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink ps1String String - HiLink ps1Conditional Conditional - HiLink ps1Function Function - HiLink ps1Variable Identifier - HiLink ps1ScopedVariable Identifier - HiLink ps1VariableName Identifier - HiLink ps1Type Type - HiLink ps1Scope Type - HiLink ps1StandaloneType Type - HiLink ps1Number Number - HiLink ps1Comment Comment - HiLink ps1CommentTodo Todo - HiLink ps1Operator Operator - HiLink ps1Repeat Repeat - HiLink ps1RepeatAndCmdlet Repeat - HiLink ps1Keyword Keyword - HiLink ps1KeywordAndCmdlet Keyword - HiLink ps1Cmdlet Statement - delcommand HiLink -endif - -let b:current_syntax = "powershell" +" Vim syntax file +" Language: Windows PowerShell +" Maintainer: Peter Provost +" Version: 2.7 +" Url: http://www.vim.org/scripts/script.php?script_id=1327 +" +" $LastChangedDate: 2007-03-05 21:18:39 -0800 (Mon, 05 Mar 2007) $ +" $Rev: 58 $ +" +" Contributions by: +" Jared Parsons +" Heath Stewart + +" Compatible VIM syntax file start +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" PowerShell doesn't care about case +syn case ignore + +" Sync-ing method +syn sync minlines=100 + +" Comments and special comment words +syn keyword ps1CommentTodo TODO FIXME XXX TBD HACK contained +syn match ps1Comment /#.*/ contains=ps1CommentTodo + +" Language keywords and elements +syn keyword ps1Conditional if else elseif switch +syn keyword ps1Repeat while default for do until break continue +syn match ps1Repeat /\/ nextgroup=ps1Cmdlet +syn keyword ps1Keyword return filter in trap throw param begin process end +syn match ps1Keyword /\/ nextgroup=ps1Cmdlet + +" Functions and Cmdlets +syn match ps1Cmdlet /\w\+-\w\+/ +syn keyword ps1Keyword function nextgroup=ps1Function skipwhite +syn match ps1Function /\w\+-*\w*/ contained + +" Type declarations +syn match ps1Type /\[[a-z0-9_:.]\+\(\[\]\)\?\]/ +syn match ps1StandaloneType /[a-z0-9_.]\+/ contained +syn keyword ps1Scope global local private script contained + +" Variables and other user defined items +syn match ps1Variable /\$\w\+/ +syn match ps1Variable /\${\w\+:\\\w\+}/ +syn match ps1ScopedVariable /\$\w\+:\w\+/ contains=ps1Scope +syn match ps1VariableName /\w\+/ contained + +" Operators all start w/ dash +syn match ps1OperatorStart /-c\?/ nextgroup=ps1Operator +syn keyword ps1Operator eq ne ge gt lt le like notlike match notmatch replace /contains/ notcontains contained +syn keyword ps1Operator ieq ine ige igt ile ilt ilike inotlike imatch inotmatch ireplace icontains inotcontains contained +syn keyword ps1Operator ceq cne cge cgt clt cle clike cnotlike cmatch cnotmatch creplace ccontains cnotcontains contained +syn keyword ps1Operator is isnot as +syn keyword ps1Operator and or band bor not +syn keyword ps1Operator f + +" Regular Strings +syn region ps1String start=/"/ skip=/`"/ end=/"/ +syn region ps1String start=/'/ end=/'/ + +" Here-Strings +syn region ps1String start=/@"$/ end=/^"@$/ +syn region ps1String start=/@'$/ end=/^'@$/ + +" Numbers +syn match ps1Number /\<[0-9]\+/ + +" Setup default color highlighting +if version >= 508 || !exists("did_ps1_syn_inits") + if version < 508 + let did_ps1_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink ps1String String + HiLink ps1Conditional Conditional + HiLink ps1Function Function + HiLink ps1Variable Identifier + HiLink ps1ScopedVariable Identifier + HiLink ps1VariableName Identifier + HiLink ps1Type Type + HiLink ps1Scope Type + HiLink ps1StandaloneType Type + HiLink ps1Number Number + HiLink ps1Comment Comment + HiLink ps1CommentTodo Todo + HiLink ps1Operator Operator + HiLink ps1Repeat Repeat + HiLink ps1RepeatAndCmdlet Repeat + HiLink ps1Keyword Keyword + HiLink ps1KeywordAndCmdlet Keyword + HiLink ps1Cmdlet Statement + delcommand HiLink +endif + +let b:current_syntax = "powershell"