C language Use VI writing C language

Source: Internet
Author: User


1. First enter the shell command interface, enter: "VI hello.c"

entered the vi editing interface, type I into the editing state. The following procedures can be entered:

#include <stdio.h>
int main (void)
{
printf ("Hello, world\n");
return 0;
}

Press ESC to exit the edit state, and then enter ": Wq" to save and fallback to the shell command interface.


2. Then enter "Gcc-wall hello.c" to compile the program.

3. Enter "./a.out", which represents the program you just compiled.


##########################################################



# "I": Start editing

# "U": Undo Yes

# "DD": delete when moving forward

# "yy": Copy the current line to the Clipboard

# "Ctrl+r": Redo the last command

# ": N" "Jumps to n rows, n indicates line number

# G Cursor is positioned on the last line

# GG Cursor is positioned on the first line

# 50% Cursor positioned in the middle of the file

# H cursor positioned on the first line of the display

# M Cursor positioned in the middle of the display

# L cursor positioned on the last line of the display



# # # more frequently used commands in: http://blog.csdn.net/it1988888/article/details/8040568

C language Use VI writing C language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.