How to enable map command only when filetype is 'perl'?
something like:
if(&ft=='perl')
map ,pt <ESC>:%! perltidy<CR>
endif
but it doesn't work.
I found the shorter way.
Add this line to your ~/.vimrc
au FileType perl nnoremap <buffer> _t <ESC>:%! perltidy<CR>