Wednesday, April 13, 2016

Python Vim

The hardest part is to get Python work with Vim for autocompletion


  1. Install Xcode, Command Line Tools, and home-brew, see home-brew
  2. Reinstall system python and vim here 
  3. Install Vundle, and autocomplete by here 
    1. git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    2. touch ~/.vimrc
    3. Change the .vimrc as in the link
    4. Add Bundle 'Valloric/YouCompleteMe' to .vimrc
    5. Open vim and :PluginInstall
    6. Add this let g:ycm_autoclose_preview_window_after_completion=1 map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR> to .vimrc
    7. Go to .vim/bundle/YouCompleteMe and do ./install.py --clang-interpreter to compile
    8. Possible increase waiting time in ~/.vim/YouCompleteMe/python/ycm/client/completion_request.py to 2seconds
  4. Do other things like: check for code error (pyflake8), NerdTree for navigation files, Powerlines

    
    

No comments:

Post a Comment