Problems with vim arrow keys in Ubuntu

Source: Internet
Author: User

Problems with vim arrow keys in Ubuntu

After Ubuntu is installed, the direction keys in VI are displayed with letters.
In the $ home/WYC/. vimrc file (a new one is created if no one is available), add the following sentence:
Set nocompatible

2. Add backspace = 2

The best solution is:

You can enter
Sudo apt-Get install Vim
Install Vim

CD/etc/Vim
Vim vimrc

It is roughly as follows:

"All system-wide defaults are set in $ vimruntime/Debian. Vim (usually just
"/Usr/share/Vim/vimcurrent/Debian. Vim) and sourced by the call to: Runtime
"You can find below. If you wish to change any of those settings, you showould
"Do it in this file (/etc/Vim/vimrc), since Debian. Vim will be overwritten
"Everytime an upgrade of the vim packages is saved med. It is recommended
"Make changes after sourcing Debian. Vim since it alters the value of
"'Compute' option.

"This line shoshould not be removed as it ensures that varous options are
"Properly set to work with the vim-related packages available In Debian.
Runtime! Debian. Vim

"Uncomment the next line to make Vim more vi-compatible
"NOTE: Debian. Vim sets 'nocompute'. Setting 'computed' changes numerous
"Options, so any other options shoshould be set after setting 'compute '.
"Set compatible

"Vim5 and later versions support syntax highlighting. uncommenting the next
"Line enables syntax highlighting by default.
"Syntax on

"If using a dark background within the editing area and syntax highlighting
"Turn on this option as well
"Set background = dark

"Uncomment the following to have Vim jump to the last position when
"Reopening a file
"If has (" autocmd ")
"Au bufreadpost * If line (" '\ "")> 0 & line ("' \" ") <= line (" $ ")
"\ | EXE" normal G' \ "" | endif
"Endif

"Uncomment the following to have Vim load indentation rules according to
"Detected filetype. Per default Debian Vim only load filetype specific
"Plugins.
"If has (" autocmd ")
"Filetype indent on
"Endif

"The following are commented out as they cause Vim to behave a lot
"Differently from regular VI. They are highly recommended though.
"Set showcmd" show (partial) command in status line.
"Set showmatch" show matching brackets.
"Set ignorecase" do case insensitive matching
"Set smartcase" do smart case matching
"Set incsearch" incremental search
"Set autowrite" automatically save before commands like: Next and: Make
"Set hidden" hide buffers when they are abandoned
"Set mouse = A" enable mouse usage (all modes) in terminals

"Source a global configuration file if available
"XXX deprecated, please move your changes here in/etc/Vim/vimrc
If filereadable ("/etc/Vim/vimrc. Local ")
Source/etc/Vim/vimrc. Local
Endif

"""""""""""""""""""""""""""""""
"" Custom Vim setting "" below are some simple settings you have added
"""""""""""""""""""""""""""""""
"One of the two can only take one of them.
Set AI/noai "is automatically indented, and the new line and the previous line are kept-caused by automatic spaces/non-automatic spaces (default)
Set AW/noaw automatic write, transfer to shell or use: N when editing other files, the current buffer is written/not written
Set Flash/noflash "flashes in the error but does not sound (default)/uses the call but does not flash
Set IC/noic "is case-insensitive/case-insensitive during query and mode matching (default)
Set nu/Nonu
Set number/nonumber "displays the row number on the left of the screen/does not show the row number (default)
Set showmatch ": matching brackets are displayed. When"] "" is entered, matching parentheses are displayed in High Brightness. The matching parentheses are not highlighted by default.
Set showmode "indicates the mode indicator in the highlighted button bar when it is in text input mode/the current mode is not indicated by default
Set showcmd "displays the currently executed commands in the status bar. The uncompleted command fragments are also displayed.
Set warn/nowarn after the text is modified, the system displays the text when it leaves the shell (default)
If set WS/nows is reached at the end of the file during search, the file header is bypassed to continue searching.
Set wrap/nowrap
Colorscheme evening "sets the background to night mode
Filetype plugin on automatically identifies the file type and automatically matches the corresponding file type. The "file type plugin. Vim" file uses indentation to define the file.
Set autoindent: the indentation value of each line is equal to that of the previous line. Use noautoindent to cancel the settings.
Set cindent "indent in C/C ++ Mode
Set noignorecase "is case sensitive by default
Set ruler "to open the status bar ruler
Set scroloff = 5 ": Set the cursor to automatically scroll out of the window when the upper and lower boundary is 5
Set shiftwidth = 4 "to set <and> the width of the command to 4.
Set softtabstop = 4 "enables you to delete four spaces at a time when you press the backspace key. If there are less than four spaces, you can delete all the remaining spaces)
Set tabstop = 4 "to set the tab length to 4
Set wrap automatic line feed display
Syntax enable
Syntax on automatic syntax highlighting

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.