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:

4042 questions
1390
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
  • 24,078
  • 21
  • 82
  • 113
747
votes
5 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
  • 8,005
  • 3
  • 15
  • 17
557
votes
13 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
  • 11,414
  • 7
  • 36
  • 43
548
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
  • 34,731
  • 32
  • 140
  • 219
510
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,835
  • 4
  • 26
  • 30
493
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,699
  • 10
  • 42
  • 60
492
votes
11 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
  • 5,680
  • 4
  • 20
  • 34
461
votes
11 answers

Sublime Text 2 - View whitespace characters

How can Sublime Text show non printable characters (I'm interested in SPACEs and TABs)?
imkost
  • 8,033
  • 7
  • 29
  • 47
449
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,627
  • 14
  • 36
  • 53
384
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
  • 28,790
  • 10
  • 43
  • 72
352
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
  • 235,628
  • 64
  • 220
  • 299
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,989
  • 4
  • 34
  • 54
317
votes
15 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,289
  • 3
  • 15
  • 5
310
votes
19 answers

Sublime Text 2: How to delete blank/empty lines

Let's say I had a text file with the following nine lines: foo bar baz qux quux How can I use Sublime Text 2 to remove all four of the blank/empty lines, leaving only five lines?
Nick
  • 8,049
  • 18
  • 63
  • 107
297
votes
8 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,129
  • 4
  • 20
  • 27
1
2 3
99 100