Installation and configuration of Vim under Ubuntu

Source: Internet
Author: User

Since ubuntu16.04 has been able to open files directly with VIM, it is not necessary to use Gvim, Vim appears more lightweight.

Installation of Vim:

sudo apt-get install vim

sudo apt-get install Vim-gnome

Configuration of Vim:

1. Under/home, Ctrl + H shows hidden files, new files. Vim can be configured with VIMRC.

SetAISetAWSetarSetsiSetSCSetSMSetCinSetHLSSetgo=0Setbs=2Setls=2Setso=3Setmat=3Setts=4Setsw=4STASetMouse=aSetshm=AtISetList lcs=tab:\ \Setcb+=Unnamedautocmd Bufenter* CD%:p: H syntax enablefiletype onfiletype plugin onfunc!run_cpp () exec"w!"exec"!clear && g++%<.cpp-o%<-G && ./%<"Endfunctionmap<F9>: Call Run_cpp () <cr>Map<space>h <C-w>Hmap<space>j <C-w>Jmap<space>k <C-w>Kmap<space>l <C-w>Lmap<space>[<c-w>-Map<space>] <c-w>+Map<space>, <C-w><Map<space>. <C-w>>Map<space><space>[8<c-w>-Map<space><space>]8<c-w>+Map<space><space>, -<C-w><Map<space><space>. -<C-w>>Map<space>w:wall<cr>Map<space>q:wqall<cr>
My. VIMRC

Ps:autocmd bufenter * CD%:p: H is the folder where the directory is transferred to the current file, there is a bug that the path cannot have spaces

The 2.vim is terminal-based, so the background/font/color can be modified in the terminal-edit-profile preferences.

The effects I configured are as follows.

Installation and configuration of Vim under Ubuntu

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.