Questions tagged [python-mode]

Python-mode is a vim plugin that helps you to create python code very quickly by utilizing libraries including pylint, rope, pydoc, pyflakes, pep8, and mccabe for features like static analysis, refactoring, folding, completion, documentation, and more. (from GH)

150 questions
29
votes
4 answers

How can I set the Python max allowed line length to 120 in Syntastic for Vim?

I'm using python-mode for Vim, I prefer for there to be 120 character lines rather than the stark 80 as defined in the PEP8 standard. In python-mode, this is easy. I just add the following to my ~/.vimrc: " Pylint configuration file let…
feoh
  • 1,281
  • 1
  • 14
  • 19
24
votes
3 answers

Set python indent to 2 spaces in emacs 23?

I am using emacs 23.1.1 on Ubuntu 10.04. I wish to program in Python with a 2-space indent. emacs looks to have a default mode for python (python.el?). I put the following in my .emacs: ;; Only spaces, no tabs (setq indent-tabs-mode nil) …
dfrankow
  • 20,191
  • 41
  • 152
  • 214
21
votes
3 answers

How to control indentation after an open parenthesis in Emacs

When I use emacs python-mode, if the last character of a line is an open parenthesis it indents the next line just one step in from the indentation of the previous line. call_some_function( …
lacker
  • 5,470
  • 6
  • 36
  • 38
17
votes
3 answers

Vim Python-Mode Folding

I recently downloaded Python-Mode. When I open a python script, my functions are folded. I can unfold easily (it's one of the movement keys when you're on top the function definition). However, I can't figure out how to re-fold the…
Eric Miller
  • 1,367
  • 4
  • 13
  • 20
17
votes
2 answers

Apply automatic pep8 fixes from QuickFix window

Background: I'm using the (fantastic) Vim plugin python-mode, which includes the pep8 linter. The :PyLint command runs all linters and opens errors in a QuickFix window. Problem: Now, let's assume I'm only using the pep8 linter, and I have a…
David Cain
  • 16,484
  • 14
  • 65
  • 75
13
votes
4 answers

Syntastic and Python-mode together?

I have installed python-mode in VIM. But I also have Syntastic installed. Since both do syntax checking, is there going to be a conflict? How can I turn off Syntastic for Python files? Thanks for any help
user798275
  • 441
  • 6
  • 14
12
votes
4 answers

VIM: Use python3 interpreter in python-mode

I have recently switched to vim and configured it for Python-programming using this tutorial. Before, I have made sure that vim supports python3 (vim --version shows +python/dyn and +python3/dyn) using this article. But when executing a file from…
Cord Kaldemeyer
  • 6,405
  • 8
  • 51
  • 81
11
votes
1 answer

How can I access directory-local variables in my major mode hooks?

I have defined a .dir-locals.el file with the following content: ((python-mode . ((cr/virtualenv-name . "saas")))) In my .emacs I have the following function to retrieve this value and provide a virtualenv path: (defun cr/virtualenv () (cond…
Chris R
  • 17,546
  • 23
  • 105
  • 172
10
votes
2 answers

Emacs Unbind a Mode's KeyBinding

I've created a custom key binding macro as follows: (global-set-key (kbd "C-C C-c") "\C-a\C- \C-n\M-w\C-y") The problem is that C-c C-c is defined for python-send-buffer in python-mode. So my macro works for all modes except python-mode. I am…
darksky
  • 20,411
  • 61
  • 165
  • 254
10
votes
4 answers

How to uncomment code block in emacs python-mode?

I just started using python-mode in emacs and I noticed that while the major mode has an option for commenting out a region ((py-comment-region) which is bound (C-c #))there is no option to uncomment the code block which is already commented. I…
Pulimon
  • 1,776
  • 4
  • 31
  • 45
9
votes
2 answers

(Vim) Changing indent setting in Python-mode

I've just installed python-mode, and it has lots of cool features like "syntax-checking". I like to have 2-spaces of indentation for my python code but the syntax-checking is warning me that it should be 4 spaces. I believe there should be a…
songyy
  • 4,323
  • 6
  • 41
  • 63
8
votes
4 answers

Turning on linum-mode when in python/c mode

I want to turn on linum mode (M-x linum-mode) automatically with python and c mode. I add the following code in .emacs, but it doesn't seem to work. (defun my-c-mode-common-hook () (line-number-mode 1)) (add-hook 'c-mode-common-hook…
prosseek
  • 182,215
  • 215
  • 566
  • 871
8
votes
6 answers

Emacs python-mode

I'm trying to configure Emacs23.2 to work with python2.7.3, using the package python-mode.el-6.0.7 After adding to my .emacs file these LISP lines, as indicated in the INSTALL instructions,... (add-to-list 'load-path "PATH/TO/PYTHON-MODE/") (setq…
peixe
  • 1,272
  • 3
  • 14
  • 31
7
votes
5 answers

improper exiting from indentation in emacs python-mode

I am using Emacs python-mode. I invoke it using this in my .emacs (add-to-list 'load-path "~/emacs/python-mode.el-6.0.3/") (autoload 'python-mode "python-mode" "Python Mode." t) (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) (add-to-list…
user248237
6
votes
1 answer

Emacs python-mode: Keyboard shortcuts for pdb step-by-step debugging

I was wondering if there is a way to associate: n RET (next) p RET (previous) c RET (continue) C-x SPC RET (set/clear breakpoint) with function keys F1-F12 or other keyboard shortcuts. The idea is to emulate the keyboard shortcuts that other IDEs…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
1
2 3
9 10