Skip to main content

Questions tagged [filetype-python]

Configuring and using vi/vim to edit python code. For scripting vim using python, use the /vimscript-python tag.

Filter by
Sorted by
Tagged with
9 votes
3 answers
10k views

Vim doesn't use the correct indentation in Python files

I have encountered something that I have never seen before in Vim. While I was tentatively modifying some of the source code for software I've been planning to work on, I noticed vim was displaying ...
BenB's user avatar
  • 193
19 votes
5 answers
7k views

Vim syntax pattern to highlight python keyword argument

I'm struggling with learning vim regexps (I don't know any other regexp very well either), so the main problem is to define regexp that would match some_function_call(simple_value, keyword=value) ...
user1685095's user avatar
  • 1,141
29 votes
5 answers
3k views

How can I reformat a multi-line string in Vim when using the Python filetype?

Let's assume I am editing some Python code in Vim that looks a bit like: myobj.myfunc("Some string parameter that goes on and on and on and on and sometimes doesn't" "split ...
Andrew Ferrier's user avatar
15 votes
1 answer
12k views

How can I fix "missing" syntax highlighting for Python keywords such as "self"?

I'm trying to fix syntax highlighting for python; my colors are different from those in screenshots of what it "should" look like in different vim color schemes. And you can see the difference in ...
sl8r000's user avatar
  • 153
14 votes
1 answer
10k views

Why is "set noexpandtab" in my ~/.vimrc ignored when I open a file? [duplicate]

I'm using Mac OS X 10.12 and I have set noexpandtab in my ~/.vimrc There are 2 different behaviors : $ vim file.py If run Vim (8.0) to open one file and type :set expandtab?, it says expandtab $ vim ...
SebMa's user avatar
  • 2,988
29 votes
1 answer
7k views

End of python block motion

I need a motion that moves to end/beginning of a python block, and I need another motion that moves to begining/end of previous/next method/class (all combinations). I've tried vim-indent-object, ...
Sassan's user avatar
  • 485
24 votes
4 answers
6k views

Quickfix support for Python tracebacks

Say I have a python script with a runtime error: $ cat example.py #! /usr/bin/env python3 a = 1/0 which gives: $ python3 example.py Traceback (most recent call last): File "example.py", line ...
Nathaniel M. Beaver's user avatar
19 votes
1 answer
1k views

Do large numbers make Vim run slowly?

This seems like a really daft question, but I have a Python file that has a number in it that's a thousand digits long and that file seems to be running very slowly, I'm not sure if there's some kind ...
baxx's user avatar
  • 1,025
18 votes
1 answer
7k views

How do I disable syntastic for python files?

I have the syntastic and python-mode plugins installed and they both include syntax checkers. I think the python-mode syntax checker is more versitle for python files so I would like to just use that ...
drs's user avatar
  • 3,028
5 votes
1 answer
3k views

How can I highlight all function names in Python files?

I try to make python.vim color similar to material theme (sublime text 3), see pictures: https://i.stack.imgur.com/Zg5pp.jpg expected is material theme and current is mine. You may noticed that all ...
Tuyen Pham's user avatar
  • 1,306