Questions tagged [sublimetext2]

DO NOT USE THIS TAG UNLESS YOUR QUESTION IS SPECIFICALLY ABOUT SUBLIME TEXT ITSELF. Do not tag your IDE or source code editor in questions about unrelated topics. Sublime Text 2 is a multi-language and cross-platform sophisticated code editor developed by Jon Skinner. Please note that version 2 is obsolete and Sublime Text 3 is now the default version. Version 4 is currently in development.

Sublime Text 2 is a multi-language, multi-platform code editor developed by Jon Skinner. Please note that version 2 is obsolete and Sublime Text 3 is now the default version. Version 4 is currently in development.

Features of Sublime Text 2:

  • Slick and Fast UI
  • A text minimap (zoomed out view of your entire file)
  • Multi-select (make changes in multiple pieces of selected text at once)
  • Goto anything (quick navigation within files and projects)
  • Snippets and macros
  • Supports plugins written in Python

TextMate snippets and themes port over nicely to Sublime Text.

Useful links:

4056 questions
1353
votes
16 answers

How do I reformat HTML code using Sublime Text 2?

I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read?
Ravi Ram
  • 22,578
  • 20
  • 69
  • 97
737
votes
4 answers

Set default syntax to different filetype in Sublime Text 2

How do I set a default filetype for a certain file extension in Sublime Text 2? Specifically I want to have *.cfg files default to having Ini syntax highlighting but I cannot seem to figure out how I could create this custom setting.
keiththomps
  • 7,903
  • 3
  • 13
  • 17
525
votes
6 answers

How do I force Sublime Text to indent two spaces per tab?

Is there a way to force Sublime Text 2 to always indent two spaces per tab when working with Ruby files? I know that indentation can be set under the view -> indentation menu option, but it does not stick. Every time I open a new file and hit tab,…
Mohamad
  • 32,727
  • 31
  • 131
  • 208
505
votes
20 answers

Indenting code in Sublime text 2?

In Visual Studio I can press Ctrl+K+D to indent everything so the code is structured nicely and readable. Is there a shortcut in Sublime 2 to do the same?
Kimpo
  • 5,775
  • 4
  • 22
  • 29
469
votes
12 answers

Replace \n with actual new line in Sublime Text

How can I replace \n in Sublime Text with real in-editor displayed new line so: foo\nbar becomes: foo bar in the editor when I view the file in it.
leemour
  • 9,294
  • 6
  • 31
  • 40
467
votes
6 answers

Regular expression search replace in Sublime Text 2

I'm looking to do search replace with regular expressions in Sublime Text 2. The documentation on this is rather anemic. Specifically, I want to do a replace on groups, so something like converting this text: Hello my name is bob And this search…
hackerhasid
  • 11,151
  • 9
  • 40
  • 60
441
votes
10 answers

Sublime Text 2 - View whitespace characters

How can Sublime Text show non printable characters (I'm interested in SPACEs and TABs)?
imkost
  • 7,473
  • 6
  • 25
  • 46
433
votes
10 answers

Sublime Text 2 - Show file navigation in sidebar

I just switched to Sublime Text as my new editor. If I open the sidebar it shows the opening file, but what I want is a file navigation sidebar, is it possible to change that without downloading plugins?
sozhen
  • 7,357
  • 14
  • 34
  • 51
422
votes
10 answers

Comparing the contents of two files in Sublime Text

I have two cloned repositories of two very similar open-source projects, which I have been working on in different instances in Sublime Text 2 to arrive at my desired result. Code from both of these projects was used. I have been using Git as…
LanceLafontaine
  • 4,910
  • 3
  • 17
  • 33
351
votes
6 answers

How do I see the current encoding of a file in Sublime Text?

How do I see the current encoding of a file in Sublime Text? This seems like a pretty simple thing to do but searching has not yielded much. Any pointers would be appreciated!
arturomp
  • 26,187
  • 10
  • 39
  • 64
334
votes
14 answers

What is the difference between Sublime text and Github's Atom

Github announced Atom which is very similar to Sublime. Even some keyboard shortcuts like ⌘ + P, ⌘ + Shift + P etc. are same. How is Atom different from Sublime? Does it include IDE features like build tools, function definition jumps,…
Om Shankar
  • 7,795
  • 3
  • 30
  • 51
320
votes
2 answers

What is PEP8's E128: continuation line under-indented for visual indent?

Just opened a file with Sublime Text (with Sublime Linter) and noticed a PEP8 formatting error that I'd never seen before. Here's the text: urlpatterns = patterns('', url(r'^$', listing, name='investment-listing'), ) It's flagging the second…
Oli
  • 215,718
  • 61
  • 207
  • 286
314
votes
16 answers

How do I run Python code from Sublime Text 2?

I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ?
neo
  • 3,259
  • 3
  • 13
  • 5
294
votes
2 answers

80-characters / right margin line in Sublime Text 3

You can have 80-characters / right margin line in Netbeans, Text Mate and probably many, many more other IDEs. Is it possible to have it in Sublime Text 3 as well? Any option, plugin etc.?
trejder
  • 15,841
  • 23
  • 110
  • 207
292
votes
7 answers

How to make ruler always be shown in Sublime text 2?

I use Sublime Text 2 and want a Ruler to be shown in every file with specific line-height. But I have to show it manually in every file.
Denis Óbukhov
  • 4,069
  • 4
  • 17
  • 27
1
2 3
99 100