The better Vim is, the better it will be. paste the configuration file. vimrc

Source: Internet
Author: User
Tags imap

On the one hand, you can see it elsewhere :)

In fact, in the past, Vim's configuration was nothing more than looking at someone else's long configuration file and copying it by yourself. Now it basically forms a habit, add the shortcut key as needed, especially for the leader starting with "," (comma, although it actually sacrifices the function of repeat reverse lookup .... But in reality, I have never used "," this strange requirement, so it is not a pity to cover it.

Unfortunately, no syntax highlighting is found in the file ..........

 

Let mapleader = ","
Set encoding = UTF-8
Set ambiwidth = double
Set nocompatible
Set HLS
Set nu
Set AI
Colors desert
Syntax on
Set Sw = 4
Set Ts = 4
"Set autocmd
Set smarttab
Set whichwrap + = H, L ,~, B, S, <,>, [,]
Set helplang = Cn
Set ruler
Set showcmd
Filetype plugin indent on
Set nomagic
Set mouse =
Set bytes Height = 2
Set backspace = EOL, start, indent
Set showmatch
Set wildmenu

"-----------------------------------------------------------
"For snippetsemu_key but it's snippet file is not created
"-----------------------------------------------------------
Let G: snippetsemu_key = "<s-tab>"

"-----------------------------------------------------------
"Folding
"-----------------------------------------------------------
"Enable folding, I find it very useful
Set nofen
Set FDL = 0
Set LBR

Set Si
Set wrap

"-----------------------------------------------------------
"Some key I maped and liked
"-----------------------------------------------------------
"I like use <space> <BS> <CR> key in Normal Mode
NMAP <space> I <space> <ESC> L
NMAP <BS> I <BS> <ESC> L
NMAP <CR> I <CR> <ESC>

"Sometimes use this to P something in New Line
NMAP <leader> o <ESC> P
NMAP <leader> o <ESC> P

"One key to save even in insert mode
NMAP <F2>: W <CR>
Imap <F2> <ESC>: W <CR>

"Select all like Microsoft's CTRL-A
NMAP <leader> A ggvg

"-----------------------------------------------------------
"For favarite C/C ++
"-----------------------------------------------------------
"Normal Mode
Autocmd filetype C Map <silent> <buffer> <F6>: W <CR>: Make <CR>: CW <CR>
Autocmd filetype CPP Map <silent> <buffer> <F6>: W <CR>: Make <CR>: CW <CR>

"-----------------------------------------------------------
"For special script file type
"I only need to use python, Lua, SH and surely only know these
"-----------------------------------------------------------
"Normal Mode
Autocmd filetype Python Map <buffer> <F5> :! Clear <CR>: W <CR> :! Python % <CR>
Autocmd filetype Lua Map <buffer> <F5> :! Clear <CR>: W <CR> :! Lua % <CR>
Autocmd filetype sh Map <buffer> <F5> :! Clear <CR>: W <CR> :!. /% <CR>
"Insert mode
Autocmd filetype Python imap <buffer> <F5> <ESC> :! Clear <CR>: W <CR> :! Python % <CR>
Autocmd filetype Lua imap <buffer> <F5> <ESC> :! Clear <CR>: W <CR> :! Lua % <CR>
Autocmd filetype sh imap <buffer> <F5> <ESC> :! Clear <CR>: W <CR> :!. /% <CR>
"-----------------------------------------------------------

"-----------------------------------------------------------
"Taglist
"-----------------------------------------------------------
Let tlist_exit_onlywindow = 1
Let tlist_use_right_window = 1
Let tlist_file_fold_auto_close = 1
Map <leader> to: tlist <CR>

"-----------------------------------------------------------
"For quickfix
"-----------------------------------------------------------
NMAP <silent> <leader> N: CN <CR>
NMAP <silent> <leader> P: CP <CR>

"-----------------------------------------------------------
"For vimgdb
"-----------------------------------------------------------
Source ~ /Vimrc/gdb_mappings.vim

"-----------------------------------------------------------
"Winmanager setting
"-----------------------------------------------------------
Let G: winmanagerwindowlayout = "fileexplorer"
Let G: winmanagerwidth = 30
Let G: defaultexplorer = 0
NMAP <silent> <leader> WM: wmtoggle <CR>

"-----------------------------------------------------------
"For A. Vim a useful plugin
"-----------------------------------------------------------
NMAP <leader> AA: A <CR>
NMAP <leader> as: As <CR>
NMAP <leader> AV: av <CR>

"-----------------------------------------------------------
"For minibufexplorer and buffer opearate
"-----------------------------------------------------------
NMAP <leader> 1: B 1 <CR>
NMAP <leader> 2: B 2 <CR>
NMAP <leader> 3: B 3 <CR>
NMAP <leader> 4: B 4 <CR>
NMAP <leader> 5: B 5 <CR>
NMAP <leader> 6: B 6 <CR>
NMAP <leader> 7: B 7 <CR>
NMAP <leader> 8: B 8 <CR>
NMAP <leader> 9: B 9 <CR>
NMAP <leader> 0: B 10 <CR>

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.