ホームページ  >  記事  >  運用・保守  >  vim を使用して Ubuntu で Python 環境構成を構築する

vim を使用して Ubuntu で Python 環境構成を構築する

巴扎黑
巴扎黑オリジナル
2017-06-23 14:14:542147ブラウズ

1. 完全な vim をインストールします
# apt-get install vim-gnome

2. ctags をインストールします。ctags はタグリストをサポートするために使用されます。
# apt-get install ctags

3. taglist をインストールします
#apt-get install vim-scripts
#apt-get install vim-addon-manager
# vim-addons install taglist

4. pydiction をインストールします (コードのパッチを実装します)すべて)
#wget
#unzip pydiction-1.2.zip

// ~/.vim/after/ftplugin および ~/.vim/tools/pydiction/ ディレクトリはデフォルトでは存在しないため、自分で作成する必要があります
# cp pydiction-1.2/ python_pydiction.vim ~/.vim/after/ftplugin
#cp pydiction-1.2/complete-dict ~/.vim/tools/pydiction/complete-dict

5. 設定ファイルを編集します
//~ /.vimrc で現在のユーザー構成を変更します。グローバル構成を変更する必要がある場合は、vim /etc/vim/vimrc
# vim ~/.vimrc

let Tlist_Auto_Highlight_Tag=1let Tlist_Auto_Open=1let Tlist_Auto_Update=1let Tlist_Display_Tag_Scope=1let Tlist_Exit_OnlyWindow=1let Tlist_Enable_Dold_Column=1let Tlist_File_Fold_Auto_Close=1let Tlist_Show_One_File=1let Tlist_Use_Right_Window=1let Tlist_Use_SingleClick=1nnoremap <silent> <F8> :TlistToggle<CR>filetype plugin on
autocmd FileType python set omnifunc=pythoncomplete#Completeautocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJSautocmd FileType html set omnifunc=htmlcomplete#CompleteTagsautocmd FileType css set omnifunc=csscomplete#CompleteCSSautocmd FileType xml set omnifunc=xmlcomplete#CompleteTagsautocmd FileType php set omnifunc=phpcomplete#CompletePHPautocmd FileType c set omnifunc=ccomplete#Completelet g:pydiction_location='~/.vim/tools/pydiction/complete-dict'set autoindent
set tabstop=4set shiftwidth=4set expandtab
set number
set lines=35 columns=118

が右側のタグリスト ウィンドウです。F8 を押して開きます。 Ctrl+w を使用してから w を押してコード ウィンドウを開き、タグリスト ウィンドウを切り替えます

以上がvim を使用して Ubuntu で Python 環境構成を構築するの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。