Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ctrl-] is not working for tcl code navigation

Tags:

vim

tags

ctags

tcl

I am new to Tcl/Tk, I am using Vim to code and browsing. The syntax highlighting for Tcl/Tk is working fine. The jump into the function using Ctrl] doesnt work it gives me an message saying that "cstag: tag not found". I have installed ctags and generated tags using "ctags -R *.tcl". I have extensively used namespaces in Tcl/Tk code. The tags generated in tags file is something like this "namespace1::function1".

How do i get Ctrl] (and CtrlT for popping from stack) working in Vim?

The function to jump could be in either of the 2 formats shown below

  1. function1
  2. namespace1::function1
like image 648
Manoj Srivatsav Avatar asked Jun 18 '12 07:06

Manoj Srivatsav


2 Answers

Found a work around for my problem:

The tags file that generated contained tags in the format namespace::function.

I just removed namespace:: from generated tags file.
Now Ctrl + ] works!!!

like image 156
Manoj Srivatsav Avatar answered Sep 30 '22 13:09

Manoj Srivatsav


Try:

:set isk+=:

Seems like ":" doesn't get recognized as a codeword by default.

To make this work every time, add the line to your '~/.vimrc'.

Source: http://vim.1045645.n5.nabble.com/How-to-have-vim-recognize-in-cursor-for-tcl-namespaces-tp1163540p1163541.html

like image 25
Finomnis Avatar answered Sep 30 '22 13:09

Finomnis