From 076a730a9ed0503a7d6f67dc9e4236ca24cb68de Mon Sep 17 00:00:00 2001 From: Chiel92 Date: Thu, 6 Dec 2012 23:34:17 +0100 Subject: [PATCH] php support added and missing astyle files added --- ftplugin/c.vim | 7 ++++++ ftplugin/cpp.vim | 7 ++++++ ftplugin/cs.vim | 7 ++++++ ftplugin/html.vim | 3 +++ ftplugin/java.vim | 7 ++++++ ftplugin/php.vim | 12 +++++---- tests/php-test.php | 62 +--------------------------------------------- 7 files changed, 39 insertions(+), 66 deletions(-) create mode 100644 ftplugin/c.vim create mode 100644 ftplugin/cpp.vim create mode 100644 ftplugin/cs.vim create mode 100644 ftplugin/html.vim create mode 100644 ftplugin/java.vim diff --git a/ftplugin/c.vim b/ftplugin/c.vim new file mode 100644 index 0000000..9475441 --- /dev/null +++ b/ftplugin/c.vim @@ -0,0 +1,7 @@ +"Set the formatter name and arguments for this filetype +let s:prgname = "astyle" +let s:arguments = "--mode=c --style=ansi" + +"Set the formatprg option, if the formatter is installed +"globally or in the formatters/ folder +call g:FindFormatter(s:prgname, s:arguments) diff --git a/ftplugin/cpp.vim b/ftplugin/cpp.vim new file mode 100644 index 0000000..ed62aff --- /dev/null +++ b/ftplugin/cpp.vim @@ -0,0 +1,7 @@ +"Set the formatter name and arguments for this filetype +let s:prgname = "astyle" +let s:arguments = "--mode=cpp --style=ansi" + +"Set the formatprg option, if the formatter is installed +"globally or in the formatters/ folder +call g:FindFormatter(s:prgname, s:arguments) diff --git a/ftplugin/cs.vim b/ftplugin/cs.vim new file mode 100644 index 0000000..1a21b8f --- /dev/null +++ b/ftplugin/cs.vim @@ -0,0 +1,7 @@ +"Set the formatter name and arguments for this filetype +let s:prgname = "astyle" +let s:arguments = "--mode=cs --style=ansi" + +"Set the formatprg option, if the formatter is installed +"globally or in the formatters/ folder +call g:FindFormatter(s:prgname, s:arguments) diff --git a/ftplugin/html.vim b/ftplugin/html.vim new file mode 100644 index 0000000..0b527fd --- /dev/null +++ b/ftplugin/html.vim @@ -0,0 +1,3 @@ +set expandtab +set tabstop=2 +set shiftwidth=2 diff --git a/ftplugin/java.vim b/ftplugin/java.vim new file mode 100644 index 0000000..1455c34 --- /dev/null +++ b/ftplugin/java.vim @@ -0,0 +1,7 @@ +"Set the formatter name and arguments for this filetype +let s:prgname = "astyle" +let s:arguments = "--mode=java --style=ansi" + +"Set the formatprg option, if the formatter is installed +"globally or in the formatters/ folder +call g:FindFormatter(s:prgname, s:arguments) diff --git a/ftplugin/php.vim b/ftplugin/php.vim index c635613..a28ed2f 100644 --- a/ftplugin/php.vim +++ b/ftplugin/php.vim @@ -1,5 +1,7 @@ -let s:prgpath-"phpCB" -let s:arguments="--space-after-if --space-after-switch --space-after-while --space-before-start-angle-bracket --space-after-end-angle-bracket --one-true-brace-function-declaration --glue-amperscore --change-shell-comment-to-double-slashes-comment --force-large-php-code-tag --force-true-false-null-contant-lowercase --align-equal-statements --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 4" -if executable(s:prgpath) - let &formatprg=s:prgpath." ".s:arguments -endif +"Set the formatter name and arguments for this filetype +let s:prgname="phpCB" +let s:arguments="--space-after-if --space-after-switch --space-after-while --space-before-start-angle-bracket --space-after-end-angle-bracket --one-true-brace-function-declaration --glue-amperscore --change-shell-comment-to-double-slashes-comment --force-large-php-code-tag --force-true-false-null-contant-lowercase --align-equal-statements --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 4" + +"Set the formatprg option, if the formatter is installed +"globally or in the formatters folder +call g:FindFormatter(s:prgname, s:arguments) diff --git a/tests/php-test.php b/tests/php-test.php index e3987e1..2459170 100644 --- a/tests/php-test.php +++ b/tests/php-test.php @@ -1,61 +1 @@ - +"; class phpVimeo { const API_REST_URL = 'http://vimeo.com/api/rest/v2'; const API_AUTH_URL = 'http://vimeo.com/oauth/authorize'; const API_ACCESS_TOKEN_URL = 'http://vimeo.com/oauth/access_token'; const API_REQUEST_TOKEN_URL = 'http://vimeo.com/oauth/request_token'; const CACHE_FILE = 'file'; private $_consumer_key = false; private $_consumer_secret = false; private $_cache_enabled = false; private $_cache_dir = false; private $_token = false; private $_token_secret = false; private $_upload_md5s = array(); public function __construct($consumer_key, $consumer_secret, $token = null, $token_secret = null){ $this -> _consumer_key = $consumer_key; $this -> _consumer_secret = $consumer_secret; if ($token && $token_secret) { $this -> setToken($token, $token_secret); } } } ?>