gVIM+zencoding快速开发HTML/CSS/JS(适用WEB前端)

一、真正解决了UTF-8中文乱码的各种问题(菜单乱码,内容乱码,提示信息乱码),不用担心WIN用默认编码写的东西在Linux乱码,或在Linux(zh_CN.UTF-8时)写的东西在WIN下乱码。在Arch、CentOS 6.2、win 7 SP1,使用GVIM 7.3.46测试通过,无问题。
二、添加了zenconding,配色方案包,JS,自动补全插件,使前端开发更快速。
三、使用时将vimfiles、_vimrc覆盖至安装目录即可。
四、参考了论坛里一些网友的设置,并附上其教程,表示感谢。
五、VIM博大精深(对我来说),如有疑惑,请参考附件手册。仅此而已。 
附上一张图 

1. [图片] VIM配置文件    


​2. [代码][其他]代码  
set nocompatible
"source $VIMRUNTIME/vimrc_example.vim "软件安装默认,source入vimrc_example.vim后,在设置encoding=utf-8时,将导致中文菜单乱码难以解决
source $VIMRUNTIME/mswin.vim
behave mswin
 
" 字体、字号
set guifont=Courier\ New:h13
 
" 编码设置
set encoding=utf-8
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set ffs=unix,dos,mac
set ff=unix                         "设置文件格式为UNIX格式
 
set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else 皇冠图片
    let cmd = $VIMRUNTIME . '\diff'
  endifhttp://www.enterdesk.com/special/huangguantp/​
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
"================================
 
 
colorscheme darkblue2        " 配色方案darkblue2 
syntax enable                " 打开语法高亮
syntax on                    " 开启文件类型侦测
filetype indent on           " 针对不同的文件类型采用不同的缩进格式
filetype plugin on           " 针对不同的文件类型加载对应的插件
filetype plugin indent on
set tabstop=4                " 设置tab键的宽度
set shiftwidth=4             " 换行时行间交错使用4个空格
set autoindent               " 自动对齐
set backspace=2              " 设置退格键可用
set cindent shiftwidth=4     " 自动缩进4空格
set smartindent              " 智能自动缩进
set ai!                      " 设置自动缩进
set nu!                      " 显示行号
set showmatch               " 显示括号配对情况
set mouse=a                  " 启用鼠标
set ruler                    " 右下角显示光标位置的状态行
set incsearch                " 查找book时,当输入/b时会自动找到
set hlsearch                 " 开启高亮显示结果
set incsearch                " 开启实时搜索功能
set nowrapscan               " 搜索到文件两端时不重新搜索
set nocompatible             " 关闭兼容模式
set vb t_vb=                 " 关闭提示音
set cursorline              " 突出显示当前行
set hidden                   " 允许在有未保存的修改时切换缓冲区
set list                     
set listchars=tab:\|\ ,     " 显示Tab符,使用一高亮竖线代替
"set listchars=tab:>-,trail:-    " 显示Tab符,使用" >-- "代替
 
if has("gui_running")
    au GUIEnter * simalt ~x  " 窗口启动时自动最大化
    "set guioptions-=m       " 隐藏菜单栏
    "set guioptions-=T       "隐藏工具栏,注释时启用工具栏,里面有个保存当前会话和加载会话挺有用,当然也可以用命令实现。
    set guioptions-=L       " 隐藏左侧滚动条
    set guioptions-=r       " 隐藏右侧滚动条
    "set guioptions-=b       " 隐藏底部滚动条
    "set showtabline=0       " 隐藏Tab栏
endif
 
set writebackup              " 设置无备份文件
set nobackup
set autochdir                " 设定文件浏览器目录为当前目录
"set nowrap                  " 设置不自动换行
set foldmethod=syntax        " 选择代码折叠类型
set foldlevel=100            " 禁止自动折叠
 
 
" For Haskell
:let hs_highlight_delimiters=1            " 高亮定界符
:let hs_highlight_boolean=1               " 把True和False识别为关键字
:let hs_highlight_types=1                 " 把基本类型的名字识别为关键字
:let hs_highlight_more_types=1            " 把更多常用类型识别为关键字
:let hs_highlight_debug=1                 " 高亮调试函数的名字
:let hs_allow_hash_operator=1             " 阻止把#高亮为错误
 
 
set laststatus=2                          " 开启状态栏信息
set cmdheight=1                           " 命令行的高度,默认为1,这里可以重设
 
" 状态行显示的内容 [包括系统平台、文件类型、坐标、所占比例、时间等]
set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\ %y%r%m%*%=\ %{strftime(\"%y/%m/%d\ -\ %h:%m\")}

转载于:https://www.cnblogs.com/xkzy/p/3951695.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值