카테고리 없음

[Atom] wrap the selected text

AM0530 2018. 6. 28. 11:30

[Atom]  선택한 텍스트 tag로 감싸기 / 텍스트 여러개 한꺼번에 변경 / a tag 한꺼번에 추가


1.  text 선택 후 tag로 감싸기 


단축키 : ctrl + alt + w 


text를 drag한 후 단축키 : ctrl + alt + w 를 누르면 감쌀 tag를 입력할 창이 하단에 생김 

그 창에 tag를 입력하면 text가 입력한 tag로 감싸짐 


* 멀티 커서 적용은 되는데 생각대로 안됨 




2. 멀티커서 (Ctrl + Alt + 방향키) 로 text 선택 후 단축키 : Alt + Shift + W)누름



출처 : https://coderwall.com/p/d1qphg/sublime-text-wrapping-content-with-tag



3. 해당 기능은 Sublime Text에서 더 잘된다고 함 

-> SubLime Text3 설치 


[SubLime Text 3]


1. text drag함 

Alt+Shift+W 


============

1)snippet 에  코드 추가

<snippet>

<content>

<![CDATA[

<li>

<a href="" target="_blank">

<span>$SELECTION</span>

</a>

</li>

]]>

</content>

<tabTrigger>wrap</tabTrigger>

<scope>text.html</scope>

<description>Wrap in multiple tag</description>

<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->

<!-- <tabTrigger>hello</tabTrigger> -->

<!-- Optional: Set a scope to limit where the snippet will trigger -->

<!-- <scope>source.python</scope> -->



</snippet>


  

2) keybind 설정  :  상단메뉴 : Preferences > Key Bindings - User

// wrapping HTML tags around existing text

{ "keys": ["ctrl+shift+o"], 

  "command": "insert_snippet", 

  "args": { "name": "Packages/User/wrap.sublime-snippet" } },

]


3) text 드래그 후 keybind에 설정한 단축키 누름.  


실행됨 


==============

이거 찾느라 이틀걸렸다 ㅠㅠㅠ 

찾고나니까 엄청 간단한데 애먼데서 헤매고 있었다 ㅠㅠ 

에효 ㅠㅠㅠ