ctags

Vim keyword completion for ctags with backslashes?

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using ctags for keyword completion on a PHP project in vim. Since ctags doesn't handle PHP namespaces out of the box, I've added a regex option to my ctags command: ctags (...) --regex-PHP='^namespace\s+([^;]*)/\1/c/' (...) This works fairly well: if I type Foo<Ctrl+N> I get suggestions for Foo , Foo\Bar , Foo\Bar\Baz and so on. However, the backslash seems to count as a word separator when vim determines the keyword to look up in the tags file. In other words, typing Foo\Ba<Ctrl+N> does not give me suggestions for Foo\Bar\Baz etc, which

Can ctags be made to follow #include directives?

只谈情不闲聊 提交于 2019-12-03 08:27:00
I am trying to create a target in my Makefile to automatically create a tags file using ctags. I have a list of source files (.cpp files) but I don't have a list of all the header files (I use g++ -MM to create the list of header dependencies). I would have assumed that ctags would follow any #include directives in the .cpp files when generating the tags, but it seems my assumption is wrong. If I create a simple tags file like this: ctags --fields=+iaS --extra=+q myClass.cpp and then go into vim and type in the name of an object followed by a '.' I get the error "Pattern not found". However,

VIM - Sourcing tags from multiple locations in project

孤人 提交于 2019-12-03 08:21:11
Good day, I typically work on relatively small (less than 20,000 lines of code) projects that are all self contained within a single directory, have their own Makefile, and are fairly easy to work with. VIM is my preferred editor, and when I open a project, I typically build the ctags list via a mapping to the F10 key: map <F10> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR> This allows me to jump to the definition of a variable/struct/etc via moving the cursor over the text, and hitting CTRL + ] , as well as using code completion with a drop-down list via OmniCppComplete. However, I

How to add comments to an Exuberant Ctags config file?

折月煮酒 提交于 2019-12-03 08:16:45
问题 What character can I use to put comments in an Exuberant Ctags .ctags file? I would like to add comments with explanations, and perhaps to disable some regexps. But I can't find any comment character which ctags-exuberant accepts! I keep getting the warning: ctags: Warning: Ignoring non-option in /home/joey/.ctags which is better than an error, but still a little annoying. I have tried # // /* ... */ and ; as comments, but ctags tries to parse them all! Here is an example file with some

How can I make vim tag jumps as smart as OmniCppComplete?

蓝咒 提交于 2019-12-03 08:05:52
I generate my tags (Exuberant Ctags 5.9~svn20110310) like this: ctags --c++-kinds=+p --fields=+iaS --extra=+q -L ctags.files I have roughly this class structure: class RenderObject { InterpolatedVector offset; }; class Quad : public RenderObject { }; class KeyframeWidget : public Quad { void shiftRight() { if (!offset.isInterpolating()) offset.interpolateTo(Vector(offset.x+80, 0), 0.1, 0, 0, 0); } }; (Code is from Aquaria's open source release .) If I tag jump on offset ( Ctrl - ] ), then I get a list every offset in my codebase. After I type offset. to the end of shiftRight() ,

ctags multi-line C function prototypes

别来无恙 提交于 2019-12-03 06:14:11
Is there a way for ctags to handle multiline function prototypes in C? I've searched around and the --fields=+S is supposed to do multiline prototypes, but I can't get it to work: ctags -x --c-kinds=pf --fields=+S file file: int foo(int x, int y ); ctags only returns: foo(int (Note that the return type is also missing) Ultimately I would like to get an output similar to int foo(int x, int y); or int foo(int x, int y is --fields=+S not the correct way? Are there part of the ctags fields that I am missing? Any pointers in general? If there is not a way to do it in ctags, any recommended programs

Installing Exuberant Ctags on Windows (Vista and XP)

北城余情 提交于 2019-12-03 04:48:25
问题 I want to use Exuberant Ctags on Vista (and probably the XP laptop) at work; no choice about the OS. I'm use GVim instead of the Flex Builder recommended by my co-worker, because the FB is buggy and doesn't do what GVim does, anyway. I got the zip file here. The Ctags install file says, among other things: mk_bc3.mak For MSDOS using Borland C/C++ 3.x mk_bc5.mak For Win32 using Borland C++ 5.5 mk_djg.mak For MSDOS using DJGPP Gnu GCC (better to follow Unix install) mk_ming.mak For Win32 using

Exuberant Ctags with R

北慕城南 提交于 2019-12-03 02:37:55
Is there any documented use of ctags with R? Would this be useful? Would it be difficult to implement? Specifically, I've just started using Vim. It would be cool to be able to write an R function in one file, use the function in another file (e.g., an Rnw file, test file, or some other script), and be able to use Ctrl+] to navigate to the function source. Update: I've since stumbled on the rtags function, although it suggests that it is emacs specific. This is a modification of Henrico's answer, and may be implemented by copying and pasting the following code into one's ~/.ctags files.

How to navigate multiple ctags matches in Vim?

旧街凉风 提交于 2019-12-03 02:09:59
问题 I'm using Ctrl - ] in Vim to navigate using Ctags. How do I navigate to alternate file if there are multiple matches? Ex. something.publish in a codebase containing multiple occurrences of publish : class Foo def publish end end class Bar def publish end end 回答1: :tn[ext] goes to the next tag, :tp[revious] goes to the previous one. :ts[elect] gives you a list to choose from. :help tag-matchlist for more fun and exciting things to try! 回答2: Use g] instead of C-] to get the list of all matches.

Exuberant Ctags on Mac

泄露秘密 提交于 2019-12-03 02:02:50
I'm currently using vim for my PHP development. A few weeks ago I bought myself a mac, and wanted to re-generate my tags for a new Zend Framework version. I used the following script in the past (linux machine) to generate the tags: #!/bin/bash cd ~/www/ZF/ ctags-exuberant -f ~/.vim/tags/zend \ -h ".php" -R \ --exclude="\.svn" \ --totals=yes \ --tag-relative=yes \ --PHP-kinds=+cf \ --regex-PHP='/abstract class ([^ ]*)/\1/c/' \ --regex-PHP='/interface ([^ ]*)/\1/c/' \ --regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/' You can see I used the "ctags-exuberant"