Reputation: 1043
I want to run a python program directly in vim. I type
:w !python
I get error
'no module named...' or 'no such file or directory: 'file.json''.
It occurs only when I load file after opening vim. When I start vim typing gvim filename.py
, it works fine (:w !python
works). What is wrong here?
Upvotes: -1
Views: 2518
Reputation: 1043
I solved it by adding this to my _vimrc config file:
noremap <F5> :w !python %<CR>
inoremap <F5> <ESC>:w !python %<CR>
Upvotes: 0