python vim天作之合_VIM搭建PYTHON开发环境

参考

系统

CentOS 7.3

问题记录

PEP8

添加'|'符号

au BufNewFile,BufRead *.py

set tabstop=4 |

set softtabstop=4 |

set shiftwidth=4 |

set textwidth=79 |

set expandtab |

set autoindent |

set fileformat=unix

标示不必要的空白字符

添加

highlight BadWhitespace ctermbg=red guibg=darkred

退格键backspace不能退到前一行尾

set backspace=indent,eol,start

安装YouCompleteMe

执行vim提示

YouCompleteMe unavailable: requires Vim 7.4.1578+.

因为vim版本是7.4.160所以怀疑是不是安装ycm有问题,决定自己重新编译vim一下试试(结果不行,最后还是升级到vim8.0)

使用补全功能提示

YCM core library not...need to compile YCM before using it,

需重新编译YCM

进入YCM文件夹,执行 ./install.py

报错如下:

Searching Python 2.7 libraries...

Found Python library: /usr/lib64/python2.7/config/libpython2.7.so

Found Python headers folder: /usr/include/python2.7

-- The C compiler identification is GNU 4.8.5

-- The CXX compiler identification is GNU 4.8.5

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- NOTE: You appear to be on CentOS version 7.3.1611. In order to use this application, you require a more modern compiler than the default compiler on this platform. Please install the devtoolset-6 or greater. For example, see this link: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/

CMake Error at CMakeLists.txt:217 (message):

Your C++ compiler does NOT fully support C++11.

-- Configuring incomplete, errors occurred!

See also "/tmp/ycm_build_sUJpgN/CMakeFiles/CMakeOutput.log".

ERROR: the build failed.

Install a package with repository for your system:

On CentOS, install package centos-release-scl available in CentOS repository:

$ sudo yum install centos-release-scl

On RHEL, enable RHSCL repository for you system:

$ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms

Install the collection:

$ sudo yum install devtoolset-6

Start using software collections:

$ scl enable devtoolset-6 bash

注意:要在同一个用户下执行3个命令

执行 ./install.py

报错如下:

[ 74%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o

c++: internal compiler error: Killed (program cc1plus)

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://bugzilla.redhat.com/bugzilla> for instructions.

ycm/CMakeFiles/ycm_core.dir/build.make:172: recipe for target ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o' failed

CMakeFiles/Makefile2:133: recipe for target 'ycm/CMakeFiles/ycm_core.dir/all' failed

CMakeFiles/Makefile2:145: recipe for target 'ycm/CMakeFiles/ycm_core.dir/rule' failed

Makefile:163: recipe for target 'ycm_core' failed

gmake[3]: *** [ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o] Error 4

gmake[2]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2

gmake[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2

gmake: *** [ycm_core] Error 2

ERROR: the build failed.

解决方案

sudo ./install.py 成功

但是依然报错

YouCompleteMe unavailable: requires Vim 7.4.1578+.

升级vim到8.0,成功解决,参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值