简体   繁体   English

删除从 emacs 中复制粘贴添加的选项卡

[英]delete tabs that added from copy-paste in emacs

when i copy text in emacs sometimes it breaks the indentation adding extra tabs.当我在 emacs 中复制文本时,有时它会破坏缩进添加额外的标签。 for example if i copy the output from the command例如,如果我从命令中复制 output

curl api.test.org | python -mjson.tool

and paste it in the emacs the json format breaks.并将其粘贴到 emacs json 格式中断。

i am looking for a way to select the whole text and delete the tabs.我正在寻找一种方法来 select 整个文本并删除标签。 A small piece of this looks like this一小块看起来像这样

»       »       »       »       ················"settings":·[$
»       »       »       »       »       »       ················{$                                                                                                                                                                           
»       »       »       »       »       »       »       »       ····················"key":·"+ASSET_1",$
»       »       »       »       »       »       »       »       »       »       ························"value":·"runtest-files-%HDD_1%.tar.gz"$

i tried delete-indentation but it is something different.我尝试了删除缩进,但它有所不同。 And the untabify will just replave the tabs with spaces.而 untabify 只会用空格替换选项卡。 Any ideas?有任何想法吗?

Answer from @Rorschach I copy-paste his solution select the region, Mx replace-string first enter Cq for the target string, and empty string for replacement @Rorschach 的回答我复制粘贴他的解决方案 select 区域, Mx replace-string首先输入Cq作为目标字符串,然后输入空字符串进行替换

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM