ropevim = vim + rope + python

    For a python developer and vim user in one person, ropevim will bring a pleasant surprise. Finally, painless integration of rope, a python library designed for refactoring, is possible in our favorite editor. For those who have not heard of rope, I’ll briefly list some of the features: pretty smart code completion, the ability to rename variables and modules, the ability to go to the description of the object, wherever it is, auto import, and more.

    All this is based on ropemacs (from there the legs of emacs-like binders grow), which has proven itself perfectly.

    You can check if rope is installed using the command:
    $ python -c "import rope"
    if there is no output, then everything is ok.
    if we see a traceback, install it with your favorite package manager:
    $ sudo apt-get install python-rope
    or take fresh from sorsforge.

    Next, install ropevim (the ropemacs it uses is already on): Done! The functionality and hotkeys can be written in detail in the README.txt file attached to ropevim. ,) In conclusion, I only note how to quickly curb code completion for the project (probably the most useful and often used feature for many), which here really seems human. . Next, open one of the files with the project code in vim, go to insert-mode and type , after which rope indexes, and we rejoice. Well, the final touch is a beautiful addition not by M- / and M-?, Offered by default, but by the taboo familiar to everyone. Copy the piece taken from here (thanks to the author!) To ~ / .vimrc:
    $ wget
    $ tar xvf ropevim-0.2.tar.gz
    $ cd ropevim-0.2/
    $ sudo python install
    $ cp ropevim.vim ~/.vim/plugin/

    $ echo "let ropevim_vim_completion=1" >> ~/.vimrc


    function! TabWrapperRope()
    if strpart(getline('.'), 0, col('.')-1) =~ '^\s*$'
    return "\"
    return "\=RopeCodeAssistInsertMode()\"

    imap =TabWrapperRope()

    Also popular now: