My Personal Vim Config for Reading Linux Kernel Source Code
-
Setup Vundle.vim
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim -
clone this Repo. to anywhere you like, such as
HOME:git clone https://github.com/mintisan/oh-my-vim.git ~/oh-my-vim -
Change the directory you just cloned(maybe
cd ~/oh-my-vim), create symbolic link to~/.vimrc# Attension : the source file can't use relative path, must absolutely path ln -s $PWD/vimrc ~/.vimrc
When you execute
echo $PWDin shell, you will know what the$PWDmeans.
-
Download Linue Kernel Source Code, like 2.6.32 Version, and
tarittar xzf linux-2.6.32.69.tar.xz -
Enter the directory, and generate
tags&cscope.outfor Vim, maybe for a coffee of time XDctags -R * cscope -Rbkq
-
Execute
Vimcurrent directory and then Update Vim Plugin, maybe for another coffee of time XD. It depends on your network solution.:PluginInstall
or u can use shell script below after you backup your vim config:
sh -c "$(curl -fSL https://raw.githubusercontent.com/mintisan/oh-my-vim/master/install.sh)"
Use shortcut to jump between files and functions
- use
CTRL+Fto forward page &CTRL+Bto back page - use
ggto top &shift+gto bottom(current file) - use
shift+mto middle &shift+lto bottom &shift+hto top(current view) - use
:numberto any line of file - use
CTRL+pto find file in current directory - use
CTRL+w+left/rightto jump with (left-NERDTree-windown & center-main-window & right-tagbar-window) CTRL+]to locate definition andCTRL+tto come back- Debian:
sudo apt-get install ctags - Mac:
brew install ctags - Windows:
choco install ctags
- Debian:
:tabnewto open a new tab;:tabnto the next tab;tabpto the previous tabAck {pattern}orAg {pattern} --hiddento search text patten in current directory- Debian:
sudo apt-get install ack-grep - Mac:
brew install ack - Windows:
choco install ack
- Debian:
/to find specific string you like, and usento next,Nto previouscs find <x> <xxx>: use cscope to location files or functions- sudo apt-get install cscope
- brew install cscope
