TextMate - automatically add a closing HTML tag

Is there a way to get TextMate to automatically add a closing HTML tag when I enter an opening? Something like what Notepad ++ does under Windows / Linux or MS Visual Studio.

I mean without any shortcuts? So I just type "<body>" and it adds "</body>" and moves the cursor back. Without "Ctrl + Shift + Option + Whatever" is black magic.

Or maybe an alternative to TextMate?

PS. Mac OS is just one of the many operating systems I work on, so I don’t want to clog my brain with any shortcuts ...

+6
source share
3 answers

No, you can’t. The simplest thing you could do to close the tags is to print some opening tag with the contents of <div>Some text , and then press Command + Option + Dot to close the most recent closed tag. This is due to contraction, but it is easy to remember.

+11
source

Input, for example. body , and then pressing TAB will end the tag.

+1
source

One option that may or may not be suitable for your code is to press Ctrl + shift + W (select a wrapper). Nothing is selected, you will get <p></p> with a highlighted β€œp” so that you can override the name of your desired tag.

I personally prefer the cmd ++ option. shortcut already mentioned.

Credit http://www.456bereastreet.com/archive/200811/textmate_productivity_tips/

+1
source

Source: https://habr.com/ru/post/901930/


All Articles