Skip to content

Instantly share code, notes, and snippets.

@jstvz
Created August 7, 2017 01:17
Show Gist options
  • Save jstvz/95b6f99121572cb209b5f64801551a0b to your computer and use it in GitHub Desktop.
Save jstvz/95b6f99121572cb209b5f64801551a0b to your computer and use it in GitHub Desktop.
Vimperator plugin to copy buffer url and title as an org-mode hyperlink
// PLUGIN_INFO//{{{
var PLUGIN_INFO = xml`
<VimperatorPlugin>
<name>Yank as Org</name>
<description>yank-as-org from Vimperator</description>
<author mail="j@jstvz.org" homepage="http://jstvz.org">jstvz</author>
<version>0.1</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0pre</maxVersion>
<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/yank-as-org.js</updateURL>
<detail><![CDATA[
== COMMANDS ==
yankorg [URL]:
echo and copy URL and title in org-mode hyperlink format
== LIBRARY ==
plugins.get-as-org.yankasorg(url):
return yank-as-org
]]></detail>
</VimperatorPlugin>`;
//}}}
(function() {
commands.addUserCommand(['yankasorg'], 'copy title and url as Org',
function(args) util.copyToClipboard(`[[${buffer.URL}][${buffer.title}]]`, true),
{
argCount: '?',
});
})();
// vim: fdm=marker sw=4 ts=4 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment