Sublime Text 2 is a cross-platform GUI text editor for Windows, OS X and Linux.

learn more… | top users | synonyms

52
votes
4answers
32k views

How can I filter a file for lines containing a string in Sublime Text 2?

I want to filter a file I'm editing in Sublime Text 2 for lines contain a certain string, if possible including regular expressions. Consider the following file: foo bar baz qux quuux baz When ...
46
votes
3answers
29k views

Sublime Text 2: how to force all files to open in a single window?

I like using a single Sublime Text 2 window with multiple tabs. Currently, when I click on files in Finder that are openable via ST2, they open in separate ST2 windows. How do I force ST2 to open ...
38
votes
3answers
94k views

Sublime Text 2 - Encoding UTF-8

How do I change the file encoding in Sublime Text 2? How do I change character encoding of a text file in OpenOffice.org writer? http://www.sublimetext.com/forum/viewtopic.php?f=4&t=3541
38
votes
1answer
28k views

Search and replace with TAB character in Sublime Text 2

In Sublime Text 2, I want search and replace by the TAB character. I tried replacing with \t char but it's not working. How can I do it?
34
votes
5answers
12k views

Can I right-click a folder in Windows 7 and choose “Open with Sublime Text”?

In Windows 7, I can do this at the command line: "c:\Program Files\Sublime Text 2\sublime_text.exe" samplefolder This launches a Sublime Text window, with the contents of samplefolder loaded in ...
31
votes
1answer
20k views

Hotkey to remove duplicate lines in Sublime Text 2?

I'd like to add a hotkey for the menu item Edit>Permute Lines>Unique, but what I've added to my user keybindings isn't working: [{ "keys": ["f8"], "command": "permuteLines method unique" }] What ...
30
votes
3answers
11k views

Turn Off Parenthesis Matching in Sublime Text 2

I have questions about turn off parenthesis matching. Does anyone know how to turn off parenthesis matching? example: When I type a (, it will automatically add ), becomes (). It's pretty nice for ...
30
votes
1answer
12k views

How do I assign a keyboard shortcut to recorded macro in Sublime Text

I have a bunch of macros which I have recorded and saved in Sublime Text 2. I'm trying to assign keyboard shortcuts to each of those, but I'm kind of lost as to how to go about doing this, I had a ...
29
votes
2answers
17k views

In Sublime text, how do you disable increase/decrease font size with ctrl and mouse wheel?

With Sublime Text, is it possible to disable increase/decrease font size when using control and mouse? I found the key bindings for ctrl and +/-: { "keys": ["ctrl++"], "command": "increase_font_size"...
27
votes
1answer
10k views

Possible for Sublime Text 2 to save on loss of focus?

Textmate can save files when I switch focus to another application (that is, on blur). Is it possible to set this up in Sublime Text 2?
25
votes
1answer
10k views

Switch between columns' active tabs in Sublime Text 2

I know Sublime Text makes the following commands available: ctrl+tab and ctrl+shift+tab - navigate through recent tabs ctrl+pageup and ctrl+pagedown - navigate through adjacent tabs I usually keep ...
22
votes
4answers
36k views

Is there an HTML auto-indentation feature or plugin for Sublime Text (aka prettify/beautify/format)?

For example, something to change: <section><article><h1></h1><p></p></article></section> to: <section> <article> <h1></h1&...
20
votes
1answer
9k views

Convert variables between camel case and underscore style

I would like to convert variables from or to UpperCamelCase, lowerCamelCase, underscore_style, or even "separate by spaces". This would be useful for coding and making documentation. I use Sublime ...
19
votes
1answer
15k views

Set current language without saving file in Sublime Text

I have recently started using Sublime Text 2 after getting tired with Notepad++. Now, if I wanted to set what language I am currently programming in in Notepad++, I would go to the Language menu, and ...
18
votes
4answers
16k views

How to open file using only keyboard in Sublime Text?

How do I open a file using only keyboard in Sublime Text 2/3? Looking for equivalent of <Esc>:e /path/to/file from Vim.
17
votes
4answers
29k views

Autoindentation in Sublime 2 text editor

Is there an auto indentation option in Sublime 2? In Visual Studio I can press Ctrl+K+D to indent everything so the code is structured nicely. Is there a shortcut in Sublime 2 to do the same?
16
votes
4answers
33k views

Sublime Text 2: Disable cursor position overwriting characters (like vim replace mode)

I'm not sure how, but I managed to get Sublime Text into a 'Replace Mode' which at whatever position the cursor is at, it overwrites the next character with whatever you press instead of inserting it. ...
15
votes
6answers
14k views

Sublime Text: Find-and-replace within selection

Does Sublime Text 2 allow the user to perform find-and-replace, limited to the current selection? I should think it must, only I've been unable after multiple searches to find how to carry it out.
15
votes
1answer
3k views

Opposite of CTRL+D in Sublime Text 2

In Sublime Text 2, one may extend selection to include the next occurence of the current selection with CTRL+D. I often find myself pressing this one too many times, necessitating I clear selection ...
12
votes
4answers
8k views

Edit both opening and closing html tag

Is there a way (core or plugin) that a closing html tag name changes accordingly when renaming the opening one ? A behaviour similar to multi-selection...
11
votes
1answer
4k views

Hide build results window in Sublime Text 2

After a build command (control + b) a window with results appear. Is there any way (not automatically but by shortcut or using another command) to hide it?
11
votes
2answers
7k views

How to have Sublime Text 2 show git folders and files in the sidebar?

When adding a folder to a Sublime Text 2 project, it doesn't seem to show .git subfolders. It also seems these files cannot be opened by Ctrl-P. I disabled the Git plugin but that didn't help.
11
votes
1answer
2k views

How to prevent ST2 from searching in excluded folders?

I've got a sublime-project like this: { "folders": [ { "path": ".", "folder_exclude_patterns": ["_doc", "cache", "logs", "_release"], "file_exclude_patterns": ["...
11
votes
2answers
6k views

How do I record and run multiple find/replace with Sublime Text 2?

How do I record and run multiple find/replace with Sublime Text 2? I tried recording a macro but, as it seems, Sublime won't record find/replace, only text input etc.
11
votes
1answer
485 views

Sublime Text: Disable Find in Selection

I sometimes have selected text when I open the find panel and Sublime Text defaults to "finding in selection". I never want this, any way I can disable it?
11
votes
1answer
664 views

sublime text 2 - display jsdocs while typing

I installed the JsDocs package and use it to document my code. ATM I'm using SublimeCodeIntel with Alt+Click to jump to the documentation, but this is quite annoying, especially when you just want to ...
10
votes
5answers
9k views

Creating new bash command for Sublime Text 2

I'm trying to get Sublime Text 2's command line alias working. The instructions make perfect sense: Run ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl So, in ~/...
10
votes
1answer
4k views

How to make Sublime Text 2 spell check comments only?

The built-in spell check feature seems to be running over the whole code, underlining lots of text that is supposed to be that way i.e. the code itself. Any way to limit it to just comments (//)?
10
votes
3answers
18k views

Sublime Text 2 IntelliSense - How to?

I would like to plug IntelliSense-like functionality into Sublime Text 2. Is there a package that does this?
9
votes
3answers
6k views

Renaming open files in sublime text 2

I am trying to rename open files in sublime text 2. In version 2.0.1 Build 2217, you could rename by pressing f2 or by opening the command palette by pressing Ctrl + Shift + P and entering rename. ...
9
votes
2answers
17k views

Setting up Sublime Text 2 Custom Keyboard Shortcuts

I'm a Vim user trying to move to Sublime Text 2, as it's faster than MacVim with a bunch of stuff open. I have may custom keyboard shortcuts in Vim, that I would like to transfer to ST2. How can I ...
9
votes
3answers
8k views

Sublime Text 2 opens last opened files from last session

Whenever I open Sublime Text 2 on Fedora, it used to restore the last session. But now in Mac OS X Mountain Lion, and it's not opening the window from the last session. What setting do I need to ...
9
votes
1answer
15k views

How can I change the font in Sublime Text 2?

How would I go about changing the font in Sublime 2? This is what my settings look like: { "color_scheme": "Packages/User/Monokai Soda.tmTheme", "font_size": 12, "theme": "Soda Dark....
9
votes
1answer
1k views

sublime text 2 open file from find results keyboard shortcut

In the Sublime Text 2 "Find in Files" results, a box is drawn around wherever your search term appears. Double clicking within that box opens the file and focuses your cursor on that line. Is there ...
9
votes
1answer
608 views

Open up results from Find Results window in new tab/column

In Sublime Text 2 on Mac, I am using the two column layout. Is it possible to open results from the Find Results tab (when I search through a directory/multiple files) into the opposite tab. For ...
8
votes
3answers
34k views

How to shift a block of text to the right/left in Sublime Text 2

How do I shift a block of text to the left or right with Sublime Text 2?
8
votes
1answer
6k views

How can I switch between pdflatex and xelatex conversion in Sublime Text 2?

I often switch between compiling "classic" LaTeX and XeTeX documents. Sublime Text 2 has a package called LaTeXTools that allows you to build LaTeX documents via a simple CmdB. Neat. The build file ...
8
votes
1answer
5k views

How can I set key bindings for menu items in Sublime Text 2?

There is no keyboard shortcut for menu items such as Refresh Folders. I have to use my mouse every time. How can I define key bindings for menu items in Sublime Text 2?
7
votes
2answers
2k views

Sublime Text 2: Working with multiple documents, building master file

I am currently working with LaTeX. I have a big document split up in several sub documents. When I am workin in a sub document, I'd love to compile the master file when pressing ctrl+b, not the file I ...
7
votes
1answer
2k views

Sublime Text, getting configuration under version control

After using vim for the better part of a year I've decided to give Sublime Text 2 a whirl. Using vim my .vimrc of course grew quite substantial since I constantly found small ways to modify it, I ...
7
votes
3answers
12k views

Better syntax highlighting for Java in Vim?

I've found Vim to have fantastic syntax highlighting with my preferred color schemes for Ruby and Python, but whenever I need to write Java code, it's like I haven't even turned on highlighting in the ...
7
votes
0answers
4k views

Sublime Text - keyboard shortcut binding not functioning

Following the instructions here, I've set up a new installation of SublimeText for use with R. I have no other SublimeText plug-ins installed. The keyboard shortcuts that are setup using the ...
6
votes
2answers
7k views

In Sublime Text how do you short-cut writing code?

My apologies but I do not know what its called, if this has been asked or what Stack site this is best suited for. I've seen several videos on how people use Sublime to create quicker tags and I ...
6
votes
1answer
842 views

Change middle mouse button in Sublime Text

On Sublime Text running on Windows the Middle Mouse button acts as select range, on Linux its Shift+Right click. How can I set the middle mouse button to be select range on Linux? Specifically ...
6
votes
2answers
2k views

vi/vim alternative to sublimetext's “Expand selection to scope”

Sublime text has a cool feature called "Expand selection to scope" SHIFT+CMD+SPACE which selects the everything within the scope. It select everything in scope, works perfectly ( ) or [ ] or { } ...
6
votes
2answers
14k views

How to uninstall packages from Sublime Text 2

I'm using a portable version of sublime text 2 on windows. And I'm trying to uninstall some packages which are on this directory: D:\Downloads\sublime\Data\Packages The problem is that it always ...
6
votes
6answers
4k views

I can't write the open square bracket in Sublime Text 2 - How can I find out why?

I'm running Sublime Text 2 on Windows x64 with the following packages installed: Package Control CoffeeScript EncodingHelper GIT MarkDown Preview Python PEP8 Lint Stylus SFTP Theme - Soda I had ...
6
votes
2answers
3k views

Sublime Text 2 - insert breaks to match current wrapping?

Is there an automated way to insert line breaks at every point where the text is currently wrapping? After this operation, no lines should be wrapped, but it should look visually identical.
6
votes
1answer
1k views

Sort (permute) lines by length in Sublime Text?

I'm looking to sort lines by length. I see how to do it by alpha or reverse alpha, but is there a way to see shortest to longest? Good writing mixes sentence lengths, and I'd find it very helpful if ...
5
votes
4answers
16k views

auto-close HTML tags in Sublime Text

I'm using Sublime Text 2, and I'm sure there must be a way to make it auto-close XML/HTML tags, the way for example Notepad++ can. Is there a way to have it add </div> immediately after I type &...