sublimetext2 - 在 sublime 文本中粘贴多光标复制/粘贴而无需换行

标签 sublimetext2 sublimetext3 sublimetext sublime-text-plugin

有没有办法粘贴多光标( Ctrl+dCtrl+d 、... Ctrl+C )选择,去掉换行符?

[...]代表亮点,光标:

The ⦙[red].
The ⦙[blue].
The ⦙[green].

如果我粘贴我会得到:
red
blue
green⦙

但我想要
redbluegreen⦙

这可能吗?

最佳答案

保存以下脚本@:/Packages/Paste Without NewLines/paste_without_newlines.py

import sublime, sublime_plugin

class paste_without_newlines( sublime_plugin.TextCommand ):
    def run( self, edit ):

        clipboard = sublime.get_clipboard()
        clipboard = clipboard.replace( "\n", "" )
        sublime.set_clipboard( clipboard )
        self.view.run_command( "paste" )



通过 Command Palette > Paste Without NewLines 执行,添加以下代码@:/Packages/Paste Without NewLines/Default.sublime-commands
[
    {
        "caption": "Paste Without NewLines",
        "command": "paste_without_newlines",
    },
]



要通过 Ctrl + Shift + Alt + V 执行,请添加以下代码 @:/Packages/Paste Without NewLines/Default.sublime-keymap
[
    {
        "keys": ["ctrl+shift+alt+v"],
        "command": "paste_without_newlines",
    },
]

关于sublimetext2 - 在 sublime 文本中粘贴多光标复制/粘贴而无需换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37880494/

相关文章:

sublimetext2 - Sublime Text 3 在 PHP 中使用适当的数组括号重新缩进

python - SublimeREPL 无法识别 python 库

ruby - SublimeText2 RubyTest "Verify Ruby Syntax"触发UTF-8错误

sublimetext3 - 带有多个窗口的 Sublime Text : How to always open the same file in the same window?

sublimetext3 - Sublime Text 3 中的 ES6 反引号支持

indentation - Sublime Text PHP注释缩进(双斜线)

python - Sublime 插件 - 获取区域或删除单词

html - Sublime Text 2 : Autocompleting html escaped characters (starting with ampersand)?

python - Sublime Text 3 自动完成功能不起作用

ide - 如何更改 Sublime Text 3 中的文件夹和菜单字体大小?