Copyq: Always copy and past as plain text?

Created on 19 Apr 2017  路  7Comments  路  Source: hluk/CopyQ

Dear all,

I might have just missed the option or setting, but is there a way to always copy and paste as plain text without any formatting applied?

Yours,

Robert

Most helpful comment

It might be possible to override normal paste shortcut with "Paste clipboard as plain text" command (it's available under Add button in Command dialog F6).

Perhaps more reliable way is to remove any HTML when copied with following command.

[Command]
Automatic=true
Command="
    copyq:
    if (dataFormats().indexOf(mimeHtml)) {
      removeData(mimeHtml)
      copy(mimeText, data(mimeText))
    }"
Icon=\xf031
Input=text/plain
Name=Ignore HTML

All 7 comments

It might be possible to override normal paste shortcut with "Paste clipboard as plain text" command (it's available under Add button in Command dialog F6).

Perhaps more reliable way is to remove any HTML when copied with following command.

[Command]
Automatic=true
Command="
    copyq:
    if (dataFormats().indexOf(mimeHtml)) {
      removeData(mimeHtml)
      copy(mimeText, data(mimeText))
    }"
Icon=\xf031
Input=text/plain
Name=Ignore HTML

This is really cool. Thank you, @hluk! :-)

@hluk, one last question:

Can the above command also only be applied to items selected from the tray icon?

image

You have to remove the HTML format before pasting it or paste it from application window with "Paste as Plain Text" command.

To remove HTML from all items in list:

  • open application window,
  • select all items with Ctrl+A,
  • open Action dialog with F5,
  • enter copyq:removeData(mimeHtml) in Command field (leave other fields empty),
  • and press OK.

Thanks for the addition, @hluk!

I have to do these steps manually, correct?

There is no way to apply this to all items in that tray icon list automatically?

The command at the top here creates new clipboard items without the HTML format so you only need to remove it from existing items once.

Thank you again!

I guess that is now all I needed. :-)

Was this page helpful?
0 / 5 - 0 ratings