Commit 1132b1dd authored by Mathieu Maret's avatar Mathieu Maret

Add indent finder

Indent finder search for current indentation in the file
parent 095b5458
This diff is collapsed.
" Done in .vimrc
augroup IndentFinder
au! IndentFinder
au BufRead *.* let b:indent_finder_result = system('python2 -c "import indent_finder; indent_finder.main()" --vim-output "' . expand('%') . '"' )
au BufRead *.* execute b:indent_finder_result
"
" " Uncomment the next line to see which indentation is applied on all your loaded files
" " au BufRead *.* echo "Indent Finder: " . b:indent_finder_result
augroup End
......@@ -62,6 +62,23 @@ highlight link cSpaceError SpaceError
highlight link pythonSpaceError SpaceError
highlight SpaceError ctermfg=235 cterm=reverse
if has("autocmd")
" enable file type detection and do language-dependent indenting
" filetype plugin indent on
" detect indentation see http://www.freehackers.org/Indent_Finder
if has('python')
autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output "' . expand('%') . '"' )
endif
else
" auto-indent
set autoindent
" smart-indent
set smartindent
" C-indent
"set cindent
" indent-expr
"set indentexpr ""
endif
"""""""""
" Plugin"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment