ctags

设置vim语法高亮显示和自动缩进

这一生的挚爱 提交于 2019-12-20 10:17:58
设置 vim 语法高亮显示和自动缩进 1 、配置文件的位置 在目录 /etc/ 下面,有个名为 vimrc 的文件,这是系统中公共的 vim 配置文件,对所有用户都有效。而在每个用户的主目录下,都可以自己建立私有的配置文件,命名为: “ . vimrc ” 。例如, /root 目录下,通常已经存在一个 . vimrc 文件。 2 、设置语法高亮显示 1) 打开 vimrc ,添加以下语句来使得语法高亮显示: syntax on 2) 如果此时语法还是没有高亮显示,那么在 /etc 目录下的 profile 文件中添加以下语句: export TERM=xterm-color 3 、设置 Windows 风格的 C/C++ 自动缩进(添加以下 set 语句到 vimrc 中) 1 ) 设置(软)制表符宽度为 4 : set tabstop=4 set softtabstop=4 2 ) 设置缩进的空格数为 4 set shiftwidth=4 3 ) 设置自动缩进 : 即每行的缩进值与上一行相等;使用 noautoindent 取消设置: set autoindent 4 ) 设置 使用 C/C++ 语言的自动缩进方式: set cindent 5 )设置 C/C++ 语言的具体缩进方式(以我的 windows 风格为例): set cinoptions={0,1s,t0,n-2

The ctags command doesn't recurse saying “it is not a regular file”

*爱你&永不变心* 提交于 2019-12-20 09:10:43
问题 When I run ctags -R * , I get errors saying that all directories are not regular files and it skips them instead of recursively generating tags for them. ctags: skipping arpa: it is not a regular file. ctags: skipping asm: it is not a regular file. ctags: skipping asm-generic: it is not a regular file. ctags: skipping bits: it is not a regular file. ctags: skipping blkid: it is not a regular file. ctags: skipping boost: it is not a regular file. What is the problem? 回答1: Similar to this and

use :tjump instead of :tag vim on pressing ctrl-]

时光毁灭记忆、已成空白 提交于 2019-12-19 00:57:53
问题 in vim, when i press ctrl-] 1) the usual behavior: it goes to the first matching tag with the word under the cursor, after that we need to do :tjump separately to see a list of all matching tags and then jump to the desired tag. 2) what i want is: vim should search the tag file, if there are multiple matches, show me a list of all the matching tags if there is one match, simply jump to the matching tag (just like :tjump does) this behavior(2) already happens when we use g-ctrl-] , but i want

run a shell command (ctags) in cmake and make

空扰寡人 提交于 2019-12-17 23:46:18
问题 I'm coding a c++ project in vim. I'd like to run a ctags command ( ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . ) to generate references when I run make. I think the way to do it is to use add_custom_command but I get confused on how to integrate it into CMakeLists.txt . 回答1: The most basic way to do this is: set_source_files_properties( tags PROPERTIES GENERATED true) add_custom_command ( OUTPUT tags COMMAND ctags -R --c++-kinds=+p --fields=+iaS --extra=+q . WORKING_DIRECTORY ${CMAKE

ctags multi-line C function prototypes

穿精又带淫゛_ 提交于 2019-12-13 11:37:10
问题 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

Customize airline tagbar extension to include current tags parent

一曲冷凌霜 提交于 2019-12-13 08:39:19
问题 The airline plugin has an extension which uses Tagbar to show the current function name. (I know this because of this question which I found via asking this question) This works really well and looks great. Here's airline showing me I'm editing the do_foo() function: But Tagbar knows much more than this! Specifically, it knows the current class (i.e. the parent of the current tag): (It does this using ctags) Is there a way to configure airline to tell me the current class as well as the

ctags for autocompleting c++ library functions in vim

守給你的承諾、 提交于 2019-12-13 08:01:58
问题 After following some tutorials i tried to use exuberant ctags to autocomplete e.g. openGL functions. I used the command ctags -R --languages=C,C++ --c++-kinds=+p --fields=+iaS --extra=+q ./ in the directory where the freeglut.h, glew.h etc resides. Then copying this to a directory pointed by in the .vimrc file (with 'set tags+=./myTag/tags' in my .vimrc) When I try to autocomplete some glut functions i dont get the funciton parameters listed, only the function itself gets completed, but

Vim Plugin to Resolve a Member Function More Efficiently Using Ctags

房东的猫 提交于 2019-12-13 07:04:10
问题 Say I have N class' defined as: 1 class Bar0 2 { 3 public: 4 void func(); 5 }; 6 7 void Bar0::func() 8 {} 9 10 class Bar1 11 { 12 public: 13 void func() 14 }; 15 16 void Bar1::func() 17 {} Say I am using ctags, my tags file is sorted and I am using it with vim. When I place my cursor over func on line 13 and hit Ctrl + ] . This will/could take me to the definition of Bar0 's member function func on line 7 because its lexicographical ordering comes before Bar1 's. To get around that I could

NODE_PATH error with node.js while attempting to setup jsctags for vim

筅森魡賤 提交于 2019-12-12 19:01:10
问题 I am trying to setup doctorjs on my windows machine, to work with vim's tagbar, but I think this may be a node.js question more than anything else. I'm following this tutorial. Even after I set my NODE_PATH, I still get an error claiming that it needs to be set. What could be going wrong? Here is a terminal log on my win7 machine: C:\Windows\system32>set NODE_PATH=C:\Users\JG\Desktop\new\doctorjs\lib\jsctags C:\Windows\system32>node.exe C:\Users\JG\Desktop\new\doctorjs\bin\jsctags.js -h 'node

Setting up Taglist plugin to work with vala

喜欢而已 提交于 2019-12-12 17:17:02
问题 Like the title says,I would like to develop vala with vim.My productivity is badly affected due to the lack Taglist plugin support for vala. I found a ctags implementation in valide, http://bazaar.launchpad.net/~valide/valide/trunk/files/head:/ctags-vala/ Can anyone guide me how to make this ctag implemention work with Taglist or some other vim plugin which works for vala 回答1: Found the answer, set this is .vimrc let tlist_vala_settings='c#;d:macro;t:typedef;n:namespace;c:class;'. \ 'E:event