5

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.

jww
  • 11,918
  • 44
  • 119
  • 208
Paul
  • 205
  • 2
  • 8
  • See http://stackoverflow.com/questions/20817133/in-pycharm-how-to-navigate-to-the-top-of-the-file too – Pat Oct 21 '14 at 19:50

3 Answers3

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
  • 1
    I 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
  • 1
    That 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
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.

Keymap entry

Pat
  • 891
  • 1
  • 8
  • 20