CornSmith
CornSmith

Reputation: 2037

How can I run a normal command after scripts load?

I'm trying to start vim from command line and have it jump to a certain place in the file and run <c-c>g to trigger goto_definition in python-mode.

So far running vim filename "+call cursor(x, y)" does at least get me to the position I want, but now how do I run <c-c>g afterwards?

If I try vim % "+call cursor(x, y)" -c "normal! <c-c>g" I get a "not an editor command" error

Upvotes: 0

Views: 82

Answers (1)

YLJ
YLJ

Reputation: 2996

Try

vim FILENAME -c "call cursor(x, y)" -c "call pymode#rope#goto_definition()"

<c-c>g is actually bind to function pymode#rope#goto_definition(). You can look up in :map to see the mapping.

Refer to here if you're interested in why not an editor command error occured.

Upvotes: 1

Related Questions