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.
To install Exuberant Ctags: Go to the following website and download the latest package labeled Source and binary for Windows: http://ctags.sourceforge.net. If the latest binary package is not available for download, go to the Download section and download the binary package for the previous version of Ctags.
Ctags is a tool that generates a tag file of names found in source files. In Moodle, it can be used to index PHP functions, variables, classes and so on. These tags allow definitions to be quickly and easily located by a text editor such as vim.
Ctags is a tool that makes it easy to navigate large source code projects. It provides some of the features that you may be used to using in Eclipse or other IDEs, such as the ability to jump from the current source file to definitions of functions and structures in other files.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With