I have the following example:
autocmd FileType python nnoremap <buffer> <leader>c :let python_file=expand('%:p')<CR>:term 'python ' . python_file<CR>
This is an example script for running python code, however whenever I try to use this keybinding in a python file I get the following error:
''python' is not recognized as an internal or external command,
What seems to be happening is that the term command may not be concatenating the strings properly ('python ' . python_file
) which I am providing it as a command.
Is there a way I can fix this?
Please note that this is just a simplified example of something which I am trying to do please do not suggest a solution such as :term python expand('%:p')
which I know will work for most common cases but it will not work in my case.