如何在不使用RTF格式的情况下复制和粘贴代码? [英] How to copy and paste code without rich text formatting?

查看:131
本文介绍了如何在不使用RTF格式的情况下复制和粘贴代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前经常发现自己从网站/ Word文档等处处理一段代码,却发现在粘贴时我会得到所需的代码以及一些额外的HTML标记/文本,基本上是额外的格式信息。 / p>

要摆脱多余的镇流器,我会将文本粘贴到记事本中,然后再次复制,然后粘贴到所需的目标位置。



最近,我发现了一个用于Windows的简单免费工具,名为 PureText 允许我剪切记事本步骤。它基本上增加了一个额外的键盘快捷键,例如WinKey + V,它将执行粘贴操作而不进行格式化;只是纯文字。
我觉得非常方便。



我想知道您会使用哪种方法?他们有更好/更容易使用的工具吗?

解决方案

仅概述可用选项:



工具





浏览器




  • 要从浏览器中复制纯文本:复制为纯文本 CopyPlainText (由 cori 建议)-Firefox扩展

  • 粘贴而不格式化为浏览器(至少是Firefox / Chrome): CTRL + ⇧Shift 在Windows / Linux上为+ V ,对于Mac OS X,请参见下文。



其他




  • Mac OS X ,您可以⇧Shift + ⌥Alt + ⌘命令 + V 以当前格式粘贴(编辑-> 粘贴和匹配样式);或⌘Command + ⇧Shift + V 即可粘贴而不格式化(通过 Kamafeather

  • 粘贴到记事本(或其他文本编辑器),然后从记事本复制并再次粘贴

  • 对于单行文本:粘贴到任何非富文本字段(浏览器URL,文本区域,搜索/查找输入等)



请随时编辑/添加新项目


I used to often find myself coping a piece of code from a website/Word document etc only to discover that when doing Paste I would end up with the desired code plus some extra HTML tags/text, basically extra formatting information.

To get rid of that extra ballast I would paste the text to the Notepad and then copy it again and then paste to the desired destination.

Pretty recently I discovered a simple and free tool for Windows called PureText that allows me to cut the Notepad step. It basically adds an extra keyboard shortcut e.g WinKey + V that will do the Paste action without formatting; just pure text. I find it very handy.

I was wondering what approach would you use yourselves? Are they any better/easier to use tools around?

解决方案

Just to summarize the available options:

Tools

Browsers

  • To copy plain text from a browser: Copy As Plain Text or CopyPlainText (suggested by cori) - Firefox extensions
  • To paste without formatting to a browser (Firefox/Chrome at least): CTRL+⇧ Shift+V on Windows/Linux, see below for Mac OS X.

Other

  • Under Mac OS X, you can ⇧ Shift+⌥ Alt+⌘ Command+V to paste with the "current" format (Edit -> Paste and Match Style); or ⌘ Command+⇧ Shift+V to paste without formatting (by Kamafeather)
  • Paste to Notepad (or other text editor), and then copy from Notepad and paste again
  • For single-line text: paste to any non-rich text field (browser URL, textarea, search/find inputs, etc.)

Please feel free to edit/add new items

这篇关于如何在不使用RTF格式的情况下复制和粘贴代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆