vim:
myrc
“updata 10_4_29
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function! MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '/<cmd'
let cmd = '""' . $VIMRUNTIME . '/diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '/diff"'
endif
else
let cmd = $VIMRUNTIME . '/diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
"***************************MYVIMRC*************************
"-----------------------------EDIT--------------------------
"设置背景
colorscheme darkblue
"显示行号
se nu
"tab 键为4
se ts=4
" Set mapleader
let mapleader = ","
"Fast reloading of .vimrc
map <silent> <leader>ss :source $vim/_vimrc<cr>
"Fast editing of .vimrc
map <silent> <leader>ee :tabnew<cr>:e $vim/_vimrc<cr>
"when .vimrc is edited,reload it
autocmd! bufwritepost .vimrc :source $vim/_vimrc
"设置搜索高亮,边写边搜
set hls is
"去掉工具栏
set go-=T
"去掉菜单栏
set go-=m
" 与windows共享剪贴板
set clipboard+=unnamed
" 启动的时候不显示那个援助索马里儿童的提示
set shortmess=atI
"设置字体
set guifont=Consolas:h11
"-----------------------IDE-----------------------
map <F5> :call CompileRun()<CR>
"设置代码格式化快捷键F3
map <F3> :call FormartSrc()<CR>
"定义CompileRun函数,用来调用进行编译和运行
func! CompileRun()
exec "w"
"C程序
if &filetype == 'c'
exec "!del %<.exe"
exec "!gcc % -o %<.exe"
exec "!%<.exe"
elseif &filetype == 'cpp'
exec "!del %<.exe"
exec "!g++ % -o %<.exe"
exec "!%<.exe"
"Java程序
elseif &filetype == 'java'
exec "!del %<.class"
exec "!javac %"
exec "!java %<"
endif
endfunc
"结束定义CompileRun
"
""定义FormartSrc()
func! FormartSrc()
exec "w"
"C程序,Perl程序,Python程序
if &filetype == 'c'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
elseif &filetype == 'cpp'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
elseif &filetype == 'perl'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
elseif &filetype == 'py'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
"Java程序
elseif &filetype == 'java'
exec "!astyle --style=java --suffix=none %"
exec "e! %"
elseif &filetype == 'jsp'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
elseif &filetype == 'xml'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
elseif &filetype == 'html'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
elseif &filetype == 'htm'
exec "!astyle --style=gnu --suffix=none %"
exec "e! %"
endif
endfunc
"结束定义FormartSrc
:noh 去除搜索后高亮
%s/x/y/g 把全文中的x 替换成y
win+r/cmd:
convert x: /fs ntfs---convert fat32 to ntfs;
copy con 1.txt 然后回车,在下面输入文字,要退出时,按CTRL+Z,再回车。
services.msc---本地服务设置