Vim settings for python

I have the following settings file:

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

How do I make these settings apply to python only ? Also, how can I add python coloring (e.g. textmate for each language)?

+6
source share
3 answers

I have these lines in my configuration:

 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 are looking for with coloring: Improved Python syntax, Blackboard color scheme

+3
source

Put them in vimfiles/ftplugin/python.vim (but change set to setlocal ) and add filetype plugin on to .vimrc . To highlight syntax, add syntax on to .vimrc .

+6
source

In addition to the above, try your hand at vim-janus , which adds other benefits to vim.

0
source

Source: https://habr.com/ru/post/916695/


All Articles