Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
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
add comment

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

share|improve this answer
3  
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
    
In mc on Lion Fn + arrows only works right for me. ^f, ^b keys loads previous\next file in current folder. Thanks –  kradmiy Jun 13 '12 at 9:35
add comment

Vim commands (these aren't mac specific):

end of line: $

start of line: 0

page down: ctrl+f

page up: ctrl+b

share|improve this answer
add comment

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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