Adjusting keyboard shortcuts on Windows - windows-7

How to change default shortcuts?
For example, I want to try Caps+S instead of Ctrl+C.

Autohotkey is probably what you want. There are some instructions for remapping keys.
You might also be interested in Ctrl2Cap

Related

How do I prevent the option key from performing alternative input when I use it as part of a keyboard shortcut

Usually, the keyboard shortcut will work but I will also get an accent or symbol character in the file editor.
Sometimes, even the keyboard shortcut doesn't seem to work.
I'm new to macos, so maybe this is an os-wide setting somewhere. However, there are some times when I might need a symbol or accent so I'm perplexed why the option key was chosen as a shortcut key modifier for vscode if its default behavior in a mac is to produce alternative input.
The option key alone (and with SHIFT) is generally reserved for use by the active keyboard configuration, and is not often used for application shortcuts. You generally want to have at least COMMAND or CONTROL as part of your shortcut.

Using windows shortcuts in vim

I was wondering if there was a way to use windows shortcuts in vim (in particular those used to select lines (with shift, alt, ctrl) ?
Maybe an option to set in the .vimrc ?
Thanks.
You can enable this via the following command in your ~/.vimrc:
source $VIMRUNTIME/mswin.vim
See :help mswin.vim for a detailed explanation.
Alternatively, copy that script into ~/.vim/plugin/mswin.vim. This allows you to gradually comment out or tweak certain mappings. The downside of this plugin is that many Windows shortcuts conflict with Vim commands, so you're losing some features, and the completely different structure may prevent you from learning and using Vim effectively. Having started with a Windows background myself, this is how I proceeded. Now, I only use a few of those Windows mappings in Vim, and have customized several remaining ones so that they provide a true added value.

Emacs Terminal.app Meta Key - German MacBook Keyboard

Good evening,
I have a problem using Emacs in Terminal.app the last 9 hours but wasn't able to solve it on my own.
The workarounds I have found on Stackoverflow etc. didn't persuade me.
I didn't want to use the Option 'Wahltaste als Metataste verwenden' (alt/option as meta), because I have to type for example {}[] with my alt-key. Keybinding of these Charakters in Emacs is no solution for me, because outside of Emacs in nano I want to use []{}..., too.
I also didn't want to use iTerm2.app, I think it should be possible in Terminal too.
Because sometimes I use Emacs over SSH, it is not possible to choose an GUI-based Emacs either.
A possibilty I would accept is to use the left alt/option key for meta and the right one for typing []{}... Or the Fn-Key for meta...
But I wasn't able to do it the last 9 hours...
I already ported 'emulate-mac-keybord-mode.el' from Aquamacs, but I didn't get it work as expected.
Does anybody have an idea?
Thanks in advance,
Zappel
If you insist on a TTY Emacs within Terminal.app, you may probably have some success with kernel level remappings of modifier keys, using KeyRemap4MacBook. I do not know, because I never used it for such things, and since the key codes, Terminal.app sends to the TTY process when a modifier is pressed, are ultimately hard-coded in Terminal.app, this is neither easy nor particularly pretty.
iTerm2 probably provides means to customize modifiers individually, and is generally a superior terminal emulator (with the notable exception of color management), but frankly, do yourself a favor, and use a GUI Emacs.
A GUI Emacs provides a much nicer expierence on OS X. You are not only able to map each modifier key individually with mac-option-modifier and friends, you also more modifiers available, namely Super and Hyper.
For instance, the following setting uses the Command keys as Meta, the function key has Hyper, and keeps the Option keys for OS X, so that you can still use the alternate layout level:
(setq mac-option-modifier 'none
mac-command-modifier 'meta
mac-function-modifier 'hyper)
To edit files on remote systems, you'd just use Tramp then.

Any text editors for Mac with hotkey PASTE of pre-defined text for faster coding?

Coding PHP on a Mac using TextEdit. It's always annoying to have to type the same lines of code that I use over and over (Ex: MyClass::myLocalizedString('Hello');).
Anyone know of a useful editor for Mac that can save me time by allowing me to predefine a string and bind it to a hotkey combination?
Ex: Cmd+1 pastes the text MyClass::myLocalizedString('');
Tincta Pro also has a code-snippets feature with shortcut expansion.
(Disclaimer: I'm the developer of Tincta)
I think there are plenty of choises. For instance, you can use Keyboard Maestro to create a hotkey or use TextExpander for short snippet. I think you might be able to create this with Quicksilver too, but for this I'm not sure.

Why is so complicated to remap Esc to CAPS LOCK in Vim?

I saw the vim wiki tips and it says that in order to remap Esc to CAPS LOCK you have to edit the following windows code:
REGEDIT4
[HKEY_CURRENT_USER\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00
Is it possible to remap Esc to CAPS LOCK by only adding or modifying lines in the _vimrc?
I recommend that you use AutoHotkey for this.
You can do a per-application hotkey change:
SetTitleMatchMode,2
#IfWinActive,VIM
CAPSLOCK::ESC
return
#IfWinActive
CAPSLOCK::CTRL
return
This script, for example sets caps to escape in vim, and control everywhere else.
There's no vim key identifier for the capslock key, so you have to do it with a scan code.
It would be like trying to map the ctrl key or the shift key to something - those keys don't do anything by themselves, they are key modifiers, so they can't be trapped the same way.
The mapping has to be done at the OS level instead of vim, so the complication comes from the OS. For example, on my Ubuntu machine I have the following in ~/.Xmodmap:
! Esc on caps lock
remove Lock = Caps_Lock
keysym Caps_Lock = Escape
However, I don't think the REGEDIT script is so bad. It's kind of ugly, but it's only two lines!
Also you can try this: SharpKeys.
I swaped CapLock and Esc with it.
You could also use Ctrl-C to escape (Available at least in vim). Which is what I normally use. I commonly swap control and capslock, though, and have done so through registry settings in windows and keyboard conf in ubuntu.
Edit: as #mMontu kindly notes, Ctrl-C is more brutal than Esc: As stated in this appropriate question,
vim isn't going to bother checking if you just wrote part of an
abbreviation, and it isn't going to run the fancy auto commands your
plugins have set up for every time you leave insert mode
I hadn't noticed because my vimming is not so advanced yet.
Another alternative that worked well for me was to use the instructions found in
this website
Essentially: Install Microsoft's Keyboard Layout Creator, then edit its source code to allow remapping of CAPS LOCK and create your own custom layout.
Remap CAPSLOCK to ESC and CTRL on Windows
A very nice tool that I've already described in this answer gives you the possibility to remap CAPSLOCK to both
to ESC (when pressed alone) and
to CTRL (when pressed with other keys)
Just use this little piece of open source software by ililim.
You do not need Admin privileges for this and ESC and CTRL are still working as expected.
I use it to enjoy convenient CTRL + anything presses without hurting my pinky and to toggle modes in Vim that I use via ssh in MobaXterm. For installation just follow this description.

Resources