I want to do block-comments in Colab using a Mac laptop (Big Sur), so I had a look here:
Is it possible to do block-comments in Google Colab?
Ctrl+/ does not work for me, so I follow jakevdp's advice:
If this does not work for you, check Tools->Keyboard Shortcuts and search for "Comment Current Line" to see what the shortcut is within your current settings.
Here's the output:
This leads to several problems:
The shortcut I need is one of the very few that can't be customized.
On my non-American keyboard, I need to press Shift+7, to get /
On the Mac, ⌘ + Shift + 7 is bound to the Help menu: How to use the macOS Help menu
To summarize, every time I try to comment a block of code, the Help menu opens instead. Is there any workaround for this?
PS: I tried all the other answers to Is it possible to do block-comments in Google Colab?, and they didn't work.
I found a simple solution. If the standard solution ⌘ + Shift + 7 doesn't work for you (like it didn't for me)....just use the / from the numeric keypad!
⌘ + numeric keypad 7 worked great for me.
I acquired a macOS machine for the first time, and I can't figure out how to use commands such as alt+E to open the current command in $EDITOR.
I don't want to remap the ⌘ key to alt system-wide, but I can't figure out how to the remap in either Kitty or Fish.
Why is the fish binding not working in mac os? is a relevant question but the answer there only applies to iTerm2.
Kitty allows treating ⌥ as alt with macos_option_as_alt. So I've put
macos_option_as_alt yes
into kitty.conf and started using ⌥ as my alt replacement on macOS.
It seems that it's discouraged on macOS to reuse ⌘ as a modifier.
By pressing ⌘+e, I found out that the shell gets "[101;9u", so I've decided to create a custom binding:
bind "[101;9u" edit_command_buffer
This way I get the alt+e equivalent on macOS.
In Chrome, it's possible to switch tabs with cmd + tab_number, like cmd + 3 to go to the third tab. Is there anyway to specify this for Terminal on a Mac running Mavericks?
I know how to change a shortcut via System Preferences, but I'm not the exact name of the Menu Command I should add, if it's even possible.
You can Shift + Command + Left or Right Arrow to cycle through tabs:
Shift ⌘ ←→
or
⌘{}
If you want to use a specific # as you mentioned then you'll have to script it or use windows instead of tabs.
I tried to use Alt as meta key for the FSF Emacs 23 Windows version and for EmacsW32 but especially M-x (Alt-x) does not work.
Somehow I cannot use Alt as Meta key for Alt-x (M-x). I searched really hard and all I got is how to switch the meta key to Alt in w32-meta-style. Currently this variable has the value 'use Alt as Meta key'. I also tried all other values with no success. Furthermore I installed the unpatched version of emacs from http://ourcomments.org/Emacs/EmacsW32.html and the original binaries from gnu.org. All versions have the same problem.
Alt works as Meta, except for Alt-x (Meta-x).
My setup is as follows:
Windows 7 x64 Professional
German keyboard
This question is Windows specific as I have a working Ubuntu version of Emacs 23.
EDIT: It was Growl for Windows. It loads on start up and caputes all Alt-x inputs. So my solution was to just disable Growl as I do not need it anymore. Might be another App for you.
It should work out of the box. Does Alt+x work as M-x if you start Emacs with the -Q flag? That inhibits loading of your customizations, in case one of them is breaking M-x on Windows.
Also, Emacs only treats the left Alt key as Meta by default, the right Alt (AltGr), is used for entering special characters .
I don't know about w32-meta-style but did you set w32-alt-is-meta? See http://www.gnu.org/software/libtool/manual/emacs/Windows-Keyboard.html
The Growl hotkeys can be changed:
https://groups.google.com/forum/#!topic/growl-for-windows/luSpf9lQQRM
To disable the hotkeys, just remove the content of the 'value' tags.
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.