Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim settings for python

Tags:

python

vim

I have the following settings file:

# ~/.vimrc
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set autoindent

How would I make these settings apply to python only? Also, how would I add python coloring (such as textmate does for each language) ?

like image 602
David542 Avatar asked May 25 '12 19:05

David542


People also ask

Can you use vim for Python?

Using Vim as a Python IDEThe python-mode project is a Vim plugin with syntax highlighting, breakpoints, PEP8 linting, code completion and many other features you'd expect from an integrated development environment.

How do I make vim like PyCharm?

To enjoy VIM emulation inside PyCharm, download and install PyCharm, go to File | Settings | Plugins and search for IdeaVim. Install it, restart the IDE and that's it! Give it a try, and while you're at it feel free to vote for new features and report any issues in YouTrack. Develop with pleasure!

How do I create a Python file in vim?

Write Your Python Script To write in the vim editor, press i to switch to insert mode. Write the best python script in the world. Press esc to leave the editing mode. Write the command :wq to save and quite the vim editor ( w for write and q for quit ).

How do I know if vim supports Python?

Run :ve[rsion] in command-line mode or run vim --version from Bash. If vim was compiled with Python 3, you'll find -python and +python3 . If vim was compiled with Python 2, you'll find +python and -python3 . If vim was compiled without Python support, you'll find -python and -python3 1.


1 Answers

I have these lines in my config:

filetype plugin indent on
syntax on
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 expandtab smarttab autoindent

This may be what you're looking for with the coloring: Improved Python syntax, Blackboard color scheme

like image 76
Justin Warkentin Avatar answered Sep 19 '22 17:09

Justin Warkentin