0

I am normally able to use vim without any issues. But whenever I try to start it from inside a python virtual environment (both Conda and virtualenv), I get a segmentation fault.

I have identified that it is because of the Valloric\YouCompleteMe plugin. When I comment out the corresponding lines from my .vimrc everything works as expected.

I use YCM a lot in my workflow and would love to find a solution where I can use it with virtual environments.

The relevant lines in my .vimrc are as follows :

Bundle 'Valloric/YouCompleteMe'
"*****other plugins follow
call vundle#end()

" You Complete Me
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration<CR>
Nihar Sarangi
  • 4,845
  • 8
  • 27
  • 32
  • What operating system are you using? – Robᵩ Jun 30 '17 at 18:58
  • @Robᵩ I am using macOS – Nihar Sarangi Jun 30 '17 at 19:05
  • What about opening a defect against YCM? – dlmeetei Jun 30 '17 at 19:05
  • @dlmeetei Did you mean creating an issue into YCM repo? I was not sure if it is due to some mistake on my side. – Nihar Sarangi Jun 30 '17 at 19:09
  • That's right. May be you can confirm that first then by loading into debugger first. Tend to believe it will be mostly YCM as commenting that out plugins stopped the crash – dlmeetei Jun 30 '17 at 19:12
  • @dlmeetei Thanks. This is how the log looks like : `YouCompleteMe unavailable: dlopen(/Users//Programming///lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder Referenced from: /Users//Programming///lib/python2.7/lib-dynload/_io.so Expected in: flat namespace in /Users//Programming///lib/python2.7/lib-dynload/_io.so` – Nihar Sarangi Jun 30 '17 at 20:35
  • It seems like there was some issue with the vim in macOS channel being outdated. I used brew to get macVim and aliased vim to use mvim -v and that fixed the issue. – Nihar Sarangi Jun 30 '17 at 22:05

1 Answers1

1

Apparently, it is because of incompatibility with the macOS's default vim.

To fix it, use brew to install macVim. Now, you can use the vim app in macVim to get everything started again.

brew install macvim
alias vim="mvim -v"
Nihar Sarangi
  • 4,845
  • 8
  • 27
  • 32