當前位置:編程學習大全網 - 網站源碼 - vim 如何設置 python 標準庫的高亮和補全

vim 如何設置 python 標準庫的高亮和補全

可以代碼添加到vim語法高亮

將下面代碼添加符合到的後面就可以了:

syn keyword pythonStatement False, None, True

syn keyword pythonStatement as assert break continue del exec global syn

keyword pythonStatement lambda nonlocal pass print return with yield syn keyword

pythonStatement class def nextgroup=pythonFunction skipwhite

syn keyword pythonConditional elif else if

syn keyword pythonRepeat for while

syn keyword pythonOperator and in is not or

syn keyword pythonException except finally raise try

syn keyword pythonInclude from import

 

可以代碼添加到vim中vim語法補全

1、修改_vimrc

2、在_vimrc文件中加入如下這幾行:

let g:pydiction_location='C:/program

files/vim/vimfiles/ftplugin/pydiction/complete-dict'

filetype plugin on

set autoindent

syntax enable

set softtabstop=4

set shiftwidth=4

set number

使用:

如果是開新的python檔案,尚未儲存為 .py,VIM不知道目前編輯的是python,所以要在vim的命令列裏面下這個指令 set

FileType=python ,之後,按tab就會列出method和attribute了

  • 上一篇:寶雞蔡家坡直播公司有哪些
  • 下一篇:pycaffe中net.blobs.data,這個data是存放什麽數據的
  • copyright 2024編程學習大全網