Skip to content

pasela/ctrlp-cdnjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

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)

About

CtrlP extension for cdnjs.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published