What are the advantages of textmate?

Source: Internet
Author: User
Tags regular expression

To my surprise, James was speaking from the window and thought he would talk about TextMate's design philosophy first.

The left side of the edit window can (note: you can) display line numbers, code folding, bookmarks, and so on. Below is the position information of the current cursor, text format, etc., press ^ can pull out bundles.

It's crazy to hit the words

The triple realm of word-knocking:

Knock a Get A, knock b b;

Knock one, get a pair;

Just knock on the key, the rest let the editor do it.

Literary and artistic ^_^

Always heard that textmate support more than a label, but I can not find, the original must first build a project, the project inside the document can be displayed in the form of a label.

Switch between tags, and textmate one of the most dreamy features-intelligent lookup (T pull up the go to File window, if you want to find pitches_controller_test.rb, just type pct, enter, that is you). It also has a brother go to Symbol (⇧⌘t)

The text operation provided by TextMate is also very simple, nothing more than moving, checking, and intelligent transformations.

Move, remember up or down is enough. However, textmate cattle in the move, people can make flowers, such as camelcasewords such as linked together, but the words separated by capital letters, with ^←/^→ incredibly can a word a word jump.

Previously found a very intimate design in Windows Notepad: press ALT to select. In fact, TextMate also can, hold ⌥ on the line.

Next is the TextMate has a selling point: automatic completion (press, is the ESC key).

Of course, ⌘f that support regular lookups are more useful.

Auto-complement

TextMate's bundles, like a language library, brings a one-stop comfort for users of different needs (I just got off the bundle of Mathematica, which is pretty strong, though). In my opinion, bundle is a library for some kind of demand, the agreement is good I knock what word, press a key, you put it complete, for example: Enter an HTML tag div, hold ⌃< (learn name Shinma Insert Open/close tag Word), TextMate will help you complete the <div></div>.

In addition to bundle, TextMate also provides snippet, macros, command and other tools.

Bundle

Take Ruby Bundle as an example:

Run Script: ⌘r

Mark the result in a note: First, after the line that needs to be calculated, #⇥, #号会补全为 # =>, and then ⌃⇧⌘e, when all lines marked with # => automatically calculate the result.

"Markers" width= "750" height= "259" style= "border:0px;" _src= "http://pic.cr173.com/up/2015-4/2015042315433133002.jpg" >

In addition to the #⇥ mentioned above, there are Cla⇥, Mod⇥, Def⇥, Defs⇥, Deft⇥, R⇥, W⇥, Rw⇥, If⇥, Case⇥, While⇥, and Snippet,inj⇥, Tim⇥, Ea⇥, Sorb⇥, Eawi⇥ ... ...

Provides Tc⇥, Ts⇥, As⇥, Asid⇥ for unit tests

Use ⌃h to view Ruby's built-in documentation

......

Snippet

Snippet, as the name implies is a small program, as usual see good articles do excerpt. Usually triggered by a shortcut key, the book says, "This simple association of the A trigger and a response is exactly what TextMate ' s snippets are."

You can use ⌃⌥⌘b to open:

Now just knock Ap⇥ will automatically expand to Armystrong Pope

Snippet has two characters that do not represent its literal itself: $ and ', you can use/$ and/' to represent it. In addition to string expansion, TextMate can also make a ⇥ jump position. Remember to fill in the form, click the ⇥ will automatically be transferred to the next table? This technique is called tab stop, from the start (yes, starting from 1, the end of the $ $), in the place where you need to jump to write $, $, ..., $n. If you do not tab stop, the default cursor stops at the last word in Sinppet end-of-file. Alternatively, you can specify a default value, like this:

<div${1:id= "${2:some_id}"}>

$

</div>

In this way, the "id=" some_id will be selected at the beginning, and the cursor will circle "some_id" after pressing ⇥.

If it were only these, textmate would not have been so famous. Many languages require names at the beginning and end of the scope because of their rigorous pursuit, such as in Tex

/begin{content}

/end{content}

At this point you can use the mirror, the content entered in the begin{} will appear in the end{in sync. Look at $n familiar, it feels like a variable, in fact it is a variable. It can be mirrored where it is needed:

/BEGIN{$1}

$

/END{$1}

Further, there are times when you need to do a little bit of mirroring, such as capitalizing the first letter .... Clang clang clang, regular expression of the appearance! Yes, you can use regular expressions to change the tab stop. Capitalize first letter yes, simple:

Begin ${1:foo}

Bla bla ...

End ${1/.//u$0/}

Examples are not appropriate. Note that/u$0 's $ is $ in the regular expression, referring to the entire string being matched;/U is the next character uppercase (this is the standard regular expression usage), because the effect is before the whole sentence, it becomes the first letter capital.

Remember the previous snippet that there are two special characters $ and '? $ is used to refer to variables, and ' is typically used to insert shell code:

<a href= "' Echo http://example.com/'" ></a>

From how to transform textmate you can realize how simple and intimate these customization mechanisms it offers.

Macros

The macros in TextMate are more like macros in m$ Office: Start Recording (⌥⌘m), small red flashes, records, Stop Records (⌥⌘M), and finish the call.

Command

Here the command some ambiguity, one refers to the shell Commands, one refers to the textmate inside an automatic complement mechanism.

First of all, Shell command. You can play a script in the TextMate, and ⌃r,textmate will send the results in a pipe.

The command in TextMate typically invokes shell commands. Compared with snippet, macros, it can complete automatic completion with more complex logic.

What are the advantages of textmate?

I don't know much about other editors, many of the features I've seen for the first time in textmate, so if I'm not right, I'm not saying the same:

1. First snippets code generation function automatically. I believe many people use TextMate for this function, it is really very useful. At the time, almost all the Ides had you fill out a bunch of dialog frames and then automatically generate a file or code that was cumbersome and inflexible. In the TM test only a series of snippets, you can extend the preset abbreviations into classes, functions and branching loop structure, and can test tab to modify the custom site;

2. Pioneered plugin bundle distribution and management mechanisms, and formed a community of a certain size. TextMate plug-in installation is very simple, and installed with the use, at any time to delete. At that time many software plug-ins have to copy so files to the development directory, Vim needs to be in the. vim/directory to extract the plug-in package or manually copy vim.

3 defines the lexical scope so that all snippets, commands, and macros are not scoped to the entire file/project. This design allows different types of files, and even different locations in the file can share the same shortcut keys, behavior is completely different. This design reduces the key commands that need to be remembered, but the power does not diminish;

4. The discoverbility do the best in the Automation editor. TextMate is often used in comparison to vim and Emacs, with the ability to do both keyboard operations, not far from the scalability. But her learning curve was remarkably smooth. This is proud of all of her shortcuts can find the corresponding menu operation. The Novice can remember the regular shortcuts after flipping through the menus, and because of the 3rd, users can use these shortcuts to try out in different file types to get a less than predictable result;

5. Use the script. Because TextMate's author was previously an Emacs user, the support for calling scripts was perfect, in fact, most textmate commands invoke external scripts to implement certain functions. And the script can be a script that can run under any UNIX, such as Python, Ruby, Shell, Perl, and so on. In addition, TextMate does not force users to learn these scripting languages, and you can write scripts to develop bundle as bundle users.

Of course, TextMate also has a lot of drawbacks, and the author is brewing TM2, rather than the rapid iteration of this version, resulting in slow evolution, many features have been imitated by other editors. I think TM has a few deficiencies or no advantages:

0. WideCharacter support too bad, forever pain!
1. Snippets has been absorbed by a large pile of editors such as Vim, EMacs, notepad++, and so on
2. Bundle can be modeled by pathogen,
3. The complement function is too weak;
4. Temporary pipeline input and output, Need to go through a dialog box, far less than vim convenience;
5. tab-type multiple files, file a lot of navigation is not good, not support screen segmentation; In particular, file switching can not avoid mouse operation, and Vim/emacs keyboard operation comparable;
6. Text Lookup dialog box, Now even the browser is not used, nor as vim under the/convenience. Multiple results found depend on mouse access, unlike Vim with Quickfix and shortcuts;
7. Remote edit file is too weak.

So, after about 1 years of textmate, I used vim back. Vim is gradually maturing through strong scalability and community support, as well as the division of Snippets and bundle. And the individual has been through vim learning curve steep stage, textmate for me, the advantage is not too much.

Fortunately plug-ins are many ah.
It's just an enterprising editor. The author promised free upgrades to 2.0 no longer expected, but at least you upgrade Ah!
I believe that these are the problems that everyone with TextMate has complained about.

So the comrades in our company have already switched to vim, there are many plug-ins, the custom is very strong (strong enough to do a set of others do a good job of setting their own from scratch), open source.

TAB key Auto complement, multiline edit. That's all I know.
Haha actually I also did not use the Mac. I've used some of the editors that I've modeled on Linux and Windows.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.