From 005835befea2072a1bc10ecaa74f5005c225a4cb Mon Sep 17 00:00:00 2001 From: Chiel92 Date: Fri, 8 Mar 2013 18:24:10 +0100 Subject: [PATCH] formatprg defaults changed, samples added and renamed --- plugin/autoformat.vim | 6 ------ plugin/formatprgdefaults.vim | 14 ++++++++++---- samples/csharp.cs | 1 + samples/{html-test.html => html.html} | 0 samples/{js-test.js => js.js} | 0 samples/{js-test2.js => js2.js} | 0 samples/{php-test.php => php.php} | 0 samples/{python-test.py => python.py} | 0 8 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 samples/csharp.cs rename samples/{html-test.html => html.html} (100%) rename samples/{js-test.js => js.js} (100%) rename samples/{js-test2.js => js2.js} (100%) rename samples/{php-test.php => php.php} (100%) rename samples/{python-test.py => python.py} (100%) diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim index 338bb93..2787a73 100644 --- a/plugin/autoformat.vim +++ b/plugin/autoformat.vim @@ -50,9 +50,3 @@ au FileType * call s:set_formatprg() "When current buffer changes, store b:formatprg into &formatprg au BufEnter * if exists("b:formatprg") | let &formatprg = b:formatprg - -"Set indent behaviour to match with the formatprg defaults -set expandtab -set tabstop=4 -set softtabstop=4 -set shiftwidth=4 diff --git a/plugin/formatprgdefaults.vim b/plugin/formatprgdefaults.vim index f6fd59d..643b7be 100644 --- a/plugin/formatprgdefaults.vim +++ b/plugin/formatprgdefaults.vim @@ -1,11 +1,11 @@ let g:formatprg_cs = "astyle" -let g:formatprg_args_cs = "--mode=cs --style=ansi -p -P -c" +let g:formatprg_args_cs = "--mode=cs --style=ansi -p -c -H" let g:formatprg_c = "astyle" -let g:formatprg_args_c = "--mode=c --style=ansi -p -P -c" +let g:formatprg_args_c = "--mode=c --style=ansi -p -c -H" let g:formatprg_cpp = "astyle" -let g:formatprg_args_cpp = "--mode=c --style=ansi -p -P -c" +let g:formatprg_args_cpp = "--mode=c --style=ansi -p -c -H" let g:formatprg_java = "astyle" -let g:formatprg_args_java = "--mode=java --style=ansi -p -P -c" +let g:formatprg_args_java = "--mode=java --style=ansi -p -c -H" let g:formatprg_php = "phpCB" let g:formatprg_args_php = "--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" let g:formatprg_python = "autopep8" @@ -17,6 +17,12 @@ let g:formatprg_args_html = "-q --show-errors 0 --show-warnings 0 --indent auto let g:formatprg_javascript = "js-beautify" let g:formatprg_args_javascript = "-i" +"Set default indent behaviour to match with the formatprg defaults +set expandtab +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 + "We allow an alternative path for js-beautify "If js-beautify is installed as a bundle, we still want to detect it let s:bundleDir = fnamemodify(expand(""), ":h:h:h") diff --git a/samples/csharp.cs b/samples/csharp.cs new file mode 100644 index 0000000..ba1c867 --- /dev/null +++ b/samples/csharp.cs @@ -0,0 +1 @@ +using System; class Program{static int Main(string[] args){Console.WriteLine(args[0]);int i=0;i++;return 0;}} diff --git a/samples/html-test.html b/samples/html.html similarity index 100% rename from samples/html-test.html rename to samples/html.html diff --git a/samples/js-test.js b/samples/js.js similarity index 100% rename from samples/js-test.js rename to samples/js.js diff --git a/samples/js-test2.js b/samples/js2.js similarity index 100% rename from samples/js-test2.js rename to samples/js2.js diff --git a/samples/php-test.php b/samples/php.php similarity index 100% rename from samples/php-test.php rename to samples/php.php diff --git a/samples/python-test.py b/samples/python.py similarity index 100% rename from samples/python-test.py rename to samples/python.py