首页 > 系统服务 > 详细

vimrc

时间:2015-10-29 00:25:02      阅读:311      评论:0      收藏:0      [点我收藏+]

 

" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the ‘compatible‘ option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets ‘nocompatible‘. Setting ‘compatible‘ changes numerous
" options, so any other options should be set AFTER setting ‘compatible‘.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("‘\"") > 1 && line("‘\"") <= line("$") | exe "normal! g‘\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif

set nu
set tabstop=4
set nobackup
"set smartindent
set cursorline
set ruler
set autoindent
set showcmd
auto BufNewFile *.cpp exec ":call SetTitle()"
func SetTitle()
if &filetype == ‘cpp‘
call setline(1,"#include <cstdio>")
call append(line("."),"#include <queue>")
call append(line(".")+1,"#include <cstring>")
call append(line(".")+2,"#include <iostream>")
call append(line(".")+3,"#include <cstdlib>")
call append(line(".")+4,"#include <algorithm>")
call append(line(".")+5,"#include <vector>")
call append(line(".")+6,"#include <map>")
call append(line(".")+7,"#include <set>")
call append(line(".")+8,"")
call append(line(".")+9,"using namespace std;")
call append(line(".")+10,"")
call append(line(".")+11,"int main()")
call append(line(".")+12,"{")
call append(line(".")+13," //freopen(\"/home/user/in\",\"r\",stdin);")
call append(line(".")+14," ")
call append(line(".")+15," return 0;")
call append(line(".")+16,"}")
endif
autocmd BufNewFile * normal G
endfunc

set clipboard+=unnamed
set autowrite
set confirm
set smarttab
set history=1000
set nobackup
set autoread
set foldenable "允许折叠
set foldmethod=manual "手动折叠
set formatoptions=tcrqn "自动格式化

"键盘命令
""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <leader>w :w!<cr>
nmap <leader>f :find<cr>
"映射全选+复制 ctrl+a
map <C-A> <Esc>ggVGY
map! <C-A> <Esc>ggVGY
map <F12> gg=G
"选中状态下 ctrl+c 复制
vmap <C-c> "+y

 

vimrc

原文:http://www.cnblogs.com/cdyboke/p/4919018.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!