ctrlp-cdnjs


Ⅰ. 插件描述

CtrlP extension for cdnjs.com

Ⅱ. 基本信息

创建日期:  2014-10-10
使用用户:  4
Github星:  12
插件作者:  Yuki

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'pasela/ctrlp-cdnjs'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'pasela/ctrlp-cdnjs'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'pasela/ctrlp-cdnjs'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/pasela/ctrlp-cdnjs

Ⅳ. 文档说明

ctrlp-cdnjs

CtrlP extension for cdnjs.com.
Select and insert the library URL/tag.

screenshot

Usage

:CtrlPCdnJs

If may add map into your vimrc like below: >

noremap <leader>js :<c-u>CtrlPCdnJs<cr>

In CtrlP window,

<CR> inserts the URL.
<C-t> inserts the script tag.

<C-v> opens the library's page on the cdnjs.com.
This function requires open-browser.vim
(see: https://github.com/tyru/open-browser.vim)

<C-s>, <C-x>, <C-CR> rotate URL's scheme.

http -> https -> scheme-less -> http -> ...

Variables

g:ctrlp_cdnjs_scheme is current scheme. (default=1)

0 = scheme-less (protocol relative)
1 = http
2 = https

g:ctrlp_cdnjs_script_tag is a template of script tag.
${url} is replaced with the URL.

default:

<script type="text/javascript" src="${url}"></script>

g:ctrlp_cdnjs_css_link_tag is a template of link tag.
${url} is replaced with the URL.

default:

<link rel="stylesheet" type="text/css" href="${url}">

g:ctrlp_cdnjs_indent_tag is auto indent flag. (default=1)
If this value is 1, the inserted tag is indented automatically.

Requirements

ToDo

  • Select version
  • Multiple asset files
  • Multiple select
  • Cache control

Thanks

  • kien - the author of ctrlp.vim
  • mattn - the author of webapi-vim
  • tyru - the author of open-browser.vim

License

MIT

Author

Yuki (a.k.a pasela)

添加新评论