.. include:: /include/substitutions.txt .. include:: /include/external_links.txt .. include:: /include/custom_roles.txt .. _dual boot setups: **************** Dual Boot Setups **************** Some day (maybe now) you may want to run Sublime |nbsp| Text in two different operating systems on the same computer, for example Windows and Linux, while making both versions of Sublime |nbsp| Text share the same :term:`data directory`. There is a workable way to do this. Assuming your "master" Sublime |nbsp| Text :term:`data directory` is under Windows, you can choose to either have the Linux OS use the data directory where it is, or you can choose to move it to a storage location that both OSes can share. The only restriction is that you would not be able to safely run Sublime |nbsp| Text on both OSes at the same time. Assuming that is the case, read on to find out how. The Windows Side **************** If you chose to have Sublime |nbsp| Text on the Linux side access the :term:`data directory` where it is on the Windows system without moving it, there is nothing further to do on the Windows side of things. You can skip to :ref:`dual_boot_the_linux_side`. If you chose to move the Sublime |nbsp| Text :term:`data directory` to a shared location, follow these steps on Windows to do so. - Close Sublime |nbsp| Text on the Windows system. - Manually move the directory (typically ``%APPDATA%/Sublime Text/``) to the shared location. For illustration, let's say it is: .. code-block:: doscon E:\System\sublime_data\ - In its place, create a Directory Junction: .. code-block:: doscon c: cd %APPDATA% mklink /J "Sublime Text" E:\System\sublime_data - Using File explorer, navigate to ``%APPDATA%/Sublime Text/`` and ensure you see your Sublime |nbsp| Text data files. It should contain at least these directories: - Installed Packages/ (if you have installed any 3rd-party :term:`Packages `) - Lib/ - Local/ - Log/ - Packages/User/ - Packages/... (any other packages you may be developing or have overrides for) and possibly also: - Backup/ and - Trash/ - Start Sublime |nbsp| Text, and ensure you are able to run any custom Commands you may have created in your :term:`User Package`, and Packages you have installed run correctly. If you have a Sublime |nbsp| Text license, look at the title bar and ensure it does not say "Unregistered". .. _dual_boot_the_linux_side: The Linux Side ************** Getting Sublime Text ==================== To avoid confusion and any potential problems, ensure that you are using the same version on both platforms. On Ubuntu, Linux Mint, and other Linux distributions that use the ``apt`` package manager: - Install the GPG key: .. code-block:: bash wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo tee /etc/apt/keyrings/sublimehq-pub.asc > /dev/null - Select the channel to use: + Stable .. code-block:: bash echo -e 'Types: deb\nURIs: https://download.sublimetext.com/\nSuites: apt/stable/\nSigned-By: /etc/apt/keyrings/sublimehq-pub.asc' | sudo tee /etc/apt/sources.list.d/sublime-text.sources + Dev .. code-block:: bash echo -e 'Types: deb\nURIs: https://download.sublimetext.com/\nSuites: apt/dev/\nSigned-By: /etc/apt/keyrings/sublimehq-pub.asc' | sudo tee /etc/apt/sources.list.d/sublime-text.sources - Update ``apt`` sources and install Sublime Text: .. code-block:: bash sudo apt-get update sudo apt-get install sublime-text If that doesn't work, or if you have a system that uses a different package manager, follow the instructions at `Linux Package Manager Repositories`_. Paths ===== On the Linux side, you can actually share project files with the Sublime |nbsp| Text on Windows by mounting the windows drives to mount points that use their drive latter under Windows. Example: say you have a project with a path: .. code-block:: json "path": "E:\\System\\sublime_data\\Packages", or .. code-block:: json "path": "E:/System/sublime_data/Packages", Under Linux, if you mount that drive to mount point ``/e``, then Sublime |nbsp| Text on both sides can share project files by re-writing the path above like this: .. code-block:: json "path": "/e/System/sublime_data/Packages", Sublime |nbsp| Text under Windows is just as happy with the last version of that path as the first two. Data Directory ============== Under Linux, the path to the Sublime |nbsp| Text :term:`data directory` is .. code-block:: bash ~/.config/sublime-text/ To get Sublime |nbsp| Text on Linux to use the shared directory you created above (or the original path to the Windows Sublime |nbsp| Text :term:`data directory`), do the following: - Close Sublime |nbsp| Text on Linux - Execute these commands: .. code-block:: bash $ cd ~/.config $ # Preserve original directory in case there is something valuable in it. $ mv ./sublime-text ./sublime-text.orig $ # In its place, create a symbolic link to the new shared directory. $ ln -s /path/to/shared/data/directory ~/.config/sublime-text - Navigate to the symbolic link and ensure the files in the Windows Sublime |nbsp| Text :term:`data directory` are present. - Start Sublime |nbsp| Text and observe: - Functionality in :term:`Installed Packages ` and :term:`User Package` is operational. - If licensed, that the title bar does not say "Unregistered". Cross-Platform Conflicts ======================== If you have any Packages that do not load correctly under Linux, you have the option of using .. code-block:: py my_platform = sublime.platform() and thereafter ``my_platform`` will contain one of these values: - 'windows' - 'linux' - 'osx' in order to determine what things need to be re-coded to be compatible on both platforms. License ******* Assuming you have paid the deserving development team at Sublime Text HQ for the honor of continuing to use Sublime |nbsp| Text, you will have a license file in the Sublime |nbsp| Text :term:`data directory` in the ``./Local/`` subdirectory. According to `Portable License Keys`_, when you copy/paste your license into the window that prompts for it, "Sublime Text stores license keys in a format specific to the computer it's entered on." Unfortunately, this is not *completely* accurate, and probably should read: "Sublime Text stores license keys in a format specific to the computer and platform it's entered on." .. only:: internal The reason I say this is that this author has tested using Sublime |nbsp| Text on both Linux and Windows platforms on the same computer at different times in the product's Dev channel (cutting-edge releases, requiring a license), and I discovered that when I switched platforms and booted into the *other* platform, that it prompted me for my license again. And I caught a copy of both license files generated and they are, unfortunately, not the same, even though they were indeed generated on the same computer. However, according to that same documentation page, there is a work-around for a situation involving the Portable version of Sublime |nbsp| Text---which this is not---but it happens to work for this issue as well. I quote from that documentation page: "This can be worked around by manually saving the license key as plain text, which Sublime |nbsp| Text will read from, but not write to." Here are the steps to take to implement this work-around: - Close Sublime |nbsp| Text. - Create a new text file in the :term:`data directory` ``./Local/`` subdirectory. - Paste into it the plaintext version of your license key. This should be its only contents. - Remove or move the original ``License.sublime_license`` to a safe place if you wish to preserve it. (It can always be re-generated if need be.) - Rename the text file you just created to ``License.sublime_license``. - Re-start Sublime |nbsp| Text.