vimrc: fix expandtab
This commit is contained in:
parent
d694a515f6
commit
f4fdbe044f
14
.vimrc
14
.vimrc
@ -185,14 +185,18 @@ augroup Binary
|
|||||||
au BufWritePost *.bin set nomod | endif
|
au BufWritePost *.bin set nomod | endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" detect indentation see http://www.freehackers.org/Indent_Finder
|
|
||||||
|
fu DetectIndent()
|
||||||
|
execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' )
|
||||||
if &expandtab
|
if &expandtab
|
||||||
autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' )
|
let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: Never}"
|
||||||
autocmd BufReadPost /* let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: Never}"
|
|
||||||
else
|
else
|
||||||
autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default tab --default-size ' .&tabstop .' "' . expand('%') . '"' )
|
let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: ForContinuationAndIndentation}"
|
||||||
autocmd BufReadPost /* let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: ForContinuationAndIndentation}"
|
|
||||||
endif
|
endif
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" detect indentation see http://www.freehackers.org/Indent_Finder
|
||||||
|
autocmd BufReadPost /* call DetectIndent()
|
||||||
|
|
||||||
map <C-K> :pyf ~/.vim/syntax/clang-format.py<CR>
|
map <C-K> :pyf ~/.vim/syntax/clang-format.py<CR>
|
||||||
imap <C-K> <ESC>:pyf ~/.vim/syntax/clang-format.py<CR>i
|
imap <C-K> <ESC>:pyf ~/.vim/syntax/clang-format.py<CR>i
|
||||||
|
Loading…
Reference in New Issue
Block a user