Corey/vimrc:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Corey留言 | 贡献
无编辑摘要
 
(未显示3个用户的5个中间版本)
第1行: 第1行:
=== vimrc的一个简单例子 ===
=== vimrc的一个简单例子 ===
是一个我自己的简单例子,经过简单的修改就可以变成你自己的,enjoy it. 我也是修改别人的,呵呵
是一个我自己的简单例子,经过简单的修改就可以变成你自己的,enjoy it. 我也是修改别人的,呵呵
另外,https://github.com/kepbod/vim-config 里的配置也很不错,可以去看看


注意看下面的文本里面的注释。 拷贝,修改里面注释的地方,粘在vim的安装目录_vimrc里面。
注意看下面的文本里面的注释。 拷贝,修改里面注释的地方,粘在vim的安装目录_vimrc里面。
第13行: 第16行:


我这里是作为我windows上实际使用的文件,同时也是说明怎么使用字体名称带空格的方法。
我这里是作为我windows上实际使用的文件,同时也是说明怎么使用字体名称带空格的方法。
最近写的一个插件,截图和下载地址<br>
http://www.vim.org/scripts/script.php?script_id=2194<br>
[[Image:Vim_marks.PNG]]<br>


==== _vimrc windows版 ====
==== _vimrc windows版 ====
第78行: 第87行:




</pre>
</pre>  
 
==== vimrc Ubuntu版 ====
==== vimrc Ubuntu版 ====
<pre><nowiki>
<pre>" ######## Ubuntu vim 7.0 ########
" ######## Ubuntu vim 7.0 ########
" ######## 注意这个部分是用在Ubuntu上面的 适用于vim7.0,只需拷贝添加到你的vim安装目录下(/etc/vim/vimrc)文件中任意位置。
" ######## 注意这个部分是用在Ubuntu上面的 适用于vim7.0,只需拷贝添加到你的vim安装目录下(/etc/vim/vimrc)文件中任意位置。
colo corey
colo corey
第93行: 第100行:
set nobk
set nobk


</nowiki></pre>
</pre>  
==== 配色方案(corey.vim) ====
==== 配色方案(corey.vim) ====
<pre><nowiki>
" Vim color file
" Vim color file
" Maintainer: corey
" Maintainer:   corey
" Last Change: 2005 November 21
" Last Change: 2005 November 21
" This color scheme uses a dark grey background.
" This color scheme uses a dark grey background.
" First remove all existing highlighting.
" First remove all existing highlighting.
set background=dark
set background=dark
hi clear
hi clear
if exists("syntax_on")
if exists("syntax_on")
syntax reset
syntax reset
endif
endif
let colors_name = "corey"
let colors_name = "corey"
hi Normal ctermbg=DarkGrey ctermfg=White guifg=White guibg=grey20
hi Normal ctermbg=DarkGrey ctermfg=White guifg=White guibg=grey20
" Groups used in the 'highlight' and 'guicursor' options default value.
" Groups used in the 'highlight' and 'guicursor' options default value.
hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
hi IncSearch term=reverse cterm=reverse gui=reverse
hi IncSearch term=reverse cterm=reverse gui=reverse
hi ModeMsg term=bold cterm=bold gui=bold
hi ModeMsg term=bold cterm=bold gui=bold
"hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold
"hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold
"hi StatusLineNC term=reverse cterm=reverse gui=reverse
"hi StatusLineNC term=reverse cterm=reverse gui=reverse
hi StatusLine term=reverse cterm=reverse,bold guibg=black guifg=White
hi StatusLine term=reverse cterm=reverse,bold guibg=black guifg=White
hi StatusLineNC term=reverse cterm=reverse guibg=White guifg=darkgray
hi StatusLineNC term=reverse cterm=reverse guibg=White guifg=darkgray
"hi StatusLine term=reverse,bold cterm=reverse gui=NONE guifg=White guibg=darkblue
"hi StatusLine term=reverse,bold cterm=reverse   gui=NONE             guifg=White guibg=darkblue
"hi StatusLineNC term=reverse cterm=reverse gui=NONE guifg=white guibg=#333333
"hi StatusLineNC term=reverse   cterm=reverse     gui=NONE             guifg=white guibg=#333333
hi VertSplit term=reverse cterm=reverse gui=reverse
hi VertSplit term=reverse cterm=reverse gui=reverse
hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
hi Cursor guibg=Green guifg=Black
hi Cursor guibg=Green guifg=Black
hi lCursor guibg=Cyan guifg=Black
hi lCursor guibg=Cyan guifg=Black
hi Directory term=bold ctermfg=LightCyan guifg=Cyan
hi Directory term=bold ctermfg=LightCyan guifg=Cyan
hi LineNr term=underline ctermfg=LightCyan guifg=LightCyan
hi LineNr term=underline ctermfg=LightCyan guifg=LightCyan
hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
hi NonText term=bold ctermfg=LightBlue gui=bold guifg=LightBlue guibg=grey30
hi NonText term=bold ctermfg=LightBlue gui=bold guifg=LightBlue guibg=grey30
hi Question term=standout ctermfg=LightGreen gui=bold guifg=Green
hi Question term=standout ctermfg=LightGreen gui=bold guifg=Green
hi Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
hi Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan
hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan
hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta
hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta
hi WarningMsg term=standout ctermfg=LightRed guifg=Red
hi WarningMsg term=standout ctermfg=LightRed guifg=Red
hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
hi Folded term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
hi Folded term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
hi FoldColumn term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
hi FoldColumn term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
hi DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta
hi DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta
hi DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan
hi DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan
" Groups for syntax highlighting
" Groups for syntax highlighting
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
if &t_Co > 8
hi CursorLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
if &amp;t_Co &gt; 8
endif
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
hi Ignore ctermfg=DarkGrey guifg=grey20
endif
" vim: sw=2
hi Ignore ctermfg=DarkGrey guifg=grey20
</nowiki></pre>
" vim: sw=2
 
 
 
----
----
* [[支持所有版本类]]
* [[支持所有版本类]]

2016年6月15日 (三) 11:05的最新版本

vimrc的一个简单例子

是一个我自己的简单例子,经过简单的修改就可以变成你自己的,enjoy it. 我也是修改别人的,呵呵

另外,https://github.com/kepbod/vim-config 里的配置也很不错,可以去看看

注意看下面的文本里面的注释。 拷贝,修改里面注释的地方,粘在vim的安装目录_vimrc里面。

然后就可以打开gvim试一下了。

第一个个是在windows上vim7.0测试通过的, 第二个是用于ubuntu上。

注意有可能拷贝到ubuntu时,行尾会带有WINDOWS的换行回车,

可以直接在vim里面从新打开.vimrc这个文件,删掉行尾怪怪的符号就行了。和修改set guifont为你的ubuntu可用的字体和编码格式。

我这里是作为我windows上实际使用的文件,同时也是说明怎么使用字体名称带空格的方法。

最近写的一个插件,截图和下载地址

http://www.vim.org/scripts/script.php?script_id=2194


_vimrc windows版

" ######## windows vim 7.1 ########
" ######## 注意这个部分是用在windows上面的 适用于vim7.1,只需拷贝覆盖你的vim安装目录下_vimrc文件。 "下面几行保证你使用的时候类似windows其它的编辑器,Ctrl+v Ctrl+c 也可以用了
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin     
colo corey "//这里需要修改成你喜欢的,要不然就把我底下的文件拷贝下来,粘在vim的colors目录下起名corey.vim里面。
"不换行显示

set nowrap "把tab键转化为空格
set expandtab "不忽略大小写
set noignorecase
"显示下面的横向滚动条
set guioptions+=b 
"高亮显示当前光标行
set cul
"下面两句是,当你是插入模式时候,取消行高亮
au InsertEnter * set nocul
au InsertLeave * set cul
"放开下面的注释,为开始的时候自动窗口最大化
"au GUIEnter * simalt ~x "maximum the initial window


"在状态行显示一些编码信息
if has("statusline")
set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
endif
"默认设置ctag寻找tags文件的路径,
set tags=tags,./tags

set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set guifont=NSimSun:h14:cGB2312


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




vimrc Ubuntu版

" ######## Ubuntu vim 7.0 ########
" ######## 注意这个部分是用在Ubuntu上面的 适用于vim7.0,只需拷贝添加到你的vim安装目录下(/etc/vim/vimrc)文件中任意位置。
colo corey
set number
set shiftwidth=4
set softtabstop=4
set tabstop=4
set fileencodings=ucs-bom,utf-8
set guifont=Monospace\ 16
set nobk

配色方案(corey.vim)

" Vim color file
" Maintainer: corey
" Last Change: 2005 November 21
" This color scheme uses a dark grey background.
" First remove all existing highlighting.
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "corey"
hi Normal ctermbg=DarkGrey ctermfg=White guifg=White guibg=grey20
" Groups used in the 'highlight' and 'guicursor' options default value.
hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
hi IncSearch term=reverse cterm=reverse gui=reverse
hi ModeMsg term=bold cterm=bold gui=bold
"hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold
"hi StatusLineNC term=reverse cterm=reverse gui=reverse
hi StatusLine term=reverse cterm=reverse,bold guibg=black guifg=White
hi StatusLineNC term=reverse cterm=reverse guibg=White guifg=darkgray
"hi StatusLine term=reverse,bold cterm=reverse gui=NONE guifg=White guibg=darkblue
"hi StatusLineNC term=reverse cterm=reverse gui=NONE guifg=white guibg=#333333
hi VertSplit term=reverse cterm=reverse gui=reverse
hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
hi Cursor guibg=Green guifg=Black
hi lCursor guibg=Cyan guifg=Black
hi Directory term=bold ctermfg=LightCyan guifg=Cyan
hi LineNr term=underline ctermfg=LightCyan guifg=LightCyan
hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
hi NonText term=bold ctermfg=LightBlue gui=bold guifg=LightBlue guibg=grey30
hi Question term=standout ctermfg=LightGreen gui=bold guifg=Green
hi Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan
hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta
hi WarningMsg term=standout ctermfg=LightRed guifg=Red
hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
hi Folded term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
hi FoldColumn term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
hi DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta
hi DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan
" Groups for syntax highlighting
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5

hi CursorLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE
if &t_Co > 8
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
endif
hi Ignore ctermfg=DarkGrey guifg=grey20
" vim: sw=2