2014-05-08

Dictionnary in sublimetext

I recently have been annoyed by his own typoes and has been looking for a way to fix it. This is actually pretty simple to cmd-shift-p and install a package called Dictionnaries. Then by hitting F6 you switch on and off the spellcheck highlighting. When you write a lot of documentation that is very helpful (and you want to write a lot of documentation, don’t you ?).

The spellcheck auto-highlight can be enabled for specific file extensions (like .md files) by adding

"spell_check": true

in preferences > Settings - more > Syntax specific - user (while having a markdown page open)

2012-10-28

Sublimetext2, plugins, sshfs

For 15 years I have been using vim and I don’t like IDEs. Of course I had to use eclipse and netbeans sometimes when coding in java. Java probably can’t be really well handled without a full-blown IDE anyways.But I didn’t like it, you get distance from your code, stuff happens behind the scene and I like to keep visibility on everything that happens.

But since I went into rails, I tried what was out there and there is a popular editor for the few rails coder that use Linux and not mac, called sublimetext2. And I have to say it just works fine for me (even if I will always keep my Vim not far). And I don’t feel any loss in control !

Here are a few tuning that I made or got from friends that I want to keep in memory, so I figured I should post about it.

Enable plugins manager

It’s not on by default and can be enable by copy-pasting this line into the console (view / console in the menu)

import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not  os.path.exists(ipp) else None;  urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print   'Please restart Sublime Text to finish installation'

Then just relaunch sublimetext and you can access the plugin manager using shift-ctrl-P and type ‘install’.

There is a damn long list of plugins you can add there (a list is on http://wbond.net/sublime_packages/community) and a few of them were advised to me that I should use: brackethighliter, docblockr, sublimecodeintel, sublimelinter, vintageex, git

sublimecodeintel seems to be the one that really does a lot of magic in there. The rest is for convenience and display of blocks in a more visual way,

Use sshfs for remote editing

Well this is not related to sublimetext but makes it easy to remote edit a dir when you have an ssh access. On Ubuntu you can just

apt-get install sshfs

and then

mkdir workdir && sshfs you@server:/path/to/dir workdir

so the remote dir pretends to be local now and can be opened by sublimetext easily. It’s of course adding some response time as the editor refreshes the file you browse each time you focus on it, but it works pretty fine for me.

Special thanks to beve that provided me those nice tricks.