Ⅰ. 插件描述
A very simple plugin to enable SQL syntax highlighting inside strings in a Clojure file.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'krisajenkins/vim-clojure-sql'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'krisajenkins/vim-clojure-sql'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'krisajenkins/vim-clojure-sql'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/krisajenkins/vim-clojure-sql
Ⅳ. 文档说明
# vim-clojure-sql
A very simple plugin to enable SQL syntax highlighting inside strings in a
Clojure file. If you can handle the visual trip of two syntax highlighters
co-existing, this plugin will provide.
Works with the standard vimclojure plugin.
Installation
- Be using the vimclojure plugin already!
- Install Pathogen. (You're already using Pathogen, right?)
- Clone this project into
~/.vim/bundle/vim-clojure-sql.
Usage
Whenever you edit a Clojure file, strings starting with "SELECT, "INSERT,"UPDATE, "DELETE, "CREATE or "DROP will be highlighted as SQL.
Matches are case-sensitive, because that's my preference, but it's trivial to
fork & change the matching rules to suit your coding style.
Notes
This repo serves as a reasonable recipe for embedded Vim syntax highlighting in
- The next time I'm there, I'll probably write a plugin for SQL inside
Hibernate XML files. Highlighting code inside docstrings is another obvious use
of this approach.
Credits
Thanks to Max Bane who figured out the hard stuff when when mixing Tex with Python.
See Also
vim-java-sql - the same plugin for SQL inside Java files.