Hacker News new | past | comments | ask | show | jobs | submit login

You also execute a selection with ":w !sh". For example, if I have a line that says 'echo "Hello, world!"' I can select the line with Shift-V and then ":w !sh" to execute the line in the shell. Works with other interpreters too so ":w !perl" would execute it in perl. The vim command should show "'<,'>" between the ':' and 'w'. Using it without selecting something first sends the whole buffer to the interpreter.



> The vim command should show "'<,'>" between the ':' and 'w'.

I've always wondered about this; I sometimes get it (but don't know how to reproduce it) when trying to navigate. What does it mean?


It's a motion command that means from the beginning of the selected area to the end. It's really two different commands ("'<" and "'>") and there is a good description of them in the vim help (":help '<" will bring you there).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: