歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 14.04在Vim上配置Python開發環境

Ubuntu 14.04在Vim上配置Python開發環境

日期:2017/2/28 13:44:39   编辑:Linux教程

Ubuntu 14.04在Vim上配置Python開發環境

A 安裝Vim

sudo apt-get install vim

B 在用戶主目錄創建bundle文件夾

mkdir -p ~/.vim/bundle

C 安裝Vundle

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle  

D 創建或編輯用戶目錄下的.vimrc文件,添加如下內容:

    set nocompatible  
    set rtp+=~/.vim/bundle/vundle/  
    call vundle#rc()  

    " let Vundle manage Vundle  
    " required!  
    Bundle 'gmarik/vundle'  

    " The bundles you install will be listed here  
    Bundle 'scrooloose/nerdtree'  
    Bundle 'davidhalter/jedi-vim'  

    filetype plugin indent on  

    " The rest of your config follows here.  

    augroup vimrc_autocmds  
    autocmd!  
    " highlight characters past column 120  
    autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black  
    autocmd FileType python match Excess /\%120v.*/  
    autocmd FileType python set nowrap  
    augroup END  

    " NerdTree Shortcut.  
    map <f2> :NERDTreeToggle<cr>  

    " automatically change window’s cwd to file’s dir  
    set autochdir  
    autocmd vimenter * NERDTree  " 當打開vim時就顯示NERDTree 可以通過F2來打開或關閉它

    " Prefer spaces to tabs  
    set tabstop=4  
    set shiftwidth=4  
    set expandtab  
    set nu!  

E 打開vim,鍵入命令“:BundleInstall”,等待自動安裝插件完成(下面顯示“done”)

F 使用方法

例如: vim hello.py


當按下F2時就可以關掉NERDTree(如果你屏幕小的話),如下:

G 現在是不是覺得VIM特別強大 已經愛上這個編輯器了 ^_^,這下也給我寫Python程序增加了bi ge o(∩∩)o…哈哈

下面會繼續出在Vim上配置Java開發環境的詳細步驟以及很難下到的插件。

Linux下編譯安裝Vim8.0 http://www.linuxidc.com/Linux/2017-01/139210.htm

Vim學習指南 http://www.linuxidc.com/Linux/2013-08/89096.htm

Vim編輯器配置 http://www.linuxidc.com/Linux/2016-09/135460.htm

Vim編輯器使用 http://www.linuxidc.com/Linux/2016-09/135043.htm

快速學會 Vi編輯器 http://www.linuxidc.com/Linux/2013-08/88586.htm

強大的Vim 編輯器 http://www.linuxidc.com/Linux/2013-07/87544.htm

Linux文本編輯器Vim的一般用法 http://www.linuxidc.com/Linux/2016-11/137263.htm

把Vim打造成優秀的C++ IDE http://www.linuxidc.com/Linux/2016-06/132262.htm

Ubuntu 14.04升級Vim7.4到8.0 http://www.linuxidc.com/Linux/2016-11/136816.htm

Vim安裝youcompleteme自動補全插件 http://www.linuxidc.com/Linux/2016-11/137665.htm

Linux Vim編輯器使用簡單講解 http://www.linuxidc.com/Linux/2016-12/138930.htm

Copyright © Linux教程網 All Rights Reserved