Questions tagged [tags]

Questions related to the use of tags files created by programs such as `ctags` to quickly locate language objects such as functions.

Filter by
Sorted by
Tagged with
0 votes
2 answers
217 views

<C-x><C-o> "Pattern not found" even with a Ctags file (C/C++)

<C-x><C-o> returns Pattern not found in C/C++ files even with a ctags file. It used to work and I haven't made any configuration/plugin changes that I know of Starting vim with vim -u ...
2 votes
1 answer
200 views

Search for symbols in tags from multiple projects

I am developing a Linux kernel driver so I have a git directory with my project. I have another git directory with the Linux sources. I am using neovim with gutentags with the setting of gtags_cscope ...
1 vote
1 answer
86 views

what's the difference between `tag` and `tags` command

I've recently come across the concept of tags in vim. I run ctags on a file and it generates tags for that file. When I try to access those tags Iuse the tag command which basically provides a list of ...
125 votes
3 answers
13k views

How do I navigate to topics in Vim's documentation?

In Vim's built-in help system, how do I… search for topics that I want help on? follow hyperlinks? browse around for related material?
0 votes
1 answer
46 views

How can I tag lines?

I would like to tag or annotate lines so that I can later refer to those lines and perform commands on them. I wouldn't like for the tag to be in the actual text but external metadata. Is there any ...
3 votes
0 answers
57 views

I use vim for notetaking. Can I fold/filter to relevant notes by tag?

I use vim for notetaking. I use a simple format like this: Friday, August 27, 2021 01:00 pm / tech leadership What should our top priorities be? Monthly priority review. Can we budget for continual ...
1 vote
1 answer
42 views

How to filter results in tagfunc?

I'm using Vim to edit Erlang source files. As function names in Erlang are only unique within a module (unlike in C), the tags support "out of the box" is not perfect (for example there are ...
2 votes
1 answer
41 views

Sorting `taglist()` output by order of appearance in the file

As a followup to https://vi.stackexchange.com/a/33176/4674, I found that taglist() output seems arbitrarily ordered (maybe alphabetical?). Right now I'm using this function to get the list of all tags ...
0 votes
1 answer
63 views

How to cycle through all tags in the current file?

Sometimes I want to just loop through all tags in a file. One use case is for help files, but it's also useful for browsing large unfamiliar source code files. Is there a way to do this? Something ...
0 votes
0 answers
489 views

Why my easytags plugin not generating tags automatically?

I have xolox/vim-easytags and xolox/vim-misc installed. I have following configuration in vimrc: let g:easytags_dynamic_files = 1 let g:easytags_on_cursorhold = 1 let g:easytags_updatetime_min = 4000 ...
0 votes
1 answer
94 views

Taglist isn't reading custom Markdown tags

The plugin Taglist is showing tags perfectly for my python but not for my markdown files. There is a MCVE on github. I have two files. test1.py is: def one(): print("one") def two(): ...
5 votes
2 answers
107 views

Code-review: persistent tag-stack display

Update: I've created a plugin. I wrote a bit of code for a friend who's dealing with large C code-bases and using cscope/ctags to navigate around. He was hoping to get a persistent display of the ...
0 votes
1 answer
47 views

What are the E tags in vim help?

I've been browsing vim's help and noticed there are some topics which have multiple E### tags and others with just a single E### tag. I'm curious as to what the significance of these E### tags are. My ...
1 vote
1 answer
58 views

Iterate through functions calls in various files

I can jump to a function definition thanks to :tjump. Or I can search for a function call in a file with / but is there a way to iterate through function calls across various files ? If the solution ...
1 vote
1 answer
47 views

vim auto select tags upon launch

I have multiple projects (folders), and each of them has its corresponding tags generated. I found every time I launch vim it only links to my first tags file (:set tags?), I need to manually set the ...
1 vote
1 answer
193 views

Vim :tag can jump to the tag but using short key ctrl+] gives cstag: tag not found

I have generated tags using ctags -R . In Vim I'm able to find the tag when I type :tag TagName and it does jump to it. However, if I have a cursor over the TagName and do Ctrl+] vim shows cstag: tag ...
0 votes
1 answer
68 views

Get file and line number for tag with name

I would like to make simple utility that opens tag under cursor in popup window introduced in recent vim version. Assuming I get word under cursor with command let l:word = expand("<cword>&...
0 votes
0 answers
85 views

CTRL-] keys not working with very specific tags

So, I'm trying to use vim's help tags in my notes files, so that i can easily reach them (without using ex command or making a new keymapping). For that, i used: set tags=$VIMRUNTIME/doc/tags to set ...
0 votes
2 answers
102 views

How do you :tag: every word of a line using substitution?

How do you substitute every word of a line, so that it becomes a useful vimwiki tag? Provided the following line: Word Compund_Word I want: :Word: :Compund_Word: I guess it involves some use of ...
3 votes
2 answers
38 views

Suppress "Using tag with different case" message

With ignorecase set, I am able to jump to a tag Foo by typing :ltag foo. However, doing so causes the message Using tag with different case! to appear at the bottom of the screen, along with a ~0.5s ...
1 vote
1 answer
31 views

Persistent tag highlights when changing between buffers

I've put following code in my vimrc. function ExtraHighlights() let list = taglist('.*') for item in list if item.kind == 's' || item.kind == 't' || item.kind == 'u' || item.kind == 'g'...
5 votes
2 answers
5k views

How can I close the quickfix window and go back to the file I was editing

I use gutentags and gutentags-plus for generating and managing tag files. When I use the key combinations setup by them ( cX usually ), it opens the relevant lines in a quickfix window and I can use :...
3 votes
2 answers
491 views

Why are helptags not shipped with plugins?

Part of the job performed by virtually all plugin managers in Vim is to create helptags, which will index the help files shipped with the plugins and will allow searching for commands and mappings ...
5 votes
3 answers
829 views

How do I jump to tags instead of lines?

I'm using vim as note-taking software. My notes grow to thousands of lines across 7 different files. If I was writing code, I would be able to jump to a function definition in a different file ...
1 vote
0 answers
24 views

Jumping to tags instead of lines in a text-file opened by vim [duplicate]

I'm using vim as note-taking software. My notes grow to thousands of lines across 7 different files. If I was writing code, I would be able to jump to a function definition in a different file ...
2 votes
1 answer
381 views

Jump to definition (CTRL-]) slow on windows

I have a big source code base on both Mac and Windows on which I work on this with MacVim/NeoVim. When using CTRL-] to search tag through a 1.6G tags file, I got immediate result with MacVim while ...
5 votes
2 answers
2k views

How To Use Tags In Vim For Notes

Backstory: So there is all these notes app like Evernote Onenote... but I do not want to be locked into a system and only are going to use my laptop. So I thought why not use vim to edit markdown ...
1 vote
0 answers
44 views

How do I navigate using tags in a personal copy of the vim documentation?

As background: I am a beginner in VIM and I want to go through the built-in vim manual, but with my own copy (not the system copy) so that I can practice in the manual text as I go along (I also ...
10 votes
3 answers
4k views

How to search multiple occurences of a vimwiki tag?

I'm using the vimwiki plugin and trying to figure out tagging with vimwiki-syntax-tags. I can add a tag :tag-example: to a vimwiki .wiki file. I can search :VimwikiSearchTags tag-example and it ...
0 votes
0 answers
11 views

"tnext" command skips to next file

I'm using vim's built in helptags command to create a tags file in LaTeX. While LaTeX files are not the txt files normally used, helptags seems to work just fine, and generates an empty "tags" file ...
1 vote
0 answers
387 views

How to select unclosed tag and close it automatically?

Here is my html file already edited,there are two errors in it. <!DOCTYPE html> <html lang="zh-Hans"> <head> <meta charset="utf-8"> <link rel="stylesheet" type="...
1 vote
0 answers
20 views

How to jump to or list a tag exclusively defined in a header?

I have a .h and a .cpp with declarations and definitions, and I'd like to be able to :tselect only the declarations, in order to see all the functions I've got that match a pattern. some_file.h: ...
3 votes
1 answer
541 views

Open quickfix Window Only, Don't Jump To First Result

Is there a way to open just the quickfix list without jumping to the first result when using :lt? I am using :lt to populate the location list with tags that match with the following binding: nmap &...
1 vote
2 answers
543 views

quickfix Menu Usage With :tselect and :vimgrep

I am currently using the following mapping to search for knows tags: nnoremap <expr> <Leader>t "<ESC>:tselect /" . input("") . "<ESC>" I also use this mapping to grep all ...
3 votes
0 answers
101 views

Highlight tag matches for better visibility

When I search for occurrences of some frequent pattern (lets say finding a c symbol), I'll get a list of suggestions at the bottom of vim. Is there a way that the pattern is highlighted for easier ...
4 votes
0 answers
429 views

How to have gutentags build tags from the .git folder in a repository?

I want to have my tags file generated from gutentags/ctags to be in the .git folder, because I am working on a project with other people where I don't want to edit the .gitignore file. So, I have ...
1 vote
1 answer
212 views

How do I open a tag in an existing gvim instance?

On windows I use gvim, and like to keep just one gvim instance running. Most of the time I open files like this: gvim -p --remote-tab-silent FILES. However, sometimes I want to open a tag in that same ...
1 vote
0 answers
56 views

Ctrl-] matching single word in custom tags

When using vim's help I can jump to multi-word tags, but when creating my own tags Ctrl-] tries to match individual words. Consider the following example: file.txt |a-tag| *a-tag* When ...
11 votes
3 answers
1k views

Vim, ctags and overloading

Is there a way to make vim jump to the right matching definition automatically in case of multiple definitions. Our C++ code heavily uses function overloading and vim's handling of ctags does not ...
0 votes
1 answer
1k views

Setting a list of tag files

Is there a way to set multiple default tag files, to be searched sequentially in my vimrc? My hope was that I would be able to have a local tags file that would be searched first and then, if nothing ...
6 votes
2 answers
2k views

Bidirectional tag stack movement with cscope in vim

When using ctags, one can move back through the tag stack by using [count]CTRL-T or :[count]pop, and forward using :[count]tag However, when using cscope instead of ctags and setting 'cscopetag', ...
3 votes
1 answer
955 views

vim can't process tags

I generated tags files and I'm using the following command in my .vimrc: :set tags=./tags; When I press Ctrl] I get the following error: E433: No tags file E426: tag not found: poll_wait I'm not ...
4 votes
2 answers
314 views

Make Ctrl-] give a list of matches to choose from instead of taking me to the first match

When the cursor is over a word that has multiple matches according to ctags, the Ctrl-] command on one machine I use gives me a list of matches to choose from, while on another it just populates the ...
1 vote
0 answers
601 views

Tag not found unless searched for

I have a very weird situation with my tags file not working as expected. My tag file is sorted case-insensitively (starts with !_TAG_FILE_SORTED\t2\t/foldcase/), and ignorecase is set. When I put my ...
5 votes
1 answer
688 views

difference between marks and tags?

Reading the manuals, seems to me that marks and tags are the same thing, only difference is that mark names can be [a-zA-Z] values, while tags can be alphanumeric. If I'm wrong, what is the difference ...
2 votes
1 answer
1k views

why ctags take me to class definition rather than actual file

Background I'm using vi with a php/laravel code base.. I ran ctags and see what happens: filename: app/Http/Controllers/RetailerApproveController.php use App\Repositories\ApproveOrderRepo; ... ...
5 votes
1 answer
963 views

How to browse tags when autochdir is set?

I like autochdir a lot, but it breaks my tag browsing, e.g.: main.c: int main(){} d/a.c: int main(){} vimrc: set nocompatible set autochdir set tagrelative set tags=tags; tags: main d/a.c ...
1 vote
0 answers
268 views

Fuzzy Find C++ function definition

I am looking for a way to fuzzy find C++ function/method definition in NeoVim. A function definition can look like this: bool Cls::func() { bool func() { bool Cls::func(unsigned some, bool argument)...
1 vote
1 answer
3k views

Alternatives to ctags: are rtags, uctags or other alternatives better?

The problem: I've used ctags with C++ code for a while, but that has no knowledge of the code. If there are many subclasses that overwrite a certain virtual function, then on a Ctrl-] I may end up in ...
3 votes
0 answers
495 views

links/tags inside a file

I apologize in advance for not knowing enough even to ask the question correctly. I'd like to implement something like the links in the help files (that you jump to using ctl]) in my own file, but I'...