Questions tagged [python]
The python tag has no usage guidance.
72
questions
1
vote
0
answers
48
views
UnicodeDecodeError caused by the key <bs>
To simplify the problem, run following command will get the same error
:py3 print(vim.eval('"\\<bs>"'))
And the real situation is
while 1:
vimcmd("let nr = getchar()")
...
2
votes
1
answer
337
views
Ignore lines with string in errorformat
I'm writing a GitHub action that creates an annotation for files that would be reformatted when the black python formatter is run. For this, to work, I want to parse the following example output:
...
0
votes
2
answers
495
views
How to disable the quickfix window?
This is the display when I typed :AsyncRun -mode=term -pos=bottom ~/.anaconda/bin/python %.
But if I set:
filetype plugin on
map <F5> :call RunPython()<CR>
function! RunPython()
exec &...
0
votes
1
answer
29
views
Debugging python2 under windows
For a while I've been trying now to get python debugging under windows to work with a precompiled GVim to work (with dynamical python2/python3 support):
MS-Windows 32 Bit GUI Version mit OLE-...
1
vote
0
answers
128
views
Starting an interpreter and dumping the output to a new buffer
I am working on some Python code, and I would like to call an IPython interpreter from within a script. I have no problem doing this, however, I would then like to dump all of the output from both the ...
0
votes
2
answers
610
views
How to get vim using anaconda as default python3?
I am using Manjaro/Arch Linux and I use vim from sudo pacman -S vim instead of build it from source
I want to run my .py files in vim by F5 but when I added these to ~/.vimrc:
map <F5> :call ...
4
votes
1
answer
532
views
Is there a way to make vim use a python3 interpreter which is not explicitely installed under Windows 10?
I want to use a certain python interpreter instead of an installed one.
My gvim version is
VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Dec 12 2019 13:30:17)
MS-Windows 32 Bit GUI Version mit OLE-...
3
votes
1
answer
3k
views
Jedi module is not found (deoplete)
:checkhealth shows neither errors nor warnings about jedi:
health#jedi#check
====================================
## jedi
#### Jedi-vim debug information
##### jedi-vim version
- jedi-vim git ...
3
votes
1
answer
195
views
Evaluate an expression from visual selection in Python
I'd like to be able to select a part of a line, send it to a python interpreter, and have the selection replaced by the expression result. The use case is for doing math in Markdown documents:
1. Text ...
0
votes
1
answer
61
views
Adding python directory
After following some advice my vimrc contains:
set rnu
set nu
set autoindent
set pythonthreedll=C:\Program Files (x86)\Vim\vim82\autoload\python37.dll
set pythonthreehome=C:\Program Files (x86)\Vim\...
1
vote
0
answers
101
views
How to set the Bash python env and vim python env paths the same?
When I check for python version in vim file, it displays 3.6 whereas it shows python 3.7 when I check from the bash terminal. As a result, when I pip install from the terminal, it installs in the ...
1
vote
2
answers
2k
views
How to let Vim work with pyenv?
I've created some Python virtual environments:
hmanx ~ » pyenv virtualenvs
3.7.4/envs/nn (created from /home/roach/.pyenv/versions/3.7.4)
3.8.2/envs/py38 (created from /home/roach/.pyenv/versions/...
0
votes
2
answers
687
views
Do not use the system Python 3 version in Vim
I am running Ubuntu 16.04, which requires the Python 3 system version to be 3.5: updating it to 3.7 breaks the package manager.
At the same time, I want to use Vim with YouCompleteMe. YouCompleteMe ...
1
vote
1
answer
2k
views
"The ycmd server SHUT DOWN" with vim 8.1
I just upgraded my system, in the process vim was itself updated to version 8.1 (from 8.0). Now every time I start vim the following error is displayed:
The ycmd server SHUT DOWN (restart with ':...
4
votes
2
answers
585
views
How to run a single Python unittest.TestCase test in VIM?
I have two simple Python tests in my_tests.py file:
from unittest import TestCase
class MyTestCase(TestCase):
def test_true(self):
self.assertTrue(True)
def test_false(self):
...
4
votes
1
answer
943
views
Installing vim8.2 with python3.8 : Python.h not found
I have cloned the vim git repository (even tried to run git clean -xdf prior to configuring, as suggested here), then compiled with:
./configure --with-python3-command=python3.8
--with-python3-config-...
0
votes
1
answer
33
views
Is there a way to create a new file from the editior once I have a file open?
So I have the following file number11.py open in vim, this is the route I usually take to create a new file I do ESC :save number11.py, and then :x. Then from my Ubuntu terminal I do the following vim ...
0
votes
1
answer
329
views
GVim Shows Python Support Error When Opening
Every time I open up gVim there is an error that says that Python is not supported. I have checked numerous websites and everything that I have tried does not seem to work. In my vimrc file, I have ...
0
votes
1
answer
120
views
How to import library in my template python script? (not working like in vim like in the repl)
I have a python script for generating templates that's being invoked by this line in my vimrc file:
autocmd BufNewFile ~/Documents/wiki/diary/*.mkd :silent 0r !vimwiki-diary-template.py
That works. ...
4
votes
1
answer
191
views
Vim thinks Python @ operator is decorator
Python3 has the matrix multiplication operator (@) which is used to multiply numpy matrices. But when we write something like A = B @ C in vim, the @ C portion gets highlighted. Apparently Python has ...
2
votes
1
answer
169
views
UltiSnips shows error with Python `If-Else`
I am using UltiSnipswith vimtex as explained here and trying to use the snippet for Inline Math for LaTeX as shown in the link above. Everytime I try to execute the snippet it executes but immediately ...
1
vote
0
answers
93
views
Why does Gvim treat ansi escape codes differently than Vim in python code?
The following python code uses ansi escape sequences to clear the terminal screen and change the text color to red. It then prints "Hello from Vim."
print ('\033c\033[31m Hello from Vim.')
In Vim I ...