vim编译安装python
㈠ 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”可以查看安装的插件。
㈡ ubuntu怎么给vim添加python支持
1、在终端中输入 vim --version 查看是否支持 python,如果看到 +python,请关闭本页面;看到 -python 相信你苦恼多时了,往下看吧!
2、没办法只能安装 py2 包 ,以 nox 为例,在终端输入 sudo apt-get install vim-nox-py2
3、安装完成后在查看是不是支持 python,显然从 +python3 换成了 +python。你想要两个都要加号,给你一个眼神。
4、sudo update-alternatives --config vim 可以让你在 python 和 python3 之间切换,如图 1 就是 python3,2 就是 python了。
㈢ python在vim中怎么用
Python在vim中怎么用?
1、安装Python
2、将安装路径,如C:Python34放到Path
3、在Vim中打开文件xxx.py
4、在vim中执行: :!python.exe %
%:标识当前所编辑文件,会被该文件名替换。
更多Python知识,请关注:Python自学网!!
㈣ 在vim中pyflakes.vim需要python编译怎么办
1
错误提示如下:the pyflakes.vim plugin requires Vim to be compiled with +python大体上的意思是pyflakes.vim插件需要编译。
2
解决方法可以去github重新下载一个pyflakes.vim。执行如下命令git clone --recursive kevinw/pyflakes-vim.git
3
然后进入git克降目录,./pyflakes-vim/ftplugin,通过如下命令将python目录下的所有文件复制到~/.vim/ftplugin目录下即可。cp -R ./python/ ~/.vim/ftplugin/ 复制完成后,再用vim打开python源码文件就不会出现1中的错误了。
㈤ 怎么使用vim编译python
vim只能修改文件,不能编译。
比方说你可以直接在终端输入vim Code.py来打开文件并修改之类的。
如果要编译,就要在终端输入Python Code.py
那么他会自行对该文件编译然后直接运行
㈥ 如何使vim下开发python调试更方便
首先得确认操作系统,如果是Linux的话,vim编译的时候会打开python特性,Windows的话需要自己重新编译。
其次确保系统已经有Python环境。
最后可以在cmdline下使用
python2:py print "Hello"
python3:py print("Hello")
来查看是否配置成功。
之后就可以使用omni补全import导入的关键词等等。另外可以安装个自动补全插件来自动补全。
㈦ 在BSD下编译VIM(带python)支持的一些问题
如果要调整编译选项,可以去 src/Makefile 里做调整。
通常需要去掉一些行的注释。 Makefile 里有详细的注释,看着做就行。
如果您已经编译成功了,那么欢迎您在这里介绍一下您的经验。我还没有自己编译过 vim。