2016-11-16 29 views
0

我決定從Sublime Text 3跳轉到Atom。我處理HTML,CSS,JS和主要是 ColdFusion。我似乎無法弄清楚凌動如何選擇一個變量,說:如何使用Atom選擇變量名稱並用##圍繞它使用Atom

<cfoutput>testVariable</cfoutput> 

,並添加周圍##沒有跡象原子與僅#替換選定的文本。期望的最終結果是:

<cfoutput>#testVariable#</cfoutput> 
+0

使用Dreamweaver,它是ctrl-shift-3或ctrl-#。這值得一試, –

回答

4

我知道這是舊的,但以防萬一別人期待,這個工作對我來說:

在init.coffee:

wrapSelection = (selection, before, after) -> 
    after ?= before 
    selectedText = selection.getText() 
    selection.insertText("#{before}#{selectedText}#{after}") 

atom.commands.add 'atom-text-editor', 
    'custom:wrap-with-pound', -> 
    editor = @getModel() 
    editor.transact -> 
     wrapSelection(selection, "#", "#") for selection in editor.getSelections() 

在keymap.cson:

'atom-text-editor': 
    'ctrl-#': 'custom:wrap-with-pound' 

enter image description here