I received this error when i tab in vim.
Traceback (most recent call last):
File "< string >", line 1, in < module >
File "utils.py", line 15, in write
current_buffer.append('some text')
vim.error: Vim:E523: Not allowed here
I have the current .vim file
if expand("%:e") == 'xml'
inoremap <expr> <tab> WriteFile()
endif
function! WriteFile()
python3 utils.write()
endfunction
and this .py file
import vim
def write():
current_buffer = vim.current.buffer
current_buffer.append('some text')