How to disable autocomplete for just one file in Sublime Text 3? - autocomplete

I do understand that autocomplete/(tab to complete) can be disabled by toggling true/false in the settings file. But is there a shorter way to do it. Also, can we encode it for a particular folder/file?

I don't think you can accomplish this for a single file other than by manually toggling it. However, the sublime settings work on multiple hierarchical levels: General Settings < Syntax Settings < Project Settings. So if you want enable/disable a specific setting for all e.g. python files, you can open a python file and edit the settings in Preferences > Syntax Settings. If you want to enable/disable a specific setting for a project folder, open the project and add the setting via Project > Edit Project.

Related

How to set which extensions are enabled when opening a new folder or workspace?

So I have a great many extensions, and on any given project, I find myself using maybe a third of all of them (If I'm working on a Python project, I don't really need JavaScript related extensions now do I?). The problem is that right now VS Code loads and enables every single extension installed at the start of each new project. I find it a pain to then have to manually go and disable all the extensions I won't be needing for the project.
Is there a way to setup VS Code to only enable certain extensions when opening a new folder / workspace? I couldn't find anything in the docs on that subject and when looking at the extension section of the preferences I couldn't find such a functionality.
As of Feb 2023, it is now possible to create different Profiles in VS Code.
A Profile can include extensions, settings, keyboard shortcuts, UI state, tasks, and user snippets. You can customize VS Code for different development scenarios like data science, documentation writing, or for multiple programming languages like Python or Java. If you have different VS Code setups based on workflow such as "Work" or "Demo", you can also save those as different profiles. You can open multiple workspaces (folders) with different profiles applied simultaneously.
The following image demonstrates a folder opened with a Work profile that is customized for a work setup.
To my knowledge, the best you can do is use the Enable, Enable (Workspace) and Disable, Disable (Workspace) options.
Here is how ended up doing this:
Open a new workspace / folder.
Disable all extensions using Disable.
Enable all extension that you want to have enabled in every new project with Enable.
Enable extensions that you only want to use in this particular workspace / folder with Enable (Workspace)
From then on, when you open a new workspace, only the "default" extensions should be enabled. If ever you want to disable one of these "default" extensions in a particular workspace but still want it to be a "default" extension, make sure to use the Disable (Workspace) option.

Eclipse syntax coloring settings gone.

I use customized syntax coloring for my Eclipse editor and it has reverted back to the default settings. This is the second time in a couple weeks that it has happened. Any ideas as to why this is happening or how I can get my custom settings back? I have a very specific coloring scheme that I like to use and it takes forever to manually set!
Are you switching across workspaces? As I understand eclipse preferences are stored in .settings/ present in workspace's root directory.
I export eclipse preferences and import it when I switch workspaces. Another cool trick I found is to close projects when I do not use them.
Eclipse official link on how to export preferences:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftimpandexp.htm
Sometimes simply import/export would not be enough, so you may need a list of .pref files where the syntax coloring settings are stored. What I have here is not complete and I just list what I use and I hope it helps.
(I process .java, .jsp, .xml, js and .properties files.)
You can find them by searching .pref files in your workspace. Remember to adjust your searching options to look into subfolders.
org.eclipse.ui.editors.prefs
org.eclipse.jdt.ui.prefs
org.eclipse.ui.workbench.prefs
org.eclipse.wst.xml.ui.prefs
org.eclipse.jst.jsp.ui.prefs
org.eclipse.wst.html.ui.prefs
org.eclipse.wst.jsdt.ui.prefs
org.eclipse.ant.ui.prefs
org.eclipse.datatools.sqltools.sqleditor.prefs
org.eclipse.debug.ui.prefs
org.eclipse.php.ui.prefs
com.adobe.flexide.mxml.core.prefs
org.python.pydev.prefs
com.adobe.flexide.as.core.prefs
com.adobe.flexide.css.core.prefs
org.codehaus.groovy.eclipse.ui.prefs
org.epic.perleditor.prefs
org.eclipse.cdt.ui.prefs
You may copy them when you finish adjusting your syntax coloring settings. When needed, search .pref again to get access to their locations, and restore your settings by copying the lines with color code, in order to avoid unpredictable side effect. As I can see this is the only way, inconvenient buy effective.

How to make UltraEdit autocomplete class members/functions of C++ class?

I'm currently using UltraEdit, which is armed with Ctags, to edit C++ files (.cpp). Its Ctags support automatically autocompletes symbols while I'm typing—but it can't correctly confine itself to only the members of a class, which is so blind. How to make UltraEdit smarter like Vim+ctags+cppcomplete? So far, I can't find any plugins on web.
UltraEdit doesn't do a great job of auto complete when compared to an IDE like Eclipse etc. because it doesn't know how to parse tokens in a language specific way - i.e. it has no way of knowing what your variable/method names are and listing just those for auto complete.
However, UltraEdit does have a default auto-complete feature built in (control+space) - UltraEdit will search back 50K in the active file from the cursor location for words that match a partially typed word and show these. Go to Advanced > Configuration > Editor > Auto-complete and you can tick the option to "show auto-complete dialog automatically" after X number of chars.
Also, you can set language specific auto-complete files (and UtlraEdit's website has a few predefined ones you can download). So for example you can fill this file with a bunch of class names or other common words/tokens and they will always appear in the auto-complete dialog for that file type too. Link a specific auto-complete file to a file type through preferences:
Advanced > Configuation > Editor > Word Wrap/Tab Settings
Click Change List
Type c or java or whatever the extension is > click Add > click OK
Under the text "select extension for settings or default", select the new extension you just made.
Click "Browse" to link that file type to a specific auto-complete file.
Click OK to exit the Configuration dialog.
Lastly, as of UltraEdit 18, the editor got a lot better with templates. While you have a c file open, display the template view: View > Views/Lists > Template List. You should see in that template list a bunch of smart template for common c structures such as IF, DO etc etc. You can also create your own here too.
Note that all these things (search tokens 50k back in the file; list tokens in the autocomplete file; list templates) will all show up on control+space.

How do I make an editor the default editor for all unknown files in Eclipse?

I regularly open files of different types in Eclipse. For many types, Eclipse uses the system editor by default. I don't want this to happen. I want Eclipse to use the built-in Text Editor for unknown file types. However all I can find are options to set the default editor for a certain file type, but not for all unknown ones. Is there an option to do this?
I don't think you can do this in one swoop, however:
Windows > Preferences > General > Editors > File Association.
If you don't have a LOT of unknown file types, just type *.junk, *.punk, *.clunck and add Text Editor as the default editor.
Sadly you can't use *.* here.
This issue with file associations is something that has always annoyed me with Eclipse. It is specially frustrating if you are trying to use Eclipse to edit files that don't have a file extension because then you can't even set a editor.
I searched over the Eclipse bug database and found my exact issue there. It was first reported in 2003 and up until now there is no solution for it. If you follow the long comment track over the years you will see that there is no way of setting a default editor for unknown file types. From what I gathered the problem boils down to eclipse not looking at the content of file to try to determine the type. Instead it fully depends on the file extension.
Some people have made suggestions for fixes but again nothing has come out of that. If you search the bug tracker DB you will find a lot more bugs created around this.
A clean solution to this is finally implemented in Eclipse.
On the Preferences > General > Editors > File Association page, you can now define an editor selection strategy for unassociated file types.
Source: https://www.eclipse.org/eclipse/news/4.6/platform.php#text-editor-selection-strategy
There is an Eclipse plugin that overrides the default behavior of the platform and opens text file of unknown type in the plain text editor of Eclipse instead in an external editor.
https://github.com/eclipselabs/default-text-editor

Export single Eclipse Perspective and Settings

I customized my Eclipse for a special Latex Perspective and saved this perspective as "MyLatex". I even added shortcuts in my texlipse preferences, so that I can type "tab"+strg+space to insert a table.
Now I would like to offer this to friends. I found out that I can use Export->General->Settings, but this exports ALL perspectives.
Is there any way to export only the perspective "myLatex" and the texlipse editor templates?
Best regards
Philipp
There exists another way to do this.
Share Eclipse perspective layouts across multiple workspaces
To save your perspective, select Window > Save Perspective As… from
the application menu. A dialog should popup (shown below), prompting
you for a perspective name. Enter a name that you’ll remember, eg. My
Java or Debug Jack. Click Ok once you’ve entered a new name.
Note: You can choose to overwrite one of the default perspectives, eg.
Java, without fear. However, I prefer to leave these intact, so always
choose a new name, but you can choose whatever works for you.
Now you can go through the normal routine of exporting the preferences
to a properties file via File > Export > General > Preferences. Then
import the same file in another workspace via File > Import > General > Preferences. All you now have to do is switch over to the perspective you saved and all your layout settings will be restored.
If you overwrote one of the default perspectives, you may have to
select Window > Reset Perspective… to restore the saved settings.
If you’ve chosen to create a new perspective, be sure to point your
Run/Debug settings to the new perspective under Window > Preferences >
Run/Debug > Perspectives. For example, if you made a new perspective
based on the Debug perspective, then you’ll need to change references
to the Debug perspective to the My Debug for launchers you use.
I don't know of a nice way to export/import one perspective from eclipse, but maybe try the following:
open this file -
workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
and copy the part that relates to your new perspective to the same file for the users you want to share it to. If this doesn't work you may have to replace the entire file in their workspace with your one.
In my case I had to copy from one workspace to another
.metadata.plugins\org.eclipse.e4.workbench