Sublime text 2 - share configuration with two computers and more - sublimetext2

I am working on Sublime Text 2 at home and at work. I need the same configuration on both computers. When I change something at home, I want to see this change at work and vice versa. I think I can do something like that with Dropbox?
I need to share user configuration, user bindings, snippest and plugins installed by Package Control. How can I share the configuration between two computers and more?

I recommend putting your files in Dropbox or any similar file-syncing service.
(I do exactly this with AutoHotKey scripts, and it works really well.)
There is a thread on the SublimeText forum that asks the same question, and in there, an answer refers to the page Using Dropbox to synchronise Sublime Text settings across Windows computers, saying "I don't have any issue with this method."
Other suggestions mentioned in that thread are:
Keeping your configuration in an online version-control system (such as GitHub or Bitbucket) - but it warns "some plugins does contain some private infos (SFTP plugin, for example, keeps its license into the user's folder)"
"For whatever it's worth, I use the Windows portable version and dump the whole of it into my Dropbox."
Using a shell script to do the sync between OS X and Linux

Here's a solution in order to sync between Windows and Mac

Related

disable simultaneous tags editing in PHPStorm for one project

With latest phpStorm 9 we have new feature called simultaneous tags editing.
This is generally very nice feature that i'd like to use, but i have one old project with very bad code with a lot of mixed PHP, HTML and JS code, where it breaks code.
I know i can disable this in settings->editor->General->simultaneous tag editing, but it disables this feature for whole phpStorm. Is there way to disable it only per one project?
Is there way to disable it only per one project?
Nope -- this is an IDE-wide setting.
The only possible solution I can think of is to have separate PhpStorm installation that will use custom folders to store IDE settings (look into idea.properties file from PhpStorm distribution, e.g. on Windows 7 it would typically be %PhpStorm-Install-Folder%\bin\idea.properties).
With IDE settings stored in different location you can now configure this installation with different settings (e.g. have that option turned off). Obviously, all settings here will be different to your original setup, unless you configure it the same way or will keep certain config files synced (e.g. Keymaps, Color, Web Servers, Live Templates and other things could easily be synced on file level).
Just remember to launch this installation when you want to work with that specific project.

Exporting Sublime Text configuration and installed packages

I have spent considerable time to tune up Sublime Text 2 configs. Now I would want to share my configurations (one file) and installed packages list with my friend. What would be the best way to do this? Manually pick related folders in Packages and zip them or something else? Preferably I'd like to create an automated script which could be copy-pasted to my friend and others.
My friend is using Linux. I am using OSX, which may cause some extra problems.
If you are using Package Control, send your friend Package Control.sublime-settings. In fact, the easiest way to transfer settings between machines is to move the User package between machines. This, in combination with package control, makes setting up on a new machine relatively quick and painless. The only issues your friend might have is mismatched key binding or other system specific settings. These files have the notation some_name (platform).extension. Other than that, I wouldn't forsee any issues (unless you are using OS X specific plugins).
Package control has a good doc talking about how to sync Sublime settings and install packages: https://packagecontrol.io/docs/syncing
Using Windows
Open a new Command Prompt and type the following at the command line:
cd "C:\Users\<name>\AppData\Roaming\Sublime Text 3\Installed Packages" dir
Then copy and paste to an editor (e.g. Sublime Text) and filter out the relevant parts. Not great but working.

Centralizing Packages folder on Sublime Text 2

Hi I am running 2 copies of sublime text 2. One on a windows box and another on a laptop running ubuntu.
I am wondering if it is possible to move the sublime packages folder to a shared location. I only use one machine at any given time but it would be nice if the packages/snippets etc were consistent across both environments.
Any one had any luck with this?
Thanks,
Sublime Text 2 may hold write lock on the files of the settings files, so sharing files might not work as intended if you are trying to use them from multiple locations simultaneously.
However, it is possible to share settings and on UNIX users do it via symlinks (mklink on Windows). I am pretty sure you cannot set the path of the config files from Sublime itself, so you need to instead do some kind of file-system trickery.
But as the recommended method I'd use some file sharing service like Dropbox which will also automatically keep back-ups from your files in the case you manage to destroy them within Sublime Text 2 accidentally:
http://opensourcehacker.com/2012/05/24/sync-and-back-up-sublime-text-settings-and-plug-ins-using-dropbox-on-linux-and-osx/ (have pointers for OSX, Linux, Windows)
Also I am not sure if there is anything operating system specific in those configs, but I can confirm it works 100% if you are using the same OS.

If I make a sikuli script in Windows, will the same script work in Linux?

I am currently looking for a tool to test a a website and Sikuli seems perfect. However, my company uses both Windows and Linux, and I'd like our scripts to be transferable.
Will it work or are Windows scripts for Windows and Linux scripts for Linux?
It seems like Sikuli can be run from the command line, perhaps I can run the same script on both the Linux and Windows Computers?
There is no technical reason why a Sikuli script won't run under both operating systems (jython has the same syntax on both platforms). The biggest technical issue faced is that the screenshots may not match between Windows and Linux.
This thread discusses how to setup two images pools, one for each OS.
Creating Sikuli scipts directly in java might ease the cross platform issues. But you will still have the images looking slightly different issue. File directories are handled well accros OS in java though.
there are two main points to be concerned of:
Images: Even if the application looks the same in both the systems the ways to launch it are different. In the worst case one needs two complete sets of images.
Paths: In Windows and Linux paths are different. Different slashes, different lengths of the whole paths and components, different set of allowed symbols in the naming. Windows paths are not case sensitive by default.
There are some points to use the same script still with set of OS specific libraries.
- The more common logic in applications the more reusable code.
- The policy "changing something are must for both platforms". is easy to follow.
So the answer for your question is:
Specially prepared script will work on both the platforms

Self installing application or separate installer?

To get an application installed on a new computer there seems to be two major approaches in current use:
Separate installer: Create a separate installer package
that creates all directories, files,
registry entries required by your
application (ie an MSI, InstallSheild etc) and then finally copies your application to the target computer.
Self installer: Include all required
installation steps in a component
that is part of your application. Then use this component to check and create required settings each time the main application executable is run. ie Just run the application to install.
I've used a few applications that corrupt their settings over time, and most had a separate installer. Therefore the only fix was to to re-install, sometimes with settings and even data being lost (very frustrating).
Also during software projects I've worked on, the separate installer approach often dictated spreading application specific knowledge across both the installer package and the actual application. Then, when code/functionality changes were made, both the installer and app needed to be updated. It always felt a bit too brittle and prone to human error.
So I'm currently leaning toward the self installer approach because of a simpler more robust installation/setup, ie just run the app. This self installing approach I feel would also lend itself a more robust application.
Integration with in application settings (options) would also be much more clean, in many cases the same component could perform both installation and settings management.
On the negative, however, performing these extra checks/steps each time the app starts might negatively impact startup times, and OS integration might be a bit more work then using a standard installer.
So which approach to people recommend and why?
(I'm most interested in installation of desktop rich client applications at present.)
There are pros and cons to both approaches:
Having an installer is the proper way to install necessary system components, like drivers, libraries, COM components and so on. Since many of these activities need elevated permissions the install may be performed by the administrator, while the application can be used by all users.
There may actually be requirements for a scriptable installation procedure in corporate environments.
Not having an installer opens the way to portable applications. If the program has everything in a directory, then this can simply be copied to a USB stick and be run on any system. This may of course not make sense for your particular kind of app, but that is for you to decide.
I'm not sure that the issue about corrupted settings is really important here. If settings are corrupted (why?) - how is the application to know what to do about it? OTOH the installer can of course also be written to not blindly overwrite any old settings. It all depends...
Edit: You write in your comment:
Even portable apps require certain configuration/settings, Isn't it better to have the main app check that settings are valid/exist on each startup, and only prompt the user when needed.
and again, it really depends on your needs. There are different types of configuration settings or preferences, and you have to decide individually:
Per-user configuration settings will be missing if the application is run for the first time by the current user. It can be helpful to show a message that it is missing, and how to create it. For example in FlameRobin (a database administration program for Firebird) we have a message that is shown when no registered servers and databases are found on program startup, and how to register them.
Per-user settings for UI behaviour will also be missing, but there are default values for them. The user will get the default behaviour of the application, and can later change things in the option dialog. Since it is best to minimize the number of such settings, and since the defaults should be what most users expect or what works best in the general case, there is also no need to bother the user at program startup.
Some configuration may be not per-user, but per-program. This is generally stored in a location where standard users have no write access, so checking for this and prompt the user to enter it is not really helpful. What could be done is to start an external program, asking the standard user for the account with sufficient privileges and its password.
Going with a separate installer is the "better" way from my point of view. Making an application self-installing does not only add additional workload to the application itself, it also "works around" any installer system of the underlying operating system (like MSI on windows).
And if the application corrupt its settings over time it's broken and need to be fixed. How should corrupt settings be handled by the self-installer? Just overwrite it with the defaults? Users will get annoyed by that too, so having them to run a separate installer and choosing a "repair" option makes this at least more transparent.
I would recommend a separate installer that can do the following:
Install a new installation
Repair an existing installation
Remove an existing installation
The reason I recommend these options is because that is what I have come to expect for installers in Windows environments.
The reasons I recommend separating installation and application logic into two different applications area:
There may be conflicts between dependencies used used by the installer and application.
I want to be sure my team don't inadvertently use classes in the dependencies from the installer framework when developing the application.
Thanks for your feedback. I'm starting to think something along these lines would be a good compromise approach:
Choose the self installer approach by creating an installer component (class library) that is referenced by the main application.
This component is a core part of the application and is responsible for ensuring all configuration/settings exist and are valid.
The main app. executable, on each run, asks this component to check existance/validity of settings, and only prompt the user when required. This could be easily done in a user friendly manner by grouping all setting issues and presenting them in a single GUI (avoids a sequence of annoying dialogues).
For OS integration, the installer component (in the case of Windows) ensures an entry is added to the "Add Remove Programs" list for the application, as well as any other OS required conventions.
Within the application the standard options/settings screen is also provided by the installer component. This avoids duplicating settings management code.
I've asked this question because I've met many non-technical users who ask why they cannot simply copy an application from one computer to another, they can do this with their data (eg photos, documents etc). It's an extremely valid question, in particular for GUI oriented desktop applications.
Separate installers are certainly "the way it's been done" on Windows for many years. For drivers/system components, obviously they are often a necessity. But for desktop GUI style applications I don't believe they are the best in terms of simplicity and realiability for the user/customer.