diff --git a/.vimrc b/.vimrc index 3804271..cca0d78 100644 --- a/.vimrc +++ b/.vimrc @@ -186,28 +186,13 @@ augroup Binary au BufWritePost *.bin set nomod | endif augroup END -if has("autocmd") - " detect indentation see http://www.freehackers.org/Indent_Finder - if &expandtab - autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' ) - else - autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default tab --default-size ' .&tabstop .' "' . expand('%') . '"' ) - endif -else - " auto-indent - set autoindent - " smart-indent - set smartindent - " C-indent - "set cindent - " indent-expr - "set indentexpr "" -endif - +" detect indentation see http://www.freehackers.org/Indent_Finder if &expandtab - let g:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AlignTrailingComments: true, UseTab: Never, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 95, IndentWidth: " . &tabstop ."}" + autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' ) + autocmd BufReadPost /* let g:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: Never}" else - let g:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AlignTrailingComments: true, UseTab: Always, BreakBeforeBraces: Linux, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 95, IndentWidth: " . &tabstop ."}" + autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default tab --default-size ' .&tabstop .' "' . expand('%') . '"' ) + autocmd BufReadPost /* let g:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: ForContinuationAndIndentation}" endif map :pyf ~/.vim/syntax/clang-format.py