有没有办法粘贴多光标( Ctrl+d
、 Ctrl+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/