A
A
Aztart2021-10-15 22:12:07
vim
Aztart, 2021-10-15 22:12:07

How to use portable Vim and Python together?

There are portable Vim, Python and this directory structure with them on Windows:

C:.
├─── portable_programs
│   ├─── vim
│   │   ├─── vim82
│   │   │   └─── vim.exe
│   │   ├─── vimfiles
│   │   ├─── _vimrc
│   ├─── portable_python
│   │   ├─── App
│   │   │   ├─── Python
│   │   │   │   └─── python.exe


Task: Run a .py file directly from portable Vim with one button using portable Python.

"Попытка 1"
let $HOME=$VIM
map <F5>      :! "~\.\..\..\portable_python\App\Python\python.exe" %<CR>

"Попытка 2"
map <F5>      :! "$VIM\..\portable_python\App\Python\python.exe" %<CR>

"Попытка 3"
$PYTHON = "C:\\portable_programs\\portable_python\\App\\Python\\python.exe"
map <F5>      :e $PYTHON %<CR>


Given that the above methods do not work, but this one works:
map <F4> :e $VIM\_vimrc <CR>

I realized that the problem is in the incompatibility of Vim's variables and the terminal.

Are there other ways to do this without changing the concept of complete portability?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question