Skip to content

Instantly share code, notes, and snippets.

@hluk
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hluk/6325e726f11dc5abac08 to your computer and use it in GitHub Desktop.
Save hluk/6325e726f11dc5abac08 to your computer and use it in GitHub Desktop.
CopyQ 2.3.0 user commands to move selected items to next or previous tab
[Commands]
1\Name=Move To Next Tab
1\Command="
copyq:
how = +1
source = selectedtab()
tabs = tab()
i = tabs.indexOf(source)
j = (i + tabs.length + how) % tabs.length
target = tabs[j]
tab(source)
items = selecteditems()
for (i in items) {
tab(source)
item = getitem(items[i])
tab(target)
setitem(i, item)
}
tab(source)
remove.apply(this, items)
for (i in items)
items[i] = i
tab(target)
selectitems.apply(this, items)
show(target)"
1\InMenu=true
1\Icon=\xf061
1\Shortcut=Ctrl+Shift+Right
2\Name=Move To Previous Tab
2\Command="
copyq:
how = -1
source = selectedtab()
tabs = tab()
i = tabs.indexOf(source)
j = (i + tabs.length + how) % tabs.length
target = tabs[j]
tab(source)
items = selecteditems()
for (i in items) {
tab(source)
item = getitem(items[i])
tab(target)
setitem(i, item)
}
tab(source)
remove.apply(this, items)
for (i in items)
items[i] = i
tab(target)
selectitems.apply(this, items)
show(target)"
2\InMenu=true
2\Icon=\xf060
2\Shortcut=Ctrl+Shift+Left
size=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment