Is there an equivalent of M-x forward-paragraph/backward-paragraph in PyCharm?

I can't find the equivalent of Emacs' M-x forward-paragraph and backward-paragraph in PyCharm. I thought it would be "Move caret until code block (end|start)" but I don't think that does what I think it does. Can someone elaborate on this functionality and if the only way to do this right now is to write my own plugin?

Mahmoud

5 comments
Comment actions Permalink

Hello Mahmoud,

It will be easier for us to answer the question if you explain what exactly

forward-paragraph does in Emac.

I can't find the equivalent of Emacs' M-x forward-paragraph and

backward-paragraph in PyCharm. I thought it would be "Move caret until

code block (end|start)" but I don't think that does what I think it

does. Can someone elaborate on this functionality and if the only way

to do this right now is to write my own plugin?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Hi Dmitry,

From Gnu Emacs, the forward-paragraph function moves caret forward to the end of the paragraph and the backward-paragraph function moves caret back to previous paragraph's beginning.

In this case, the word paragraph here means (from Emacs):

In major modes for programs, paragraphs begin and end only at blank lines. This makes the paragraph commands useful, even though there are no paragraphs as such in a program.

So, basically, what I want to do is move between blank lines. Hope this helps.
0
Comment actions Permalink

Hello Mahmoud,

At the moment there are no such navigation shortcuts in PyCharm. They can

be added by a plugin, but the plugin needs to be written in Java.

From http://www.gnu.org/s/libtool/manual/emacs/Paragraphs.html, the

forward-paragraph function moves caret forward to the end of the

paragraph and the backward-paragraph function moves caret back to

previous paragraph's beginning.

In this case, the word paragraph here means (from Emacs):

In major modes for programs, *paragraphs begin and end only at blank

lines*. This makes the paragraph commands useful, even though there

are no paragraphs as such in a program.

So, basically, what I want to do is move between blank lines. Hope

this helps.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Thanks Dmitry.

Any resources on where to get started on building a plugin? Maybe even an open source plugin I can take a look at?

Mahmoud

0
Comment actions Permalink

Hello Mahmoud,

The starting point for plugin development documentation is:

http://confluence.jetbrains.net/display/IDEADEV/PluginDevelopment

PyCharm is based on the IntelliJ Platform, so the infrormation applies to

PyCharm as well as IntelliJ IDEA.

You can also download the source code of IntelliJ IDEA Community Edition

(http://www.jetbrains.org/) and look at the code implementing other editor

actions as an example for implementing your own. The EditorActionUtil class

should be of the most relevance for this task.

Any resources on where to get started on building a plugin? Maybe even

an open source plugin I can take a look at?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.