My Vim configuration file

Source: Internet
Author: User

[Root @ Leo-desktop :~ /] # Cat. vimrc
"NOTE: rename this file as. vimrc and copy it ~ /Bottom
"Install/copy files under plugin to/usr/share/Vim/vim71/plugin/

Set nu "sets the row number
Set autoindent "Set automatic indent
Set cindent "sets automatic indentation for C Language
Set shiftwidth = 4 "set the automatic indent of C language to 4 spaces
Set expandtab to convert the tab key to the Space key
Set tabstop = 4 "indicates that the tab has four spaces.
Set softtabstop = 4 "allows you to delete four spaces at a time by pressing the backspace key, and delete less than four spaces.
Set incsearch "Enter the search content to display the search content
Set hlsearch "highlight the found text during search
Set nocompatible "sets the mode that is incompatible with VI, that is, running in Enhanced Mode
Set mouse = A "set the mouse to be used at any time
Set showcmd "sets the status bar to always display the currently executed command
Set wrap
Set ruler "Open the status bar ruler
Set scroloff = 3 "set the cursor to automatically scroll out of the upper and lower boundary 3 rows
Set history = 50 "set the historical length of the command list for the colon command and search command to 50
"Set cursorline" highlight the current row

Syntax on "set to highlight
Colorscheme evening "sets the background to night mode

"Some options when Ctrl + P is not complete: when there are more than one row, the menu is displayed. The maximum value is selected, and the additional information currently selected is displayed.
Set completeopt = menu, longest, preview

"Autocmd bufenter * Call dowordcomplete ()" automatically completes the function. Press the tab key to confirm that the function is too slow.

"Set ctags and taglist
Let tlist_show_one_file = 1
Let tlist_exit_onlywindow = 1

"Set File Manager and Window Manager
Let G: winmanagerwindowlayout = 'fileexplorer | taglist'
Nmap wm: wmtoggle <CR>

"Open file type check
Filetype plugin indent on

"Code folding: za opens/closes the current folding; ZM closes all folds; Zr opens all folds
Set foldmethod = syntax

"Complete pairing
Inoremap () <ESC> I
Inoremap {{}< ESC> I
Inoremap [[] <ESC> I
Inoremap <> <ESC> I
Inoremap ''' <ESC> I
Inoremap "" <ESC> I
Inoremap) <right>
Inoremap} <right>
Inoremap] <right>
Inoremap> <right>
"Inoremap '<right>
"Inoremap" <right>

"Press F8 to save and start compiling the current C program, and then execute it
Map <F8>: Call compileandruncprogram () <CR>
Func! Compileandruncprogram ()
Exec "W"
Exec "! Gcc-wall %-o % <"
Exec "!. /% <"
Endfunc

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.