If I call gvim main.py -c "call cursor(41, 45)" -c "call pymode#rope#goto_definition()"

Then I get this error about parenthesis:

"main.py" [unix] 54L, 1677C
Error detected while processing command line:
E107: Missing parentheses:pymodeC:\Users\me\key_state_manager.pyropeC:\Users\me\key_state_manager.pygoto_definition()
Press ENTER or type command to continue

I'm trying to make a function for opening a definition in another gvim window.

pymode link

  • I've just cobbled together a horrible solution by having a ~/goto_def.vim file that contains autocmd VimEnter * call pymode#rope#goto_definition() and finally calling gvim main.py -c "call cursor(41, 45)" -c "source ~/goto_def.vim" – CornSmith May 28 '17 at 20:36
  • Could you copy/paste the error as text (rather than an image)? It's easier to read, and it facilitates searching, copy/pasting, etc. – Martin Tournoij May 29 '17 at 11:31
  • The problem was that I couldn't copy an error from a gvim window because it doesn't let you highlight. However I'm actually having a hard time reproducing this now that I've fixed it. I've updated python and vim since then. The problem though was escaping # symbols. I'll post my answer now and type out the error manually :) – CornSmith May 29 '17 at 19:28

The problem was that I wasn't escaping # symbols. Here's my final function which opens a new gvim window for a function under the cursor.

function! NewGvimGotoDefin()
    let loc = ' -c "call cursor(' . line(".") . ', ' . getpos(".")[2] . ')" '
    let goto_def = ' -c "call pymode\#rope\#goto_definition()" '
    execute '!start /b gvim % ' . loc . goto_def

And more generically: gvim main.py -c "call cursor(41, 45)" -c "call pymode\#rope\#goto_definition()"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.