Vim practice manual (8) vimide -- build your own IDE ()

Source: Internet
Author: User

Reprinted please indicate from "LIU Da's csdn blog": http://blog.csdn.net/poechant


Let me call it a VIM-IDE, it sounds like a fight with the IDE of Eclipse, Visual Studio, xcode stream, more fun, you can call it vimide, isn't it more like

To turn Vim into an IDE, first familiarize yourself with some basic Vim usage.

1. ctags Installation

Download the ctags plug-in at [Reference 1] (the latest version is 5.8)

Run the following command to install the SDK:

tar zxvf ctags-5.8.tar.gzcd ctags-5.8./configuremakesudo make install

Generally, after ctags is installed by default, the ctags file is/usr/local/bin/ctags, if ctags are installed in your system by default or when you install other software, remember the path of the ctags you installed and write it to vimrc, so that Vim won't be circled.

2. Experience ctags in a simple way

(1) preparation: create several source files

Create the following three files. Assume that you create them in the/home/Michael/testspace/test_ctags directory.

//main.cpp#include "obj.h"int main(void){obj 0(2);o.out();return 0;}

//obj.h#ifndef _OBJ_H_#define _OBJ_H_class obj{public:obj(int x);void out();private:int m;};

//obj.cpp#include <iostream>#incude "obj.h"obj::obj(int x){m = x;}void obj::out(){std::cout << "member = " << m << std::endl;}

(2) generate ctags

After creating these three files, enter the following command:

cd /home/michael/testspace/test_ctagsctags *

(3) experience ctags

cd /home/michael/testspace/test_ctagsvim main.cpp

Run the following command:

:set tags=/home/michael/testspace/test_ctags/tags


Move the cursor to obj o (2); and the cursor is on OBJ. Press Ctrl +]. what do you find? Haha, has the buffer been switched to the OBJ: OBJ (int
X) Where is the definition? Handsome!

So how can we switch back? Press Ctrl + T. The memory cost here is "Ctrl +]" and "Ctrl + T!

3. Install taglist

(1) install taglist

It is more about mobile than installation. Download the tag list from the site [Refer to 2], decompress it, and move it to your vim directory.

unzip taglist_45.zipcp taglist_45/doc/taglist.txt /usr/share/vim/vim73/doc/cp taglist_45/doc/taglist.vim /usr/share/vim/vim73/plugin

Then go to vim and enter the command to view the taglist help file to test whether you have installed the taglist successfully.

:help taglist

(2) Possible Problems and Solutions

Taglist: Failed to generate tags for /your/path/to/filePress ENTER or type command to continue/usr/bin/ctags: illegal option -- -^@usage: crags [-BFadtuwvx] [-f tagsfile] [-f tagsfile] file …^@Press ENTER or type command to continue

The official explanation is provided. For details, refer to [Reference 3] below, which indicates that you have used the GNU ctags or Unix
Ctags and taglist do not support these two types of ctags. I started to use Unix ctags during installation, So I encountered this problem. Just install the [Reference 1] ctags again.

At this time, your vim should be configured as below?


4. What should I do?

So far, our vimide has not been configured. Because I have never liked to read long blog posts, I am not patient enough. So, I will continue to introduce them in the next blog article.
:)

5. Postscript

When I wrote this blog post, I found that there was already a file called vimide named zookeeper. This is the link [Reference 4]:
)

Reference

[0] This article from "LIU Da's csdn blog", http://blog.csdn.net/poechant

Download ctags, http://ctags.sourceforge.net

Download taglist, http://sourceforge.net/projects/vim-taglist/files/

[3] taglist FAQ, http://vim-taglist.sourceforge.net/faq.html

[4] vimidehomepage, http://code.google.com/p/vimide/

Reprinted please indicate from "LIU Da's csdn blog": http://blog.csdn.net/poechant

-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.