2017年5月

安装commant-t时遇到一些问题

通过 Vunble 安command-t 后,在Normal模式下输入 \t 或者 命令模式:CommandT 后,提示

command-t.vim could not load the C extension

于是乎:

进入ruby目录下编译C扩展(当然你需要安装ruby)

  cd ~/.vim/bundle/command-t/ruby/command-t
  ruby extconf.rb
  make

前提是

安装了 ruby-dev

安装好了后,遇到了<c-s>不能用,但是<c-v> <c-t>可以用的问题,
还是在 https://github.com/wincent/command-t/blob/master/doc/command-t.txt
这里找到了答案

If you find that <C-s> also doesn't work the most likely explanation
is that XON/XOFF flow control is enabled; this is the default in many
environments. This means that when you press <C-s> all input to the
terminal is suspended until you release it by hitting <C-q>. While
input is suspended you may think your terminal has frozen, but it
hasn't.

To disable flow control, add the following to your .zshrc or
.bash_profile:

stty -ixon -ixoff

如果需要切换 tab ,需要在 .vimrc 中添加 参考 另一个参考

map <C-L> :tabn<CR>
map <C-H> :tabp<CR>

安装python3.6.1后的问题error while loading shared libraries: libpython3.6m.so.1.0

运行python3 后出现:

python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

运行 ldd /usr/local/bin/python3 看看python3运行所需要的库

linux-vdso.so.1 =>  (0x00007ffdcf1f8000)
libpython3.6m.so.1.0 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0160eb3000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f0160caf000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f0160aac000)
libm.so.6 => /lib64/libm.so.6 (0x00007f01607a9000)
libc.so.6 => /lib64/libc.so.6 (0x00007f01603e8000)
lib64/ld-linux-x86-64.so.2 (0x00007f01610d9000)

查找一下文件的位置:
find / -name 'libpython3.6m.so.1.0'

/usr/local/lib/libpython3.6m.so.1.0

之后在目录 /etc/ld.so.conf.d 下,建立 python3.conf
并在 python3.conf 中加入:也就是所在的目录

/usr/local/lib/

然后运行:ldconfig

再运行python3 就可以啦

这里面用到了 /etc/ld.so.conf 这个文件,还不是很明白,有空再去理解一下。

参考:
Linux下执行python报错:error while loading shared libraries: libpython2.7.so.1.0的解决方法

在vim上安装YouCompleteMe的记录

准备
cmake (mac可以通过homebrew安装,brew install cmake,ubuntu可以通过sudo apt-get install cmake, centos下就是 yun install cmake)
Vundle 参考 https://github.com/VundleVim/Vundle.vim ,也可用pathogen来管理插件,这里使用Vundle

安装 YouCompleteMe
在文件 .vimrc 中添加
Bundle 'Valloric/YouCompleteMe'
然后进入 vim 输入
:BundleInstall

然后到目录
~/.vim/bundle/YouCompleteMe
运行
install.sh 或 install.py

安装成功后,就可以享受如果丝滑般的。。。。。

这里说明下:
安装的时候,vim的窗口没有进程条之类的,只是在最下方 显示
Processing 'Valloric/YouCompleteMe'
还以为出什么问题了呢,后来查看了下网络,发现在下载东西呢,所以就放心地继续等

##### 如果下载没有动静,可以试试科学上网 ######

可能遇到的问题: python3 需要下面这个库,编译的时候得加上 --enable-shared

/usr/local/lib/python3.4/config-3.4m/libpython3.4m.a

如果还遇到什么问题欢迎留言,一起讨论

参考:
YouCompleteMe — Ultimate Autocomplete Plugin for Vim
Vundle, the plug-in manager for Vim