zoukankan      html  css  js  c++  java
  • 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")}
  • 相关阅读:
    Linux安装ElasticSearch,Elasticsearch安装辅助插件,IK分词器安装,使用IK分词器
    springBoot高级:自动配置分析,事件监听,启动流程分析,监控,部署
    dubbo:分布式系统中的相关概念,服务提供者,服务消费者,dubbo高级特性
    Maven高级:分模块开发与设计,聚合,集成,属性,版本管理,多环境开发配置和跳过测试,私服搭建
    springMVC:校验框架:多规则校验,嵌套校验,分组校验;ssm整合技术
    springMVC:异步调用,异步请求跨域访问,拦截器,异常处理,实用技术
    Web全段重点整理
    spring事务:事务控制方式,使用AOP控制事务,七种事务传播行为,声明事务,模板对象,模板对象原理分析
    Java基础技术基础面试【笔记】
    高级知识点:多线程,资源管理【笔记】
  • 原文地址:https://www.cnblogs.com/xkzy/p/3951695.html
Copyright © 2011-2022 走看看