Back up vimrc

Source: Internet
Author: User

Back up vimrc 001 "=========== global basic settings =========002 source/usr/share/vim/vim73/gvimrc_example.vim003 "compatible with Windows system solution 004" source $ VIMRUNTIME/mswin. vim005 "behave mswin006 007" =================008 set nocompatible "use Vim syntax on" enable syntax to support 010 011 "==== ============= public functions ================== 012 "get the current working directory 013 function! GetPWD () 014 return substitute (getcwd (), "", "", "g") 015endfunction016 017 "get the current edited file directory 018 func! GetFilePWD () 019 return expand ("%: p: h ") 020endf021 "======================================== === 022 023 024 "set tab 025 set tabpagemax = 9" tab up to 9 026 set showtabline = 2 "always show label 027 set guioptions-= e" tab label not provided by Gui 028 029 "display row number and ruler 030 set number031set ruler032set rulerformat = % 15 (% c % V \ % p %) 033 034 "command line status line 035 set height Height = 1036" set stl = \ [File] \ % F % m % r % h % y [% {& fileformat }, % {& fileencoding}] \ % w \ [PWD] \ % r % {GetPWD ()} % h \ % = \ [Line] % l/% L \ % = \ [% P] 037 set stl = [File] % f % m % r % h % y [% {& fileformat }, % {& fileencoding}] % w \ % r [PWD] % {GetPWD ()} % h % = \ [Line] % l/% L % = [% P] 038 set laststatus = 2 "always show status Line 039 set wildmenu" command Line completion to run in Enhanced Mode 040 041 set bsdir = buffer "sets the file browser directory to the current directory 042 043 set display = lastline" not displayed @ 044 045 "Search Settings 046 set hlsearch047set magic048set noincsearch049 050 set showmatch" display match 051 set matchtime = 1 "display matching flicker time 052 053 "Display (partial) on the last line of the screen) command 054 set show1_055 056 set autoindent "auto indent 057 set smartindent" smart indent 058 059 060 "=== TAB \ t === 061 set tabstop = 4062 set expandtab063set smarttab064set shiftwidth = 4065 set softtabstop = 4066 067 068 set autoread "automatically loaded 069 070 set history = 1000" retain history 071 072 set autochdir "automatically switches to the current working directory 073 074 set nobackup "do not enable backup file 075 set noswapfile" do not enable swap file 076 077 set nowrap "default setting text is not displayed according to automatic line feed on the screen 078 079 "current column highlight 080" set cuc081 082 "allows the cursor to be anywhere in the editing area. The default effect is that the cursor can only be stopped in the character area 083 ": set ve = all084 085 "======== Auto completion ========== 086 set complete = ., w, B, k, t, i087set completeopt = longest, menu088 "====================== 089 090" Multi-byte character encoding settings, mainly for Chinese 091if has ('multi _ byte') 092 set fenc = UTF-8 "fileencoding default file encoding 093 set fencs = UTF-8, gbk, big5, latin1 "fileencodings file encoding automatic match list 094 set formatoptions + = mM095 set nobomb096 s Et ambiwidth = double097else098 echoerr "Sorry, this version of (g) vim was not compiled with + multi_byte "099endif100 101 102" =============== GVim special settings ====== ========= 103if has ('gui _ running ') 104 set cursorline "highlight the current row 105 set guioptions-= e" tab is displayed as terminal mode, you do not need to use the gui label 106 set mouse = a ". In all cases, you can use the 107 set guifont = Ubuntu \ Mono \ 12" font to set Linux108 colorscheme desert "color configuration 109 set guioptions-= T "toolbar 110 11 is removed by default. 1 "toolbar and menu bar display/hide shortcut key 112" F2 display or hide menu bar 113 map <silent> <F2>: if & guioptions = ~ # 'T' <Bar> 114 \ set guioptions-= T <Bar> 115 \ else <Bar> 116 \ set guioptions + = T <Bar> 117 \ endif <CR> 118 "F3 display or hide toolbar 119 map <silent> <F3>: if & guioptions = ~ # 'M' <Bar> 120 \ set guioptions-= m <Bar> 121 \ else <Bar> 122 \ set guioptions + = m <Bar> 123 \ endif <CR> 124 125 "automatic maximization 126" au GUIEnter * simalt ~ X127endif128 129 130 "=================== character encoding of some source code files ============== export au FileType xml set fenc = utf8132au FileType html set fenc = utf8133au FileType xhtml set fenc = export FileType css set fenc = utf8135au FileType javascript set fenc = export FileType jsp set fenc = utf8137au FileType php set fenc = utf8138 139 140 "==================== define <Leader> As a semicolon ========== === 141let mapleader = "; "142let maplocalleader = "; "143 144 145" ======================== custom Shortcut Keys ==================== ======= 146 147 "Ctrl + Alt + Move the current row up and down to the previous row and the next line (Eclipse) 148map <C-A-Up>: <ESC> kddp <ESC> k149map <C-A-Down >:< ESC> ddp150 "Ctrl + D Delete the current line (Eclipse) 151map <C-d>: <ESC> dd152 153 "quickly set the current working directory to user desktop 154 nmap <Leader> CD: cd ~ /Desktop <CR> 155 "nmap <Leader> CD: cd ~ /Desktop <CR> 156 157 "tag operation ing 158 nmap <Leader> tt: tabnew <CR> 159 nmap <Leader> tn: tabNext <CR> 160 nmap <Leader> tf: tabfirst <CR> 161 nmap <Leader> tl: tablast <CR> 162 163 "quick open your browser to view the current file (html, etc) linux164nmap <Leader> ff: update <CR>: silent! Firefox-f file: // %: p <CR> 165 nmap <Leader> cm: update <CR>: silent! Chrome-f file: // %: p <CR> 166 167 "Zen-Coding shortcut key 168let g: user_zen_expandabbr_key = '<c-e>' "Expand tag shortcut 169" jump to the next Tag: 170 nmap <Leader> zn <c-y> n <ESC> 171 "Jump to the previous tag click 172 nmap <Leader> zN <c-y> N <ESC> 173 "to jump to the next tag 174 nmap <Leader> zd <c-y> d <ESC> 175" to the previous one. labels 176 nmap <Leader> zD <c-y> D <ESC> 177 178 "F4 tab 179 set listchars = tab: \|\, 180map <silent> <F4>: if & list <Bar> 181 \ set nolist <Bar> 182 \ echo "do not show tab" <Bar> 183 \ else <Bar> 184 \ set list <Bar> 185 \ echo "show tab" <Bar> 186 \ endif <CR> 187 188 "automatically insert comments /** /, <! --> 189 nmap <Leader>/* a/**/<ESC> hi1_nmap <Leader> -- a <! --> <ESC> 4ha <ESC> a191 192 "======================== some plug-ins ================= 193 "set MRU194" let MRU_Max_Entries = 10

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.