I found the following code snippet on the internet, and want to use it in my own .vimrc
.
augroup CodeFormatters
autocmd!
autocmd BufReadPost,FileReadPost *.py :silent %!PythonTidy.py
augroup END
However, I'm not quite sure where to put the PythonTidy.py
script, so that it is accessible from everywhere.
Furthermore I read that using BufReadPre
is better than BufReadPost
, respectively FileReadPre
, is that true?