From 672ce9379df476edf589fa41ed01954929f4225a Mon Sep 17 00:00:00 2001 From: Chiel92 Date: Sat, 15 Dec 2012 11:05:34 +0100 Subject: [PATCH] bugfixes on cpp.vim and ftplugin loading --- ftplugin/c.vim | 5 +++++ ftplugin/cpp.vim | 7 ++++++- ftplugin/cs.vim | 5 +++++ ftplugin/html.vim | 5 +++++ ftplugin/java.vim | 5 +++++ ftplugin/javascript.vim | 5 +++++ ftplugin/php.vim | 5 +++++ ftplugin/python.vim | 5 +++++ 8 files changed, 41 insertions(+), 1 deletion(-) diff --git a/ftplugin/c.vim b/ftplugin/c.vim index 9475441..2b1cfee 100644 --- a/ftplugin/c.vim +++ b/ftplugin/c.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "Set the formatter name and arguments for this filetype let s:prgname = "astyle" let s:arguments = "--mode=c --style=ansi" diff --git a/ftplugin/cpp.vim b/ftplugin/cpp.vim index ed62aff..2b1cfee 100644 --- a/ftplugin/cpp.vim +++ b/ftplugin/cpp.vim @@ -1,6 +1,11 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "Set the formatter name and arguments for this filetype let s:prgname = "astyle" -let s:arguments = "--mode=cpp --style=ansi" +let s:arguments = "--mode=c --style=ansi" "Set the formatprg option, if the formatter is installed "globally or in the formatters/ folder diff --git a/ftplugin/cs.vim b/ftplugin/cs.vim index 1a21b8f..3d22142 100644 --- a/ftplugin/cs.vim +++ b/ftplugin/cs.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "Set the formatter name and arguments for this filetype let s:prgname = "astyle" let s:arguments = "--mode=cs --style=ansi" diff --git a/ftplugin/html.vim b/ftplugin/html.vim index 0b527fd..becbd91 100644 --- a/ftplugin/html.vim +++ b/ftplugin/html.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + set expandtab set tabstop=2 set shiftwidth=2 diff --git a/ftplugin/java.vim b/ftplugin/java.vim index 1455c34..df0e4a0 100644 --- a/ftplugin/java.vim +++ b/ftplugin/java.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "Set the formatter name and arguments for this filetype let s:prgname = "astyle" let s:arguments = "--mode=java --style=ansi" diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim index 3d3a0b0..d84f662 100644 --- a/ftplugin/javascript.vim +++ b/ftplugin/javascript.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "Besides installing the js-beautify globally or in the "formatters/ folder, cloning the repository as a vim bundle "is supported as well. diff --git a/ftplugin/php.vim b/ftplugin/php.vim index a28ed2f..7641ced 100644 --- a/ftplugin/php.vim +++ b/ftplugin/php.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "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" diff --git a/ftplugin/python.vim b/ftplugin/python.vim index 8426bdf..6eb5314 100644 --- a/ftplugin/python.vim +++ b/ftplugin/python.vim @@ -1,3 +1,8 @@ +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + "Set the formatter name and arguments for this filetype let s:prgname = "autopep8" let s:arguments = "/dev/stdin"