aboutsummaryrefslogtreecommitdiffstats
path: root/twittperator
diff options
context:
space:
mode:
authorJagua2012-06-10 21:09:48 +0900
committerJagua2012-06-10 21:09:48 +0900
commitedd842ff05b02a316e677907dc06bc206d9c3858 (patch)
treeac5bc3d68ff90ac4e35f2f52d613afad09b5eae2 /twittperator
parenta623d92eda40366ce758aa9f5a07bc77c9cc5cfd (diff)
downloadvimperator-plugins-edd842ff05b02a316e677907dc06bc206d9c3858.tar.bz2
retweet official or unofficial
Diffstat (limited to 'twittperator')
-rw-r--r--twittperator/rt.tw44
1 files changed, 44 insertions, 0 deletions
diff --git a/twittperator/rt.tw b/twittperator/rt.tw
new file mode 100644
index 0000000..fde9194
--- /dev/null
+++ b/twittperator/rt.tw
@@ -0,0 +1,44 @@
+/*
+ * Please write the below line into .vimperatorrc.
+ * let g:twittperator_plugin_rt = 1
+ */
+
+(function () {
+ const TW = liberator.plugins.twittperator;
+
+ TW.SubCommands.add(
+ TW.SubCommand({
+ command: ['rt'],
+ description: 'Official retweet',
+ action: function(arg) {
+ setTimeout(function () {
+ commandline.open(':', 'tw RT ' + arg, modes.EX);
+ }, 100);
+ },
+ timelineComplete: true,
+ completer: TW.Completers.name_id(function(s) s.id)
+ })
+ );
+
+ TW.SubCommands.add(
+ TW.SubCommand({
+ command: ['urt'],
+ description: 'Unofficial retweet',
+ action: function(arg) {
+ arg.match(/^@([a-zA-Z0-9_]+)#\d+: (.*)$/);
+ var screen_name = RegExp.$1;
+ var text = RegExp.$2;
+ if (screen_name && text) {
+ setTimeout(function () {
+ commandline.open(':', 'tw RT @' + screen_name + ': ' + text, modes.EX);
+ }, 100);
+ }
+ },
+ timelineComplete: true,
+ completer: TW.Completers.name_id_text(function(s) s.id)
+ })
+ );
+
+})();
+
+// vim: set et fdm=syntax fenc= ft=javascript sts=2 sw=2 ts=2 :