vimrc
" 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
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
" 禁止光标闪烁
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
"最大化启动
au GUIEnter * simalt ~xn
"上次光标位置
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"=================插件管理=================
"包管理工具
" vundle {
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#begin ('~/.vim/bundle/')
"call vundle#rc()
"使用Vundle来管理Vundle
Bundle 'gmarik/vundle'
"对齐线
Bundle 'Indent-Guides'
let g:indent_guides_guide_size=1
"窗口管理
"Bundle 'winmanager'
"Bundle 'bufexplorer.zip'
"au VimEnter * :WMOpen
"let g:AutoOpenWinManager = 1
"按下Ctrl+h/j/k/l,可以切换到当前窗口的上下左右窗口
"let g:miniBufExplMapWindowNavVim = 1
"按下Ctrl+箭头,可以切换到当前窗口的上下左右窗口
"let g:miniBufExplMapWindowNavArrows = 1
"启用以下两个功能:Ctrl+tab移到下一个窗口
"let g:miniBufExplMapCTabSwitchBufs = 1
"let g:winManagerWindowLayout='FileExplorer|TagList'
"let g:winManagerWidth =25
"nmap wm :WMToggle<cr>
"nmap <silent> <F7> :WMToggle<cr>
Bundle 'The-NERD-tree'
Bundle 'The-NERD-Commenter'
Bundle 'ctrlp.vim'
"let g:ctrlp_map = '<c-p>'
"let g:ctrlp_cmd = 'CtrlP'
"let g:ctrlp_working_path_mode = 'ra'
"Exclude files
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe
"let g:ctrlp_custom_ignore = {
"\ 'dir': '\v[\/]\.(git|hg|svn)$',
"\ 'file': '\v\.(exe|so|dll)$',
"\ 'link': 'some_bad_symbolic_links',
"\ }
let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d'
" 设置状态栏主题风格
" airline {
Bundle 'bling/vim-airline'
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme = 'light'
if !exists('g:airline_symbols')
let g:airline_symbols = { }
endif
"}
call vundle#end ()
"}
filetype plugin indent on
"=================代码显示=================
" 自适应不同语言的智能缩进
filetype indent on
" 将制表符扩展为空格
set expandtab
" 设置编辑时制表符占用空格数
set tabstop=4
" 设置格式化时制表符占用空格数
set shiftwidth=4
" 让 vim 把连续数量的空格视为一个制表符
set softtabstop=4