Welcome Guest

Ruby Plus

Free Ruby and Rails Screencasts
Navigation: Home | Services | Mentoring | Login | Signup | Archive | RSS Feed

Search

 

Services

Hire Us

Become a Member

Sign up for free membership and get notifications for members only free Ruby and Rails screencasts. Privacy

Rails Meetup

If you live in the bay area, check out Silicon Valley Ruby Meetup

Home Office

For those who are curious, here is my Home Office

Recommend Me

Recommend Me

Please Support

Greenpeace

Subscribe to RSS

Bookmark this Site

Required

Get Quicktime Player
94
September 16, 2009
Discuss

vi editor

When you want to work on unix systems, you need to know the basics of using an editor like vi. This will help you to do basic tasks on remote server such as staging, production etc where you don't have your favorite IDE / text editor. This episode covers the basics required to use vi editor.

Here is the notes:

 vi demo.txt

~ means that the file is empty. It will disappear when you add lines to the file.

:q! - Quit without saving work

Press i to enter Input mode. It allows text to be typed into the file.

Escape will take the vi to Command Mode (Beeps if it is already in command mode)

:set number [ENTER] will display line numbers

:set nonumber to turn off numbering

i - Insert before the cursor
a - append after the cursor

:help insert - Shows help for insert feature

j or down arrow Moves cursor down

Control-D - Scroll Down
Control-U - Scroll Up
(Half a window at a time)

:q! - Closes the help window

hjkl - To move cursor

x - Delete character
dw - Delete word
dd - Delete a line
u - Undo the previous command (can do multiple undo's)
:redo - Redo (can do multiple redo's)
o - Open a new line below the cursor
O - Open a new line above the cursor
w - Move forward one word at a time
b - Move backward one word at a time

Control-F - Page Down
Control-B - Page Up

:line_number - Go to the line number
r - Replace one character
R - Replace till escape is hit
:s/old/new - Substitute string
~ - Changes case
yy - Yank
p - Paste

 Recommended Book

A Practical Guide to UNIX(R) for Mac OS(R) X Users

Signup now to download the episode for free.

Recommend Me
Privacy Policy | Site Map
Copyright © 2007 - 2008, rubyplus.org