G
N
I
D
A
O
L
W
e
l
c
o
m
e
: )

vimrc的的编写

.vimrc参数配置

       vim config  file

       date 2019-10-06

       created  by oldboy

       www.pyhtone.net

#全局配置

 

set      nocompatible

#关闭兼容模式

set   history=100

#设定历史记录数

filetype  on

filetype  plugin  on

filetype indent on

#开启相关的插件

set  autoread

#当文件在外部被移动时,自动更新文件

set  mouse=a

激活鼠标的使用

 

#指定字体和颜色

 

syntax   enable

#开启语法

set      guifont=dejaVu\ Sans\ MONO\ 10

#指定字体

colorscheme desert

#设置颜色

set  cursorline

hi cursorline  guibg=#00ff00

hi       CursorColumn  guibg=#00ff00

#高亮显示当前行

#代码折叠功能

set  foldenable

#设置按照语法方式折叠

有6种方法

manual   手工定义折叠

indent   更多的缩进表示更高级别的折叠

expr     用表达式来定义折叠

syntax   用语法高亮来定义折叠

diff     对没有更改的文本进行折叠

marker   对文中的标志进行折叠

set      foldmethod=manual

 

set   foldcolumn=0

#设定折叠区域宽度

setlocal  foldlevel=3

#设定折叠的层数

set  foldclose=all

#设定为自动关闭折叠

"zo O-pen a fold" 

#打开折叠

"zc C-lose a  fold"

#关闭折叠

"zf  F-old creation"

#创建折叠

 

####文字处理

set   expandtab

#使用空格来替代tab

set  tabstop=4

#设置所有的Tab和缩进4个空格

 

 

 

set   shiftwidth=4

#设定<<和>>命令移动时的宽度为4

set       softtabstop=4

#按退格键时可以一次删除4个空格

set         smarttab

#缩进,自动缩进

set   autoindent

#关闭自动缩进

set  ai

#配置缩写,可以使用:autoindent命令的缩写,即set  ai 和set  noai还可以使用set  ai   sw=4

set   si

#智能缩进

set   wrap

#自动换行

set  sw=4

设置软宽度

 

#####界面软宽度

set    wildmenu

#Turn   on  wild  menu

set    ruler

#显示标尺

set   nu

#显示行数

set   lz

#do   not   redraw  when  running  macros  ..  lazyredraw

set   backspace=eol ,start,indent

#设定退格

set  whichwrap+<,>,h,l

#Bbackspace  and  cursor  keys  wrap to

set  magic 

#设置魔术on

set  noerrorbells

#关闭遇到错误时的声音提示

#关闭错误信息响铃

set  novisualbell

#关闭使用可视响铃代替呼叫

set    showmatch

#显示匹配的括号({[]})

set  mat=2

#how  many  tenths  of a second   to  blink

set    hlsearch

#搜索时高亮显示内容

set    igmorecase

#搜索时不区分大小写,还可以使用简写(set  ic和set  noic)

 

 

#####编码设置

set  encoding=utf-8

#设置编码

set  termencoding=utf-8

#设置终端编码

 

######其他设置by  oldboy  2010

set    smartindent

set    cin

set    showmatch

#开启新行使用智能自动缩进

 

set    guioptions-=T

#隐藏菜单栏

set   vb  v_vb=

#置空错误铃声的终端代码

set   laststatus=2

#显示状态栏(默认值为1,表示无法显示状态栏)

set    pastetoggle=<F9>

#粘贴不换行问题解决方法

set   background=bark

#设置背景色

higlight Search  ctermbg=black   cteermfg=white  guifg=white  guibg=black

 

全部配置

                                                                                                                                                   

 [root@10 ~]# vim ~/.vimrc         

Error detected while processing /root/.vimrc:

line    8:

E492: Not an editor command: 激活鼠标的使用

Press ENTER or type command to continue

set     nocompatible                                                                                                                                                       

set   history=100

filetype  on

filetype  plugin        on

filetype         indent on

set  autoread

set  mouse=a

激活鼠标的使用

syntax  enable

set     guifont=dejaVu\ Sans\ MONO\ 10

colorscheme desert

set  cursorline

hi cursorline  guibg=#00ff00

hi      CursorColumn    guibg=#00ff00

set  foldenable

"zo O-pen a fold" 

"""zc C-lose a  fold"

"zf  F-old creation"

""

"set   expandtab

""set  tabstop=4

"

""

"

""set   shiftwidth=4

"set    softtabstop=4

""set            smarttab

"set   autoindent

""set  ai

"ai   sw=4

""set   si

"set   wrap

""set  sw=4

"设置软宽度

""

"set    wildmenu

""set    ruler

"set   nu

""set   lz

"set   backspace=eol ,start,indent

""set  whichwrap+<,>,h,l

"set  magic 

""set  noerrorbells

"set  novisualbell

""set    showmatch

"~/.vimrc" 63L, 1127C   

posted @ 2019-10-06 23:17  狸猫大侠  阅读(189)  评论(0编辑  收藏  举报