From 01539b7d76e462409e347aa76c38dad5a9e81b09 Mon Sep 17 00:00:00 2001 From: Chiel92 Date: Wed, 13 Mar 2013 18:51:26 +0100 Subject: [PATCH] a little try --- plugin/autoformat.vim | 2 +- plugin/defaults.vim | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim index 9d7e472..4f60fee 100644 --- a/plugin/autoformat.vim +++ b/plugin/autoformat.vim @@ -48,7 +48,7 @@ function! s:set_formatprg() let s:formatprg_args = "" if exists(s:formatprg_args_var) - let s:formatprg_args = eval(s:formatprg_args_var) + let s:formatprg_args = eval(eval(s:formatprg_args_var)) endif "Set correct formatprg path, if it is installed diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 46c4c54..5d96102 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -1,24 +1,24 @@ if !exists("g:formatprg_cs") | let g:formatprg_cs = "astyle" | endif -if !exists("g:formatprg_args_cs") | let g:formatprg_args_cs = "--mode=cs --style=ansi -p -c -H" | endif +if !exists("g:formatprg_args_cs") | let g:formatprg_args_cs = '"--mode=cs --style=ansi -pcHs".&softtabstop' | endif if !exists("g:formatprg_c") | let g:formatprg_c = "astyle" | endif -if !exists("g:formatprg_args_c") | let g:formatprg_args_c = "--mode=c --style=ansi -p -c -H" | endif +if !exists("g:formatprg_args_c") | let g:formatprg_args_c = '"--mode=c --style=ansi -pcHs".&softtabstop' | endif if !exists("g:formatprg_cpp") | let g:formatprg_cpp = "astyle" | endif -if !exists("g:formatprg_args_cpp") | let g:formatprg_args_cpp = "--mode=c --style=ansi -p -c -H" | endif +if !exists("g:formatprg_args_cpp") | let g:formatprg_args_cpp = '"--mode=c --style=ansi -pcHs".&softtabstop' | endif if !exists("g:formatprg_java") | let g:formatprg_java = "astyle" | endif -if !exists("g:formatprg_args_java") | let g:formatprg_args_java = "--mode=java --style=ansi -p -c -H" | endif +if !exists("g:formatprg_args_java") | let g:formatprg_args_java = '"--mode=java --style=ansi -pcHs".&softtabstop' | endif if !exists("g:formatprg_python") | let g:formatprg_python = "autopep8" | endif -if !exists("g:formatprg_args_python") | let g:formatprg_args_python = "/dev/stdin" | endif +if !exists("g:formatprg_args_python") | let g:formatprg_args_python = '"/dev/stdin"' | endif if !exists("g:formatprg_xml") | let g:formatprg_xml = "tidy" | endif -if !exists("g:formatprg_args_xml") | let g:formatprg_args_xml = "-q -xml --show-errors 10 --show-warnings 10 --indent auto --indent-spaces 4 --vertical-space yes --tidy-mark no --wrap 68" | endif +if !exists("g:formatprg_args_xml") | let g:formatprg_args_xml = '"-q -xml --show-errors 10 --show-warnings 10 --indent auto --indent-spaces ".&softtabstop." --vertical-space yes --tidy-mark no --wrap 68"' | endif if !exists("g:formatprg_html") | let g:formatprg_html = "tidy" | endif -if !exists("g:formatprg_args_html") | let g:formatprg_args_html = "-q --show-errors 0 --show-warnings 0 --indent auto --indent-spaces 4 --vertical-space yes --tidy-mark no --wrap 68" | endif +if !exists("g:formatprg_args_html") | let g:formatprg_args_html = '"-q --show-errors 0 --show-warnings 0 --indent auto --indent-spaces ".&softtabstop." --vertical-space yes --tidy-mark no --wrap 68"' | endif if !exists("g:formatprg_xhtml") | let g:formatprg_xhtml = "tidy" | endif -if !exists("g:formatprg_args_xhtml") | let g:formatprg_args_xhtml = "-q --show-errors 0 --show-warnings 0 --indent auto --indent-spaces 4 --vertical-space yes --tidy-mark no --wrap 68 -asxhtml" | endif +if !exists("g:formatprg_args_xhtml") | let g:formatprg_args_xhtml = '"-q --show-errors 0 --show-warnings 0 --indent auto --indent-spaces ".&softtabstop." --vertical-space yes --tidy-mark no --wrap 68 -asxhtml"' | endif if !exists("g:formatprg_javascript") let g:formatprg_javascript = "js-beautify" @@ -34,11 +34,3 @@ endif if !exists("g:formatprg_args_javascript") let g:formatprg_args_javascript = "-i" endif - -"Set default indent behaviour to match with the formatprg defaults -if !exists("g:autoformat_no_default_shiftwidth") - set expandtab - set tabstop=4 - set softtabstop=4 - set shiftwidth=4 -endif