[原创]vim配置文件收集(作为c/c++和脚本开发的环境) 6月2日更新
- toawinner47
- 帖子: 200
- 注册时间: 2006-11-08 20:46
- 联系:
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
这个和vim没有关系吧。是.ICEauthority权限的问题??怎么像是/home下面一些文件权限的不对了。
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
-
- 帖子: 7
- 注册时间: 2008-09-26 21:24
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
我的gvim7.2添加了c.vim这个插件,可是编译,链接,run这几个快捷键不能用,请问是怎么回事啊?
下面是我的配置:
set nocompatible
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM userinterface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"选择配置方案
colorscheme putty
"选择字体及大小
set guifont=Lucida_Console:h11:cANSI
"语法高亮
syntax on
"显示行号
set number
"不在单词中间断行
set lbr
"set tab stop
set tabstop=4 " 实际的 tab 即为 4 个空格, tabstop = 4 is better for c programming
set shiftwidth=4 "设置自动缩进 4 个空格, 当然要设自动缩进先.
set softtabstop=4 "即设置 softtabstop 为 4. 输入 tab 后就跳了 4 格.
set expandtab "在输入 tab 后, vim 用恰当的空格来填充这个 tab
"命令行高度
set cmdheight=2
"No sound on errors.
set noerrorbells
set visualbell " when error, flash as visual bell
"允许在有未保存的修改时切换缓冲区
set hidden
"搜索关键字不要高亮
set nohlsearch
"自动切换当前目录为当前文件所在的目录
set autochdir
"用确认对话框(对于gvim)或命令行选项(对于vim)来代替有未保存内容时的警告信息
set confirm
"显示状态栏 (默认值为 1, 无法显示状态栏)
set laststatus=2
" 设置在状态行显示的信息如下:
" %F 当前文件名
" %m 当前文件修改状态
" %r 当前文件是否只读
" %Y 当前文件类型
" %{&fileformat}
" 当前文件编码
" %b 当前光标处字符的 ASCII 码值
" %B 当前光标处字符的十六进制值
" %l 当前光标行号
" %c 当前光标列号
" %V 当前光标虚拟列号 (根据字符所占字节数计算)
" %p 当前行占总行数的百分比
" %% 百分号
" %L 当前文件总行数
set statusline=%F%m%r,%Y,%{&fileformat}\ \ \ ASCII=\%b,HEX=\%B\ \ \ %l,%c%V\ %p%%\ \ \ [\ %L\ lines\ in\ all\ ]
下面是我的配置:
set nocompatible
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM userinterface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"选择配置方案
colorscheme putty
"选择字体及大小
set guifont=Lucida_Console:h11:cANSI
"语法高亮
syntax on
"显示行号
set number
"不在单词中间断行
set lbr
"set tab stop
set tabstop=4 " 实际的 tab 即为 4 个空格, tabstop = 4 is better for c programming
set shiftwidth=4 "设置自动缩进 4 个空格, 当然要设自动缩进先.
set softtabstop=4 "即设置 softtabstop 为 4. 输入 tab 后就跳了 4 格.
set expandtab "在输入 tab 后, vim 用恰当的空格来填充这个 tab
"命令行高度
set cmdheight=2
"No sound on errors.
set noerrorbells
set visualbell " when error, flash as visual bell
"允许在有未保存的修改时切换缓冲区
set hidden
"搜索关键字不要高亮
set nohlsearch
"自动切换当前目录为当前文件所在的目录
set autochdir
"用确认对话框(对于gvim)或命令行选项(对于vim)来代替有未保存内容时的警告信息
set confirm
"显示状态栏 (默认值为 1, 无法显示状态栏)
set laststatus=2
" 设置在状态行显示的信息如下:
" %F 当前文件名
" %m 当前文件修改状态
" %r 当前文件是否只读
" %Y 当前文件类型
" %{&fileformat}
" 当前文件编码
" %b 当前光标处字符的 ASCII 码值
" %B 当前光标处字符的十六进制值
" %l 当前光标行号
" %c 当前光标列号
" %V 当前光标虚拟列号 (根据字符所占字节数计算)
" %p 当前行占总行数的百分比
" %% 百分号
" %L 当前文件总行数
set statusline=%F%m%r,%Y,%{&fileformat}\ \ \ ASCII=\%b,HEX=\%B\ \ \ %l,%c%V\ %p%%\ \ \ [\ %L\ lines\ in\ all\ ]
-
- 帖子: 9
- 注册时间: 2008-09-25 18:37
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
好文章阿,收藏了~
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
windows下面$PATH下面没有make.exe ?insmile 写了:我的gvim7.2添加了c.vim这个插件,可是编译,链接,run这几个快捷键不能用,请问是怎么回事啊?
下面是我的配置:
set nocompatible
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM userinterface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"选择配置方案
colorscheme putty
"选择字体及大小
set guifont=Lucida_Console:h11:cANSI
"语法高亮
syntax on
"显示行号
set number
"不在单词中间断行
set lbr
"set tab stop
set tabstop=4 " 实际的 tab 即为 4 个空格, tabstop = 4 is better for c programming
set shiftwidth=4 "设置自动缩进 4 个空格, 当然要设自动缩进先.
set softtabstop=4 "即设置 softtabstop 为 4. 输入 tab 后就跳了 4 格.
set expandtab "在输入 tab 后, vim 用恰当的空格来填充这个 tab
"命令行高度
set cmdheight=2
"No sound on errors.
set noerrorbells
set visualbell " when error, flash as visual bell
"允许在有未保存的修改时切换缓冲区
set hidden
"搜索关键字不要高亮
set nohlsearch
"自动切换当前目录为当前文件所在的目录
set autochdir
"用确认对话框(对于gvim)或命令行选项(对于vim)来代替有未保存内容时的警告信息
set confirm
"显示状态栏 (默认值为 1, 无法显示状态栏)
set laststatus=2
" 设置在状态行显示的信息如下:
" %F 当前文件名
" %m 当前文件修改状态
" %r 当前文件是否只读
" %Y 当前文件类型
" %{&fileformat}
" 当前文件编码
" %b 当前光标处字符的 ASCII 码值
" %B 当前光标处字符的十六进制值
" %l 当前光标行号
" %c 当前光标列号
" %V 当前光标虚拟列号 (根据字符所占字节数计算)
" %p 当前行占总行数的百分比
" %% 百分号
" %L 当前文件总行数
set statusline=%F%m%r,%Y,%{&fileformat}\ \ \ ASCII=\%b,HEX=\%B\ \ \ %l,%c%V\ %p%%\ \ \ [\ %L\ lines\ in\ all\ ]
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
-
- 帖子: 7
- 注册时间: 2008-09-26 21:24
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
Re:
这个问题修正了kofshower 写了:忘了说了环境是vim 7.2
而且一些设置需要python模块的支持
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
- banban
- 帖子: 3340
- 注册时间: 2008-03-23 17:01
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
呵呵,不错。。。
- Jarson
- 帖子: 2371
- 注册时间: 2008-07-21 9:44
- 来自: 深圳
- 联系:
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
看不懂,是不是把vim的配置文件修改成楼主的那样就可以有像楼主的一样的效果了?那些插件是怎么装的?
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
恩,可是最好还是看看那个贴出来的文件.vimrc,因为包里的东西不如贴出来的新,因为现在我自己的包远远不止是c++和ruby开发环境了,所以不好贴了.fhc2007 写了:看不懂,是不是把vim的配置文件修改成楼主的那样就可以有像楼主的一样的效果了?那些插件是怎么装的?
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
- Jarson
- 帖子: 2371
- 注册时间: 2008-07-21 9:44
- 来自: 深圳
- 联系:
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
kofshower 写了:恩,可是最好还是看看那个贴出来的文件.vimrc,因为包里的东西不如贴出来的新,因为现在我自己的包远远不止是c++和ruby开发环境了,所以不好贴了.fhc2007 写了:看不懂,是不是把vim的配置文件修改成楼主的那样就可以有像楼主的一样的效果了?那些插件是怎么装的?
谢谢!
-
- 帖子: 403
- 注册时间: 2007-10-27 1:04
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
楼主,请问,你在8楼的图二中查看api,是那个如何实现的?
还是同一张图片,它的下方的编译区又是如何设置出来的呢?
谢谢指教。
还是同一张图片,它的下方的编译区又是如何设置出来的呢?
谢谢指教。
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
有好多办法,早期的时候是直接用终端划分窗口,sarrow 写了:楼主,请问,你在8楼的图二中查看api,是那个如何实现的?
还是同一张图片,它的下方的编译区又是如何设置出来的呢?
谢谢指教。
现在喜欢用重载vim的keywordprg,
最终阶段打算自己写个api的字典,放在balloonexpr接口里面,那时候的效果和IDE就没有两样了
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
还有一件事情,就是其实划分终端或是用screen是必须的,因为vimsh之类的vim终端扩展,使用的是重定向做的,效果很不好
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
-
- 帖子: 403
- 注册时间: 2007-10-27 1:04
Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)
kofshower,你的意思是不是,你在那个8楼中的贴图二,其下方的编译区是通过终端划分窗口划出来的?
而右侧的api窗口则是通过vim实现的,内容则是你自己写的?
能贴一下具体的设置,并说明一下如何创建自己的api字典?网上有人把这些成果分享出来吗?
我搜索过vim C-doc,C++ doc 类似的关键词,可都没有找到符合自己要求的。
再次感谢。
而右侧的api窗口则是通过vim实现的,内容则是你自己写的?
能贴一下具体的设置,并说明一下如何创建自己的api字典?网上有人把这些成果分享出来吗?
我搜索过vim C-doc,C++ doc 类似的关键词,可都没有找到符合自己要求的。
再次感谢。