Sublime 和 Atom 裡都有的功能,翻遍設定和外掛也沒找到,勉強用兩個套件組合出來湊合使用⋯
安裝 Extension
組合原本的和客製化的篩選條件
原本指令在跨頁連續選取時會有不斷跳動的問題,嘗試後修正為以下,也不需要連續觸發 selectby 了,目前用起來一切安好 🙏
{ "key": "cmd+d", "command": "extension.multiCommand.execute", "args": { "sequence": [ "editor.action.addSelectionToNextFindMatch", { "command": "selectby.regex", "args": { "surround": " +" } } ] }, "when": "!editorHasSelection" }
{ "key": "cmd+d", "command": "extension.multiCommand.execute", "args": { "sequence": [ "editor.action.addSelectionToNextFindMatch", { "command": "selectby.regex", "args": { "surround": " +" } }, { "command": "selectby.regex", "args": { "surround": "[-+]?\\d+(\\.\\d+)?([eE][-+]?\\d+)?[fF]?" } } ] } }
要記得設定在 editorHasSelection 下,cmd+d 繼續觸發 selectby 的連選命令
{ "key": "cmd+d", "command": "selectby.addSelectionToNextFindMatchMultiCursor", "when": "editorHasSelection" },