How do I remove CodeIntel in Sublime Text 3? - sublimetext3

I'm using ST3 build 3114. How do I stop the code completion popup? I can't find SublimeCodeIntel anywhere in my Package Control to remove, I added SublimeCodeIntel to my 'ignored_packages' in settings which did nothing, and I searched my entire hard drive for CodeIntel and found nothing. Why does this keep popping up? I would actually like to just disable it for CSS files, but that doesn't work too.

The autocompletion of property names in CSS is supplied by the built in CSS package. To disable it:
Install PackageResourceViewer from Package Control, if it is not already installed.
Open the Command Palette
Type PRV: O and select PackageResourceViewer: Open Resource
Select CSS
Select css_completions.py
Delete the contents of the file
Save it
To disable other auto completion sources (like word/buffer completion) in CSS files, you can add the following to your user preferences:
"auto_complete_selector": "meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc - source.css",
Note that this is the default auto_complete_selector value with - source.css added to the end of it.

Related

Sublime Text 3 doesnot show color scheme when opened Visualforce page

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.

Enable Autosave files plugin on Sublime Startup

How can the AutoSave plugin for Sublime Text be automatically enabled on Sublime Text 3 startup?
link to auto-save is here
This particular package doesn't naively support the idea of enabling itself automatically when Sublime starts, so in order to accomplish this a small plugin is needed to make this happen, which I've posted below.
In order to use this plugin, select Tools > Developer > New Plugin... from the menu, then replace the stub plugin code that is presented to you with the code below and save the file in the location that Sublime will default to (your User package) as a Python file, for example auto_save_on_startup.py
NOTE: See the edit below; this plugin requires that you add a setting in order to control whether it's enabled or not.
import sublime
import sublime_plugin
# Sublime executes this every time it loads the plugin, which includes when
# it first starts, as well as whenever the this file changes on disk.
def plugin_loaded():
settings = sublime.load_settings("auto_save.sublime-settings")
# See if auto_save_toggle_at_startup is turned on; default it to
# not being turned on if the setting is missing, because that is
# how the package would behave if you didn't add the setting.
if settings.get("auto_save_toggle_at_startup", False):
sublime.set_timeout(lambda: sublime.run_command("auto_save"), 1000)
Edit: The original version of this plugin called run_command directly; however Sublime invokes the plugin_loaded endpoint before it has fully added all of the command classes provided by plugins, so it was possible for this to try to run the command before it was available.
The code above has been modified so that there is a delay imposed before the command triggers to give the commands time to become available.
As the comment suggests, every time Sublime loads a plugin file, it will execute the plugin_loaded() function inside of that plugin file, if it happens to exist.
Here the code checks the auto save package settings to see if you have set the value auto_save_toggle_at_startup to true, and if you have it will invoke the command from the auto save package that turns it on.
As such, you also need to select Preferences > Package Settings > Auto-save > Settings - User from the menu and add the appropriate setting. Preferences is under Sublime Text in the menu if you're using MacOS.
If that brings up an empty file (because you're using the default settings), then you should enter the following into the file and save it. Otherwise you can just add the setting itself to the existing settings.
{
// Toggle auto save at startup (from User/auto_save_on_startup.py)
"auto_save_toggle_at_startup": true
}
Here the comment is a reminder that this setting is being provided by something outside of the package itself, in case you forget.
Since the plugin command will only toggle the state of the auto save when it's loaded, you either have to add the setting before you add the plugin, save the plugin file to get Sublime to reload it once the setting is in place, or restart Sublime.
Alternatively you can replace the plugin_loaded() function to contain only the run_command line to unconditionally always toggle the state at startup, but you may want to temporarily stop it from doing that at some point in the future, which you could easily do by just toggling the setting.

Is there a way to use Sublime to show file previews in Windows Explorer for certain files?

I'd like to be able to preview all plain-text files in the Windows File Explorer Preview Pane. To illustrate, here's what sublime files currently look like:
As you can see, Context.sublime-menu is highlighted, but a preview doesn't appear. They're just plain-text files though - you can open them in Notepad. Is there a way to tell windows "Use notepad (or sublime) to view this type of file the preview pane"?
Thanks to #KeithHall's link - while it didn't work for me - got me started on a pretty long path to finally figuring this out. And finding a better solution than I thought existed.
In short, simply install the Delphi Preview Handler. Which pretty much gives you an IDE in the preview pane. It's pretty simple to use and just awesome.
After installation, if you click on a .js file in Windows File Explorer you can immediately see a different preview pane.
Registering Other Extensions
The Preview Handler doesn't compensate for all plain-text files unfortunately, so you're gonna have to manually add the sublime extensions and any other extensions in the Registry Editor.
Here's the bird's-eye view of this process:
Find the key/value that instructs Windows to use Delphi as the preview handler for .js files.
Copy the key/value
Apply that to each extension you want to preview.
Here's more in-depth instructions:
First, you need to find the ID of the Preview Handler, and its Default Value
win + rregedit > expand HKEY_CLASSES_ROOT
Find .js and expand it.
.js should have a subkey named shellex, expand that
You need to recreate this shellex key for each extension you want to add, so copy its contents:
shellex should have a sub-key named with a bunch of numbers, letters, and dashes, this is the ID of the preview pane (I think)
Right-Click that > Rename > Copy > Cancel
Open Sublime > Create a new file > Paste
Go back to the Registry Editor, Click that ID subkey, and a String value called (Default) should appear in the right side of the window.
Double-Click that
Copy > Cancel > Paste in sublime. This is the ID of the Preview Handler (I think).
At this point there should be 2 IDs in the sublime file.
Now You're ready to add these same values to other extensions.
Find the extension(s) you want to change. For me it was all the sublime file-types.
Right-click > New > Key > call it shellex
Go to sublime, copy the first value
Right-click shellex > New > Key > Paste
Go to sublime, copy the second value
Click the new key and make it's default value that 2nd id.
So it should look similar to this:
v .sublime-commands
| v shellex
| |- {823BD1D4-...
And in the right side of the window:
Name Type Data
(Default) REG_SZ {AD9955...
Sources:
This Answer by #rxantos pointed me in the direction of the Delphi Preview Handler.
I spent about an hour looking for this app but never found it.
This Answer by #tvj247 is perhaps a more simple solution, but my HKey structure didn't match his (I'm using Windows 10).
And as for fiddling with the Registry, that was trial, error, and comparing sublime extension keys to js, html and css.

Where is my themes folder on windows 10?

I am trying to change the color of my indents but I can not find my themes folder at all, both in the programs folder and the %appData% folder. I only have the one theme which does not change anything when I edit it.
I want to change the indents to have the following colors...
<key>guide</key>
<string>#FF0000</string>
<key>stackGuide</key>
<string>#00FF00</string>
<key>activeGuide</key>
<string>#0000FF</string>
Many thanks in advance,
Do you have a value assigned to the "theme" key in your Preferences.sublime-settings file?
If not, the default setting is "theme": "Default.sublime-theme"
You can edit Default.sublime-theme with the following process:
Install:
PackageResourceViewer
Open the command palette & run:
PackageResourceViewer: Open Resource
Select:
Theme - Default
Update & Save Default.sublime-theme
SublimeText will automatically create a user instance of the file, leaving the original file intact.
The user instance will override the original file.

Where does notepad++ store style configurator settings?

I downloaded and modified a style file and placed it in the Notepad++ themes folder. I was able to select it and have it update the style as expected. I then went to Settings -> Style Configurator and changed the font of COMMENT of language VHDL to MS Gothic, hit save, and closed and exited Notepad++. I am able to relaunch Notepad++ and still see the change (I'm running Notepad++ in admin mode on Win7).
The only file that I can see a new timestamp on is my XML theme file, but I don't see MS Gothic anywhere in the file. Where is this information being stored? It is overriding the settings from my theme file. I also checked %APPDATA%\Notepad++\stylers.xml but I don't see it there either.
I realize I can change it back through the GUI, but I'd like to know how to get back to my original theme without selecting every style in the language manually (as I've made multiple changes). If I could edit (or delete) a file, I would prefer it.
Look in your %APPDATA%\Notepad++ folder, specifically for the stylers.xml file.
Uninstall Notepad++
Reinstall it again, but this time check the first box, the one that says "Don't use %APPDATA%..... "
Enjoy.
The reason is that Notepad++ install all the files at administrator profile, if you are using another user then you are screw, it will not work properly, you have to run it always as an administrator so it can work properly. To avoid this, just do as i said.
If files are going to APPDATA, then you can create a folder called "themes" and then inside that place your new xml themes. Then close and reopen notepad++ and you should see your new style in the "Select theme:" drop down. Whatever you named the file should be what appears in the dropdown
If you are on Windows 10 the path to add the new theme is :
C:\Users\NAME-OF-COMPUTER\AppData\Roaming\Notepad++\themes
stylers.xml is located one director/ folder above the themes :
Just as a complement to the other answers, if you made the changes on another theme than the default theme (stylers.xml) then your changes are saved to
%APPDATA%\Notepad++\themes\TheThemeYouModified.xml.
For example, if you modified the choco theme, then look for the %APPDATA%\Notepad++\themes\choco.xml.
You will also find a choco.xml in the C:\Program Files (x86)\Notepad++\themes but this one is not where your changes are saved.
I tried Rbastardo answer, but even when I check "Don't use %APPDATA%....." when installing Notepad++, the changes are still saved in %APPDATA%.
In case this helps someone in the future, if you installed Notepad++ via Scoop then look for your themes directory here:
D:\Users\yourusername\scoop\persist\notepadplusplus\themes

Resources