1. Installing Ctags
[Email protected]:~#apt-get Install Ctags
2. Setting the ctags of the kernel directory
[Email protected]:/study/linux-git/linux-git/linux-3.18.3# ls
Arch documentation include kernel NET security
Block drivers init Lib README sound
COPYING firmware IPC maintainers reporting-bugs Tools
CREDITS fs kbuild Makefile samples usr
Crypto git-test.txt Kconfig mm scripts Virt
[Email protected]:/study/linux-git/linux-git/linux-3.18.3#pwd
/study/linux-git/linux-git/linux-3.18.3
[Email protected]:/study/linux-git/linux-git/linux-3.18.3#Ctags-r
3. Create a tags file in the directory at this time
[Email protected]:/study/linux-git/linux-git/linux-3.18.3# ls
Arch documentation include kernel NET security virt
Block drivers init Lib README sound
COPYING Firmware IPC maintainers reporting-bugsTags
CREDITS FS Kbuild Makefile samples Tools
Crypto git-test.txt Kconfig mm scripts usr
[Email protected]:/study/linux-git/linux-git/linux-3.18.3#
in Vim, execute the following command using tags:
Set Tags=/study/linux-git/linux-git/linux-3.18.3/tags
Or add this vim command in. VIMRC, you can jump with Ctrl +] and ctrl+t.
4. Using the Ctags function
CTRL +] jump to Definition
CTRL + T jumps back to the distance
Vim Configuration (ii): Use Ctags to read the kernel source code