Skip to content

Instantly share code, notes, and snippets.

@bitdust
Last active July 21, 2018 13:31
Show Gist options
  • Save bitdust/c3d611a5433f7587bbd1 to your computer and use it in GitHub Desktop.
Save bitdust/c3d611a5433f7587bbd1 to your computer and use it in GitHub Desktop.
vimrc 从零开始
" 默认选项
set fileencodings=utf8,cp936,gb18030,big5
syntax enable
syntax on
set number " 显示行号
set nocompatible " 与vi不兼容
set showmatch " 匹配括号
" tab相关
set tabstop=4
set smarttab
set shiftwidth=4
set expandtab
set cindent
set autoindent
filetype plugin indent on
" 配色
set t_Co=256
colorscheme desert
" 搜索
set hlsearch " highlight matches
set incsearch " incremental searching
" set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
" 代码折叠
set foldmethod=manual "默认使用手动折叠
" set foldmethod=indent "缩进折叠
" set foldmethod=syntax "语法折叠
" 保存代码折叠信息
au BufWinLeave,BufLeave,WinLeave ?* mkview
au BufWinEnter ?* silent loadview
" 参考 http://vim.wikia.com/wiki/Make_views_automatic
" zc 关闭折叠
" zo 打开折叠
" zf 创建折叠
" zd 删除折叠
" zM 关闭所有
" 参考资料
" http://coolshell.cn/articles/11312.html 无插件Vim编程技巧
" http://mislav.uniqpath.com/2011/12/vim-revisited/ Vim: revisited
" 备注
" 插入模式中,ctrl+n可以自动补全
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment