What does mnemonic attribute mean in sublime text?
Because i found it in some Main.sublime-menu files and it is written like that :
"mnemonic": "O" // or any other letter instead of O
It is used many times in sublime text packages, but now i said to myself it is time to know what does it mean and why it is there.
From Google, mnemonic means
a device such as a pattern of letters, ideas, or associations that assists in remembering something.
and from Techopedia:
Mnemonics are used in computing to provide users with a means to quickly access a function, service or process, bypassing the actual more lengthy method used to perform or achieve it.
In Sublime (and most software), the mnemonic is the underlined letter in a menu item that allows you to choose that item using the keyboard. For example, in the following .sublime-menu entry:
[
{
"caption": "File",
"mnemonic": "F",
"id": "file",
"children":
[
{ "command": "new_file", "caption": "New File", "mnemonic": "N" },
the F in File will be underlined, and within that menu, the N in New File will be as well. So, on Windows or Linux, for example, you can use AltF to open the File menu, then hit N to choose New File.
Related
I can see opened files in 1st group (created via split editor) using command "show editors in first group", in 2nd group "show editors in second group" and I can also see all opened files including all groups "show all editors".
Bu, how to see the files opened only in the currently focused group?
VS Code has added this now. Go to File-->Preferences-->Keyboard Shortcuts.
2. Scroll down PAST the keys that have assignments to the unassigned keys. It's under "Show Editors in Active Group"
3. Since it has no assignment, click on the '+' symbol to give it an assignment.
The existed answer https://stackoverflow.com/a/53537818/7860292 is right.
And it is also okay to directly type edt active in the FilePicker ~
And shortcut configs like following would be easy to toggle in active group or in all groups:
{
"key": "ctrl+oem_period",
"command": "workbench.action.quickOpen"
},
{
"key": "ctrl+oem_period",
"command": "workbench.action.showEditorsInActiveGroup",
"when": "inFilesPicker && inQuickOpen",
},
However, I do not find anything like show editors in first group as said in question, are those deprecated ? ...
When I type in "^" it is highlighted and waits for the next keyboard input such that if available, the next input is accented with it. For example typing in "^" and then "a" would result in "â" instead of "^a". How do I prevent this from happening?
I was able to solve this by creating a custom layout with the help of this post
https://superuser.com/questions/665494/how-to-make-a-custom-keyboard-layout-in-os-x.
First downloaded Ukelele.
Chose my desired layout to be edited as the current layout.
In Ukelele, went to File -> New From Current Input Source
The current layout is then shown on an on-screen keyboard. All the keys that will automatically accent the next keyboard input are highlighted with a different color from the rest of the keyboard. Right Click on the highlighted key and clicked on Make Output and pressed OK.
This makes the output of the key to the character and does not accent any following inputs. Did the same for all other highlighted keys ("Dead Keys" I think they are called).
Then saved the keyboard layout as a Bundle file anywhere (Remember to also change the name of the keyboard layout within the bundle. Otherwise it will have the same name as the layout you started with and may cause confusion when trying to select it)
Moved the saved bundle to ~/Libraray/Keyboard Layouts/
Selected the new layout from the Input Sources in System Preferences
Became a happy programmer :)
If by chance you are using the US International PC layout, remove that and use US, British, or ABC instead.
In the Spanish LATAM layout I ran into the same problem with the symbols ~, ^ and `. I added comfortable key bindings for them as "regular keys" (contrary to dead keys) with Karabiner. I think the approach I followed could work with other layouts as well, although I haven't tried.
Using Karabiner-Elements
Before getting into Karabiner, select "Show Keyboard Viewer" in the menu of the Input icon in the menu bar. You should see a virtual keyboard displayed. If the Input icon is not shown, enable:
System Preferences > Keyboard > Input Sources > Show Input menu in menu bar
Leveraging the virtual keyboard, find if there is a specific key combination to make the special symbol be printed as-is (without waiting for another key press). For instance, in Spanish LATAM, pressing Option+Shift+{ directly prints ^.
The amount of keystrokes can be reduced using Karabiner. The following is an example of a complex modification to reduce Option+Shift+{ into Option+{ for typing ^ in the Spanish LATAM layout. To find the value for key_code, use Karabiner's EventViewer.
{
"title": "Regularize dead keys - Spanish LATAM",
"rules": [
{
"description": "left_option+{ PRINTS caret(^)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "quote",
"modifiers": {
"mandatory": ["left_option"]
}
},
"to": {
"key_code": "quote",
"modifiers": ["left_option", "left_shift"]
}
}
]
}
]
}
In my case, my laptop keyboard was working fine, but somehow I bumped some keys and then my external keyboard was typing symbols instead of characters and numbers as expected.
I was going to investigate further, then I remembered the ancient wisdom that provides the simplest solution.
unplug it & plug it back in.
I'm having trouble typing the Ω symbol (U+03A9) in the Visual Studio Code editor.
On my Mac, I can usually type this with option + z but it doesn't seem to work in Code.
Many other combinations seem to work just fine (for example, ≈ option+x inputs correctly).
I'm wondering if VS Code is intercepting option + z for some other keyboard shortcut. I searched for a list of keyboard shortcuts but didn't find anything relevant.
⌥Z is bound to toggle word wrap.
You can toggle word wrap for the VS Code session with ⌥Z. Restarting VS Code will pick up the persisted editor.wrappingColumn value.
https://code.visualstudio.com/docs/editor/codebasics#_common-questions
In the Default Keyboard Shortcuts it shows up as:
{
"key": "alt+z",
"command": "editor.action.toggleWordWrap",
"when": "editorTextFocus"
}
To remove a specific key binding, simply add a - to the command and the rule will be a removal rule.
https://code.visualstudio.com/docs/customization/keybindings#_removing-a-specific-key-binding-rule
Your keybindings.json file should include the following:
{
"key": "alt+z",
"command": "-editor.action.toggleWordWrap",
"when": "editorTextFocus"
}
I have confirmed that this is working on VSCode for Mac.
I'm using a Mac for development, but 15 years of Windows experience before that means certain keystrokes are hard-wired (like Home for beginning of line, etc).
Is there a simple way to get Sublime Text 2 on my Mac to behave more like a Windows editor? I am used to Visual Studio.net on Windows.
I see two possible methods to solve your problem. The first is to find an OS X keybinding that does what you want. Then in the ST console enter sublime.log_commands(True). Then execute the command. This will give you the command so you can create a custom key binding. The second is to search for a key binding where you know the proper behavior exists in the Windows key map file (in your case home). In either case, the goal is to get a command and any necessary arguments.
You can now create a custom key binding. Go to Preferences -> Key Bindings - User. Insert the key binding you desire here. For your particular case, you would want something like the following.
[
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} }
]
Of course remove the square braces if you already have an entry. Additionally, you can change the keys to something else if you need to, but since you said you wanted to rebind home, I assume that is what you want.
I had a hard time getting used to Mac after I switched from Windows. Took me quite a while but you know, you have to get used to a few frequently used shortcuts.
Here are a few shortcuts.
Command +
left arrow - beginning of the line,
right arrow - end of the line,
up arrow - beginning of the document,
down arrow - end of the document.
Alt or Option +
left arrow - beginning of the word,
right arrow - end of the word.
Hope this helps.
I want to be able to use the alt key in Sublime Text 2 like I can use it on the command line in iTerm. For example, when I hit alt+f, the cursor moves forward a word, or when I hit alt+b, the cursor moves backward a word.
Instead, what happens is UTF+8 characters corresponding to the keys get inserted (ex: ƒ or ∫). In iTerm on the Mac, I can change the left alt behavior to act like +esc and it seems to do the trick.
This could either be a Mac OS X problem in general (I have the same problem in the web browser) or something specific with Sublime Text 2 so I would appreciate any Mac or Sublime Text 2 expertise. Thanks!
After using Sublemacs Pro for a few days, I realized it does too much for my liking, although it may be fine for more seasoned emacs users.
I come from TextMate and what I really want is the best of all worlds: mostly Sublime shortcuts, a few missing shortcuts from Textmate's ruby library of shortcuts, and a few shortcuts that Textmate stole from emacs.
So, I figured out how to solve the alt+f and alt+b problems:
{ "keys": ["alt+b"], "command": "move", "args": {"by": "subwords", "forward": false} },
{ "keys": ["alt+f"], "command": "move", "args": {"by": "subword_ends", "forward": true} }
If I find some more really useful ones, I'll post them here. Also, if I find a resource that lists all the possible "by" field values, I'll post that, as well.
There is a Sublime Text 2 plugin called Sublemacs Pro that provides emacs-like keybindings and operations, including those that you mentioned pining for. You can find installation instructions and the complete keybinding reference on the Github page.