up vote 2 down vote favorite
share [g+] share [fb]

I write a lot of python in my VIM, on the terminal. What do I do?

link|improve this question

74% accept rate
1  
actually, if you need to ask these question, you should really consider using another editor or IDE to write python. For the matter, home => ^, end => $, page up = ^f, page down = ^b; note that you need to quit edit mode using Esc first, and then go in again by e.g. i or a.... – bubu Jun 24 '10 at 9:33
1  
@bubu bah! I say. I do all my coding in VIM, it is an excellent editor, even for python. – Jed Daniels Jun 24 '10 at 11:17
1  
Are you referring to the 'home' 'end' 'page up' 'page down' keys on your keyboard, or are you simply looking for the proper VIM navigation commands? – Stefan Lasiewski Jun 24 '10 at 18:09
feedback

3 Answers

Do the standard over-30-year-old vi shortcuts of

^f (forward == page down)
^b (back == page up)
^ (that's a shift-6 caret for start of line) and
$ (end of line)

...not work?

Or are you looking for PC-style keyboard keys for those functions? For those, use Fn + arrow keys:

Fn + down arrow == page down
Fn + up arrow == page up
Fn + left arrow == home
Fn + right arrow == end

link|improve this answer
1  
The 'Fn + arrow' key combinations don't work for me using Terminal.App and Vim. – Stefan Lasiewski Jun 24 '10 at 18:11
| is equivalent to HOME: they both go to the 0th column of the line, rather than to the first non-space character in it. – intuited Jul 17 '10 at 20:38
feedback

Vim commands (these aren't mac specific):

end of line: $

start of line: 0

page down: ctrl+f

page up: ctrl+b

link|improve this answer
feedback

If you look in the terminal keyboard settings - you can swap the actions for page up/down and shift page up/down. That works in default vim and like you'd expect on remote boxes.

gg and G are all you need for home/end. (I did spend a while trying to make it work)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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