I'm looking for the VI/VIM equivalent of 'gg' and 'Shift+g' but within PyCharm. Searched through their docs and didn't find anything.
Asked
Active
Viewed 924 times
3 Answers
4
First: Do the standard plain-text shortcuts ctrl + home and ctrl + end not work in PyCharm?
Second: If you're a Vim user, I can personally recommend IdeaVim. It's a vim emulator plugin for Idea, and google tells me that it works just as well with PyCharm.
SBI
- 769
- 4
- 9
-
1I forgot to mention that I am a mac user, so I don't have the `home` and `end` buttons. I will look into the IdeaVim option. – Paul Dec 18 '13 at 14:48
-
@Paul I haven't used a Mac in a bit, but if I'm not mistaken it should be `cmd + up arrow` and `cmd + down arrow` respectively. – SBI Dec 18 '13 at 15:07
-
1That was my gut feeling but those key combos don't move the cursor around the script. Instead, they move the IDE's focus out of the script and onto PyCharm's breadcrumbs for directory structure. – Paul Dec 18 '13 at 18:21
3
Mac OS X defaults in PyCharm are -
Cmd + Fn + <UP>: Top of the document (equivalent of gg in vi/m)
Cmd + Fn + <DOWN>: Bottom of the document (equivalent of G in vi/m)
Shreyas
- 131
- 3
-
-
well I would think mention of Cmd in itself would be a clear indication; but here you go, edited anyway. – Shreyas May 02 '16 at 10:37
-
-
I am not sure what's the difference between page and document here? by page, do you mean visible part (on the screen) of the opened document/file? – Shreyas May 06 '16 at 04:21
-
-
In vim, in addition to `gg` and `G` you can also type [50%](https://stackoverflow.com/a/35142871/5783745) to go to the middle of a file (any other % works too) – stevec Jul 28 '22 at 10:50
1
I've found that Cmd+fn+left works - it's the "Move Caret to Text Start" command. "Scroll to Top" just moves the view, but not the cursor, so as soon as you move the cursor you are back at your starting point in the code.

Pat
- 891
- 1
- 8
- 20