首页 > 代码库 > vim配置

vim配置

"vimrc配置map <F5> :call CompileRunGcc()<CR> " 按F5键根据文本后缀启动相应程序func! CompileRunGcc() exec "w" if &filetype == c exec "!g++ % -o %<" exec "! ./%<" elseif &filetype == cpp exec "!g++ % -o %<" exec "! ./%<" elseif &filetype == java exec "!javac %" exec "!java %<" elseif &filetype == sh :!./% elseif &filetype=="html"exec "! firefox %"endif endfunc:nmap <silent> <Leader>i <Plug>IndentGuidesToggle filetype on "侦测文件类型filetype plugin indent on " 载入文件类型插件filetype indent on "为特定文件类型载入相关缩进文件map <F3> :NERDTreeMirror<CR> "按F3启本资源管理脚本map <F3> :NERDTreeToggle<CR>let g:SuperTabDefaultCompletionType = "<c-x><c-o>" "按Tab键自动补全"let g:indent_guides_enable_on_vim_startup=1 " let g:indent_guides_start_level=2 " let g:indent_guides_guide_size=1 " set fileencodings=utf-8,gbk,gb18030,utf-16,big5 "依次检测使用文本编码set fileencoding=gbk"set encoding=utf-8set nocompatible "不要使用vi的键盘模式,而是vim自己的set incsearch "开启实时搜索功能set ignorecase " 搜索时大小写不敏感set nocompatible "关闭兼容模式set wildmenu "vim命令行模式补全set laststatus=2 "总显示状态栏set nowrap "不自动换行set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 "set foldmethod=indent set foldmethod=syntax " 基于缩进或语法进行代码折叠set nofoldenable "启动 vim 时关闭折叠代码set guioptions-=T " 禁止显示工具条set guioptions+=bset guioptions-=mset shortmess=atI "不显示援助乌干达儿童syntax on syntax enablemap <c-c> "+y map <c-d> "+pif strftime("%H")>=16||strftime("%H")<8 "早上8点到16点用 Tomorrow主题 其他用solarized主题"set guifont=宋体\ 13"set guifont=yaHei\ Consolas\ Hybrid\ 13set guifont=Monaco\ 12"set guifont=Bitstream\ Vera\ Sans\ Mono\ 12"set background=darkcolorscheme railscasts "solarized \"molokai let g:Powerline_colorscheme=solarized256else colorscheme Tomorrowset guifont=YaHei\ Consolas\ Hybrid\ 13endifstartinsert "启用时使用插入模式exec "cd /home/fhw360/桌面"set showcmd

 

vim配置