I18n preview shortcut for Rubymine - internationalization

When I open a file on Rubymine, that has i18n string using "Ruby translate method", it displays a "preview" of the translated text instead of the actual code "t('translate_key')". When I click the text it shows up the code as expected, but I would like to know how can I make it displays the preview again for that piece of code.
I've tried many things from closing the file and opening it again but got unsuccessful. I believe that may have a keyboard shortcut to switch from "string preview" to "actual code", but haven't been able to find it.

I figured out that the correct way to do this is by folding the line (it may not seen obvious as folding is usually used to fold blocks).
The menu item is: "Code > Folding > Collapse". On Mac OS X using "Mac OS X 10.5+" keymap, the shortcut is ⌘+-

Go to the Preferences menu, IDE Settings, Editor, Code Folding and then uncheck 'Ruby i18n strings'. You will need to close and reopen the file to see the unfolded i18n strings.

place your cursor on translation code and press (ctrl-) from keyboard it displays the preview again for that piece of code.

Related

Visual Studio Code shortcut to display autocomplete list before typing on macOS

I am trying to display all possible words after putting the cursor in certain place in the code.
The autocomplete list appears when I start writing/typing:
However, I would like to see all suggested words even before typing.
I tried command + space, however it was a system shortcut for Search in macOS:
Any thoughts?
In case you are a CJK user using Mac, Ctrl+Space will not work, since it is used to switch IMEs.
There is another keyboard shortcut for triggering suggestions:
Option+Esc (Mac)
Alt+Esc (Windows)
Also see this post.
VS code version: 1.41.1
I solved this problem using fn+control+space.
Hope it helps you.
"change input source" keyboard shortcut should be disabled
To disable it->
Go to system preferences -> keyboard -> input sources
add a new input source (choose ABC)
Go to shortcuts tab (inside of keyboard settings)
Click on input sources on the left
disable the "select previous input source" shortcut
restart your vs code and now ctrl+space will show quick suggestions.
You can use the following alternative keyboard shortcuts:
⌘+I (mentioned in the official VS Code documentation for "Trigger suggestion")
⌥+esc
fn+control+space
The shortcut for the "Trigger Suggest" command is ⌃Space (ctrl+space) — as mentioned in the comments.
Most default shortcuts can be found in the documentation, which will automatically show the correct keybindings for the system you're on. In other words, if you visit the page on a Mac, you'll see Mac keybindings.
Additionally, you can:
go to Code > Preferences > Keyboard Shortcuts (on a Mac) and search for keybindings based on the command you want to execute
open up "show all commands" (⇧⌘P on a Mac) and search for the command there, allowing you to either view the keybinding for that command, or simply navigate to it directly from the search
Of course you'd have to have some idea of what the command's name might be. And in this case, a search for "suggest" would suffice.
If you use too many keyboard layouts, maybe the MacOS shortcut might be active. You can disabled ^(Ctrl)+Space shortcuts for MacOS.
System Preferences>Keyboard>Shorcuts>Input Sources> Disable Select the previous input source.
You can use next shortcut for change input sources.Ctrl+Alt+Space
when I was set up 2 keyboards with different layouts, and it turn out it overrides the ^+Space behavior, so this is how fix it:
Go to system preferences -> Keyboard -> Keyboard shortcuts
Click on input sources
and disable the "select previous input source" shortcut

Auto-indent after pressing `Enter` between tags

Please see the GIF below:
I am using Visual Studio Code. By pressing Enter and Ctrl + Shift + Enter. I can make the auto indent in the next line.
So, I guess there is a more convenient way or package which can accomplish that by just pressing Enter.
In preference->editor search for autoIndent and make it full
I resolved this problem by switching Language Mode from Django HTML (for some reason it was auto detected) to HTML.
Press Ctrl+Shift+P (or directly press Ctrl+K, M => Select HTML)
Print 'Change language mode' and press Enter
Select HTML
I'm not sure if you are still having this problem, but I stumbled across this other post that seems to have a solution:
Visual Studio Code Auto close tag and indent XML as with HTML
Hopefully this is what you're looking for.
EDIT: I've just realised that this causes the language mode to be changed to HTML, which may lead to unexpected/unwanted behaviour. It suits my needs, however.
I have modified the Emmet preferences, I'm not sure if it's a good solution, but it works.
In the preferences, search emmet.includeLanguages
Click Edit in settings json
In the right column, click on User settings
Add "emmet.includeLanguages": {"php": "html"} on the last line

Manual markers for code folding in RubyMine

In RubyMine, is it possible to insert manual fold markers (like vim or emacs)?
I want to automatically fold a very large hash whenever I open a file. It's available in IntelliJ.
Yes. Rubymine has the same function like IntelliJ.
Select any code region you like, press option+command+T on a mac or some other similar keys binding on windows (I haven't a win install right now). Also you can do this from menu: Code -> Surround With....
To go to any custom folding, press option+command+. on mac, or from menu: Navigate -> Custom Folding....

How to get smart tabs ("indent with tabs, align with spaces") behavior in Xcode?

I used to use tabs for indentation and spaces for alignment.
Like so (arrows show tabs and dots show spaces).
In QtCreator you can set such coding style in standard preferences.
I can't find the way to achieve the same goal in Xcode. Could you please tell me if it is possible?
May be there is a plugin for that?
UPDATE:
Here is how it can be achieved in QtCreator:
P.S. Please, don't try to persuade me that using spaces only/tabs only is better, otherwise this question will turn into another holywar :)
Once more about what I'm trying to achieve: Indent with tabs, align with spaces. Vim Tips Wiki.
UPDATE 2: I've just submitted an Apple Radar bug-report (enhancement) rdar://22285639. Here it is on the open radar.
UPDATE 3: I received an answer from Apple. My bug is a duplicate of rdar://8165023.
In Xcode > Preferences (⌘,):
If I understand your question correctly, this should do it for you.
If you want to remap the standard Xcode's ⌘+[ to TAB, you can do the following:
Install a program called "Karabiner".
Go to Preferences ~> "Misc and Uninstall"
In "Custom Setting" section click on the "Open private.xml" button
Open the file and replace its content with the following code:
<?xml version="1.0"?>
<root>
<item>
<name>Tab instead of Command+[</name>
<identifier>private.swap_tab_and_cmnd+[</identifier>
<autogen>
__KeyToKey__
KeyCode::TAB, ModifierFlag::NONE,
KeyCode::BRACKET_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::NONE
</autogen>
</item>
</root>
Go to Preferences ~> "Change Key" ~> click on "Reload XML" button
Put a tick in the checkbox which is called "Tab instead of Command+["
Enjoy
PS: Please note that this setting works globally on your machine, not just in Xcode. However, I am sure that google might help you to find a solution how to customize it even further, applying the changes only to Xcode.
In XCode
Xcode > Preferences or use ⌘ , to open Preferences
now click on the Text Edit tab and then there is sub tab bar click on Indentation and you can change setting of the Indentation as you need

Change language being spell-checked in Textmate

In OS X applications such as Mail and Firefox you can right click in a text field and change the language being spell-checked. I can't figure out how to do the same in Textmate. Can it be done easily, and if, how?
Press ⌘: (it's a shortcut to Edit, Spelling, Show Spelling and Grammar) and change the language in the dropdown.
To update the error highlights on the active file, press ⌥⌘; twice to turn Check Spelling as You Type off and on again.
Edit / Spelling /check spelling as you type (click on it to uncheck).
Since there is no option in the TextMate preferences, there is no easy option. The only way to accomplish this is to change your preferred system language, i.e. going to "System Preferences" > "Language & Text" > "Language" and dragging the language you want to spell-check to the top. You have to log out and log in again to make this change work.
Hopefully there will be an easier solution in TextMate2.
Very old thread but in TextMate 2:
Edit -> Spelling -> various options to spell check are shown at the top of that menu. Below, choose System (Automatic by Language) ideally and it'll follow System Preferences, else choose from one of the other languages listed.
If using the "automatic" setting, you should not need to log in/out or restart Textmate 2 (at least, in OS X Sierra) to detect a change made in System Preferences, though you might need to toggle on and off the "system automatic" TextMate language selection if it doesn't seem to "see" the change straight away.
The ⌘: shortcut mentioned by #dipnlik works in TextMate 2, showing a popup menu hovering under the first "underlined in red" word and is useful for its "learn spelling" and "ignore spelling" options.

Resources