Making Sublime Text 2 portable on OSX - sublimetext2

I'd like to be able to run sublime from a mounted drive, but not look in the local users /Library for its settings, but instead have them on the mounted drive too. Is there a way to remap the settings to another folder or make sublime portable in this manner.

You can do this with a symbolic link in the user's ~/Library/Application Support directory. First, copy the ~/Library/Application Support/Sublime Text 2 folder to the mounted drive (for example, /Volumes/MyDrive/Settings/Sublime Text 2). Then, run the following commands from Terminal.app or your favorite replacement (the $ is just the command prompt, don't type it):
$ cd /Users/UserName/Library/Application\ Support
$ rm -rf Sublime\ Text\ 2
$ ln -s /Volumes/MyDrive/Settings/Sublime\ Text\ 2 Sublime\ Text\ 2
and you should be all set. The first command changes to the right directory (obviously, replace UserName with your user name...), the second deletes the original folder (make sure you've copied it before you run this!), and the third creates a symbolic link to the new folder where the old one was before.
This should work for any type of mounted drive, including USB sticks, network shares, and external hard drives, as well as Dropbox, Google Drive, and similar services.

Just move %appdata% to Data folder in your sublime text folder (this one containing sublime_text.exe). This method works both for ST2 and ST3
http://docs.sublimetext.info/en/latest/basic_concepts.html#the-data-directory

Related

Google Drive File Stream on OS X fails to ls files

I am running Google Drive File Stream Version: 25.252.289.1612 on OS X 10.12.6 which mounts/Volumes/GoogleDrive/
Open a Bash shell (I use iTerm3). When I ls (or ls -a) this directory, I get no results. But if I use tab completion, I can see the two subdirectories, 'My Drive' and 'Team Drive' as well as some other stuff. As I cd into subdirectories, again ls shows no files but tab completion shows them. And I can operate on files/directories. So if there is a file foo.gsheets , I can open * open foo.gsheets* which will launch in Chrome, for example. Or if I had foo.txt I could vi foo.txt. I checked that I had read/write/execute permission on files and dirs. And even tried to sudo ls .
Any ideas? Here is my mount
drivefs on /Volumes/GoogleDrive (dfsfuse_DFS, local, nodev, nosuid, synchronous, mounted by aberezin)
Maybe related to the implemenation of osxfuse
https://github.com/osxfuse/osxfuse/issues/503

Can you recovered delete folders with sublime text 2?

I think i've deleted a whole folder by accident in sublime text 2. Is it possible to recover this deleted folder? I've checked my trash and nothing.
Using windows 7.
Same thing just happened to me.
Not to worry! Sublime does not permanently delete your files, but only moves them to trash (Recycle Bin). You will find your hard work sitting right there :)
See this reference for more information.
You can easily recover it from thrash / Recycle Bin folder on your machine.
Sublime or any other third party software never delete files permanently, in case of windows, it catches deleted files and move it to Recycle Bin.
In case you don't find in trash as in my case you can use "restore-trash" utility on linux. It can be installed using following command
sudo apt install trash-cli
After installing open command line and navigate to the folder.
Enter command
restore-trash
Choose the file which you wish to restore
If you are on windows, You can look at Recycle Bin.
Otherwise not possible without any advance tool.
Its gone buddy ! I did something similar and couldn't retrieve a file.
Anyway, not sure if it is going to help you but I wrote a simple SLT-plugin to back up modified files (locally and remote).
Local backup plugin:
class RemoteEdit(sublime_plugin.EventListener):
def on_post_save(self, view):
os.system('cp -r %s %s' % (view.file_name(), <backup_path>)) #use scp for remote backup

Nitrous.io for Mac does not sync .git?

I am trying out Nitrous.io -- it is a very nice tool. I am also using Nitrous' Mac application which syncs box content to a local directory -- except I have noticed that it doesn't sync the .git directory. I assume this is intentional(?). Is there a list someplace that describes what is and what is not synced?
You can update the file <home dir>\Nitrous\<box name>\.unison\default.prf and add any configuration there per the manual: http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html
Mine contains this line, for example:
ignore=Name node_modules
This way my node_modules folder is not synced in either direction.
You could add this line to yours:
ignorenot=Name .git
As #ajhit406 noted though, you should handle your git actions in one place (the box, in this case).
The .git directory is not synced on purpose. You should be SSH'ing into your box to manage your git repositories.
In the Mac application shortcut menu, hover over the box you want to SSH into, and click "Open Shell". You should enter any git commands from your box in the cloud.
Nitrous has a resource about this: http://help.nitrous.io/nitrous-desktop/
In the document it details that these are the files and directories that aren't synced:
.unison
.git
.svn
.hg
CVS
.DS_Store
.AppleDouble
.LSOverride
.Spotlight-V100
.Trashes
*.sock
*.sw?
._* , *~

Unable to run package setup:

Getting this error in sublime text, wondering what to do about it. Is there a way to completely uninstall any related files to ST2? I tried uninstalling it and re-installing it, but this error still persists. I imagine there are some temp files, or cached files that I need to remove, is there a way to clear those out?
Unable to run package setup:
Traceback (most recent call last):
File "/usr/lib/sublime-text-2/PackageSetup.py", line 165, in upgrade
upgradePackage(pkg, pristinedir, datadir, backupdir)
File "/usr/lib/sublime-text-2/PackageSetup.py", line 158, in upgradePackage
os.path.join(backupdir, base), inhibitOverwrite)
File "/usr/lib/sublime-text-2/PackageSetup.py", line 90, in upgradeArchive
writeFile(fname, newar.read(f))
File ".\zipfile.py", line 834, in read
File ".\zipfile.py", line 857, in open
File ".\zipfile.py", line 824, in getinfo
KeyError: "There is no item named u'nathos-sass-textmate-bundle-0e46064/Snippets/expression(\\u2026).tmSnippet' in the archive"
execute
sudo sublime
for the first time
On Ubuntu:
I tried Achu solution but it didn't work. My Sublime Text 2 started working after I changed the files owner to my user. You have to open Terminal (ctrl+alt+t) and type:
sudo chown -R [your user name here] /home/[your user name here]/.config/sublime-text-2/
So, for example, if your user is "john" you have to type:
sudo chown -R john /home/john/.config/sublime-text-2/
Hope this helps.
Similar to Victor's answer, but more specific, I deleted the single file C:\Users\(Username)\AppData\Roaming\Sublime Text 2\ Installed Packages\Sass.sublime-package and then Sublime Text 2 started up fine.
On Ubuntu:-
I found this is a permission issue. Just change the permission to 777
sudo chmod 777 -R /home/user/.config/sublime-text-2/Packages/[package name]
The last line says:
KeyError: "There is no item named u'nathos-sass-textmate-bundle-0e46064/Snippets/expression(\\u2026).tmSnippet' in the archive"
So search for that object recursively in files in the sublime text user data directory:
cd ~/Library/Application\ Support/Sublime\ Text\ 2/
grep -r nathos-sass-textmate-bundle-d6d079e *
#Result# Binary file Installed Packages/Sass.sublime-package matches
Then delete the offending file:
rm -rf Installed\ Packages/Sass.sublime-package
I deleted some erronous packages which solved my problem. Steps to do it here: http://untroubler.com/questions/8-sublime-text-2-and-unable-to-run-package-setup
Update after comment below:
This is due to a corrupt install of a package. On OSX, goto:
/Users/YOU_USER_NAME/Library/Application Support/Sublime Text 2/Installed Packages/.
Remove the package you tried to install and it should work again.
I managed to find all related files to this bundle and deleted them manually. I've noticed that if I miss a package from somewhere ST2 recreates some folders based on packages related to it, so it's not enough to delete some folders, you have to really find all related data and delete it.
sudo sublime-text
This works for me.
Simply reverting Sublime Text to a freshly installed state resolved this issue.
Sublime Text 2 can be reverted to a freshly installed state by removing your data folder. Depending on your operating system, this folder is located:
OS X: ~/Library/Application Support/Sublime Text 2
Windows: %APPDATA%\Sublime Text 2
Linux: ~/.config/sublime-text-2
To revert to a frestly installed state on Ubuntu 13.10, you can:
Exit Sublime Text 2
Delete (or move) the data folder, so running sudo rm -rf
~/.config/sublime-text-2
Start Sublime Text 2
Hope this helps.
There's already an answer related to permissions for Linux, but I found the issue was related to permissions for a Windows install. I placed the install for portable files into "Program Files/SublimeText2" - apparently when I run ST2 it needs additional permissions which it wasn't getting.
So I installed ST2 portable to a folder in a user directory (e.g. A folder my user created and maintains - C:\dev\SublimeText2) and everything works fine now.

How to install MySQL Connector/C on Mac OS X?

I'm writing an app in C that requires MySQL interaction, so I downloaded the Connector/C archive from the official website, and it contains bin, lib and include folders, but I don't know where to install them.
I could copy the include files into my project folder, but where can I put the lib file so that my compiled binary (and other binaries) can find it?
Thanks in advance!
This is confusing, isn't it.. don't know why they don't make this more clear.
The lib/ files go in /usr/local/lib
The include/ files go in /usr/local/include
The bin/ files go in /usr/local/bin
The /usr/.. directory isn't visible through finder afaik so you have to go at it via commandline. Best of luck
Also, in your Xcode project, make sure you add a Linked Library by going to your Target's settings, General, then adding Linked Library "libmysqlclient.dylib"
Alternatively, to do everything on the commandline by "mv", you could also execute (on cmdline):
defaults write com.apple.finder AppleShowAllFiles TRUE
and
killall Finder
to make the hidden folder /usr (and everything else) visible.
After placing your connector files (like Nektarios explicitly discribed where) and closing all "hidden folder - finder windows", execute on your cmd:
defaults write com.apple.finder AppleShowAllFiles FALSE
and again
killall Finder
to hide what have to be hidden.