下面是自己的一些步骤仅供参考:
打造适合自己的系统
1 增加快捷键
1.1 增加Ctrl+R快捷命令行命令
1.1 建立sort目录,将常用操作快捷方式加入到其中(记得将名字改成简单易记的英文
名字),并将sort目录添加到系统环境path中。
2 软件设置
2.2.8 Web Developer
2.2 下载VIM,下载自己的VIM配置文件
“ author: feelingluckyi.feelinglucky@gmail.com
“ modify: Simon<[email protected]
“ website: http://csbde.cn
“ date: 2008-10-07
“ 在处理未保存或只读文件的时候,弹出确认
set confirm
set linebreak
set textwidth=80
set nocompatible
set backspace=2
set history=400
set ruler
set number
set hlsearch
“逐字符高亮搜索词语
set incsearch
set expandtab
set noerrorbells
set novisualbell
“高亮的时间
set matchtime=5
“close visual bell
set t_vb=
set foldmethod=marker
set tabstop=4
set shiftwidth=4
set nobackup
set nowritebackup
“set noswapfile
set smarttab
set smartindent
set autoindent
set cindent
set wrap
set autoread
set cmdheight=1
set showtabline=2
“和其他程序共用剪贴(Windows)
set clipboard+=unnamed
set tabpagemax=20
set laststatus=2
“状态栏
“set statusline=%F%m%r%h [%{&ff}] [%Y] %w %=[POS] %l,%c %=%P
set statusline= %F%m%r%h %w [PWD] %r%{CurrectDir()}%h %=[%{(&fenc==””)?&enc:&fenc}] [POS] %l,%c %= %P
“set statusline=%F%m%r%h%w [FORMAT=%{&ff}] [TYPE=%Y] [POS=%l,%v][%p%%] %{strftime(“%d/%m/%y - %H:%M”)}[PWD] %r%{CurrectDir()}%h
function! CurrectDir()
return substitute(getcwd(), “”, “”, “g”)
endfunction
let g:calendar_diary=$VIM
“ 配置多语言环境
if has(“multi_byte”)
set encoding=utf-8
set termencoding=utf-8
set formatoptions+=mM
set fencs=utf-8,gbk
if v:lang =~? '^(zh)|(ja)|(ko)'
set ambiwidth=double
endif
if has("win32")
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
source $VIMRUNTIME/mswin.vim
behave mswin
language messages zh_CN.utf-8
endif
else
echoerr “Sorry, this version of (g)vim was not compiled with +multi_byte”
endif
if has(‘gui_running’)
if has(“win32”)
source $VIMRUNTIME/mswin.vim
endif
" Always show file types in menu
let do_syntax_sel_menu=1
unmap <c-Y>| " <c-Y> for Redo is kept in insert mode
iunmap <c-A>| " <c-A> for Select-All is kept in normal mode
" Key mapping to switch windows quickly (<c-Tab> is already mapped)
nnoremap <c-S-Tab> <c-W>W
inoremap <c-S-Tab> <c-O><c-W>W
" 针对 Windows 的配置
if has("win32")
set guifont=新宋体:h10:cGB2312
" set guifontwide=YaHei Consolas Hybrid:h10
"au GUIEnter * simalt ~x " 最大化窗口
set lines=30
set columns=85
elseif has("unix")
set guifont=
set guifontwide=
elseif has("mac") || has("macunix")
set guifont=
set guifontwide=
endif
colorscheme desert
set guioptions=
set guioptions+=r
set cursorline
else
“ English messages only
“language messages en
" set the default theme in no-GUI
colorscheme default
" Do not increase the windows width in taglist
let Tlist_Inc_Winwidth=0
" Set text-mode menu
if has('wildmenu')
set wildmenu
set cpoptions-=<
set wildcharm=<c-Z>
nmap <f10> :emenu <c-Z>
imap <f10> <c-O>:emenu <c-Z>
endif
" Change encoding according to the current console code page
if &termencoding != '' && &termencoding != &encoding
let &encoding=&termencoding
let &fileencodings='ucs-bom,utf-8,' . &encoding
endif
endif
if has(“autocmd”)
filetype plugin indent on
“ autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
augroup vimrcEx
au!
autocmd FileType text setlocal textwidth=80
autocmd BufReadPost *
if line("'"") > 0 && line("'"") <= line("$") |
exe "normal g`"" |
endif
augroup END
function! AutoClose()
:inoremap ( ()<esc>i
:inoremap " ""<esc>i
:inoremap ' ''<esc>i
:inoremap { {}<esc>i
:inoremap [ []<esc>i
:inoremap ) <c-r>=ClosePair(')')<cr>
:inoremap } <c-r>=ClosePair('}')<cr>
:inoremap ] <c-r>=ClosePair(']')<cr>
endf
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "<right>"
else
return a:char
endif
endf
"auto close for PHP and Javascript script
au FileType php,c,cpp,h,python,javascript exe AutoClose()
endif
“Other Setting
“语法高亮
syntax on
“ key stock
“绑定自动补全的快捷键
imap
“ca日记h
map ca :Calendar
“设定开关Taglist插件的快捷键为F4,可以在VIM的左侧栏列出函数列表等
map
“设置程序的编译运行和调试的快捷键F5,F6,Ctrl-F5
map
map
map
“设置代码格式化快捷键F3
map
map
“设置tab操作的快捷键,绑定:tabnew到
“
map
map
map
“使用
if has(“unix”)
map ,e :e
else
map ,e :e
endif
“定义CompileRun函数,用来调用进行编译和运行
func CompileRun()
exec “w”
“C程序
if &filetype == ‘c’
if has(“win32”)
exec “!del %<.exe”
else
exec “!rm %<.exe”
endif
exec “!gcc % -o %<.exe”
if has(“win32”)
exec “!%<.exe”
else
exec “!./%<.exe”
endif
else
if &filetype == ‘cpp’
if has(“win32”)
exec “!del %<.exe”
else
exec “!rm %<.exe”
endif
exec “!g++ % -o %<.exe”
if has(“win32”)
exec “!%<.exe”
else
exec “!./%<.exe”
endif
endif
endif
endfunc
“结束定义CompileRun
“定义Run函数,用来调用进行编译和运行
func Run()
exec “w”
“C程序
“
if has(“win32”)
exec “!%<.exe”
else
exec “!./%<.exe”
endif
endfunc
“结束定义Run
“定义Debug函数,用来调试程序
func Debug()
exec “w”
if has(“win32”)
exec “!del %<.exe”
else
exec “!rm %<.exe”
endif
exec “!g++ % -g -o %<.exe”
exec “!gdb %<.exe”
endfunc
“结束定义Debug
2.3 下载TC,以及TC设置文件