Solved

Vi commands

Posted on 2014-02-04
9
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 14

Expert Comment

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

Expert Comment

by:netcmh
ID: 39833389
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 166 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
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 166 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 168 total points
ID: 39836027
I'd also add change:

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

replace a character -- r
0
 
LVL 20

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

622 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