" Python logger-print and vice-versa
function! SetPrintLogMaps()
echom "called"
nnoremap <buffer> <Leader>lp "lyy"lp"l5cawprint^[
nnoremap <buffer> <Leader>ll "lyy"lp"lcawself.logger.info(^O$)^[
endfunction
autocmd BufWrite,BufRead *.py :call SetPrintLogMaps()
I have this autocmd so that the mappings are set only when a python script is read or written. But the function is not being called when I open any python script.
I've just found that if I am opening the script from command-line like
vim test.py
it is not working.
But if I just open vim
and then execute :e test.py
the function is being called.