Home > System Tutorial > LINUX > body text

sudoapt-getinstallcscope usage: -Rb

WBOY
Release: 2024-03-26 12:20:36
forward
431 people have browsed it

/*********************************************************************
 * Author  : Samson
 * Date    : 07/02/2015
 * Test platform:
 *              gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
 *              GNU bash, 4.3.11(1)-release (x86_64-pc-linux-gnu) 
 * Nginx version:
 *Nginx 1.6.2
 *Nginx 1.8.0
 * *******************************************************************/
Copy after login

linux vim 使用_linux操作系统安装vim_linuxvim安装教程

In the vim world, when viewing the source code, you can use the ctags tool to achieve function jumps. If you want to find out where the corresponding method is called or defined in the source code, you can only use Use the grep command to find it. In this case, you need to open a new terminal or use:!grepfucname./*-rn|greptags in the same terminal. Such a switch is not so convenient for ssh to remote operation. Is there any better way? Can plug-in tools directly complete the above functional requirements? Then use the cscope tool, which can complete the functions described above that ctags grep can complete. Execute the following command in GNULinux to install it.

linux操作系统安装vim_linux vim 使用_linuxvim安装教程

sudoapt-getinstallcscope

Usage:

1. Download the cscope_maps.vim (download address:) file for Hongqi Linux system, and add this file to your Vim startup configuration file. If you are using Vim6.x version, you can place this file in the $HOME/.vim/plugin directory (if it is another directory, please understand your 'runtimepath' environment variable) . If you are using the Vim5. in an identifiable path).

2. In the source code directory, execute cscope-Rb to generate the cscope.out file. This is an index file, similar to the tags index file generated by ctags;

3. Open Vim. If you use an existing symbol in the C code (for example: 'vim-tmain'), Vim will jump to the place you want. Connect the cursor to a function in each source code in the program, and type "CTRL-S" continuously and quickly (that is, press CRTL-backslash, and then press 'S'), and then you will see A window pops up at the top of Vim linux vim uses , which displays the corresponding tags in the program. Select the corresponding one and type Enter linux vim using will also jump to the corresponding location. Like ctags, you can type "CTRL-t" to return to where you were before searching.

The above is the detailed content of sudoapt-getinstallcscope usage: -Rb. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!