Skip to content

Instantly share code, notes, and snippets.

@mtmtcode
Created January 10, 2014 10:47
Show Gist options
  • Save mtmtcode/8349988 to your computer and use it in GitHub Desktop.
Save mtmtcode/8349988 to your computer and use it in GitHub Desktop.
現在のタブで開いているRedmineチケットの番号,タイトル,URLをコピー
js <<EOS
commands.addUserCommand(
['tcopy'], 'Copy ticket number and subject',
function() {
var matches = document.title.match(/#([0-9]+): ([^ ]+)/);
var num = matches[1];
var subject = matches[2];
var copiedStr = '#'+num+' '+subject;
util.copyToClipboard(copiedStr+"\n"+content.location);
liberator.echo("Copied :" + copiedStr);
},
null,
true
)
EOS
map <silent> <C-y> :tcopy<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment