[建议]集中整理使用VIM开发C/C++程序

软件和网站开发以及相关技术探讨
回复
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

[建议]集中整理使用VIM开发C/C++程序

#1

帖子 kuerbt » 2006-07-12 9:46

只是知道VIM功能十分强大,可以搭建一个C/C++的IDE环境。
但是,很多新手(包括俺)都不知道该怎么搭这个环境。

我们多么希望高手不吝赐教,可以指点一下我们这些新手?

同时,我也希望,大家能够把使用VIM搭建C/C++IDE环境的过程经验汇集起来,做成精华帖或者是wiki。供大家学习交流使用。

不知道各位意下如何?
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

#2

帖子 kuerbt » 2006-07-12 9:48

现在我们的机器上已经安装了VIM,下一步需要安装什么插件或者软件,实现什么功能。

请高手跟下帖,指点一下?
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

#3

帖子 kuerbt » 2006-07-13 13:57

没有高手指点,就自己琢磨。

先给自己指定一个目标:在VIM上安装一些插件,支持Python的开发。

去vim.org上搜索了半天,找到几个关于python的插件,如pythoncomplete.vim。
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

#4

帖子 kuerbt » 2006-07-13 14:00

找到这个word_complete.vim还不错。

下载地址是:http://vim.sourceforge.net/scripts/down ... rc_id=5704

http://vim.sourceforge.net/scripts/scri ... ript_id=73

description
---------------------
Each time you type an alphabetic character, the script attempts
to complete the current word. The suggested completion is selected
in Select mode, so you can just type another character to keep going.
Other options: <Tab> to accept, <BS> to get rid of the completion,
<Esc> to leave Insert mode without accepting the completion, <C-N>
or <C-P> to cycle through choices, <C-X> to enter <C-X> mode.

Limitations:
The script works by :imap'ping each alphabetic character, and uses
Insert-mode completion (:help i_ctrl-p). It is far from perfect. For example, the :imap's mean that you are constantly switching out of Insert mode, which means that undo only works a few characters at a time. This also messes up any abbreviations you may have defined. Since Select mode uses the same mappings as Visual mode, the special keys mentioned above may conflict with what you are used to in Visual mode. I have received one report that mswin.vim interferes with this script.

Every second character you type is in Select mode, so with versions of vim before 6.2, completions are offered only half the time.

install details
---------------------------
:source it from your vimrc file or drop it in your plugin directory.
To activate, choose "Word Completion" from the Tools menu, or type
:call DoWordComplete()
To make it stop, choose "Tools/Stop Completion," or type
:call EndWordComplete()
If you want to activate word completion for every buffer, add the line
:autocmd BufEnter * call DoWordComplete()
to your vimrc file.
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

#5

帖子 kuerbt » 2006-07-13 14:03

嘿,心情不好。帖子发了一半,再来。

先给自己指定一个目标:在VIM上安装一些插件,支持Python的开发。

去vim.org上搜索了半天,找到几个关于python的插件,如pythoncomplete.vim。

可惜这些插件要求vim必须是使用-python编译的。

而Ubuntu安装的那个vim不是。
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

#6

帖子 kuerbt » 2006-07-13 17:10

将 word_complement.vim 放到 plugin 目录下
修改~/.vimrc文件,添加如下信息:
autocmd BufEnter * call DoWordComplete()

这样,在编写代码时,会自动补全一些关键字。
头像
lysting
帖子: 41
注册时间: 2006-07-13 11:43
来自: 深圳
联系:

Re: [建议]集中整理使用VIM开发C/C++程序

#7

帖子 lysting » 2006-07-13 19:24

kuerbt 写了:只是知道VIM功能十分强大,可以搭建一个C/C++的IDE环境。
但是,很多新手(包括俺)都不知道该怎么搭这个环境。

我们多么希望高手不吝赐教,可以指点一下我们这些新手?

同时,我也希望,大家能够把使用VIM搭建C/C++IDE环境的过程经验汇集起来,做成精华帖或者是wiki。供大家学习交流使用。

不知道各位意下如何?
没必要那么麻烦吧,其实vim有其他IDE所具有的功能,到 vim.org看看,
有什么问题google之都是可以解决的。
我的一般就是
$ cp /usr/share/vim/vim70/vimrc_example.vim ~/.vimrc
缩进
: set shiftwidth=4
显示中文:
:set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
下载
cppcomplete.vim bufexplorer.vim c.vim taglist.vim svncommand.vim 等都差不多够用了。
结合 ctags,subversion,gdb等,练多了coding的速度自然加快。
有空可以选择的翻看 vim 文档,减少一些不必要的重复蛮力工作。

that is all.
kuerbt
帖子: 305
注册时间: 2006-04-13 13:53

#8

帖子 kuerbt » 2006-07-14 10:13

感谢楼上的指点。
guava
帖子: 40
注册时间: 2006-11-22 16:42

#9

帖子 guava » 2007-02-25 21:17

虽然我不懂 但是很佩服楼主的精神
上山打野
帖子: 18
注册时间: 2008-01-12 0:09

Re: [建议]集中整理使用VIM开发C/C++程序

#10

帖子 上山打野 » 2009-10-25 3:05

:em11 太好了,本来就要学习vim,原来比想象中的还强大,mark后学习之
zu1000
帖子: 26
注册时间: 2009-10-15 3:59

Re: [建议]集中整理使用VIM开发C/C++程序

#11

帖子 zu1000 » 2009-11-01 2:01

楼主精神可嘉啊,佩服佩服,我一直用VIM,基本上不用插件,就是弄点syntax highlighting以几整一个好点得.vimrc。找东西就grep。。。傻是傻点,不过应付现在得工作也足够了。期待楼主整理啊。。
枯藤
帖子: 31
注册时间: 2008-06-09 9:21

Re: [建议]集中整理使用VIM开发C/C++程序

#12

帖子 枯藤 » 2009-11-06 23:40

期待中。。。。
头像
ChloeRei
帖子: 1021
注册时间: 2007-11-23 9:49

Re: [建议]集中整理使用VIM开发C/C++程序

#13

帖子 ChloeRei » 2009-11-07 13:47

头像
mkailxr
帖子: 62
注册时间: 2009-10-20 13:13

Re: [建议]集中整理使用VIM开发C/C++程序

#14

帖子 mkailxr » 2010-10-21 21:01

感谢
上次由 mkailxr 在 2016-07-03 21:54,总共编辑 1 次。
JiangHui
论坛版主
帖子: 21308
注册时间: 2007-08-02 20:29
系统: 窓辺とうこ

Re: [建议]集中整理使用VIM开发C/C++程序

#15

帖子 JiangHui » 2010-10-21 21:04

楼上的别再挖了
回复