Vim personal configuration under Linux

Source: Internet
Author: User
Tags set background sublime text linux mint

Today, Adobe's brackets,sublime text and other editors were used under Linux, and it was still inappropriate to find out. So I thought of vim.

First of all, I'm using the derivative version of Ubuntu: Linux Mint 17.

Then start installing Vim,linux Mint does not own vim, want to use the words need to install themselves; Open terminal and enter the following command:

sudo apt-get insatll vim

Then wait for the installation to succeed, enter "vim to edit the file name" in the terminal can be opened to use, but the default color scheme is not very like, so you reconfigure under. Of course, if you want to configure VIM, you need to create a configuration file named. VIMRC in the user's home directory (hidden by default), create and open a configuration file with the following command:

Vim. VIMRC

Then the next step is to modify the configuration, the contents of my configuration file are as follows:

 set shortmess=atI  "  Do not show the help for Ugandan children at startup  set nu "   Show line numbers  set  go=    do not graphic buttons  color default   Set background theme  syntax on    syntax highlighting   autocmd insertleave * se nocul  "  Highlight current line with light  autocmd insertenter *  se cul    Highlight current line with light  set ruler    show ruler  set showcmd    Enter the command to display, see clearly  set cmdheight=1  "  command line (under the status line) of the height, set to 1 set whichwrap+=<,>,h, l  "  Allow backspace and cursor keys to span line boundaries (not recommended)  set scrolloff=3 "   cursor moves to the top and bottom of buffer with 3 lines of distance   set novisualbell  "  Do not blink (do not understand)  set statusline=%f%m%r%h%w\ [format=%{&ff}]\  [type=%y]\ [pos=%l,%v][%p%%]\ %{strftime (\ "%d/%m/%y\ -\ %h:%m\")}  "status line display content  set laststatus=1  "  Start Display status line (1), always show status line (2)  set foldenable "   Allow collapse   Set foldmethod=manual  "  Manual folding  set background=dark " background using black  set nocompatible  "remove nasty about VI consistency mode, Avoid some bugs and limitations of previous versions     show Chinese help   if version >= 603  set helplang =cn  set encoding=utf-8  endif    "Code completion    set  completeopt=preview,menu    "Allow plugins    filetype plugin on     "Never backup    set nobackup   " make  run   set makeprg=g++\  -Wall\ \ %    "Auto Save    set autowrite   set  ruler    Open status bar ruler    set cursorline    Highlight current line    set  magic    Set Magic     set guioptions-=T    Hide Toolbars     set guioptions-=m  "  Hide menu bar    set statusline=\ %<%f[%1*%m%*%n%r%h]%=\  %y\ %0 (%{&fileformat}\%{&encoding}\ %c:%l/%l%)       Set the information displayed in the status line    set  foldcolumn=0   set foldmethod=indent   set foldlevel=3    set foldenable    Start folding     Don't use VI's keyboard mode, but Vim's own    set  nocompatible    "  Syntax highlighting    set syntax=on   "   get rid of incorrect input sounds    set noeb    "  when processing unsaved or read-only files, pop-up confirmation    set  confirm      Auto Indent    set autoindent   set  cindent    " tab key width    set tabstop=4   "   Unified indent to 4    set softtabstop=4   set shiftwidth=4    "  Do not use spaces instead of tabs    set noexpandtab    "  tabs at the beginning of rows and segments    set  smarttab    "  Show line number    set number    "  History    set history=1000    "Prevent temporary file generation    set nobackup   set noswapfile   " search ignores case    set ignorecase    "Search for verbatim Fugauliang    set hlsearch     set incsearch    "in-line replacement    set gdefault   " Encoding Settings &NBSP;&NBSP;&NBSP;SET&NBSP;ENC=UTF-8&NBSP;&NBSP;&NBSP;SET&NBSP;FENCS=UTF-8,UCS-BOM,SHIFT-JIS,GB18030,GBK, gb2312,cp936    "Language Settings    set langmenu=zh_cn. utf-8   set helplang=cn    "  My status line display content (including file type and decoding)   set  Statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\%{strftime (\ "%d/%m/%y\  -\ %h:%m\ ")}   set statusline=[%f]%y%r%m%*%=[line:%l/%l,column:%c][%p%%]     "  Always show status line    set laststatus=2    "  command line (under status line) height, default is 1, here is 2   set cmdheight=2     "  Detect file Types    filetype on  "   load file type plugins     filetype plugin on   "  Loading related indent file    filetype indent on for a specific file type"   Save global variable    set viminfo+=! "   Words with the following symbols do not wrap    set iskeyword+=_,$,@,%,#,-"  Putting the number of pixels inserted into the line    set  linespace=0 "  command line AutoComplete in enhanced mode    set wildmenu"   enables the SPACEBAR (BACKSPACE) to gracefully handle indent,  eol, start    set backspace=2 "  allow backspace and cursor keys to span line boundaries   set  whichwrap+=<,>,h,l  "  "   You can use the mouse anywhere in the buffer (similar to the workspace in office, double-click the mouse to navigate)    set  mouse=a   set selection=exclusive   set selectmode=mouse,key        by using the:  commands command, tell us which line of the file has been changed    set report=0  "  "   white space between divided windows for easy reading    set fillchars=vert:\ ,stl:\  ,stlnc:       Highlight matching parentheses    set showmatch  "  "   Match bracket highlighting time (in seconds)    set matchtime=1  "  "   keep 3 lines distance when cursor moves to top and bottom of buffer    set scrolloff=3       Auto indent for C programs    set  smartindent  "  "   highlight normal TXT file (requires Txt.vim script)    au bufread,bufnewfile  * setfiletype txt     Auto-complete    :inoremap  (  () <ESC> i   :inoremap )  <c-r>=closepair (') ') <CR>   :inoremap  { {<cr>}<esc>o   :inoremap } <c-r>=closepair ('} ') <CR>    :inoremap [ []<esc>i   :inoremap ] <c-r>= Closepair ('] ') &LT;CR&GT;&NBSP;&NBSP;&NBsp;:inoremap  " " <ESC>i :inoremap    "<ESC>i function!  Closepair (char)      if getline ('. ') [Col ('. ')  - 1] == a:char         return  "\< Right> "     else         return  a:char     endif endfunction filetype plugin indent on  "Open File type detection,  added this to use the smart complement  set completeopt=longest,menu set guifont=monospace\ vera \ sans\ h:14

Copy the above code, right-click on the terminal and press ESC--:( Colon) Wq save and exit.

Bong (Learning js ha):

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/59/77/wKioL1TUJg_RLqy3AAHMEmpWgAw028.jpg "title=" 1.png " alt= "Wkiol1tujg_rlqy3aahmempwgaw028.jpg"/>

The above content is only for the purpose of keeping marks for inspection.

Update: Modify the font and size of the vim configuration file in a solution that is inconsistent

PS: See the font in the configuration file what is not the same as the display effect is very simple, that is the default configuration of the terminal is caused. Just suddenly see the default configuration of the terminal is to display the use of the system default configuration, I instantly understand why the configuration file in the font settings and the terminal display of the effect is not the same (i specifically searched for a lot of configuration methods, check for a long time).

The solution is: in the terminal mail profile and profile preferences, the use of the system to uncheck the width of the font, choose your favorite font and size, the terminal will be displayed for you to modify the font and size.

This article is from the "Taeyeon" blog, make sure to keep this source http://taeyeon.blog.51cto.com/3898200/1612245

Vim personal configuration under Linux

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.