Skip to main content

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
30 views

<c-n><c-p> start to scan tags in insert mode whereas I just want to complete with existing words in the buffer

I found this issue while editing my .vimrc. I tried to do the same in other files, such as .txt and .sh with no problems. While in insert mode, I use <c-p> for completing words that are in the ...
Barzi2001's user avatar
  • 640
0 votes
1 answer
32 views

Wonder the scope of the output of the vim command :tags

When I invoke :tags command in vim, the result varies depending on vim windows. So I wonder the scope of the result of the vim command :tags. I guess it would be one of below: g: Global s: Script-...
Jumogehn's user avatar
  • 165
1 vote
1 answer
77 views

What is CTRL-W Tab doing?

By pure coincidence, I hit CTRL+w and then Tab while editing a C++ file, and what happened is that the window was horizontally split and the new window loaded the buffer where the word under the ...
Enlico's user avatar
  • 2,224
0 votes
1 answer
70 views

Convert some quickfix messages into tags rather than errors

Often times I get way too many diagnostics from my compiler (eg., things beginning note: which just provide context for the actual error), and I do not want to descend into these when I type :cn. Can ...
sh1's user avatar
  • 143
2 votes
3 answers
84 views

Can we configure Vim tag following to be more intelligent?

In large code bases, there can be multiple hits for an identifier. Sometimes dozens. When you look up a tag, the first choice in the list is often some false positive you don't want. The user ...
Kaz's user avatar
  • 491
1 vote
1 answer
125 views

How do I open vim from the command-line at a particular tag?

I have set up ctags to generate a tags file for my code base. I can now jump to definitions of functions by running :tag FUNCTIONNAME or by pressing ctrl-] when my cursor is on the invocation of a ...
Flimm's user avatar
  • 2,303
0 votes
0 answers
27 views

Tag file for CMake default keywords

Is there any distribution of docs and tags file for CMake default keywords? eg. I want to jump to description of CMAKE_INSTALL_PREFIX or get_cmake_property() when viewing CMakeLists.txt.
Dugesia7's user avatar
2 votes
1 answer
72 views

PHP class name collision with ctags

I have the following php file: namespace App\Validator; use Symfony\Component\Validator\Constraint; // #1 class MyValidator // ... { public function validate(Constraint /* #2 */ $constraint): ...
Nicolas Appriou's user avatar
1 vote
1 answer
275 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 ...
Julius Hamilton's user avatar
2 votes
1 answer
425 views

What is 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 I use the tag command which basically provides a list ...
nikinbaidar's user avatar
3 votes
0 answers
79 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 ...
Nathaniel Wingfield's user avatar
1 vote
1 answer
93 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 ...
user2414208's user avatar
2 votes
1 answer
79 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 ...
shadowtalker's user avatar
0 votes
1 answer
214 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 ...
shadowtalker's user avatar
0 votes
1 answer
237 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(): ...
Joe's user avatar
  • 287
0 votes
1 answer
106 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 ...
Kasper-34's user avatar
1 vote
1 answer
137 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 ...
cassepipe's user avatar
  • 395
5 votes
2 answers
204 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 ...
D. Ben Knoble's user avatar
  • 26.6k
2 votes
1 answer
204 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 ...
JZ67's user avatar
  • 55
1 vote
1 answer
586 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 ...
JZ67's user avatar
  • 55
0 votes
2 answers
142 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>&...
Vjekoslav's user avatar
0 votes
0 answers
141 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 ...
Nordine Lotfi's user avatar
0 votes
2 answers
123 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 ...
Ludenticus's user avatar
2 votes
1 answer
400 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 ...
Monti's user avatar
  • 21
3 votes
2 answers
46 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 ...
Doorknob's user avatar
  • 15.4k
1 vote
1 answer
39 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'...
Vjekoslav's user avatar
1 vote
2 answers
482 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 ...
hopibel's user avatar
  • 11
2 votes
1 answer
665 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 ...
Yukun Du's user avatar
1 vote
0 answers
56 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 ...
Jordan Mandel's user avatar
0 votes
0 answers
12 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 ...
The Pompitous of Love's user avatar
6 votes
3 answers
1k 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 ...
marinara's user avatar
  • 171
1 vote
0 answers
25 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 ...
marinara's user avatar
  • 171
1 vote
0 answers
63 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: ...
TankorSmash's user avatar
3 votes
1 answer
976 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 &...
ThoseKind's user avatar
  • 219
1 vote
2 answers
993 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 ...
ThoseKind's user avatar
  • 219
5 votes
0 answers
542 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 ...
Davis Owen's user avatar
3 votes
0 answers
135 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 ...
milaniez's user avatar
  • 131
3 votes
2 answers
766 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 ...
filbranden's user avatar
  • 29k
1 vote
1 answer
279 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 ...
Muricula's user avatar
  • 121
6 votes
2 answers
11k 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 :...
Osada Lakmal's user avatar
1 vote
0 answers
65 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 ...
Breno Pacheco's user avatar
0 votes
1 answer
2k 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 ...
Tyberius's user avatar
3 votes
1 answer
1k 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 ...
stdcall's user avatar
  • 1,059
1 vote
0 answers
666 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 ...
LambdaBeta's user avatar
5 votes
1 answer
1k 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 ...
Nicolas Quiroz's user avatar
4 votes
2 answers
587 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 ...
Warren Young's user avatar
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 ...
J. Eng's user avatar
  • 151
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; ... ...
abbood's user avatar
  • 743
5 votes
1 answer
1k 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 ...
Ciro Santilli OurBigBook.com's user avatar
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 ...
Neaţu Ovidiu Gabriel's user avatar