[原创]vim配置文件收集(作为c/c++和脚本开发的环境) 6月2日更新

Vim、Emacs配置和使用
头像
guiwen1158
帖子: 1078
注册时间: 2008-05-11 11:10
来自: 深圳
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#31

帖子 guiwen1158 » 2008-10-14 16:48

请问下LZ,如果不装插件,在vimrc里设置能不实现那个中英文以不同字体显示?
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#32

帖子 kofshower » 2008-10-14 18:19

sarrow 写了:kofshower,你的意思是不是,你在那个8楼中的贴图二,其下方的编译区是通过终端划分窗口划出来的?

而右侧的api窗口则是通过vim实现的,内容则是你自己写的?

能贴一下具体的设置,并说明一下如何创建自己的api字典?网上有人把这些成果分享出来吗?

我搜索过vim C-doc,C++ doc 类似的关键词,可都没有找到符合自己要求的。

再次感谢。
你看到的截图是用terminator虚拟终端搞的,我说的思路是如果叫我写vim脚本的话的思路,如果你有纯文本的c++文档,我倒是瞅瞅有空写一个.其实默认情况下vim按K不是就可以直接调man了么?
"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/
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#33

帖子 kofshower » 2008-10-14 18:25

guiwen1158 写了:请问下LZ,如果不装插件,在vimrc里设置能不实现那个中英文以不同字体显示?
这个的话和你用的Locale有关,如果设置guifontset的话,第一个字体对应的是英语,第二个字体对应你当前locale的语言,好想如果是Gtk2的话还有一个叫guifontwide设置宽字符字体,可以看看帮助
"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/
netstone
帖子: 60
注册时间: 2007-06-13 11:25

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#34

帖子 netstone » 2008-10-14 19:28

mark~
sarrow
帖子: 403
注册时间: 2007-10-27 1:04

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#35

帖子 sarrow » 2008-10-15 9:25

楼主,俺现在才搞明白你那个图单个的一个vim,而是整合了vim、终端、以及一个网页浏览器。

Orz.

请问一下,那个网页浏览器是什么名字?我也想像你这样同时查看glibc。

另,C++doc之类的text文档,可能得自己写一个脚本或是程序什么的,从现有的网页类资源中萃取出来。

你是不是想利用:helptags来做一个帮助系统?反正我是这么想的。
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#36

帖子 kofshower » 2008-10-15 20:13

昏,那个图只是一个虚拟终端,分别给了vim,终端.
至于你在终端里面可以运行w3m看网页,或是什么都行.这样的虚拟终端叫termintor.此外小的工程不需要单独的终端窗口来编译的用<leader>rr就可以运行,<leader>rc是编译.
直接写很容易啊,我不是说了vim有两个地方调用么,你可以自己给vim写一个帮助系统啊.反正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/
fvwmnet
帖子: 31
注册时间: 2008-09-30 7:28

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#37

帖子 fvwmnet » 2008-10-31 18:34

c.vim一般
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#38

帖子 kofshower » 2008-11-20 10:10

修改了一下,做了很多改进。比如自动对c++代码提示。codesnipet之类。
为了各个插件不冲突。将各个语言独立写了各自的工程配置,比如c,c++就在.vim/cpp中。
去掉minibuf这个麻烦,或是说buggy的插件。要buflist 按"\\"
2008-11-21-061801_1239x678_scrot.png
去掉了c.vim,自己对c++,c的理解写到了~/.vim/cpp/project.vim,需要看快捷键的同学可以看看。编译是F5,去掉不必要的界面是f7/ctrl+f7,此外为了修正qucikfix的问题,用了side-c,具体的参见打开c/c++菜单
强调了c,c++支持,里面tag了c和c++的文档,
新的c++外观,textmate样式的(在编ruby,perl等脚本代码时候)c++用的是inkpot。
对stl的关键字的支持。
2008-11-21-055519_1280x800_scrot.png
树形文件管理:
2008-11-21-061753_1226x692_scrot.png
对Doxygen的支持。
增加了自己写的字典插件,需要ruby支持。(@@貌似上传不了,因为太大,30多M)其中vim中有高亮,gvim中没:
2008-11-21-062832_1262x641_scrot.png
需要代码感知的话,自己放一个tags到~/.vim/cpp下面,名字就叫tags(不在压缩文件中,因为我的太大)
最后代码时候需要的帮助也加了,现在加了c的文档和c++stl的文档,这个是sgi stl的官方文档,里面还有例子:
这是文档的快捷键
""""""""""""""""""""""""""""""""""
"crefvim
"There are several ways to specify a word CRefVim should search for in order
"to view help:
"
" <Leader>cr normal mode: get help for word under cursor
" Memory aid cr: (c)-(r)eference
" <Leader>cr visual mode: get help for visually selected text
" Memory aid cr: (c)-(r)eference
" <Leader>cw: prompt for word CRefVim should search for
" Memory aid cw: (c)-reference (w)hat
" <Leader>cc: jump to table of contents of the C-reference manual
" Memory aid cc: (c)-reference (c)ontents
"
"Note: by default <Leader> is \, e.g. press \cr to invoke C-reference
"
"Note: The best way to search for an operator (++, --, %, ...) is to visually
"select it and press <Leader>cr.
""""""""""""""""""""""""""""""""""""

""""""""""""""""""""""""""""""""""""
"stlrefvim
""""""""""""""""""""""""""""""""""""
autocmd FileType c,cpp,cs source ~/.vim/cpp/stlrefvim.vim
"For example, in the expression:
" std::for_each(start, end, PrintFunc)
" place the cursor over for_each and type <Leader>tr to go to documentation for this function. Type <Leader>te to go to an example that uses this function.
--------------------------------------------------------------------------------------------------------------------
最后由于是在gentoo下面写的,所以不知道我编译的vim和大家一样不:
VIM - Vi IMproved 7.2 (2008 Aug 16, compiled Nov 1 2008 03:12:11)
Included patches: 1-25
附件
2008-11-21-061740_955x710_scrot.png
2008-11-21-061255_1280x800_scrot.png
2008-11-21-055930_1280x800_scrot.png
上次由 kofshower 在 2008-11-24 3:54,总共编辑 2 次。
"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/
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#39

帖子 kofshower » 2008-11-20 10:33

:em06 唠叨完了。以后有时间找个svn服务器。上传上去。东西大了些,论坛附件不怎么方便图片
附件
2008-11-21-063504_1279x799_scrot.png
"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/
macrohard
帖子: 147
注册时间: 2008-02-20 9:43
来自: Wuhan

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境) 更新ing

#40

帖子 macrohard » 2008-11-21 11:09

谢谢!
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境) 更新ing

#41

帖子 kofshower » 2008-11-24 3:57

"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/
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境)

#42

帖子 kofshower » 2008-11-24 4:06

sarrow 写了:楼主,俺现在才搞明白你那个图单个的一个vim,而是整合了vim、终端、以及一个网页浏览器。

Orz.

请问一下,那个网页浏览器是什么名字?我也想像你这样同时查看glibc。

另,C++doc之类的text文档,可能得自己写一个脚本或是程序什么的,从现有的网页类资源中萃取出来。

你是不是想利用:helptags来做一个帮助系统?反正我是这么想的。
现在的配置满足你的要求了
"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/
头像
www1862
帖子: 781
注册时间: 2006-05-12 0:52
来自: Chongqing China
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境) 更新ing

#43

帖子 www1862 » 2008-11-24 19:40

楼主,你的打包文件怎么用阿?
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
联系:

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境) 更新ing

#44

帖子 kofshower » 2008-11-24 20:38

没打包文件了阿,看上面的帖子,
kofshower 写了:用svn co http://vimcppide.googlecode.com/svn/tru ... 么更新的话执行svn update去同步一下就好了。配置中的字典依赖ruby和sqlite3
,全部同步之后扔在$Home下面就可以了,其中Apps如果不用字典的话可以不要,longman.dic可要可不要
对没有识别文件类型的文件可以指定文件类型,不然没有相应的功能
暂且识别的文件类型有“FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby,cpp,diff“
将cpp,cxx,c++,cc,hpp,h视为c++就是cpp文件类型
将c视为c文件类型
将/usr/include/c++/*
/usr/include/g++-3/*
~/Source/cpp_src/* 视为cpp文件类型
而/usr下面其他视为采用gun的缩进
"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/
sarrow
帖子: 403
注册时间: 2007-10-27 1:04

Re: [原创]vim配置文件收集(作为c/c++和脚本开发的环境) 更新ing

#45

帖子 sarrow » 2008-11-25 20:19

不错,很好很强大!

PS:楼主,你从那里搞来的资料,看上去还可以;如果有从现有的资料转换、提取的工具就好了——资料有很多,就是不能直接被vim很好地管理和读取。
回复