sublime-text interview questions
Top sublime-text frequently asked interview questions
I've been using Sublime Text on Linux. I now switched to Windows, and the file path on the title bar is different from Linux: Sublime Text always shows the complete path on the tile bar.
Can I hide it like it is under Linux?
Source: (StackOverflow)
How would I get Sublime Text 3 to recognize file type (i.e. set syntax and build system) based on a files header?
For example: If the first line of a file was <!DOCTYPE html>
, it would be recognized as an HTML file or if the first line in a file was #!/usr/bin/env python3
it would know it is a Python 3 file.
I know normally file extensions would dictate this, but I am using Linux and a lot of these files don't have extensions because they are commands.
Source: (StackOverflow)
I'm currently using Sublime Text 3 as my primary coding application. I've noticed that after (say, 25, I really have no idea) files saves there is a notification about purchasing a license for Sublime Text 3.
Is there any real benefit to purchasing a license, other than removing this little prompt every couple hours?
Source: (StackOverflow)
How can I make Sublime Text (3) re-load the file currently being edited, to take into account changes having been made externally?
Source: (StackOverflow)
Sublime Text 3 has a default feature which makes tabs overlap each other instead of the old behavior where the horizontal length of the tab would shrink. How do you disable this?
Source: (StackOverflow)
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.
Source: (StackOverflow)
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 |
barr |
foobar |
baz |
(In these examples, |
is supposed to be my cursor.)
When you just Tab or Space from the initial arrangement, you get this:
foo |
barr |
foobar |
baz |
That's useful, but not what I'm looking for. I'm looking for some kind of keyboard shortcut that will let me indent from a ragged multi-cursor insert out to a straight column.
Source: (StackOverflow)
Is there any editor that allows me to have two columns, where the second column picks up after the last line of the first column? I don't mean cloning like in Notepad++ where I have two open copies of the document, but a view where the same document displays in the second column from the point after the first column is full.
Source: (StackOverflow)
I'm recently moving from Vim to Sublime. Then I find some differences here, when I fold some code in Sublime, it automatically select those code, then I have to press Esc to cancel.
Furthermore, if I move cursor up and down just after folding code(like zcEscjk), those code will be collapsed, that is kind of annoying, can I fix it?
I'm using Sublime Text 3.
Source: (StackOverflow)
Suppose I'm working with a file In Sublime Text 3 that contains multiple occurrences of a single character variable, c
, which I want to rename to another name.
When I select one instance of that variable with my cursor, Sublime Text automatically highlights the other instances of that variable for me:

This visual highlight is enabled by the the setting: "match_selection": true
, and clearly shows that sublime is smart enough to only highlight other instances of that character where it is relevant as a variable.
However despite this highlight indicating that it should be possible, it seems there is no easy way to now automatically select just these highlighted c
variables.
If I want to quickly rename all instances of the variable c
using multiple cursors, either with Quick Add Next (cmd+D
) or Quick Find All (ctrl+cmd+G
) instead of selecting only that variable c
, I get every single instance of the character 'c' selected:

This is obviously not useful at all, since it has no correlation to the actual variable; It just blindly selected all letters "c", regardless of if they are the selected variable or not.
Is there a way to force Quick Add Next and Quick Find All, to behave like the highlighting rules that the match_selection
setting uses? This would be much more useful in this case than simply blindly selecting every instance of the selected character(s).
Am I missing something? I can't find a Quick Find All Instances or Quick Add Next Variable option, or any way to customize the default behavior of Quick Find All and Quick Add Next. As far as I can tell, my only options are to either manually rename every instance of c
, or write some custom regex to achieve the same result as the original highlighting algorithm.
Source: (StackOverflow)
I often have several virtual desktops open in Windows 10 with various programs in each one. I often want to open in my current virtual desktop a new instance of a program that already has a window open in another virtual desktop.
Most programs, like Chrome and Microsoft Word, always open a new window on the current desktop when I start them, even if there's already another window of that program on another desktop. However, attempting to start Sublime Text will cause Windows to switch to the virtual desktop in which the program is already running*, instead of opening a new window on my current one. This behavior occurs with Sublime Text 2 and 3.
Is there any way to force Sublime Text to always open a new window even if it's already running somewhere?
(*The issue isn't specifically to do with multiple desktops -- it can also be demonstrated on a single desktop. When most programs open a new window on starting even if they're already running on that desktop, Sublime Text will bring one of its existing windows into focus.)
Source: (StackOverflow)
As a security minded professional I do my day-to-day work on my computer as an unprivileged account. I will start individual programs, shells or so on with my privileged Domain Administrator account.
I almost always have my sublime editor opened in my unprivileged account with a dozen files open. Occasionally I want to open a new sublime Window with elevated privileges (Start -> Right click on Sublime -> Run as different user). Unfortunately this doesn't start a new sublime instance, it just flashes the existing unprivileged instance.
There are dozens of hits on Google about how you can use File->New Window or a shortcut to open a new instance, but this doesn't help me at all. Since that method will not create a window running under a different set of privileges.
So how do I start a second instance of Sublime running with the privileges from another account?
My system is currently running Windows 8.1, and I am on build 3083 of sublime, but I suspect this won't matter too much.
Source: (StackOverflow)
Let's say we have a file containing this:
name, job, age
Mark, Specialist, 24
Bob Guy, Manager, 43
Susan Third, Data Generation, 30
What I want to do is navigate around the fields. Move to the next field, select a field, etc. This is easily done in VIM by looking for commas (and assuming there are no escaped commas); is it also possible in Sublime Text? And in a way that works with multiple cursors, say one at the beginning of each line?
Bonus points if you can extend it to moving to the next substring or regex match.
Source: (StackOverflow)