Vim format code, coding problem?

Source: Internet
Author: User

Vim Format Code

Recently a CentOS, installed Nginx successfully configured Netcore, and then installed after the PHP configuration file prompt

The first thought is the space coding problem, but in several times the file saved, encoded as Utf-8 also useless

The code is as follows

Tell me there's a problem with the fifth line, because the Vim editor doesn't have a line number by default, so try to show the line number first.

Results Baidu to the result

VIM displays line numbers when opening a file

There are two types of configurations: Configure only the current account, configure all accounts

One, change all account configuration

Change/ETC/VIMRC directly

Vim/etc/vimrc

Add set Nu at the end of the VIMRC file

You can WQ exit.

This way, no matter which account you use to log in, Vim opens and displays line numbers

Second, configure the environment for the current user

Locate the current user's VIMRC file.

If you do not have this file, you can create this file.

Vim ~/.VIMRC

After opening the file, add the Set Nu Wq exit at the end.

Open with Vim again to display line numbers

The above set up, open the edit file still prompts the original error, but this time there is really a line number.

But I still can't see the result, what's wrong? (Because the space at this time is a space under any encoding)

So in the Baidu centos vim code format , with the results

Http://www.netingcn.com/vim-paste-mode.html

Refer to this understand some God horse! Yes, that's right. I copied and pasted it in, so is that the reason?

the ~/.vimrc file and /ETC/VIMRC were modified in the same way as the last search

Modify the/ETC/VIMRC file as follows (add to last)

Set nu

Modify the ~/.VIMRC file as follows

SetNuSetShowmodeSetautoindentSetsmartindentSetShowmatchSetTabStop =4SetSofttabstop =4SetShiftwidth =4Setencoding = UTF-8SetFileencodings = cp936, GB18030, GBK, gb2312, utf-8, ucs-bom,latin-1SetHlsearchSetNoignorecaseSetFileformats =UnixSetPastetoggle =< F4 >: Map<F8>:SetPaste:map<F9>:SetNopaste

Hold the Grass! As a result vim saw these ghosts!!!!! All right, leave a record for me.

Just started playing Linux is not a pit?

Next I know how to get ε= (´ο ')).

Copy and paste the goods, ssh on the way, can only be done in the local paste, the results ....

Vim format code, coding problem?

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.