博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
windows下 gvim 配置
阅读量:5147 次
发布时间:2019-06-13

本文共 4542 字,大约阅读时间需要 15 分钟。

配置文件为

 

" autoload _vimrc

autocmd! bufwritepost _vimrc source %
" disable VI's compatible mode
set nocompatible
set fileencodings=ucs-bom,utf-8,chinese
set fileencoding=utf-8
" use chinese help
set helplang=cn
if has("gui_running")
set guifont=Yahei_Mono:h11:cGB2312
colorscheme oceandeep
endif
" Enable syntax highlight
syntax enable
" Show line number
set nu
" show matching bracets
set showmatch
" Basic editing options
set expandtab
set shiftwidth=2
au FileType html,python,vim,javascript setl shiftwidth=2
au FileType html,python,vim,javascript setl tabstop=2
au FileType java,php setl shiftwidth=2
au FileType java,php setl tabstop=2
set smarttab
set lbr
set tw=0
"Auto indent
set ai
" Smart indet
set si
" C-style indeting
set cindent
"Wrap lines
set wrap
" Sets how many lines of history VIM har to remember
set history=400
" Set to auto read when a file is changed from the outside
set autoread
" Have the mouse enabled all the time:
set mouse=a
" Do not redraw, when running macros.. lazyredraw
set lz
" set 7 lines to the curors - when moving vertical..
set so=7
" The commandbar is 2 high
set cmdheight=2
" Change buffer - without saving
set hid
" Ignore case when searching
" set ignorecase
set incsearch
" Set magic on
set magic
" No sound on errors.
set noerrorbells
set novisualbell
set t_vb=
" How many tenths of a second to blink
set mat=4
" Highlight search things
set hlsearch
" Turn backup off
set nobackup
set nowb
set noswapfile
" smart backspace
set backspace=start,indent,eol
" switch buffers with Tab
map <C-Tab> :bn<CR>
map <S-Tab> :bp<CR>
" NERDTree
let NERDTreeBookmarksFile='d:\Vim\vimfiles\bookmarks.txt'
let NERDTreeShowLineNumbers=1
let NERDChristmasTree=1
let NERDTreeAutoCenter=1
let NERDTreeShowBookmarks=0
let NERDTreeWinPos='left'
let NERDTreeChDirMode=1
let NERDTreeStatusline = 1
let NERDTreeChDirMode = 1
map <C-t> :NERDTreeToggle <C-R>=""<CR>
map <C-g> :cs find g <C-R>=expand("<cword>")<CR>
" taglist
let Tlist_Auto_Highlight_Tag = 1
let Tlist_Auto_Open = 1
let Tlist_Auto_Update = 1
let Tlist_Close_On_Select = 0
let Tlist_Compact_Format = 0
let Tlist_Display_Prototype = 0
let Tlist_File_Fold_Auto_Close = 0
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Inc_Winwidth = 0
let Tlist_Max_Submenu_Items = 1
let Tlist_Max_Tag_Length = 30
let Tlist_Process_File_Always = 0
let Tlist_Show_Menu = 0
let Tlist_Show_One_File = 1
let Tlist_Sort_Type = "order"
let Tlist_Use_Horiz_Window = 0
let Tlist_Use_Right_Window = 1
let Tlist_WinWidth = 40
let Tlist_Exit_OnlyWindow = 1
let Tlist_Ctags_Cmd='D:\Vim\vim73\ctags.exe'
map <C-f> :TlistToggle<CR>
"bufexplorer
let g:bufExplorerDefaultHelp=1
let g:bufExplorerDetailedHelp=0
let g:bufExplorerSortBy='mru'
nmap <C-X> :BufExplorer<CR>
" php editing
" remove CR at end of lines
let PHP_removeCRwhenUnix = 1
" Set up automatic formatting
set formatoptions+=tcqlro
" Set maximum text width (for wrapping)
set textwidth=110
" NERD Commenter
let NERDShutUp = 1
filetype plugin on
"为指定后缀的文件指定字典文件
autocmd FileType php set dictionary=D:\Vim\vimfiles\php.txt
autocmd FileType python set dictionary=D:\Vim\vimfiles\python-complete-dict
autocmd FileType python set dictionary=D:\Vim\vimfiles\html.txt
"为指定后缀的文件指定模板文件
"au FileType python set ft=python.django
"au FileType html set ft=htmldjango.html
set complete-=k complete+=k
set runtimepath+=D:\Vim\vimfiles\vim-php-manual
au BufNewFile,Bufread *.module,*.inc,*.php,*.install,*.test set keywordprg="help"
au BufNewFile,BufRead *.install,*.inc,*.module,*.test set filetype=php
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {}<ESC>i
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap < <><ESC>i
:inoremap > <c-r>=ClosePair('>')<CR>
:inoremap ' ''<ESC>i
:inoremap " ""<ESC>i
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endfunction
"取消高亮
set nohls
"窗口最大化
au GUIEnter * simalt ~x
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=b
set guioptions-=l
"dir /s /b *.php > cscope.files
"cscope -b
"jj退出编辑状态 默认是按Esc  这个不方便
imap jj <Esc>
let g:SuperTabMappingForward="<tab>"

 

主要配置

1, 安装supertab插件  按tab自动补全  默认是 ctrl+n /ctrl+p

2,   snipMate 快速模板编程

3,解决 supertab 和 snipMate tab键冲突   有snipMate模板匹配执行snipMate  否则 执行tab自动补全

   就是  let g:SuperTabMappingForward="<tab>"  这个配置

4,php python 基于字典文件的自动完成

利用   

这个插件下载后只用于生成python字典文件  不安装这个插件  

 

 

需要我配置好的压缩包的同学 可以发邮件给我 quqiufeng@gmail.com

转载于:https://www.cnblogs.com/quqiufeng/archive/2011/10/29/2228263.html

你可能感兴趣的文章
IP 地址分类
查看>>
国家地区域名
查看>>
2018/3/26 省选模拟赛 60分
查看>>
201521123060 《Java程序设计》第5周学习总结
查看>>
Linux驱动程序学习备忘之六
查看>>
使用 Unity(二):配置 Unity 、读取配置信息和获取对象
查看>>
导出数据库中所有的对象到指定的目录bcp xp_cmdshell
查看>>
LNMP环境搭建
查看>>
你应该掌握的四种参数估计技术
查看>>
【计算机】DMA原理1
查看>>
百度前端学院-基础学院-第20到21天
查看>>
c#之冒泡排序的三种实现和性能分析
查看>>
订单删除,增加订单,巩固表单特定用法
查看>>
Linux命令之---nl
查看>>
nginx + uwsgi 跑python应用
查看>>
asp.net通过基类实现统一脚本和样式的管理
查看>>
『转』Bitdefender Internet Security 2013 – 免费1年
查看>>
pytorch搭建神经网络-第一篇博客
查看>>
Sublime Text 3 快捷键总结(拿走)
查看>>
return,break与continue的区别
查看>>