How to enable Python support in gVim on Windows?

前端 未结 13 1961
灰色年华
灰色年华 2020-12-13 08:47

I\'m trying to get Python support in gVim on Windows. Is there a way to accomplish that?

I\'m using:

  • Windows XP SP3
  • gVim v. 7.3
  • Pytho
13条回答
  •  我在风中等你
    2020-12-13 09:21

    You will want to turn on syntax highlighting

    put syntax on in your in your vimrc (the format of the vimrc file will be the same on linux/windows or any other OS)

    Vim also supports autoindenting, if you want to enable auto indenting for python, have look at this guide here

    The key to enable autoindenting is to include the following in vimrc

    autocmd BufRead,BufNewFile *.py syntax on
    autocmd BufRead,BufNewFile *.py set ai
    autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,with,try,except,finally,def,class
    

提交回复
热议问题