日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

vim配置python代码提示,VIM配置成Python IDE

發布時間:2024/9/18 python 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vim配置python代码提示,VIM配置成Python IDE 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、~/.vimrc 文件內容:

set nocompatible? ? ? ? ? ? ? " required

filetype off? ? ? ? ? ? ? ? ? " required

set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

Plugin 'gmarik/Vundle.vim'

Plugin 'tmhedberg/SimpylFold'

Plugin 'jistr/vim-nerdtree-tabs'

Plugin 'kien/ctrlp.vim'

Plugin 'Valloric/YouCompleteMe'

Plugin 'scrooloose/nerdtree'

Plugin 'Xuyuanp/nerdtree-git-plugin'

Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}

Plugin 'kien/ctrlp.vim'

Plugin 'scrooloose/nerdcommenter'? " commenter: \cc \cu

Plugin 'vim-scripts/indentpython.vim'

Plugin 'tpope/vim-fugitive'

Plugin 'nvie/vim-flake8'

Plugin 'jnurmine/Zenburn'

Plugin 'altercation/vim-colors-solarized'

call vundle#end()? ? ? ? ? ? " required

filetype plugin indent on? ? " required

set nuset foldmethod=indentau BufWinLeave * silent mkview? " 保存文件的折疊狀態au BufRead * silent loadview? ? " 恢復文件的折疊狀態nnoremapza? ? ? ? ? ? " 用空格來切換折疊狀態nnoremap" Ctrl+N 打開/關閉map:NERDTreeToggle" 當不帶參數打開Vim時自動加載項目樹

autocmd StdinReadPre * let s:std_in=1

autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

" 當所有文件關閉時關閉項目樹窗格

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif" 不顯示這些文件let NERDTreeIgnore=['\.pyc

, '\~

, 'node_modules'] "ignore files in NERDTree" 不顯示項目樹上額外的信息,例如幫助、提示什么的let NERDTreeMinimalUI=1let g:ctrlp_working_path_mode = 'ra'set wildignore+=*/tmp/*,*/node_modules/*,*.so,*.swp,*.zip? ? let g:ctrlp_custom_ignore = {'dir':? '\v[\/]\.(git|hg|svn)

, 'file': '\v\.(exe|so|dll)

}set pastetoggle=set guifont=Inconsolata\ for\ Powerline:h15let g:Powerline_symbols = 'fancy'set encoding=utf-8set t_Co=256set fillchars+=stl:\ ,stlnc:\set term=xterm-256colorset termencoding=utf-8let mapleader=';'let g:SimpylFold_docstring_preview=1let g:ycm_autoclose_preview_window_after_completion=1mapg? :YcmCompleter GoToDefinitionElseDeclarationau BufNewFile,BufRead *.py "pthon編碼風格

\ set tabstop=4

\ set softtabstop=4

\ set shiftwidth=4

\ set textwidth=79

\ set expandtab

\ set autoindent

\ set fileformat=unix

"au BufNewFile,BufRead *.js, *.html, *.css

"\ set tabstop=2

"\ set softtabstop=2

"\ set shiftwidth=2

au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/

set encoding=utf-8

"python with virtualenv support

"py << EOF

"import os

"import sys

"if 'VIRTUAL_ENV' in os.environ:

"? project_base_dir = os.environ['VIRTUAL_ENV']

"? ? activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')

"? ? ? execfile(activate_this, dict(__file__=activate_this))

"? ? ? EOF

let python_highlight_all=1

syntax on

if has('gui_running')

set background=dark

colorscheme solarized

else

colorscheme Zenburn

endif

let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree

set clipboard=unnamed

"bash setting

autocmd BufNewFile *.py,*.sh, exec ":call SetTitle()"

let $author_name = "Aaron.Ren"

let $author_email = "kyednal@foxmail.com"

func SetTitle()

if &filetype == 'sh'

call setline(1,"\###################################################################")

call append(line("."), "\# File Name: ".expand("%"))

call append(line(".")+1, "\# Author: ".$author_name)

call append(line(".")+2, "\# mail: ".$author_email)

call append(line(".")+3, "\# Created Time: ".strftime("%c"))

call append(line(".")+4, "\##################################################################")

call append(line(".")+5, "\#!/bin/bash")

call append(line(".")+6, "")

else

call setline(1,"\###################################################################")

call append(line("."), "\# File Name: ".expand("%"))

call append(line(".")+1, "\# Author: ".$author_name)

call append(line(".")+2, "\# mail: ".$author_email)

call append(line(".")+3, "\# Created Time: ".strftime("%c"))

call append(line(".")+4, "\###################################################################")

call append(line(".")+5, "\#!/bin/python")

call append(line(".")+6, "\# -*- coding:utf-8 -*-")

call append(line(".")+7, "")

endif

endfunc

總結

以上是生活随笔為你收集整理的vim配置python代码提示,VIM配置成Python IDE的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。