According to this source the definition if Permute Lines submenu is following:
{
"caption": "Permute Lines",
"children": [...]
}
And it doesn't contain an id. Is there a way to add items to this submenu?
Also this source is 5 years old and is probably for Sublime Text 2. Is there a more recent version of default menu file?
To answer your second question first, you can always get at the most recent menu definition from your own copy of Sublime; it's stored in the file Default\Main.sublime-menu, which you can get to most easily using PackageResourceViewer to open it up.
That said, the part of the menu that you're referencing in your question is the same between Sublime Text 2 and Sublime Text 3 and neither of them has an id value directly within the Permute Lines sub-menu.
By creating a Main.sublime-menu in some other package (e.g. your User package) you could create entries that are adjacent to that sub menu, but in order to actually put new content directly inside of it you would need to create an Override.
You can do that via PackageResourceViewer; if you use it to open up the Default\Main.sublime-menu file, you can modify the file and when you save it, it will be saved as an override.
From this point forward your override becomes the new default menu; other packages that extend the menu can still do so, but they will be merged with your version and not the shipped version.
This is not without its risks in that if a future version of Sublime Text includes a modified version of the menu, your override will still take precedence and you won't be warned that it's happening, so you could potentially miss out on fixes.
This happened recently when the latest build of Sublime modified the base menu to include an install link for PackageControl, for example.
Also, this is only a viable solution if you want to edit the menu for your own purposes; if you're a package author, you can't use this method to distribute your own changes.
Related
What is this yellow-orange color bar at the top of Sublime Text?
Hi all,
I've used sublime text before, but last time I used it I think I tinkered with the theme among other things, but I cannot figure out what this orange bar is at the top of the window or how to remove it. I've looked at the documentation but I've had no luck.
TIA
That image is the placeholder image that Sublime uses when a theme references a texture image whose underlying image file can't be found. That can happen if the file is missing or if the .sublime-theme file is using the wrong name, for example.
The only way to get rid of it is thus to either:
Fix the theme to use the correct image name
Put the missing image in place
Switch to an alternate theme (e.g. Default or Adaptive, which ship with Sublime)
If you're using a custom theme it should be an easy thing to check your sublime-theme file to see what images it's referencing and compare that to images you've added to the theme package to see what's missing.
The most expedient would be the theme switch to one of the ones that ship with Sublime.
If you're already using one of those two themes and you're having this problem, then the issue is that you're augmenting the existing theme and causing it to break. In that case, there are two things to check.
Use Preferences > Browse Packages from the menu or command palette; do you see a folder named Theme - Default? If so, move it away, the files in it are overriding the default themes (including Adaptive; they're both in the same package).
Using the same command as above, look in the User package; look for sublime-theme files and move them away; such files will be combined with other files of the same name, which allows you to add rules to an existing theme in a way that could be breaking it.
I'm developing a Sublime Text 3 plugin which uses the quick panel a.k.a. the command palette.
I would like to add a textual title/label at the top of the quick panel when the user opens my plugin's quick panel menu, because my plugin runs in various modes and I want to make it clear which mode is currently running (Test, Pre-Live, Live, etc.)
Is this possible, and how?
This a mockup of what I want to achieve:
This is not possible in a quick panel, no. The only thing you can provide to the quick panel display-wise is the list of items that you want the user to choose from. Each item in the list can contain multiple lines of data however (with the restriction that every row has to contain the same number of lines):
Something like that could potentially be used to provide context on the items in the list that allows the user to know what mode you're in.
The Command Palette and the quick panel aren't the same thing (although they are visually similar); the command palette only displays commands that you can choose. By using an input handler, you can customize the display somewhat:
In this sample, View Package File is the selected command, but the command has control over what that text says (it's just the command name by default). You also have the power to provide a "preview" (basically any extra information that you want) about the currently selected item:
So given that, depending on your use case your command could present its interface in the command palette to give this kind of contextual clue.
I am using Sublime Text-3 version 3.0 build 3143. I have connected to Salesforce using MavensMate and opened the VF Page, but dont see any color when Opened the VisualForce Page in Sublime Text. How to fixed this issue ??
VisualForce isn't something that Sublime supports out of the box, so in order to have things like syntax highlighting, you'll need to install a package that adds that support in.
The de-facto repository of third party add-on packages is Package Control, and doing a search reveals that there is a VisualForce package available.
The description for the package mentions that it provides syntax highlighting for .page files. Assuming that's the kind of file you're trying to open (I'm not familiar with VisualForce at all), this is probably what you want.
In particular, the content represented in your image appears like the following for me once this package is installed (except that I have elided what appears to be an extraneous </apex:outputText> after the email_us label):
For what it's worth, the package also includes completions to make creating such files easier.
Since you mentioned in comments that you're a little unclear on the process, here's a step by step set of instructions on how to get set up for this with Sublime Text 3143.
If you haven't already done so, you need to install Package Control. If it's not installed, the commands in the next step won't be available.
There are official installation instructions for this, but in your build of Sublime Text you can also select Tools > Install Package Control... from the menu or Install Package Control from the Command Palette in order to do the same thing.
If that menu item is not visible in your menu/command palette, then Package Control is already installed; the command is hidden if it's not needed.
Open the Command Palette with Tools > Command Palette or the appropriate key binding for your operation system (visible in that menu entry), then select the command Package Control: Install Package.
This will download the list of all packages and present them to you in a list; it may take a moment to download the whole thing. You'll see a spinner in the status line of the window to tell you the operation is in progress.
When the list of packages appears, select the VisualForce package from the list of packages; you can find it quicker by entering visual to filter the package list down.
Once this is done, the package will be installed; during the installation there will be a spinner in the status line to tell you, and the status line will briefly say that the package was installed once it's done, but it goes quick so if you blink you might miss it.
With the package now installed, you should be able to close your file and open it again to have the appropriate syntax applied to it.
You can also select Set Syntax: VisualForce from the command palette or select View > Syntax > VisualForce from the menu in order to manually set the syntax in the current file to the VisualForce syntax.
You'll need to do this for example when you create a new file since the default syntax is Plain Text and the appropriate syntax won't get set until you save the file with an appropriate extension first otherwise.
In the Sublime Text sidebar is there a way to have project folders displayed in alphabetical order, instead of by the order that the folders were added.
This is driving me nuts. I've searched everywhere for this and have given up, but it's so painful.
The contents of side bar folders are displayed in a sorted (lexical) ordering, with all sub-folders brought to the top instead of being in their natural sort position. There is currently no setting available or internal API that allows for changing that.
That said, the ordering of top level folders that you have manually added to your project is entirely under your control and defaults (as you've noticed) to the order that they were added in.
The folders in the sidebar are listed in the order that they're listed in the folders section of the sublime-project file. You can use Project > Edit Project to open your project file and manually reorder the elements in the folders list.
Additionally you can also click and drag the top level folders to change their relative ordering. Doing so causes Sublime to automatically rewrite the project file for you.
If the Project > Edit Project setting is not enabled, you haven't saved the current session as a project yet. In that case there will be no project file until you create one, but you can still drag to reorder the folders.
You can use sublime plugins for this. One that I can think of is SortTabs
In Sublime Text 3, if you have "Project Manager" installed use it to CLEAR RECENT PROJECTS. Then when you look for a project to open with Ctrl-Alt-P, they will be in alphabetic order.
To install "Project Manager" on the menu go to Preferences-Package Control, then click on Install Package. Scroll to find "Project Manager". Click on it to install. Restart Sublime Text. It will be on menu at bottom of Projects.
I have recently changed my code style and I want to apply it to the whole project and commit it to repo in one shoot.
I'm able to reformat a class by Ctrl+Alt+L but it only applies to a single open class. I'm looking for a way to apply my change all classes of project. Is it possible?
Try selecting the radio button "Whole Project" instead of the individual file under Code>Reformat
Additionally, you could right click the folder in the tree and choose Reformat from there.