0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A small utility which uses inotify to detect changes in a directory and run ctags on that directory. Useful when using VIM as an IDE.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 0.9.7
 Project Readme

rctags-watcher

Travis CI Gem Version

This is a little tool which watches for file system changes on directories specified in the configuration file and then runs ctags to generate tags files in them.

Why?

If you are using VIM and you need your tags file to be up to date, then this tool is for you.
rctags-watcher is a GNU/Linux program written in Ruby which uses inotify to detect changes on directories and then run ctags to regenerate the tags file.

Features

  • (Re)Generate the tags file when you change source code files (saving a file in your editor of choice will do that)
  • Configure which file types can trigger a tags scan
  • ctags configuration per project (see the configuration file)

Requirements

Installation

Install the gem:

gem install rctags-watcher

Cloning the repo:

git clone https://github.com/vladbalmos/rctags-watcher
cd rctags-watcher
bundle install

# copy the default configuration file to your home directory and customize it
cp data/rctags-watcher.conf.dist ~/.rctags-watcher.conf

# start the program
bin/rctags-watcher.rb

Usage

rctags-watcher runs by default in foreground. You can run it as a daemon by passing the -d flag when starting it.

bin/rctags-watcher.rb -d [--daemon]

Once in "daemon-mode" you can kill it by sending the stop command:

bin/rctags-watcher.rb stop

Communication with the daemon is done through a unix socket.

IMPORTANT: When running the program as a deamon change the logger destination from STDOUT to a file, or else you will see the any messages printed in your terminal.

Configuration

By default rctags-watcher reads the following configuration files if they exist:

  • /etc/rctags-watcher.conf
  • ~/.rctags-watcher.conf

The last one can override configuration options specified in the global one.
You can pass a different config file when starting rctags-watcher using the -c or --config flag

bin/rctags-watcher.rb --config /path/to/my/custom/config/file

This method won't load the main /etc/rctags-watcher.conf file or the one present in your $HOME directory. Each configuration change will require you to restart the rctags-watcher process.

To get started copy the default config file data/rctags-watcher.conf to ~/.rctags-watcher.conf and create a new project section in it. See the sample project for more information.

Motivation

I wanted to learn Ruby and this seemed a great way to shoot two birds with one stone.