pythonvim安裝
1. 如何安裝vim-python插件
用戶自己的插件放在 ~/.vim/ftplugin 下面,插件的文件名應當是 <文件類型.vim>. 針對同一個文件類型有很多插件的, 可以在上述目錄下建立子目錄 (和文件類型一致), 例如建立 ~/.vim/ftplugi/tex 目錄,然後把有關 tex 和 latex 的插件都放在這個目錄中,這時候子目錄下的文件名可以隨便取,只要以 .vim 為後綴即可.
系統級的插件放在 /usr/local/share/vim/vim74/ftplugin 下面 (這是你自己編譯安裝的 vim,而且是配置在 /usr/local 中,系統自帶的 vim 則放在 /usr/share/vim/vim74/ftplugin 下面,這裏的 74 是 vim 的版本號 7.4 的縮寫,其他版本類似)。
2. 安裝linux時會預裝python和vim么
系統安裝盤里都有,並且一般預設是安裝的
3. vim不支持python,是不是缺少什麼東西
問題可能來自兩方面: vim 沒有把 python 支持特性編譯進來;或者編譯支持的 python 與本地安裝的版本不兼容。
1. 只有編譯的時候帶了 python 支持的 vim 才能使用相關的功能。要想知道 vim 是否帶了編譯時的支持,使用:
:version
看有沒有 +python 之類的字樣。如果是 + 號,表示支持,如果是 - 號就是不支持(像我截圖中標出的 postscript 就是 -)。python 代表 python 2,python3 表示 python 3 的支持情況。
pythonthreedll=python35.dll
這樣你的電腦里必需要安裝 python 3.5 才可以配合 vim 使用。注意一定要是標准版的才行,定製版(比如 Anaconda)是不行的。
vim 和 python 有相當深入的交互。除了簡單的交互執行 python 語句和返回結果外,vim 的內部的數據結構(比如緩沖區、窗口之類的)和 vim-script 腳本的執行介面也全對 python 開放。因此對 python 各版本支持的靈活性就要差一些,需要在編譯階段就確定。
如果想兼容你電腦上已有的 python,需要在你的電腦上重新編譯 vim,這通常比較困難。在你的電腦上配置兩套 python 環境要相對容易很多。或者如果你對 python 的要求並不高的話,就用 vim 支持的那版也行。
以上的回答假定您已經對 python 有一定的了解,並且可以自己正確的安裝和配置 python 的環境。如果拋開 vim,python 都不能正確執行,那麼需要先解決 python 的安裝和配置問題。
4. ubuntu怎麼給vim添加python支持
如未安裝vim,使用下面命令安裝:
[python] view plain
sudo apt-get install vim
在用戶目錄下創建.vim目錄,其下創建bundle目錄:
[python] view plain
mkdir .vim\bundle
安裝Bundle/Vundle:
[python] view plain
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
創建或編輯用戶目錄下的.vimrc文件,添加如下內容:
[python] view plain
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
" Prefer spaces to tabs
set tabstop=4
set shiftwidth=4
set expandtab
set nu!
打開vim,鍵入命令「:BundleInstall」,等待自動安裝插件完成(下面顯示「done」)
在vim中鍵入命令「:BundleList」可以查看安裝的插件。
5. 為什麼vim可以使用python安裝版,不能使用綠色版
1. 使用Python自帶的來IDLE 在開始-->程序-->Python2.5(視你安裝源的版本而不同)中找到IDLE(Python GUI),
點擊後彈出如下窗體:
在>>>提示符後輸入代碼,回車,就可以執行此代碼。
IDLE支持語法高亮,支持自動縮進,支持方法提示,不過提示的很慢。
2. 在命令行窗口上運行 這種方法的前提是:你在系統的PATH變數中配置了Python的安裝路徑。
右鍵我的電腦-->屬性-->高級-->環境變數,在系統變數列表中找到Path項,點擊編輯按鈕,在其中追加「C:\Python25;」(路徑及版本視你安裝而定),保存退出。
開始-->運行-->輸入cmd,回車,開啟一個CMD窗口。
6. vim 用什麼安裝python的庫
如未安裝vim,使用下面命令安裝:
[python] view plain
sudo apt-get install vim
在用戶目錄下創建.vim目錄,其下創建bundle目錄:
[python] view plain
mkdir .vim\bundle
安裝Bundle/Vundle:
[python] view plain
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
創建或編輯用戶目錄下的.vimrc文件,添加如下內容:
[python] view plain
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
" Prefer spaces to tabs
set tabstop=4
set shiftwidth=4
set expandtab
set nu!
打開vim,鍵入命令「:BundleInstall」,等待自動安裝插件完成(下面顯示「done」)
在vim中鍵入命令「:BundleList」可以查看安裝的插件。
7. 如何配置vim的python開發環境
這是一個相當不錯的 Python 代碼自動完成的腳本。
可以實現下面python代碼的自動補全:
簡單python關鍵詞補全
python 函數補全帶括弧
python 模塊補全
python 模塊內函數,變數補全
from mole import sub-mole 補全
8. ubuntu怎麼安裝有python3支持的vim
如未安裝vim,使用下面命令安裝:
sudo apt-get install vim
在用戶目錄下創建.vim目錄,其下創建bundle目錄:
mkdir .vim\bundle
安裝Bundle/Vundle:
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
創建或編輯用戶目錄下的.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
" Prefer spaces to tabs
set tabstop=4
set shiftwidth=4
set expandtab
set nu!
打開vim,鍵入命令「:BundleInstall」,等待自動安裝插件完成(下面顯示「done」)
在vim中鍵入命令「:BundleList」可以查看安裝的插件。
9. 怎麼裝python編輯器vim
增加tab鍵長度為4的,在/etc/vimrc裡面設置set tabstop=4,效果如下
設置語法高亮,主要是設回置syntax on
下載安裝vundle,如下目錄
安裝好之答後,用VundleInstall安裝nerdtree,
上面顯示正在安裝,之後安裝完成就可以看到