zoukankan      html  css  js  c++  java
  • vim配置文件

    windows环境的gvim配置文件,安装目录/vim/_vimrc

    set nocompatible  "不要使用vi的键盘模式,而是vim自己的
    source $VIMRUNTIME/vimrc_example.vim
    source $VIMRUNTIME/mswin.vim
    behave mswin

    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'
      endif
      silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
    endfunction

    """"""""""""""""""""""""
    "编码设置
    """"""""""""""""""""""""
    set encoding=utf-8  "Vim内部使用的字符编码方式
    set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,latin1 "对编码进行自动识别
    if has("win32")
     set fileencoding=cp936
    else
     set fileencoding=utf-8
    endif
    source $VIMRUNTIME/delmenu.vim
    set langmenu=zh_CN.utf-8
    source $VIMRUNTIME/menu.vim
    language message zh_CN.utf-8
    set termencoding=cp936  "控制台下显示中文

    set number  "显示行号
    colorscheme torte  "配色方案
    syntax enable  "语法高亮
    syntax on  "语法着色
    set history=100  "历史记录数
    set autoindent  "普通自动缩进
    set smartindent  "增强自动缩进
    set cindent  "C程序自动缩进
    set tabstop=8  "Tab键的宽度
    set softtabstop=4  "软Tab键的宽度
    set shiftwidth=4  "自动缩进宽度
    set confirm  "在处理未保存或只读文件的时候,弹出确认
    filetype on  "侦测文件类型
    filetype plugin on  "载入文件类型插件
    filetype plugin indent on  "为特定文件类型载入相关缩进文件
    set nobackup  "禁止生成临时文件
    cd D:Program Files omcatwebappsmyWebSiteWEB-INFclasses "设置工作目录
    au GUIEnter * simalt ~x "窗口启动最大化
    setlocal omnifunc=javacomplete#Complete "Java自动补全功能

    """"""""""""""""""""""""""""""
    " winManager setting
    """"""""""""""""""""""""""""""
    let g:winManagerWindowLayout = "BufExplorer,FileExplorer|TagList"
    let g:defaultExplorer = 0
    let g:bufExplorerMinHeight=10  "固定缓冲列表高度,需修改原文件
    nmap <silent> <F9> :WMToggle<cr>  "设置快捷键为F9


    Linux环境的vim配置文件,/etc/vim/.vimrc

    "————————
    "通用设置
    "————————
    "不使用与vi兼容的键盘模式
    set nocompatible
    "检测文件的类型
    filetype on
    "记录历史的行数
    set history=100
    "不生成备份文件
    set nobackup

    "————————
    "界面设置
    "————————
    "显示行号
    set number!
    "高亮显示当前行
    "set cursorline
    "背景使用黑色
    set background=dark
    "去除vim的GUI版本中的toolbar
    set guioptions-=T
    "在编辑过程中,在右下角显示光标位置
    set ruler

    "———————
    "格式设置
    "———————
    "自动换行
    set wrap
    "整词换行
    set linebreak
    "自动对齐
    set autoindent
    "智能对齐
    set smartindent
    "设置自动缩进
    set ai!
    "设置tab键为4个空格
    set tabstop=4
    "设置行间交错为4个空格
    set shiftwidth=4
    "使退格键可用
    set backspace=2
    "允许backspace和光标键跨越行边界
    set whichwrap+=<,>,h,l

    "———————
    "编程设置
    "———————
    "语法高亮度显示
    syntax on
    "设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
    set showmatch

    "———————
    "搜索相关设置
    "———————
    "默认情况下,搜索结果是高亮度显示的,该设置关闭高亮显示
    "set nohlsearch
    "随输入增量搜索
    set incsearch

  • 相关阅读:
    mysql数据库
    Python中socket编程
    Python中logging模块
    Python中的多进程
    Python中并发、多线程等
    Python模块化
    Python中异常处理
    KafKa入门
    kafka入门:简介、使用场景、设计原理、主要配置及集群搭建(转)
    第一节 MongoDB介绍及下载与安装
  • 原文地址:https://www.cnblogs.com/gorechen/p/4169110.html
Copyright © 2011-2022 走看看