IPython/Jupyter notebook shortcut not working on Mac - macos

I had a hard time figuring the keyboard shortcut.
Is that true that I should press Ctrl-m together and press the other key such as d to delete one cell? I tried it but it did not work for me I also tried without - but it still does not work for me :(
I am using a Mac.

You have to first toggle the right cell state.
The newer version of IPython revamped the command structure, so that cells have two states: input mode, when the cell has a green outline, and command mode, when the cell has a grey outline.
When its green you can edit the content and run it. When its grey you can use the delete insert cell or copy commands.
Hitting Enter or Return activates the green state, while using Esc activates the grey state.
For example:
To delete a cell, use Esc to go in command mode, like the grey outlined cell below, and simply press the d key twice.

On my mac, I use fn key, instead of ctrl, to make shortcuts work in iPython notebook (in Safari). For example,
fn + d + d deletes a cell (d + d works too)
fn + x cuts a cell
fn + c copies a cell
fn + z undoes an action,
and so on. As already noted above, you must press Esc before applying any of these shortcuts; that is, you first hit Esc to make a cell "grey", then you press fn + x to cut a cell.

You first press Ctrl and m (don't press the minus key), that will put the interface in command mode. For deletion you then have to press d twice.

Related

How to debug without the F buttons?

How to debug on a laptop that has different Function keys?
On a PC those buttons work, but on my laptop they don't because, for example the F9 key (which should run the program) locks the screen. The F6, F7 and F8 keys do other things, too, like locking the touchpad. I start the program with the mouse, clicking the button in the RAD Studio that says "Run", but then when it reaches the breakpoint I don't know how to start moving to the next line.
Edit: The FN button helped me. I use laptop Lenovo IdeaPad 3
Your Lenovo IdeaPad 3 has (like also Fujitsu's Lifebook) the additional key Fn on the lower left, which occurs for compact keyboard layouts (such as on laptops). Handle it like you would handle Ctrl or Shift or Alt: press and hold it down first, then the actual key you want to press.
In general multiple actions of a keyboard key are distinguished by their printed position:
bottom left: the default action - have a look at f.e. , or 8 or Home.
top left: when holding Shift - this also explains why all letters are printed in uppercase. See also how you'd press ? or > or :.
bottom right:
if you have: when holding Alt Gr - on f.e. German layouts by this you achieve pressing µ or € or ³. If you also have a Fn key then actions for for that are enclosed in a rectangle.
if no Alt Gr is available, it is meant for holding Fn (and then actions are not essentially in rectangles) - that's how you finally can press F9 and such, while the key's default action is device specific.
top right: almost only encountered outside latin alphabets, when whole input method menus need to be used.
See Wikipedia for different layout examples, including potential Fn positions.

Is there a way to copy text in git bash (on Windows) using just the keyboard?

I want to copy text, either -
the output of the previous command, OR
any text present in the bash window,
simply by navigating the cursor and selecting the text using only the keyboard. I do not want to use the mouse at all.
Is there any way to do this?
If impossible, is there any way to do this with minimal use of the mouse?
Example use case - copying the name of a branch, or a commit ID (from a previous git log or git branch) and then pasting it in a git command for switching to it.
You can check the shortcut by
with keys: > options > keys > shortcuts
or
with mouse > options > mouse > mouse functions
The solution that worked is for:
desktop keyboard: [shift] + [insert] keys to paste
laptop keyboard: [shift] + [0] keys to paste
NB: For laptops, the 0 Key at the bottom of the number pad on the upper-right corner of your keyboard will function as an Insert Key when Num Lock is turned off. That is why it is labeled with both 0 and Ins on the key itself.
I discovered an answer on another forum. One just has to enable to Ctrl + Shift + Letter keys from the bash terminal's options. One can then use Ctrl + Shift + C to copy and Ctrl + Shift + V to paste.
You can copy but can't paste text or number on Windows.
Just copy with shortcut ctrl + v. After copying, press right mouse click to paste wherever you want.
Paste will reset when press left mouse button.

Scrolling window without using Control key in Vim

Is it possible to scroll window screen without using control + U or control + D, (or control + F,B,E etc). I am aware that I can use 'j' or 'k', but that is a line by line scroll. I am looking to scroll through a larger chunk of text without using control key. I find it little inconvenient to move from home row. (May be I am thinking too much.)
I am aware that I can use /search or nG to move to a particular line. But sometimes, it is helpful to scroll through the code, without a specific line.
I am using GVim (windows). Thank you.
<C-U> / <C-D> scroll by 'scroll' number of lines. You can emulate that via
:execute 'normal!' &scroll . 'j'
This is too long to type, so you need a mapping, but that probably again would involve a modifier key. For ad-hoc scrolling, just estimate the amount of lines and type 30j.
That said, modifier keys are important in Vim (even if less than in Emacs). Maybe you should consider remapping Ctrl, for example to Caps Lock?
As I wise friend once showed me, you can use L to move cursor to the
bottom of the current window frame. Similarly, you can use H to go to
the top, or M to go to the middle, and also you can then scroll to
center the frame on the cursor location with zz.
With that, you can scroll down with L zt, and up with H zb. Half
scroll with L zz, H zz.
Better yet, if you're using spacemacs, you can use SPC N f or SPC N b to scroll forward and back. Either of which will put you in transient
state, meaning after you enter SPC N f subsequent commands are without
the prefix: f, b, u, d, until you exit the state.

How to make a multiline cursor without using a mouse in Sublime text 3?

The only way to make a multiline cursor in Sublime text 3 is Ctrl+Shift+RC+Drag. Is there any way to do this without using a mouse?
Yes, there is. Using Shift↓ or Shift↑, select the lines you want multiple cursors on. Next, hit CtrlShiftL (CommandShiftL on macOS) to split the selection into lines. Finally, hitting ← will put the cursors at the beginning of the lines, while → will put them at the end.
Edit
There is also another, quicker way (thanks to minitech) - CtrlAlt↑/↓ will create multiple cursors without having to do selections first, and you can place the cursors anywhere in the line you wish. However, on Windows these key combos may be mapped to changing the screen orientation. To change this, hit CtrlAltF12 to open the Intel control panel, click Options, and either remap the screen orientation hotkeys, or click Off on the left side to disable all of them.
You can use Middle mouse button for this as well.
Click & Hold Middle mouse button and drag up and down
Standard key bindings not work for me(Ubuntu 16.4 and Win 10), but after redefining works good! To redefine default key bindings use (Preferences->Key Bindings)
{ "keys": ["alt+shift+down"], "command": "select_lines", "args":{"forward": true} } will add cursor below, { "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} } will add cursor above.
MAC: ctrl ( ^ ) + Shift + up / down arrow
ctrlShiftup arrow
ctrlShiftdown arrow
What works for me on a window 10 Surface Pro is
Ctrl + Alt + up/down
Because Ctrl + Alt + up/down already works for me, there is no need to do another key binding. I have it set up the same way for VS Code as well: Ctrl + Alt + up/down.
Or you can also map it as Yaroslav says (which I voted up), which works as well.
In Ubuntu, the accepted answer works. Also, you can do:
Shift + Alt + Key up/down
It was much simpler for me than any other answers above: Just hold ctrl and click on your mouse placing it where you want to have the second or third cursor.

How can I block select in Geany?

I often need to select a block of text, like a leading character that occurs on many lines. LibreOffice has block selection. How can I do this in Geany?
For example, I want to remove the pipe and the space at the beginning of each line:
| Create another 'Login Role' for the 'auth' user:
| Role name: auth
| Password: auth
| Role privileges: Create database objects
It's called "column mode editing". Look here:
http://www.geany.org/manual/current/index.html#column-mode-editing-rectangular-selections
Column mode editing (rectangular selections)
There is basic support for column mode editing. To use it, create a
rectangular selection by holding down the Control and Shift keys (or
Alt and Shift on Windows) while selecting some text. Once a
rectangular selection exists you can start editing the text within
this selection and the modifications will be done for every line in
the selection.
It is also possible to create a zero-column selection - this is useful
to insert text on multiple lines.
Peter Mortensen has documented how to configure this on Lubuntu (for LXQt):
https://pmortensen.eu/world2/2020/03/29/using-geany/#Column_mode_blues
On Lubuntu, the keyboard shortcuts for selecting a rectangular area of
text (“column mode” in UltraEdit) do not work, because they conflict
with four default keyboard shortcuts in the window manager (LXDE?
Openbox?), Shift + Alt + arrow up, Shift + Alt + arrow down,
Shift + Alt + arrow left, and Shift + Alt + arrow right.
Disable the window manager keyboard shortcuts by editing file
~/.config/openbox/lubuntu-rc.xml near “S-A-Up”, “S-A-Down”,
“S-A-Left”, and “S-A-Right”. For example, change “S-A-Up” to
“S-A-Up99”, “S-A-Down” to “S-A-Down99”, “S-A-Left” to “S-A-Left99”,
and “S-A-Right” to “S-A-Right99”, respectively. And add an XML comment
as to why and document the original values (so they can more easily be
reverted). Edit and update (without a restart required):
vi ~/.config/openbox/lubuntu-rc.xml
openbox --reconfigure
It was tested with Lubuntu 18.04 (32 bit).
In Debian the following works for me: press only the Ctrl key and select by the mouse (not both Ctrl and Shift keys, as described in the manual).
In Ubuntu MATE (Geany 1.25) I can use Shift + Alt and then mark the text using arrow keys.
I think, Ctrl + Shift + mouse(!). It's working correct on Ubuntu with Geany 1.23.1. Please use the mouse, not the arrow keys.
Ctrl + Shift + Mouse on CentOS 7.3.
For me the key shortcuts are different. After installing the Extra Selection Geany plugin, I can use:
Alt + Shift + C (and then use the up, down, etc. arrow keys to move the cursor; edit the text; and then repeat Alt + Shift + C to go back to 'normal' edit mode).
More information is here.
(I use VirtualBox with Xubuntu 16.04.4 LTS (Windows 10 host).)

Resources