15
votes
How to jump to function call?
You can't jump to function calls with ctags. For C/C++ and Java there is cscope, and it integrates nicely with Vim (see :help cscope). For other languages you might be able to find a tool that ...
9
votes
How to jump to function call?
You can't do that with ctags.
Try a beefier alternative like cscope (which even has its own help section: :help cscope) or global.
9
votes
How to jump to function call?
You could use Vim's grep command to search all the files in your project:
:grep! "\<<cword>\>" . -r
:copen
Let's put that in a keybind:
nnoremap <F4> :grep! "\<<...
7
votes
Accepted
why ctags take me to class definition rather than actual file
What's happening
When there are multiple matches for a tag, Vim uses the following list of priorities (listed at :help tag-priority).
"FSC" A full matching static tag for the current file.
"...
7
votes
Mapping ctags keys
There are q few misconceptions here:
"Hotkey" is not a thing in Vim. You have "commands", "mappings", "abbreviations"… but no "hotkeys". <C-]>, <C-t> and :tselect are all "commands".
...
7
votes
Accepted
Jumping from function definition tag to prototype tag
Okay I've done it:
It all has to do with ctags:
First create two files called foo.c and foo.h to test it:
In foo.h write down:
int bar(void);
In foo.c write down:
int bar(void) { /* */ }
And in ...
6
votes
Accepted
Exuberant Ctags - Duplicate tags problem
As @romainl said, It is indeed an FS(file system) case-sensitivity issue.
My project file is mounted from Window 7 to my Fedora using:
mount {Windows 7 Dir} {Fedora Dir} /local_folder -t cifs -o ...
6
votes
Accepted
Plugin to display a smarter method tag list
I cannot provide an answer different to the one I gave in other similar questions.
While tag-based plugins may present a complete list of existing overloads in a way much more ergonomic than :tselect ...
5
votes
Accepted
Ctags force prompt on ambiguous tag
g<C-]> will display a list of tags only when there is more than one, so you could just train yourself to type g<C-]> instead of <C-]>. But having to type two characters instead of ...
5
votes
Accepted
Why do I get the "tag stack empty" error when using :ptag and other commands?
First, the command to jump to a tag is <C-]>, not ].
Second, :ptag doesn't care about the word under your cursor. It works just like :tag but uses the preview window instead of jumping directly ...
5
votes
Accepted
Adding ctags for a 3rd party library
You could use this to tell Vim to look recursively for tags files under /usr/include/:
set tags+=/usr/include/**/tags
For the generation part, I'm afraid you will still have to generate tags files ...
5
votes
Accepted
quickfix Menu Usage With :tselect and :vimgrep
You can use the ":ltag" command which adds the matching tags to the location
list for the current window. You can then use the location list commands to
browse the matches.
BTW, the location list ...
4
votes
Accepted
Generate ctags for bash variables?
based on the prompt from @Cometsong I added wrote the regex expression below and added to my ~/.ctags
--regex-sh=/^[ \t]*(local)?[ \t]*([A-Za-z0-9_-]+)=/\2/v,variable,variables/
So far it seems to ...
4
votes
Accepted
Exuberant Ctags: CTRL-] and ":tag" went wrong
To see all the files that Vim sourced during launch, I typed :scriptnames.
I found that:
When launching vim with the command $vim --noplugin or $vim, there is a /etc/vimrc file which is sourced;
...
4
votes
Vim, ctags and overloading
The documentation (:help ctrl-]) says:
When there are several matching tags for {ident}, jump
to the [count] one. When no [count] is given the
first one is jumped to.
g] may not be what you are ...
4
votes
Accepted
ctags vs GNU id-tools?
The vim help alludes to the primary distinction as follows
But sometimes you wish you could jump to all the places where
a function or variable is being used.
tags can be only used to jump to where ...
3
votes
Accepted
How to select the tag to open when several tags have the same name?
You can use :tnext to jump to the next matching tag.
If you have four tags foo, these commands will let you jump to each tag sequentially:
$ vim -t foo
:tn
:tn
:tn
You can use :tp[revious] to jump ...
3
votes
Accepted
Search for tags with prefixes in other language files
You could use a mapping from Ctrl+] to a custom function, similar to the one described at :help CursorHold-example:
A nice addition is to highlight the found tag, avoid the ":ptag" when there
is no ...
3
votes
Generate ctags for bash variables?
A regex can be built to find variable declarations like [A-z]…=[A-z0-9]
Another for variable usage to include a \$ in the front
My own yaml-specific .ctags example is:
--regex-c=/^( YAML langdef ...
3
votes
Accepted
How to get rid of "Press ENTER or type command to continue"
Could you try the following. It directly uses :tag and :tjump instead of using the mappings. I also removed the unneeded execute ... stuff.
function! Jump(type)
if filereadable(".tags")
...
3
votes
navigating markdown documents using ctags with vim and neovim
A simple approach (that fails if you have embedded code comments) is to do something like
global/^#/#
And then type : and the displayed line number of the match you want. You could assign the ...
3
votes
Accepted
Jump to definition (CTRL-]) slow on windows
search tag through a 1.6G tags file, I got immediate result with MacVim while surfering about 5s to get search result from NeoVim.
From the symptoms you describe, it seems to me that you're getting ...
3
votes
Accepted
Vim function : how to expand vim variable in shell command?
The :execute command will assemble an Ex command from strings and evaluate it.
Here, in this case, it's actually breaking your command, since it's expanding the g:projectRoot string and forming a ...
2
votes
Accepted
Enable completion for CSS using ctags
The problem comes from the leading dot before class names.
Your search pattern leaves it out but you add it afterwards and, because tag search honors your iskeyword setting which doesn't contain ., ...
2
votes
Can I load different tags per project?
You can use my project-tags plugin for this. It requires a tiny bit more setup than the fugitive.vim approach, but it is also more of a power user tool. Once you set it up for your projects, it will ...
2
votes
Accepted
How can I know function definition in vim for C?
If you have ctags installed then save the file(type :w) and regenerate the ctags by ctags -R filename then <Ctrl-]> to go to the function definition.
2
votes
Alternatives to ctags: are rtags, uctags or other alternatives better?
On SO, I've written recently about uctags:
Regarding C++, it makes the difference -- I can't tell regarding C or
Java. It has a better understanding of C++ code bases than exuberant
ctags.
...
2
votes
Ctags not working properly on Latin american keyboard
set tags=./tags means "path of the current file" not necessarily the current directory. The vim default set tags=./tags,tags would look in both path of current file and current directory. You can ...
2
votes
use only "closest" tagfile to working directory (of buffer or of vim process)
I recently addressed this problem by writing a Vimscript function (tested and pasted below) that walks up the directory tree from the current file and sets as the tags file the first file named "tags" ...
2
votes
Accepted
^] doesn't work if cursor is on a function name prefixed with its package in Perl
Thanks I have figured it out.
Instead of a plain ctags -R, run ctags -R --extra=+q which also adds the prefix-ed version of the methods into the tags file.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ctags × 85tags × 30
filetype-c++ × 7
autocompletion × 6
vimscript × 5
cscope × 5
plugin-tagbar × 4
vimrc × 3
key-bindings × 3
navigation × 3
ide × 3
autocmd × 2
plugin-you-complete-me × 2
filetype-javascript × 2
filetype-php × 2
plugin-easytags × 2
neovim × 1
regular-expression × 1
microsoft-windows × 1
functions × 1
external-command × 1
filetype × 1
quickfix × 1
filetype-markdown × 1
filetype-python × 1