1 " All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by 2 " the call to :runtime you can find below. If you wish to change any of those 3 " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim 4 " will be overwritten everytime an upgrade of the vim packages is performed. 5 " It is recommended to make changes after sourcing debian.vim since it alters 6 " the value of the 'compatible' option. 7 8 " This line should not be removed as it ensures that various options are 9 " properly set to work with the Vim-related packages available in Debian. 10 runtime! debian.vim 11 " Uncomment the next line to make Vim more Vi-compatible 12 " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous 13 " options, so any other options should be set AFTER setting 'compatible'. 14 "set compatible 15 16 " Vim5 and later versions support syntax highlighting. Uncommenting the next 17 " line enables syntax highlighting by default. 18 if has("syntax") 19 syntax on 20 endif 21 22 " If using a dark background within the editing area and syntax highlighting 23 " turn on this option as well 24 "set background=dark 25 26 " Uncomment the following to have Vim jump to the last position when 27 " reopening a file 28 "if has("autocmd") 29 " au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 30 "endif 31 32 " Uncomment the following to have Vim load indentation rules and plugins 33 " according to the detected filetype. 34 "if has("autocmd") 35 " filetype plugin indent on 36 "endif 37 38 " The following are commented out as they cause vim to behave a lot 39 " differently from regular Vi. They are highly recommended though. 40 set showcmd " Show (partial) command in status line. 41 set showmatch " Show matching brackets. 42 "set ignorecase " Do case insensitive matching 43 "set smartcase " Do smart case matching 44 "set incsearch " Incremental search 45 set autowrite " Automatically save before commands like :next and :make 46 "set hidden " Hide buffers when they are abandoned 47 set mouse=a " Enable mouse usage (all modes) 48 49 " Source a global configuration file if available 50 if filereadable("/etc/vim/vimrc.local") 51 source /etc/vim/vimrc.local 52 endif 53 54 set nu 55 set tabstop=4 56 set softtabstop=4 57 set shiftwidth=4 58 "set smartindent 59 set cursorline 60 set ruler 61 "set autoindent 62 set showcmd 63 set formatoptions=tcrqn "自动格式化 64 set clipboard+=unnamed 65 set autowrite 66 "set confirm 67 set smarttab 68 set history=1000 69 set autoread 70 "禁止生成临时文件 71 set nobackup 72 set noswapfile 73 74 set foldenable "允许折叠 75 set foldmethod=manual "手动折叠 76 77 " 匹配括号高亮的时间(单位是十分之一秒) 78 set matchtime=1 79 80 set backspace=2 81 " 允许backspace和光标键跨越行边界 82 83 map:call AddHeader() 84 "auto BufNewFile *.cpp exec ":call AddHeader()" 85 func AddHeader() 86 if &filetype == 'cpp' 87 call setline(line("."),"#include ") 88 let l=line(".")-1 89 let l=l+1 | call append(l,"#include ") 90 let l=l+1 | call append(l,"#include ") 91 let l=l+1 | call append(l,"#include ") 92 let l=l+1 | call append(l,"#include ") 93 let l=l+1 | call append(l,"#include ") 94 let l=l+1 | call append(l,"#include
1 " All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by 2 " the call to :runtime you can find below. If you wish to change any of those 3 " settings, you should do it in this file (/etc/vim/vimrc), since debian.vim 4 " will be overwritten everytime an upgrade of the vim packages is performed. 5 " It is recommended to make changes after sourcing debian.vim since it alters 6 " the value of the 'compatible' option. 7 8 " This line should not be removed as it ensures that various options are 9 " properly set to work with the Vim-related packages available in Debian. 10 runtime! debian.vim 11 " Uncomment the next line to make Vim more Vi-compatible 12 " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous 13 " options, so any other options should be set AFTER setting 'compatible'. 14 "set compatible 15 16 " Vim5 and later versions support syntax highlighting. Uncommenting the next 17 " line enables syntax highlighting by default. 18 if has("syntax") 19 syntax on 20 endif 21 22 " If using a dark background within the editing area and syntax highlighting 23 " turn on this option as well 24 "set background=dark 25 26 " Uncomment the following to have Vim jump to the last position when 27 " reopening a file 28 "if has("autocmd") 29 " au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif 30 "endif 31 32 " Uncomment the following to have Vim load indentation rules and plugins 33 " according to the detected filetype. 34 "if has("autocmd") 35 " filetype plugin indent on 36 "endif 37 38 " The following are commented out as they cause vim to behave a lot 39 " differently from regular Vi. They are highly recommended though. 40 set showcmd " Show (partial) command in status line. 41 set showmatch " Show matching brackets. 42 "set ignorecase " Do case insensitive matching 43 "set smartcase " Do smart case matching 44 "set incsearch " Incremental search 45 set autowrite " Automatically save before commands like :next and :make 46 "set hidden " Hide buffers when they are abandoned 47 "set mouse=a " Enable mouse usage (all modes) 48 49 " Source a global configuration file if available 50 if filereadable("/etc/vim/vimrc.local") 51 source /etc/vim/vimrc.local 52 endif 53 54 set nu 55 set tabstop=4 56 set softtabstop=4 57 set shiftwidth=4 58 "set smartindent 59 set cursorline 60 set ruler 61 "set autoindent 62 set showcmd 63 set formatoptions=tcrqn "自动格式化 64 set clipboard+=unnamed 65 set autowrite 66 "set confirm 67 set smarttab 68 set history=1000 69 set autoread 70 "禁止生成临时文件 71 set nobackup 72 set noswapfile 73 74 set foldenable "允许折叠 75 set foldmethod=manual "手动折叠 76 77 " 匹配括号高亮的时间(单位是十分之一秒) 78 set matchtime=1 79 80 set backspace=2 81 " 允许backspace和光标键跨越行边界 82 83 map:call AddHeader() 84 "auto BufNewFile *.cpp exec ":call AddHeader()" 85 func AddHeader() 86 if &filetype == 'cpp' 87 call setline(line("."),"#include ") 88 let l=line(".")-1 89 let l=l+1 | call append(l,"#include ") 90 let l=l+1 | call append(l,"#include ") 91 let l=l+1 | call append(l,"#include ") 92 let l=l+1 | call append(l,"#include ") 93 let l=l+1 | call append(l,"#include ") 94 let l=l+1 | call append(l,"#include