Skip to main content

Questions tagged [vimscript-python]

For questions about the Python interface to Vim. For questions about editing Python source code, use [filetype-python] instead.

1 vote
3 answers
153 views

Whenever I open vim and type :python3 import sys; print(sys.version), it returns python3.8. I want python3 in vim to refer to python3.13. How do I do this? I'm not using NeoVim.
TheDomesticUser's user avatar
0 votes
0 answers
66 views

I am running vim 8.2.2121. I am trying to open 3 tabs One tab has instructions in it and is opened read only. Both tabs 2 and 3 create :new files and read template files into them on separate tabs. ...
leeand00's user avatar
  • 3,843
1 vote
1 answer
43 views

I've been looking at the plugin implementation of Black and I don't understand this part of the implementation for i, tabpage in enumerate(vim.tabpages): if tabpage.valid: for j, window ...
Pablo's user avatar
  • 333
1 vote
1 answer
553 views

When I try to run a Pyhton expression, I get that there is not python provider: :lua vim.fn.py3eval("2+2") ...
robertspierre's user avatar
0 votes
2 answers
43 views

A file with | in the name confuses vim. Example file: /tmp/Testchars/UTF8 Grin |😬|.. The plugin tries to run: vim.command(f"edit {chosen_file}") But Vim interprets the | as a filter: vim....
KP99's user avatar
  • 111
2 votes
1 answer
107 views

I have learned that py3eval('print(sys.path)') return the sys.path used internally by Vim. Say that i want add a new_path to the current sys.path. How shall I do? I would appreciate solutions that ...
Barzi2001's user avatar
  • 1,133
0 votes
1 answer
106 views

For example, I want to use default arguments: function! MakeOrgTable(...) let l:num_col = a:0 > 0? (a:0) : 0; python << EOF import vim vim.current.buffer[:]=make_table(vim.current.buffer, ...
Tokubara's user avatar
  • 177
-1 votes
1 answer
67 views

I'm writing a plugin to convert between word cases, and I would like to apply my filter between two marks. The conversion part is done with python, but I don't know how can I replace the text between ...
hl037_'s user avatar
  • 99
2 votes
1 answer
98 views

set textwidth=80 in my .vimrc. I have written a function to create a lorem ipsum: function! Lorem(num) python3 << EOF import random num = int(vim.eval("a:num")) words = ['...
newview's user avatar
  • 299
0 votes
1 answer
146 views

I write the function in my .vimrc which can convert string into its uppercase. function! Cap(string) python3 << EOF s = vim.eval("a:string") print(s.upper()) EOF endfunction Now i ...
newview's user avatar
  • 299
1 vote
1 answer
66 views

The syntax of UltiSnips's snippet is as below: snippet trigger_word [ "description" [ options ] ] The upper method can convert all characters in the string into upper case: "string&...
newview's user avatar
  • 299
0 votes
1 answer
134 views

I want to expand ptest into welcome python in file ending with html. Add these lines in html.snippets(located in vim-snippets/UltiSnips): snippet ptest !p print("welcome python") endsnippet ...
newview's user avatar
  • 299
1 vote
1 answer
1k views

I am trying to get UltiSnips to work with gVim on my Windows 10 machine and for some reason I keep getting the error: Error detected while processing function UltiSnips #TrackChange: line 1: E370: ...
ConlangBabble's user avatar
1 vote
0 answers
33 views

I have my package in a local folder (say C:/Users/Myself/PythonStuff/MyPackage). Next, I created a new file in C:/Users/Myself/PythonStuff where I import my package, i.e. on top of my new file I have ...
Barzi2001's user avatar
  • 1,133
1 vote
2 answers
83 views

I'm editing my ~/.vimrc this weekend, and I've run into a use case that seems to beg that I strip off indentation in an if-block. Broken use-case in my ~/.vimrc (with if-block indentation): if has('...
Mike Pennington's user avatar

15 30 50 per page
1
2 3 4 5
8