Ⅰ. 插件描述
Functionality for editing OpenGL Shading Language (GLSL) in VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'brobeson/glsl'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'brobeson/glsl'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'brobeson/glsl'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/glsl
Ⅳ. 文档说明
glslVim
This is a plugin for Vim providing extensive support for editing OpenGL Shading
Language (GLSL) code. For complete documentation, install the plugin. Then, in
Vim, type :help glsl.
If you find a bug, or would like to request a feature, open an
issue.
Installation
- Download the vimball file.
- Open the vimball in Vim.
- Type
:so %, then exit Vim. - If it doesn't exist, create the file
filetype.vimin your Vim runtime path.
This is typically~/.vim/on Linux andC:\Users\you\vimfiles\on
Windows.
- Open the
filetype.vimfile. Add the following lines:
augroup filetypedetect
au BufNewFile,BufRead *.glsl setf glsl
augroup ENDProvided Capabilities
Here is a summary of the functionality included in the plugin.
Syntax Highlighting
Basic syntax highlighting is provided. Most of it is analogous to C and C++
highlighting.
Automatic Indentation
GLSL uses the same automatic indentation as C.
Filetype Plugin
A filetype plugin provides most of the same functionality as the C filetype plugin.
- Removes text wrapping in general,
- Adds text wrapping for comments,
- Adds autoinsertion of the comment leader after hitting <Enter> in insert mode, or 'o' or 'O' in normal mode,
- Adds formatting of comments with the 'gq' command,
- Adds not breaking long lines in insert mode.
- Sets up formatting of dashed lists in comments.
- Set the code fold method to syntax.
- Adds a filter of ".glsl" files to the file browswer.