ctags for shell scripts without extensions
Asked Answered
B

2

9

I'm working on a Bash script that is designed to be run 'as a tool' so has a name without an extension and a #!/usr/bin/bash line at the top.

My script has a number of functions, so it would be nice if I could use Vim's tagging support to jump around the code, but I can't get ctags to tag the file. ctags mytool produces a tags file that is blank except for the comment section at the top.

If I rename my file to mytool.sh, ctags mytool.sh works perfectly.

Is there a way to force ctags to tag a file without an extension? I've tried a number of options that I found in the ctags manual that seem to relate to file extensions, but without joy.

Balm answered 31/7, 2012 at 12:36 Comment(0)
C
9

If you're using "Exuberant Ctags", you can use the --language-force option:

ctags --language-force=sh mytool

This is documented explicitly in the man page.

Columba answered 31/7, 2012 at 12:48 Comment(0)
C
3

I use the below command to create the tags file on all files in my entire shell source directory tree

ctags -R --language-force=sh
Collegiate answered 19/8, 2015 at 6:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.