Ⅰ. 插件描述
Vim filetype support for LLVM (including official files)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'rhysd/vim-llvm-care-of-itself'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'rhysd/vim-llvm-care-of-itself'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'rhysd/vim-llvm-care-of-itself'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/rhysd/vim-llvm
Ⅳ. 文档说明
Vim files for Low Level Virtual Machine (LLVM)
This repository and its subdirectories contain source code for Vim files for the Low Level Virtual
Machine, a toolkit for the construction of highly optimized compilers, optimizers, and runtime
- LLVM is open source software. You may freely distribute it under the terms of the license
- found in LICENSE.txt.
This repository aims to make Vim plugin package managers deal with a Vim plugin bundled in the LLVM
official repository and provides some extended features.
If no license is specified in the header of a file (it means that it came from LLVM official repository),
the file is distributed under the license described in LICENSE.txt.
Imported from upstream (LLVM official repository)
Following files are imported from llvm/utils/vim. They are updated at LLVM version bump.
ftdetect/*.vimftplugin/*.vimindent/*.vimsyntax/*.vim
Imported from LLVM 9.0.1.
Extended features
This repository provides some advanced features which are not supported in LLVM official repository.
after/**/*.vim: Extended filetype supportscripts.vim: Improvedllvmfiletype detection
If you want to disable this feature, you write a config in your vimrc:
let g:llvm_extends_official = 0Mappings
Some useful mappings to jump a cursor are provided.
K: Jump to the definition of an identifier under the cursor. Or if an instruction (likegetelementptr)
is under the cursor, the explanation of the instruction will be opened in a browser.]],][: Move the cursor to the next basic block (Please see:help ]]for more details).b]: Jump to a basic block which follows the current basic block.b[: Jump to a basic block which the current basic block is following.
More mappings will be supported (under construction).
Commands
Some useful commands are defined in llvm filetype buffers.
:LLI [file]
Runs the given file using lli command. If file is omitted, it runs current buffer instead.
This command uses Neovim/Vim8 terminal feature. The LLVM IR code is run in job asynchronously and
the result is output in a temporary terminal buffer.
The default command to run is lli. You can change it by setting g:llvm_ext_lli_executable.
Installation
Please choose one of follows:
- Use your favorite plugin manager like [vim-plug][], [dein.vim][], [minpac][].
- Use
:packadd(Please see:help packaddfor more details). - Copy all directories and
scripts.vimto your~/.vim(or~/vimfileson Windows) manually. (not recommended)