Bash's output multi-line and Vim's full selection

Source: Internet
Author: User

Using the cat command with the output character > to output multiple lines of text in a bash script is the most straightforward approach.

Cat >out.file <<eof

Start a line

...

...

A line again

Eof

Note that EOF, as an identifier, marks the beginning and end of the text, which can be any character, but must not be duplicated with the text content.

Can also be written as:

Cat <<eof >out.file

Start a line

...

...

A line again

Eof

Second, the entire selection of vim.

1, $y Copy all, not select all
DG This is the deletion of the line from the cursor to the last line (including the contents of the line where the cursor is located)
GGVG Select All

Explain the above command.
GG allows the cursor to move to the first line, the VIM is valid, VI is not valid
V is entering visual (visual) mode
G cursor moves to the last line
After selecting the content, you can do something else, such as:
D Delete Selection
Y Copy the selection to number No. 0 register
"+y Copy the selection to the + register, which is the clipboard of the system for other programs

Bash's output multi-line and Vim's full selection

Related Article

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.