美文网首页
vim的配置文件

vim的配置文件

作者: 统计学徒 | 来源:发表于2018-12-01 09:36 被阅读0次

记录一下。

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
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      if empty(&shellxquote)
        let l:shxq_sav = ''
        set shellxquote&
      endif
      let cmd = '"' . $VIMRUNTIME . '\diff"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction

"----------------------------- 配置,双引号后面为注释掉的内容 ---------------------------------
"显示中文不乱码
let &termencoding=&encoding
set fileencodings=utf-8,gbk,ucs-bom,cp936,chinese,ucs-bom

"永久显示行号
set nu!

"colorscheme evening    "配色方案

set tabstop=4       "设置tab的跳数
set autoread        "设置当文件在外部被修改,自动更新该文件
set mouse=a         "设置在任何模式下鼠标都可用
set nobackup        "设置不生成备份文件

"设置不生成 .un 文件
set noundofile
set nobackup
set noswapfile

"===========================
"查找/替换相关的设置
"===========================
set hlsearch "高亮显示查找结果
set incsearch "增量查找
 
"===========================
"状态栏的设置
"===========================
set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%] "显示文件名:总行数,总的字符数
set ruler "在编辑过程中,在右下角显示光标位置的状态行
"
"===========================
"代码设置
"===========================
syntax enable "打开语法高亮
syntax on "打开语法高亮
set showmatch "设置匹配模式,相当于括号匹配
set smartindent "智能对齐
"set shiftwidth=4 "换行时,交错使用4个空格
set autoindent "设置自动对齐
set ai! "设置自动缩进
"set cursorcolumn "启用光标列
set cursorline  "启用光标行
set guicursor+=a:blinkon0 "设置光标不闪烁
set fdm=indent  "代码缩进折叠 

"===========================
"多文件编辑
"===========================
"let g:miniBufExplMapCTabSwitchBufs=1
"let g:miniBufExplMapWindowsNavVim=1
"let g:miniBufExplMapWindowNavArrows=1

相关文章

  • vim中的.vimrc

    默认的配置文件 安装vim 之后,默认只会有 $ vim ~/.viminfo, 是没有 $ vim ~/.vim...

  • VIM显示行号以及各种配置文件

    1、在unbutu中vim的配置文件存放在/etc/vim目录中,配置文件名为vimrc 2、显示行号 进入vim...

  • leoatchina的修改后的spf13-vim配置

    leoatchina的vim配置文件 This is leoatchina's vim config forked...

  • vim c++ 代码自动格式化配置

    安装 vim 插件 auto-format 安装 Artistic Style 配置 vim 配置文件 .vim...

  • vim设置修改及命令

    修改vim环境 打开vim的配置文件:sudo vim /etc/vim/vimr #光标移动至文件末端,添加一新...

  • vim学习笔记

    vim 配置文件 在vim启动过程中,首先将查找配置文件并执行其中的命令,配置文件有三类 vimrc gvimrc...

  • vim简单操作与配置

    vim 编辑器之神Emacs 神的编辑器 vim配置 ~/.vimrc 配置文件 vimplugin 管理vim插...

  • vim光标移动

    编辑vim配置文件,vim/vimrc。vim编辑不同类型的文件,会显示不同的颜色 vim 光标移动 方向键 h ...

  • 改变vim中tab的长度

    打开vim配置文件(比如sudo,或su进入root模式) 1.sudo vim /etc/vim/vimrc 添...

  • Vi学习

    趁着台风,在家学习学习vi vim的配置 .vimrc文件是vim的配置文件,位于~/.vimrc, vim的字体...

网友评论

      本文标题:vim的配置文件

      本文链接:https://www.haomeiwen.com/subject/qfslcqtx.html