How can I use a right to left language in "Sublime Text" editor

MohammadHossein R picture MohammadHossein R · Aug 14, 2015 · Viewed 12.3k times · Source

I want to use some strings which are in my language (Persian) in "Sublime Text", but the editor does not show them correctly, for example:

it should be:

<title>عنوان صفحه</title>

but this is how sublime is showing it:

enter image description here

The encoding is set to utf-8. What should I do to fix it?

Answer

Kukuluops picture Kukuluops · Aug 14, 2015

This Plugin Does Not Work Properly

This plugin looks like something you need: https://packagecontrol.io/packages/Bidirectional%20text%20support

I've used it once and worked well for me.

added by barlop

Important Note- As comments indicate, this plugin doesn't really work. People have issues copy/pasting from sublime into notepad. It's OK for viewing but that's not much of an answer.

Note, sublime with this plugin might show leters in the correct order but copy/paste in notepad and it might not so try copy/pasting in notepad first before typing a whole load in there. Also this plugin might not move the cursor in a right to left fashion. (i.e. type a letter the cursor when typing in a right to left language should move to the left)

To install,

i've tested this on ST3 portable.

if you go to the tools menu you see there's no bidirectional option

enter image description here

Then if you go here

https://packagecontrol.io/packages/Bidirectional%20text%20support

see it mentions

their github page here

https://github.com/praveenvijayan/Sublime-Text-2-BIDI

Click on Clone/Download then download zip

enter image description here

extract it and Copy the folder to the packages folder.. i.e. open sublime, do preferences..browse packages , and it gives a folder like C:\Users\harvey\Downloads\ST3\Data\Packages Paste the folder there. (maybe it's better to put it in the user subdirectory, I don't know).

Then go to the tools menu and you see bidirectional options like bidirectional text that weren't there before

enter image description here

And while you're at it you may want to install "package control" if it's not already installed. Go to tools..command palette.. type 'package' see if package control appears. Or go to preferences, see if there is package control listed. If not then you don't have 'package control' installed. You can install package control by going to https://packagecontrol.io/ and click install and it gives you some python code in 2 tabs, one for ST2, one for ST3, and you can paste it into your console(view..console). But it's not strictly necessary you can install the bidirectional package without doing that.