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

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:
The encoding is set to utf-8.
What should I do to fix it?

There is This Plugin But It Does Not Work Properly
https://packagecontrol.io/packages/Bidirectional%20text%20support
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
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
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
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.

The RTL-Mirror plugin for sublime 3 will show you the correct text by hitting Ctrl+F1 on Windows and OSX and Shift+F1 on Linux. it's not the perefect solution but it helps.

For the last few years my workflow has to been use VS Code as an IDE, for coding, and Sublime Text 3 (sorry, 4) for editing plain text because of its startup speed and because VS Code would be overkill.
However, since it's pretty clear by this point that the ST devs don't intend to implement RTL support, and because I would rather not have to install a third text editor just to deal with RTL text (which there are very few of anyway), there were only two convenient options left for me to open up RTL files on Windows.
Use Windows 10's Notepad (yes, really)
This is the superior solution since the new Notepad works well, starts up faster than Sublime, and not only renders RTL text but renders it quite well. The only downside is the lack of a dark mode.
Use VS Code (or whatever your preferred IDE is)
Both free IDEs like VS Code and paid ones like PHPStorm and IntelliJ seem to support RTL out of the box, but pretty much the only good reason to do this is if you absolutely need dark mode or are not on Windows - otherwise all of them up start up far slower than Sublime, and in the case of VS Code, render RTL text worse than Notepad does (I can't speak for JetStorm IDEs on that front).
Who knows, if I find a better alternative text editor that I can move my custom theme over to I may eventually move away from Sublime completely to another editor, but until then, sticking to two editors.

Related

unwanted: APL keyboard overlay enabled?

I've been trying out APL. I'm running Windows 10 and I've installed Dyalog 18.0, and the APL Language and APL Backtick Symbols extentions for VS Code.
But even though I'm not running any of these programs, sometimes suddenly my keyboard is hyjacked! All my ctrl commands are replaced by APL symbols.
E.g. ctrl-Z (undo) becomes ⊂ and ctrl-A (select all) becomes ⍺. I have no idea why and how to disable this again. This makes it very hard to do my work!!!
I've been googling for this, but haven't found an answer so far. I've looked at the Windows keyboard settings, but it looks normal. The locale settings are also correct.
I'm now just de-installing everything, but that way I need to reinstall every time I want to try out APL.
Can somebody tell me what is happening and how to fix it? (And tell me who to complain to that this is a very hostile feature)
I am sorry that our Unicode IME is causing you confusion.
I do like using it, but there are some Windows settings which I set to make things easier.
Start button->Settings
In the "Find a setting" edit field, type Advanced keyboard settings
Click on the icon with that text on it
Under Switching input methods:
Tick the “Let me set a different input method for each app window”
Tick the "Use the desktop language bar when it's available". This option will show the orange D icon when our Dyalog Unicode IME is active.
On this same dialog, there is a Input language hot keys.
I find it convenient to select a hot key combination to activate our Unicode IME, and another one to go back to the default Windows keyboard layout.
Close this dialog with the X button in the top right.
If you have further problems or questions, you can always ask us at support#dyalog.com
By the way, we put links to advice pages about keyboards on our website under Resources->Fonts and Keyboards.
Regards,
Vince
When installing the standard Dyalog IME, there is a new keyboard input method on Windows. Have you checked WinKey+Space? This should cycle through available keyboard layouts and you should find your previous/default layout available there.
I personally agree that this is not a good way to handle keyboarding and causes many issues for newcomers to APL. Dyalog is aware and are looking into alternatives that can be comfortable for both new and existing users.
You can uninstall the standard IME without uninstalling the entire interpreter by running the Dyalog uninstaller (search "uninstall Dyalog" in your start menu) and selecting just the IME.
For now, I recommend the APL Wiki article on Typing Glyphs for some ideas for alternatives to the standard IME: https://aplwiki.com/wiki/Typing_glyphs#Windows
I personally use the abrudz keyboard with Alt Gr as the switching key.
I just wanted to add that your complaint has reached the people who need to be complained to. This is a difficult problem space, between changing technologies, multiple platforms, new or casual users of APL and the folks who use APL all the time and want to type APL symbols into e-mail messages, etc. It is most definitely time for an overhaul of the keyboard technologies that we use and this will be on the to do list for the next development cycle. Until then, I hope you manage to get by with the advice that has been offered so far!
Thanks for the shout,
Morten Kromberg, CTO, Dyalog

RTL language with Sublime Text editor

The RTL languages are not supported in the sublime text editor
I tried this plug-in Bidirectional text support
on windows os
Copied all files from the zip Sublime-Text-2-BIDI-master to the ST3 folder and changed the font type and size.
then I copied the unicodedata.pyd to C:\Users\USERNAME\AppData\Roaming\Sublime Text 2\Packages\Bidirectional text support\bidi
now the Tools > Bidirectional text part didn't look gray anymore but it is still disabled.
also I copied these two lines but it didn't work
sys.platform.startswith('win'):
sys.path.append('../../..')
Any help would be appreciated
In order to get Sublime Text to work with Arabic characters using Sublime Text BIDI plugin on Windows correctly, ensure you've done the following:
Copy the plugin folder to the following path C:\Users\USERNAME\AppData\Roaming\Sublime Text 2\Packages\
Copy unicodedata.pyd from ST installation directory to both, the main plugin folder which in your case is Sublime-Text-2-BIDI-master and inside bidi folder.
Set your sublime user-settings to the following:
{
"font-face": "arial",
"font_size": 11,
"default_encoding": "UTF-8",
"fallback_encoding": "Arabic (Windows 1256)"
}
Reload the plugin by viewing rtl.py and saving
In the case that doesn't fix it, you can read what sublime console log outputs when you click on Bidirectional text for a given Arabic text, console log can be accessed through ctrl+~.
Very Easy,
Just follow this Video steps
دعم اللغة العربية في برنامج Sublime
1- Download the Sublime-BIDI-master folder from Github of solution
2- Extract it and paste under \Sublime Text Build (whatever)\Data\Packages(the downloaded folder).
3- open sublime wit any RTL Language file and right click anywhere you'll new options (Bidirectional text) .. Click it :).
However, in my Sublime version (build 3126), Arabic letters will be reshaped when switching to Bidi.
Initially in the range U+0621-U+064A, which are the usual Unicode codes for Arabic letters, characters will be mapped to the range U+FE70-U+FEFC, which are codes for each (isolated, initial, middle, final) Arabic connected forms. These latter codes, called Arabic-Presentation-Forms-B, are deprecated by Unicode and their usage should be very limited.
For example, before switching to Bidi, the word كتب, looks ب ت ك, from left to right U+0643 U+062A U+0628. This is the memory order. (It is up to the final rendering tool to display the string in visual order by connecting letters.)
After Bidi switching in Sublime, the word will appear good as كتب, because the codes are ﺐ ‎U+FE90 followed by ﺘ U+‎FE98 followed by ﻛ U+‎FEDB. In this order. That means, in a Bidi enabled tool like a browser, it will appear ﺐﺘﻛ as the final visual order. This is not what the user expects.
So, not only Bidi switching changes the letters code, it also changes the memory order.
Personal experience.
When editing a source file (HTML and other languages or formats) containing some RTL characters, it is really tricky to navigate in the text edited. So the mode "before" (logical or memory order) might be very helpful than the mode "after" (visual or display order). With logical order, it's useless to join letters, it doesn't make sens.
Check this link, I had the same problem but solved it with the Sublime Text BIDI plugin.
I was still facing an issue because of the editor's font. It will be recommended to use a fixed-width font like Courier New. This should ensure the plug-in works as expected.

Sublime Text 2 split active screen like dreamweaver

At work, I have to jump into old mysql_query procedural website build higgledy-piggledy (some var are camelCased AND underscored, no indent code, page are build in table ...)
Anyway, usually I m using ST2, but here I can't. So to search my line code, I use dreamweaver to click on the screen preview and the cursor drop on the code line I want.
I do not like and I don't know dreamweaver. But as code is UNREADABLE, that is the only way I have to work.(My boss doesn't want rebuild theses sites).
Here is my question, does anybody know for ST2 a way (or a plugin) to split screen and click on screen preview to go right to the code line just like dreamweaver preview does ?
Regards.
Answer is simple, you will never find something like that.
Try here - http://webdesign.about.com/od/windowshtmleditors/tp/windows-wysiwyg-editors.htm
WYSWIG html editors.
Try Sublime CodeIntel, as well says this page:
...This plugin brings a little of IDE functionality into ST2. This plugin reads all your code and is able to code-complete, jump into
definitions and function call tooltips. Although sometimes looks a
little buggy, it’s still worth having it around. It’s a huge time
saver, especially when you are dealing with other’s people code.
If is suitable for that project you can remove the package later.

Linux Editor that can highlight all instances of a selected word [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Is there an editor in Linux that can highlight all instances of a word when the word is double-clicked? I was using Notepad++ in Windows which provided that feature. Now I am missing it in Linux editors. I tried Kate, Gedit, etc.
To enable this feature in Geany do the following:
Install the addons plugin: sudo apt-get install geany-plugin-addons
In Geany, click on Tools -> Plugin Manager
enable the plugin Addons (check in the column Active)
configure the plugin by clicking on Preferences
enable the option Mark all occurrences of a word when double-clicking it
First install the addons plugin:
sudo apt-get install geany-plugin-addons
and then apply the answer of mr13.
What version of Kate where you using, Kate has that exact feature as described here.
This Geany addon didn't work for me (on Fedora), rather this one did: http://sourceforge.net/projects/geanyhighlightselectedword/. Though installing it was a bit complicated.
Summary
Eclipse has something similar. Install the Darkest Dark plugin, then double-click a word and press Ctrl + F to highlight all instances. Press Esc to unhighlight.
Both Sublime Text 3 and 4 and Microsoft Visual Studio Code (VSCode) have the double-click feature. Just double-click any word to highlight all instances of it. Click away anywhere to unhighlight.
Details
The top 3 modern, Linux-compatible editors which come to my mind when I think about software development are the following. All 3 of them are powerful, modern, widely-used, and cross-platform (Windows, Mac, and Linux)!
Eclipse
free and open source software (FOSS), and no-cost, but very heavy.
My go-to and primary editor for professional and hobby software development because it's got an outstanding, world-class indexer which allows you to Ctrl + Click on any variable or function name to jump to its definition.
Links to my full setup documentation are found here.
Sublime Text 3 and 4
proprietary/closed-source shareware, a professional and very powerful and very light-weight tool, no-cost for an unlimited full-access trial period, and relatively low-cost for a license
My primary editor for individual files--I frequently edit the same file at the same time with both Eclipse and Sublime Text 3 and 4, since Sublime has wonderful multi-cursor support for simultaneous editing of multiple lines all at once! I also have Eclipse set as my git editor of choice (see my answer here: How do I make git use the editor of my choice for commits?)
Learn to use it with this live, interactive tutorial-style "plugin": https://sublimetutor.com/.
Microsoft Visual Studio Code (VSCode)
free and open source source (FOSS) source code, and no-cost; minor caveat: technically, the binaries distributed by Microsoft are freeware, though the source code is free and open source
One of the industry's most popular editors today, but also a relatively new entry into the field. I haven't used it much yet.
So, let's see how each of these 3 can "highlight all instances of a selected word":
1. Eclipse
If you install the plugin Darkest Dark Theme with DevStyle, you get the following features:
Just place your cursor on any variable and it automatically highlights all instances of this variable, like this. Here you can see _currentChannel_i highlighted in black in 4 places, and in some yellowish color in one place near the bottom-left:
[MY FAVORITE] Double-click any word to highlight it, then press Ctrl + F to highlight all instances of it! Use the buttons in the find bar in the top-right (also shown circled below) to choose "Case sensitive search" and/or "Match whole word" as desired too. You can also choose "Regular expression search". Here you can see 8 instances of _currentChannel_i all highlighted in blue, including some in the comments! I use love this feature and use it all the time! Press Esc to cancel the Ctrl + F blue highlighting.
See here for links to my full setup documentation.
2. Sublime Text 3 and 4.
From here, if I'm doing some fancy multi-cursor editing, I like to right-click the screen and go to "EasyShell" --> "Open with default Application" to open up this same file in Sublime Text 3 or 4.
In Sublime Text 3 and 4, you simply double-click any word to highlight all instances. That looks like this. Here, I have double-clicked _currentChannel_i, and you can see 9 instances of it highlighted/boxed, including in the comments. Simply click away anywhere to undo this selection.
Note that you can also highlight a word and then press Ctrl + D repeatedly to highlight instances of it, one-at-a-time, each with a new cursor. This is handy when editing all instances of a variable in a single file all at once, for quick-editing/refactoring, rather than using the Ctrl + H Find and Replace tool.
3. Microsoft Visual Studio Code (VSCode)
This one is super easy too! Just double-click any word to highlight all instances of it--same as Sublime Text 3 and 4. Click away anywhere to undo this selection. Here, I have double-clicked _currentChannel_i, and you can see 9 instances of it highlighted, including in the comments.
So, which editor to use?
Well, Sublime Text is the lightest, by far, but lacks a good indexer and function view/explorer. It has advanced, modern features like multi-cursor mode. It is made by one lone and very-talented developer, so if you use it, please go buy a license to support his work. That's his livelihood.
Eclipse is the heaviest, by far, but lacks modern features like multi-cursor mode. It is the oldest of the 3, by far, and has a world-class indexer. Since it is the oldest (first released in 2001) and FOSS, it is widespread and is used as the base for many other professional editors and microcontroller development platforms, such as the STM32CubeIDE, and the Arduino Professional IDE, both of which are Eclipse-based. For that reason alone, it is worth learning.
Microsoft VSCode is the newest (first released in 2015), and is more light-weight than Eclipse and more-advanced and feature-rich than Sublime Text. Since it came after the other 2 editors, it was able to borrow ideas from Sublime Text (I'm supposing), such as multi-cursor mode, which is ingenious. Therefore, it contains that feature (see here: https://code.visualstudio.com/docs/editor/codebasics#_multiple-selections-multicursor), as well as a powerful indexer (which I can't comment on since I haven't used it), and an "OUTLINE" view in the left-hand pane to view a list of functions, definitions, etc., like I can see in the "Outline" view in Eclipse in the right-hand pane. Since it is backed by Microsoft, it is arguably the best-supported of the 3.
Since I am most-familiar with Eclipse, I prefer it in conjunction with Sublime Text. If you are brand-new to these editors, however, I recommend you just start with Microsoft VSCode and go from there. Optionally, try out my Eclipse installation and configuration instructions above if you ever find yourself needing or wanting to use Eclipse directly, or STM32CubeIDE or the Arduino Pro IDE.
VIM can do this:)Not by clicking, but there is a way to quickly search for a word and highlight all occurrences.
Check this out:
http://vim.wikia.com/wiki/VimTip14
There's Geany, but I don't know if it does that.
You could customize gedit to do much of what you want:
http://grigio.org/pimp_my_gedit_was_textmate_linux
If you can't get what you want, you could install Notepad++ with WINE. Try something like this.
In Linux Mint 19 Tara
Install geany-plugin-automark, then start geany, go to
Menu -> Tools -> Plugin Manager and Enable/check Auto-mark

Can't Copy & Paste in Eclipse 3.5

I recently updated my Eclipse to the latest release 3.5 and since then I have a very annoying problem with c&p using the shortcuts.
In an editor (xml, jsp, doesn't matter which one) I try to copy something and paste it somewhere else, nothing happens. When I cut out something and put it somewhere else I sometimes get something else (like a messed up part of my previous selection) or just some whitespaces. This gets even worse when I change lines in between.
First I thought that my keyboard is probably broken but it works just fine in other programs. Then I tried using the context menus' c&p and there it works. Yesterday I managed to get at least an error message when I tried to copy a file in the navigator from one project to another (the message was just "error using copy...bla". no details).
Does anyone else have this problem, or know how to solve it?
I am running on Kubuntu 9.04, and have quite some plugins installed (but only from the Galileo Updates Site), like Birt, Mylin, WST, or Subversive.
For my problem, I had to go to Window > Preferences > Java > Editor > Typing, and uncheck "Update imports"
This must be related to the key mapping, since those shortcuts are defined according to context.
(Column "When", in Preferences / General / Keys)
Check if those shortcuts do not work for any editor (do they work for Java editor?)
If they work for some editor, not for other, then some plugin settings must have re-affected them to another command.
This is caused by various X clipboard managers doing weird things with the clipboard. (bug report).
In XFCE the clipman applet was rolled in XFCE 4.8, and will be the source of these problems.
To fix this in XFCE - kill xfce4-settings-helper. You will need to use Settings Manager -> Session and Startup -> Session to kill it, as otherwise it may restart automatically.
To prevent this starting next time, you will need to remove it from your startup/login programs in Settings Manager > Session and Startup > Application Autostart.
Problem was solved with newer Eclipse releases. I think >= 3.6. Depending on your distribution there may be a (back)port of this (not on my Xubuntu 11.04) within the repositories.
So a tarball installation of Eclipse 4.0 works perfectly for me. Cut&Paste works and I am lucky that my plugins are compatible to 4.0.
Unfortunately Sublime Text has the same problems.
I read somewhere that in KDE maybe Klipper / "Klipper on the panel" conflicts with eclipse copy action.
It's a tool for clipboard history. Try to remove that! It may solve your problem :-/
For me the xfce4-settings-helper killing worked.
Workaround:
You can cut&paste from the compare view. So simply compare the un-copyable file (e.g., local history) with a different version and Control-C what you need there.
In the *.java editor page, right click and select open in text editor. Past your snippet there. Your Snippet will show in the *.java page'
I use Eclipse Kepler for PHP development. It's dumb I know.
None of the solutions suggested here has solved this source of frustration.
I can confirm the copy function works whether shortcut keys are bound or not. As I can copy from eclipse and paste into any other application. Except eclipse.
My solution. Accidental discovery: Eclipse Kepler will allow you to paste outside the php open and close tags and allow you to click and drag the highlighted block of content into into position.
Acceptable solution for small bits of code. Horribly crippling for larger development environments.
For Xming, this resolved the problem for me. In XLaunch uncheck Clipboard (clipboard manager) in the "Specify parameter settings" GUI form.

Resources