sponsor Vim development Vim logo Vim Book Ad

auto tags gen : Plugin for creating tags automatically (C/C++)

 script karma  Rating 1/1, Downloaded by 327    Comments, bugs, improvements  Vim wiki

created by
Pinaki Sekhar Gupta
 
script type
utility
 
description
Plug-in for creating tags with ctags
in the current working directory of the currently opened
buffer (file), automatically, when you save your file.

This plug-in works with C/C++ files only.

Works in the current working directory. It can include
sub-directories as well. You can generate tags files automatically for easy access through Omni Completions,
and facilitate the plug-in that depends on a tags file.

You can even create tags file in any directory without
saving a file.

For example: code_complete.vim (by Mingbai),
             echofunc.vim (by Mingbai), plug-ins rely on a
             tags file in the working directory
             and the include directories added to vim's search list.

All of this is specified within a simple text file based plug-in script
(auto_tags_gen.vim) with a few global variables and
a shared library (auto_tag_gen.dll). On linux the plug-in is auto_tags_gen_linux.vim and the shared library is libauto_tag_gen.so.

Written For Vim version 7.4. May work with older
versions as well as the future releases also.

    Tested with Vim 32-bit on Windows XP/7 32-bit, Windows 7 64-bit (vim 32-bit),
    may work with Vim 64-bit on Windows 64-bit.
    Now it works on Linux. Tested in ubuntu 13.10 (Saucy) (Gvim from its repository).


You must set 'nocompatible' in your _vimrc file to use this plug-in. You can
stop the plug-in from being loaded by setting the
"loaded_auto_tag_generator" variable:

:let loaded_auto_tag_generator = 0

in your _vimrc file.
You can also put these lines for your convenience:

set nocompatible
filetype on
filetype plugin on
set number
set laststatus=2
:set timeout timeoutlen=4500 "   ttimeoutlen=100 "  default settings -1 not harmed under comment
set history=100 " tons of command-line history. Can be used with up-dn arrow key
 
install details
Installation:
Download Exuberant ctags from
http://ctags.sourceforge.net.
Put ctags.exe into C:\WINDOWS\system32
or, create a folder for ctags and finally add this folder to path, by
r-clicking at My Computer -> Properties -> Advanced -> Environment Variables
-> System Variables -> Path. (XP)
or,
r-clicking at Computer -> Advanced System Settings -> System Properties
-> Advanced tab -> Environment Variables
-> System Variables -> Path. (Win7)

But I recommend to put this stuff into system32 instead of cluttering up
the System Path when you are using Windows XP.
If you are using Windows 7 along with Tera Copy, instead use the above method.


Using 7-zip extract "auto_tag_gen_v0.00.04win32.7z" to any location of your preference.
This contains source code for the dll and some Makefile for different compilers.
The Code::Blocks IDE project is no longer included. This project now relies on bakefiles (http://www.bakefile.org/index.html).
Bakefile is used to create all the Makefiles. From windows bakefile can create Makefile for Linux, and vice-versa.

Extract "auto_tag_gen.zip" and put the stuffs in their respective locations, e.g. 'auto_tags_gen.txt' to C:\Program Files\vim\vim73\doc
'auto_tag_gen.dll' and 'auto_tags_gen.vim' to
C:\Program Files\vim\vim73\plugin

Fire-up gVim and at the Vim command-line do:
:helptags $VIMRUNTIME/doc
then,
:h auto_tags_gen

Read the documentations carefully.

If you want to use this plug-in on Linux, please
    build the .so file from the source. Makefile included.
    Extract the 7zip archive in your home directory, navigate through the terminal into that directory.
    Type
sudo make
sudo make install
sudo make install check

  then,
sudo nautilus ~/.vim/doc/
  paste the file 'auto_tags_gen.txt' there.
  then,
sudo nautilus ~/.vim/plugin/  
  then,
  paste the file 'auto_tags_gen_linux.vim' there.
  then,
  Fire-up GVim and press Shift+:
  and at the vim command-line do the following:
:helptags $HOME/.vim/doc
  Then press Shift+: again, and at the vim command-line do the following:
:h auto_tags_gen

Read the documentation carefully.


*NOTE FOR THE WINDOWS USERS:*
This version v0.00.04 uses taskkill /IM cmd.exe internally, to kill the ctags process associated with cmd.exe, since the
process ctags cannot be killed separately.
So while using this plug-in do not perform any other command-line jobs such as compiling etc.,
as this would kill your compilation midway. De-activate this plug-in in this situation and edit files with vim normally,
when you will have no other command-line jobs then activate this plug-in again. If needed force it to generate tags manually.

On Linux you don't have to be worried, this problem does not exist on Linux, since Linux can kill ctags process by name using pkill.
So you are free to do anything on Linux with this plug-in.





 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
auto_tag_gen_v0.00.04win32.7z 0.00.04 2014-02-07 7.3 Pinaki Sekhar Gupta This version supports Linux operating system (Makefile included). On Windows it does not starts multiple ctags process, just creates one process and when you re-save your file, it kills previous process and starts a new process. So no longer you have to wait just to finish the earlier process, it tackles everything automatically.
auto_tag_gen_v0.00.03win32.7z 0.00.03 2013-09-11 7.0 Pinaki Sekhar Gupta Better compatibility with Vim 7.4.
Minor bug-fix in the plug-in section.
auto_tag_gen_v0.00.02win32.7z 0.00.02 2013-06-24 7.3 Pinaki Sekhar Gupta Documentations updated.
Plug-in optimized.
ip used for rating: 54.166.113.249

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo