å¾ã§èªããæ¯æ´ããvimperatorã®ãã©ã°ã¤ã³ãä½ã£ã¦ã¿ã
ç§ã¯ï¼èªã¿çµãã£ããµã¤ãã¯deliciousã«ï¼å¾ã§èªããããªã¼ã£ã¦ãµã¤ãã¯firefoxã®ããã¯ãã¼ã¯ã«ç»é²ãã¦ï¼ããã¯ãã¼ã¯ã使ãåãã¦ãããã ãã©ã
ãã®firefoxã®ããã¯ãã¼ã¯ã®æä½ã¯ï¼æ®å¿µãªãã¨ã«vimperatorã使ã£ã¦ãã¦ããã¦ã¹ã使ããããããªãï¼è
ã«è² æ
ãããã£ã¦ãã¾ãã
ãã®è
ã®ç²å´ã¯ï¼ãã©ã¦ã¶ã«ä½ãèã¾ãã¦ããã¨ãããã¨ã示åãã¦ãã¦ï¼çã«æ·±åãªç¶æ
ã§ããã
ããã§ï¼ãã®ç¶æ
ãæç ´ããããã«ï¼ãã¦ã¹ã使ããªãã¦ãæä½ãå¯è½ãªããã¯ãã¼ã¯é åãä½ã£ã¦ã¿ãã
ã¢ã¤ãã£ã¢ã¯ãããã¹ã±ã¼ãã®LinkPadãç¶æ¿ãã¦ãããã¨ããããã¯ãªã
ç§ã¯ï¼ï¼£ããé«ç´è¨èªã触ã£ããã¨ãç¡ãã®ã§ï¼javascriptã¿ãããªã®ã¯å¤ä½ããã¦è§¦ã£ã¦ã¿ãæ°ã«æ £ããªãã£ããã ãã©ï¼vimperatorããã¾ãã«ãé åçéãããããã©ã°ã¤ã³ãæ¸ãã¦ãã¾ã£ããjavascriptã§ããã°ã©ã ã®ãããªãã®ãæ¸ããã®ã¯åãã¦ã ããï¼ããããããjavascriptããããªãããã°ã©ã ãããããªãã®ã§è³ããªããã¨ããã£ããï¼ã³ã¡ã³ããã¦ã¡ãã
linkpad.js
/* * @name linkpad.js * @description like LinkPad of Netscape. * @description-ja ãããã¹ã±ã¼ãã®LinkPadã®ãããªãã®ã * @author wocota <[email protected]> * @version 0.01 * * LICENSE * Public Domain http://creativecommons.org/licenses/publicdomain/ * * USAGE * :linkpad [site] * LinkPadã«ç»é²ããã¦ãããµã¤ãã表示ãé¸æãã¦éããéãã¨åæã«LinkPadããæ¶ããã * :addlinkpad * LinkPadã«ç»é²ã * */ liberator.plugins.exLinkPad = (function(){ var linkpad = storage.newMap("linkpad", true); var links = []; // view links list and open link commands.addUserCommand(['linkpad'],' linkpad ', function (args){ let arg = args.literalArg; let num = arg.match(/^\d+/); if(num > 0){ liberator.plugins.exLinkPad.open(links[--num][1], liberator.NEW_TAB); } else { liberator.echoerr("Error!:not set"); } },{ completer: function(context) liberator.plugins.exLinkPad.list(context), argCount: "?", bang: true, count: true, literal: 0 } ); // add link of current tab commands.addUserCommand(['addlinkpad'],' addlinkpad ', function (){ liberator.plugins.exLinkPad.add(buffer.URL, buffer.title); } ); return { add: function add(url, name) { linkpad.set(url, name); liberator.echomsg("Added Link Pad '" + name + "': " + url, 1); }, //del: function del(url) //{ // linkpad.remove(url); // liberator.echomsg("Delited Link Pad : " + url, 1); //}, open: function open(url, where) { if (url) { liberator.open(url, where); linkpad.remove(url); } else { liberator.echoerr("Error!:not set"); } }, list: function list(context){ //filter = context.filter.toLowerCase(); context.title = ["Link Pad", "URL"]; let i = 1; links = []; for(let [url,] in linkpad){ let title = i++ + ':' + linkpad.get(url); //if(title.indexOf(filter) == 0) links.push([title, url]); } return [0, links]; } }; })();
ãªã«ããï¼
vimperatorã®QuickMarkã¨åæ§ï¼firefoxã«æ°ãã«ããã¯ãã¼ã¯é åã追å ãããã®ã§ããã
QuickMarkã¨ãã®LinkPadã®éãã¯ï¼åè
ã¯ãªãã©ã®ã¯ã¤ãã¯ãã¤ã¢ã«ã®ãããªä½¿ãæ¹ã«åãã¦ãã¦ï¼ããã¯ãããã¹ã±ã¼ãã®LinkPadã®ãããªä½¿ãæ¹ã«åãã¦ããã
使ãæ¹
ãããé©å½ãªåå(linkpad.jsã¨ã)ã§ä¿åãï¼ãã©ã°ã¤ã³ãã©ã«ãã«å ¥ããã¨ï¼ä¸è¨ã®äºã¤ã®ã³ãã³ãã追å ãããã
:linkpad
:linkpad ã¨æã¦ã°LinkPadã«ç»é²ããã¦ãããµã¤ããè£å®é åã«è¡¨ç¤ºãã¦ãããï¼
ãã®å¼æ°ã¯æ°åã ããæå³ãããã®ã§ï¼åã« :linkpad 2ã¨ãã¦ãä¸è¨ã¨åãåä½ãããã
:addlinkpad
LinkPadã«ç¾å¨éãã¦ãããµã¤ããç»é²ãã¦ããã
è¨å®
rcã«ã¯ä¾ãã°æ¬¡ã®ãããªè¨å®ããã¦ããã¨ï¼
noremap m :linkpad<Space> noremap M :addlinkpad<cr>
mã§LinkPad表示ï¼Mã§è¿½å ã¨ãªãã