Vim 和 Ctags 提示和技巧 [英] Vim and Ctags tips and tricks
问题描述
我刚刚在我的 Vim 上安装了 Ctags(以帮助 C++ 开发)(或者更确切地说gVim),并想找出您最喜欢的命令、宏、快捷方式、与之相关的提示...
I have just installed Ctags (to help with C++ development) with my Vim (or rather gVim), and would like to find out your favorite commands, macros, shortcuts, tips that go along with it...
分享你最好的武器库.对于 Vim 开发中的 C++,您会推荐哪些其他 Vim 附加组件?
Share your best arsenal. What other Vim add-ons you would recommend for C++ on Vim development?
编辑还有哪些附加组件可以与 Ctags 结合使用?
EDIT What other add-on you would use in conjunction with Ctags?
EDIT2 您使用什么版本的 gVim 和标签?这有什么不同吗?
EDIT2 What version of gVim you use with tags? Does it make a difference?
EDIT3您如何增强大型和小型项目的编程体验?
EDIT3 How do you enhance your programming experience for both big and small projects?
推荐答案
Ctrl+] - 转到定义
Ctrl+T - 从定义中跳回.
Ctrl+W Ctrl+] - 在水平分割中打开定义
Ctrl+] - go to definition
Ctrl+T - Jump back from the definition.
Ctrl+W Ctrl+] - Open the definition in a horizontal split
在 vimrc 中添加这些行map
map
Add these lines in vimrc
map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
Ctrl+\ - 在新标签页中打开定义
Alt+] - 在垂直拆分中打开定义
Ctrl+\ - Open the definition in a new tab
Alt+] - Open the definition in a vertical split
标签生成后.您可以使用以下键来标记和标记出函数:
After the tags are generated. You can use the following keys to tag into and tag out of functions:
Ctrl+Left MouseClick
- 转到定义
Ctrl+Right MouseClick
- 从定义中跳转
Ctrl+Left MouseClick
- Go to definition
Ctrl+Right MouseClick
- Jump back from definition
这篇关于Vim 和 Ctags 提示和技巧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!