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

learn more… | top users | synonyms

45
votes
4answers
21k 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 ...
33
votes
2answers
21k 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 ...
32
votes
1answer
19k 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?
32
votes
5answers
11k 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 ...
30
votes
3answers
66k 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
25
votes
3answers
8k 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 ...
25
votes
2answers
12k 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": ...
22
votes
1answer
7k 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?
22
votes
1answer
8k 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
1answer
8k 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 ...
22
votes
1answer
14k 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 ...
16
votes
3answers
26k 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> ...
15
votes
4answers
24k 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?
15
votes
1answer
2k 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 ...
14
votes
4answers
11k 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.
14
votes
1answer
6k 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 ...
13
votes
2answers
4k views

In Sublime Text 2, how can I indent out to a straight column with multiple cursors on a ragged edge?

Suppose I've got multiple cursors along several lines, like this: foo| barr| foobar| baz| How can I automatically push the whitespace at the end of each line out to a flat edge, like this?: foo ...
12
votes
6answers
10k 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.
11
votes
1answer
9k 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 ...
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
2answers
6k 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.
10
votes
1answer
504 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 ...
9
votes
2answers
6k 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...
9
votes
3answers
4k 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
3k 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.
9
votes
1answer
357 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?
8
votes
2answers
19k 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. ...
8
votes
1answer
2k 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?
8
votes
2answers
12k 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 ...
8
votes
1answer
4k 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?
8
votes
1answer
12k 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 ...
8
votes
3answers
14k 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?
8
votes
1answer
503 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 ...
7
votes
1answer
3k 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 (//)?
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
1answer
988 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 ...
6
votes
3answers
5k 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 ...
6
votes
1answer
4k 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 ...
6
votes
2answers
11k 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
2answers
2k 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

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": ...
6
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 ...
6
votes
1answer
815 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
2answers
1k 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 { } ...
5
votes
6answers
2k 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 ...
5
votes
2answers
2k views

Is there emacs plugins to do Sublime-like completion and goto anything?

In Sublime Text 2, I can enter prnfunc[tab] and then it completes to 'PrintFunction'. If I have a project, I can press Cmd+P and enter srcpy/hello.py and then it navigates to ...
5
votes
1answer
2k views

Mac: Edit in Filezilla with Sublime text always open a new Sublime window

With my Mac, everytime I want to Edit a file from Filezilla, it open a new Sublime text window. Is there a way to tell Filezilla to open the file in the current window if it already exist?
5
votes
1answer
2k views

Sublime Text 2 / Windows: launch from command line?

How could one invoke Sublime Text from the command line, so that it starts in the current folder? (I'm using the MINGW32 that comes with Git on Windows)
5
votes
1answer
910 views

How to get a “zoomed out” code view in Visual Studio?

Sublime Text and Komodo IDE both have a very neat feature where you have a preview of the entire file you are working on in a "zoomed out" view that you can scrub up and down to move around your code. ...
5
votes
1answer
3k views

sublime text right click not working for sidebar

I am using sublime text 2 on windows 7. I had installed 3 plugins: Emmet Dockblockr SidebarEnhancements Now when i right click on the folders on the sidebar nothing is happening. I tried ...