Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Vi commands

Posted on 2014-02-04
9
Medium Priority
?
277 Views
Last Modified: 2014-04-03
I wanted to get some type of Vi commands - for dummies crash couse.

Help!
0
Comment
Question by:uppercut71412
9 Comments
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39833330
Here some articles for assistance Vi Cheat Sheet and Vi Commands
0
 
LVL 21

Expert Comment

by:netcmh
ID: 39833389
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 664 total points
ID: 39833797
vi <filename>
i - insert
(type some text)
<ESC> - go to command mode
:wq - write and quit vi

cursor movement:
i j k l - move cursor
$ - go to end of line
^ - go to beginning of line
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 664 total points
ID: 39835358
Gerwin Jansen has given you the basic commands that you can use to pretty much use vi.  I'd only add the copy and paste to this list.

Copy -- yank
Copy 1 line
yy

Copy, say, 5 lines from my cursor
5yy

Cut: same as delete, only that in delete, you don't need to paste
1 line
dd

cut/delete say 5 lines
5dd

Paste after the current cursor location -- p
Paste before the current location          -- P

Visual mode:

Things get much easier with visual mode.
Highlight within a single line  -- v
Highlight multiple lines          -- V
And then you can use d or x to cut, y to yank (copy) and p to paste as usual.
0
 
LVL 5

Accepted Solution

by:
Dave Gould earned 672 total points
ID: 39836027
I'd also add change:

change word --- cw
change to end of line -- c$

replace a character -- r
0
 
LVL 21

Expert Comment

by:netcmh
ID: 39956576
@SouthMod, it doesn't seem that the asker understood your comment. I received an answer accepted at Wed 3/26/2014 11:38 AM EST. Possibly, the same comment being selected as the answer. I object, but I couldn't find the button. Thanks
0
 
LVL 5

Expert Comment

by:Dave Gould
ID: 39956721
I must admit, I was a bit suprised to get all points for an "add-on". I would have thought that the points should have been split across all those that posted. Its also one of those questions where all posts are correct as there is no right or wrong answer.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question