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

learn more… | top users | synonyms

37
votes
4answers
13k 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 ...
29
votes
5answers
10k 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 ...
25
votes
2answers
14k 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 ...
23
votes
3answers
43k 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
21
votes
2answers
8k 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": ...
20
votes
3answers
6k 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 ...
20
votes
1answer
7k 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 ...
19
votes
1answer
12k 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?
18
votes
1answer
5k 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?
15
votes
1answer
5k 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 ...
14
votes
1answer
8k 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 ...
13
votes
4answers
19k 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?
13
votes
3answers
17k 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> ...
12
votes
4answers
7k 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.
11
votes
1answer
1k 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 ...
11
votes
2answers
3k 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 ...
10
votes
5answers
8k 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
3k 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 ...
10
votes
2answers
5k 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.
9
votes
1answer
5k 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 ...
9
votes
5answers
8k 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.
8
votes
3answers
2k 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. ...
8
votes
1answer
10k 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
2answers
1k 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.
7
votes
1answer
8k 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 ...
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 ...
6
votes
2answers
3k 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...
6
votes
3answers
11k 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?
6
votes
1answer
274 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?
5
votes
1answer
10k 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. ...
5
votes
2answers
784 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
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
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.
5
votes
2answers
8k 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 ...
5
votes
1answer
1k 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
3k 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 ...
5
votes
1answer
2k views

How to display whitespace characters in Sublime Text 2

I'd like to be able to see the whitespace characters used in files that I edit with Sublime Text 2 so that I can see when a tab is used instead of a space and replace that just to provide one example. ...
5
votes
1answer
615 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 ...
5
votes
1answer
419 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
1answer
216 views

Quick navigation between folders in the project on Sublime Text 2

For example, we have lots of folders in the project, and I want quickly navigate between them. How can I do that? Maybe there exists a command in console that opens (expand) htdocs/js/jquery folder ...
4
votes
3answers
1k views

Sublime Text 2 Vintage: Leave insert mode on focus lost

I'm using Vintage mode (Vi bindings) on Sublime Text 2. When switching back to ST2, I regularly get bitten by still being in insert mode, resulting in me entering "jjjjjjjjjjjjkkkkkkkkk". Is there a ...
4
votes
3answers
3k views

Open file in local text editor from within an SSH connection

I'm not a vim guy. I'd like to be able to open log files in Sublime Text when in an SSH connection from within Terminal. Is there a way I could do this? I'm thinking there must be a command or ...
4
votes
3answers
2k views

Sublime Text Editor command not found

I have installed Sublime on my Mac Lion Laptop, and followed the guide here http://www.sublimetext.com/docs/2/osx_command_line.html but as always it did not work. I dont have a ~/bin directory on my ...
4
votes
1answer
2k 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 (//)?
4
votes
1answer
189 views

'subl -w' doesn't ever un-block when running under tmux on OS X

On my mac, I have $EDITOR set to 'subl -w'. If I run my shell session under tmux, it opens the editor fine, but the command on the terminal never exits. However, this works fine on a terminal by ...
4
votes
1answer
3k 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?
4
votes
1answer
591 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. ...
4
votes
5answers
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 ...
4
votes
3answers
4k views

Command Line from within Sublime Text

I recently switched from Notepad++ to Sublime Text 2, and it's amazing. There's one thing I'd appreciate and that's compiling my files from the same environment. Sublime text has a console and a ...