Ⅰ. 插件描述
Search and view Linux source code from within vim (via Elixir's Bootlin)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'fcangialosi/bootlin-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'fcangialosi/bootlin-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'fcangialosi/bootlin-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/fcangialosi/bootlin.vim
Ⅳ. 文档说明
# bootlin.vim
A simple plugin for easily searching and viewing Linux source code via Elixir's Bootlin from directly within vim.
Install
vim-plug (recommended):
- Add
Plug 'fcangialosi/bootlin.vim'to your ~/.vimrc - Run
:PlugInstall
vundle:
- Add
Plugin 'fcangialosi/bootlin.vim'to your ~/.vimrc - Run
:PluginInstall
manual:
- git clone this repository into your
.vim/plugins directory
Configuration
If you're not on a Linux machine, or if you'd like it to grab the source for a version other than
your system default (which it finds by running uname -a) you can specify the version in your .vimrc as follows:
let g:bootlin_version = "4.19.1"NOTE: This is optional on Linux machines, but must be set on non-Linux machines.
Usage
- In normal mode, type
:Lxsto start searching - Input an identifier to search for and press enter. This will open a new split at the bottom listing all the places the identifier was found.
- Move your cursor over the one you're interested in and press enter. This will open a new split above with the source code for that file at the correct line number. By default it is opened in a scratch buffer, so if you want to save it you'll need to do so manually.
- Navigate back to the identifier listing at any time and hit enter to open any of the other source files

TODOs
Things I'd like to do eventually:
- Make it asynchronous
- Handle the case where an identifier appears multiple times in a file
- Make it more easily configurable (height of splits, etc.)