Navigating through selected text instances in Sublime Text 3

Ryan Urie‘s answer on StackOverflow has finally solved my little, but annoying struggle with Sublime Text 3’s key bindings (keyboard shortcuts) for navigating through all instances of currently selected text.

But that wasn’t enough for me! :>

Since ST3 is sometimes used by non-developers then these people my not catch up, how extremely important (to developer) is to be able to select addForeignKey method for example and to navigate through every existing instance of the same method call in entire file with simple keyboard shortcuts. This problem isn’t covered by default setting of Sublime Text 3 keyboard shortcuts and I had to deal with this myself.

Here is the ultimate solution to this problem. Quick and easy, as everything in Sublime Text.

Read More “Navigating through selected text instances in Sublime Text 3”

Keep Sublime Text 3’s replace panel open after replacing all elements

By default, if you open the replace panel (Ctrl+H) enter search and replace patterns and click Replace All button or hit Ctrl+Alt+Enter, replace panel will be hidden. This is very annoing to many users. However, there’s a partial solution to this problem.

This is tested only in Sublime Text 3, but should work in Sublime Text 2 as well:

  1. Select Preferences > Key Bindings — Default.
  2. Search for ctrl+alt+enter and copy entire block.
  3. Select Preferences > Key Bindings — User.
  4. Paste copied block anywhere and remove , "args": {"close_panel": true} part from it.
  5. Save Key Bindings — User and test it (you don’t need to restart Sublime Text).

Since, you have just modified key binding, then you should remember, that expected behavior will work only if you execute Ctrl+Alt+Enter inside it. If you click Replace All button, the “old” behavior will be applied — i.e. replace text panel will be closed.

Posted to Stack Overflow.

Sublime Text 3’s user configuration

As you probably know, there are no configuration dialogs, windows or generally any UI to click-through configure your Sublime Text 3. Actually, nearly everything is customized by editing ST3 configuration files.

Default configuration file is very well documented, but it is quite long and may be overwhelming. To help some of you with that problem, I wrote this article, where I show the list of configuration settings that I changed in my own development environment, that you may find interesting or at list worth considering.

Read More “Sublime Text 3’s user configuration”

Netbeans-like keyboard shortcuts in Sublime Text 3

I’ve been using Netbeans for over five years. Though it is so deadly slow, I didn’t manage to change to Sublime Text 3 (which is extremely fast) up until now. Five years of constant use of some program causes that you get used to it very hard and you’re very opponent to any changes.

This blog entry is supposed to help you configure Sublime Text 3 in the way as close to Netbeans as possible. But, Sublime Text 3 is not Netbeans. You’re able to achieve a lot of similar functionality (plus a lot more of things that you could only dream about in Netbeans), but there still be a span of things that are not replicable.

Read More “Netbeans-like keyboard shortcuts in Sublime Text 3”

Force Sublime Text 3 to auto-pair quotes before semicolon

By default, Sublime Text 3 will not auto-pair quotes (add closing quote, when you enter opening one), when following character is a semicolon (;). This is a little bit unhandy for PHP developers.

But, since nearly everything in Sublime Text 3, this can be easily tweaked, by changing ST3 configuration.

You’ll find all the details in this wonderful Stack Exchange answer, made by MattDMo after my question asking, how to fix this problem.

Read More “Force Sublime Text 3 to auto-pair quotes before semicolon”

Useful plugins for Sublime Text 3

Sublime Text 3 is powerful and really kicks ass even in its bare installation. But, when you power it up with proper combination of plugins it simply kills entire life on the planet!

Package Control claims to have over 1800 plugins for Sublime Text 3. Browsing this number of them seems impossible. Many of them are abandoned, some are for very specific reasons.

In this article I am only listing just a few plugins that I am using within Sublime Text 3.

If you’re reading this text, I assume, that:

  • you have Package Control installed and
  • you’re after reading my Beginning with Sublime Text 3 article.

If not, skip back and pass these two points.

Read More “Useful plugins for Sublime Text 3”

CTags and Goto source definition in Sublime Text 3

One of the most important functionality of each high class IDE is “Goto source definition” mechanism, which let you click particular symbol (i.e. class or method name) in any source file of your project and be immediately redirected to file (and line) that contains its definition.

Sublime Text 3 is not supporting this functionality natively. But, we can add it quite easily, using CTags plugin.

Read More “CTags and Goto source definition in Sublime Text 3”

SublimeCodeIntel and Code intelligence in Sublime Text 3

There’s an article about using CTags plugin to implement “Goto source definition” functionality in Sublime Text 3 — a mechanism, which let you click particular symbol (i.e. class or method name) in any source file of your project and be immediately redirected to file (and line) that contains its definition. You’ll find it here: “CTags and Goto source definition functionality in Sublime Text 3“.

This functionality is often called “Code intelligence” and there is another plugin — SublimeCodeIntel — that implements it in Sublime Text 3. If you want this kind of functionality in Sublime Text 3, but don’t want to use CTags plugin, this article will tell you more about alternative to it.

Read More “SublimeCodeIntel and Code intelligence in Sublime Text 3”

Working with code snippets in Sublime Text 3

This is another article about my transition from Netbeans to Sublime Text 3. This time I’m going to handle code snippets topic. This is another area, which is much better solved in Sublime Text 3 than in Netbeans.

This article is generally based on “Working With Code Snippets In Sublime Text” blog text from hongkiat.com. And — of course — wonderful, yet unofficial Sublime Text documentation’s chapter about snippets. With some my personal additions and updates.

Read More “Working with code snippets in Sublime Text 3”

Useful keyboard shortcuts in Sublime Text 3

This is one of the last article in my private serie of blog entries targeting developers, who starts their journey with Sublime Text 3. Treat it as memo or list for easy remembering sometimes very useful, not always often, keyboard shortcuts, that are available in ST3. Where it is possible, I’m adding links to Sublime Text Unofficial Documentation, which is great source of information in any aspect related to Sublime Text 3.

Note, that entire document is based on default Sublime Text 3 key bindings, before any user changes, like for example those mentioned in [Netbeans-like keyboard shortcuts in Text 3.txt] text. Also note, that when speaking about Alt key, I’m referring to left key. As on some non-English keyboards, right Alt key may have different meaning (entering language-specific letters etc.).

Read More “Useful keyboard shortcuts in Sublime Text 3”

Beginning with Sublime Text 3

My journey started with reading (and watching videos) two good blog entries done by Stuart Herbert:

However, both texts are old and covers Sublime Text 2 only. And both are quite long. If you want a shorter version, updated for Sublime Text 3, then read on…

Note, that this article is filled with many comparisons to that Netbeans. Intentionally. I’ve been using Netbeans for past five or more years. And from the first day, I started using Sublime Text 3, I feel like I’m a newborn developer again. And I finally have super-fast, super-powerful IDE instead of old, slow, buggy, cranky Java-based Netbeans. Whoa! :]

Read More “Beginning with Sublime Text 3”

Changing sidebar’s font size in Sublime Text 3

Changing font size of editor (by adding "font_size": 14 for example to Preferences > Settings – User file) changes font size of editor area. But leaves font size of sidebar unaffected. I have found files and folders’ names, drawn on sidebar with 10 pt font size, quite not so comfortable on Full HD resolution screen.

So, I needed a fix.

There’s (of course!) a Stack Overflow answer, that explains, how to achieve this in Sublime Text 2. I managed to port this solution to Sublime Text 3.

Read More “Changing sidebar’s font size in Sublime Text 3”