" URL=https://github.com/yangyangwithgnu/use_vim_as_ide
"================快捷键管理=====================
"设置退格键
set backspace=indent,eol,start
" 定义快捷键的前缀,即<Leader>
let mapleader=";"
"全屏设置
if has('gui_running') && has("win32")
map <F11> :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>
endif
"<F2>关闭高亮
map <F2> : nohlsearch <CR>
"================功能管理=======================
" 开启文件类型侦测
filetype on
" 根据侦测到的不同类型加载对应的插件
filetype plugin on
set filetype=python
au BufNewFile,BufRead *.py,*.pyw setf python
" 开启实时搜索功能
set incsearch
" 搜索时大小写不敏感
set ignorecase
" 关闭兼容模式
set nocompatible
" vim 自身命令行模式智能补全
set wildmenu
"================显示及主题管理=================
" 开启语法高亮功能
syntax enable
" 允许用指定语法高亮配色方案替换默认方案
syntax on
if has('gui_running') && has("win32")
set background=dark
set t_Co=256
colorscheme wombat256mod
" 设置 gvim 显示字体
"set guifont=YaHei\ Consolas\ Hybrid\ 11.5
"set gfw=幼圆:h10.5:cGB2312
"set guifont=Arial_monospaced_for_SAP:h9:cANSI
set guifont=Bitstream_Vera_Sans_Mono:h9:cANSI
set gfw=Yahei_Mono:h10:cGB2312
endif
" 禁止光标闪烁
set gcr=a:block-blinkon0
" 禁止显示滚动条
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
" 禁止显示菜单和工具条
" set guioptions-=m
set guioptions-=T
" 显示光标当前位置
set ruler
" 开启行号显示
set number
" 高亮显示当前行/列
set cursorline
set cursorcolumn
" 高亮显示搜索结果
set hlsearch
" 禁止折行
set nowrap
" 总是显示状态栏
set laststatus=2
"最大化启动
if has('win32')
au GUIEnter * simalt ~x
else
au GUIEnter * call MaximizeWindow()
endif
function! MaximizeWindow()
silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
endfunction
"上次光标位置
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"=================代码显示=================
" 自适应不同语言的智能缩进
filetype indent on
" 将制表符扩展为空格
set expandtab
" 设置编辑时制表符占用空格数
set tabstop=4
" 设置格式化时制表符占用空格数
set shiftwidth=4
" 让 vim 把连续数量的空格视为一个制表符
set softtabstop=4