How can I block select in Geany? - textselection

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).)

Related

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.

How to set keybinding to move (rearrange) tabs in Atom?

I'm trying to setup keybinding for physically moving my current tab, either right or left of other tabs (rather than click and drag to rearrange them).
I know user defined keybindings are added to ~/.atom/keymap.cson, I'm just having trouble determining the command as I don't see it present in the default keybindings.
I found that Atom has a native keybinding set for this under as:
ctrl + shift + ←: pane:move-item-left
ctrl + shift + →: pane:move-item-left
The native bindings weren't showing up in Settings > Keybindings. Here they are:
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-]': 'window:move-active-item-to-pane-on-right'
'ctrl-alt-[': 'window:move-active-item-to-pane-on-left'
You can take a look at Tab Move Key package. It is simple, you can use alt page up and alt + page down for moving tabs around.
command + [ = to move the block left by 1 tab
command + ] = to move the block right by 1 tab

Is there a way to do multiline editing a-la Visual Studio in Sublime?

Visual Studio allows selecting a vertical piece of text, and then editing it. One has to hold Shift + Alt and move the cursor up-down left-right to make the selection.
I know there is Ctrl + D multi-cursor thing in Sublime, but it's not quite the same.
So is there a way to do the multi-line editing a-la Visual Studio in Sublime?
Move cursor where you want, hold ctrl + shift press ↓ a few times.
Press tab, then ← twice, type "Hello World,",
Press esc to leave multi-line mode.
You also can perform "square selection" using your mouse middle button.
Answer: Standard way: Ctrl + Alt + Cursor (which flips the screen orientation on my laptop). The way that works: Keyboard Column Selection for Sublime Text 2 on Windows

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.

"Right Click" keyboard short cut for Visual Studio?

I'm trying to force myself to use as little mouse as possible and I can't find the answer to this simple short-cut anywhere! Here the the steps:
Open up Visual Studio. Open any C# file (or any code file I believe)
Point your mouse anywhere on the
window/file.
Right Click
Is there a shortcut key for this so I don't have to move my hand to the mouse?
Taken from lytebyte, you've got two options:
Shift + F10
That nutty key on the bottom-right of a modern Windows keyboard, the Menu key
Depends on where/why you're right-clicking.
The context-menu key is on the right of the keyboard nowadays, usually between the Windows key and the Control key on the right of your spacebar. That will open the context menu wherever the current focus is (usually in the text editor).
If you're using the right mouse button just to open the refactoring tools, you can use Ctrl + . (control period) to pop open the "smart tag" on any identifier. That'll get you the "generate method stub" menu item and the like.
To open a new file without keyboard you can use
CTRL + SHIFT + N (Using Resharper)
To show up the right click menu for any part of your code. Point to the part that you want and use
SHIFT + F10
Normally, I like using
CTRL + SHIFT + G (Resharper again)
for getting the Navigation menu (Usage, Base, Implementation, etc)
Even better if you want to go to any Method/class/intenal/or a field, use CTRL + SHIFT + ALT + N (Again using Resharper), this will bring you a list of all that match your criteria to choose from.
Does your keyboard have the extra 'Windows' keys, ie. the Windows logo (Start key) and the one on the right-hand side of the spacebar that looks like a menu? Cause that button on the right-hand side is the 'Context menu key'.
See the key between the right-hand side 'Windows' key and the Ctrl key?
Windows Keyboard layout
If your keyboard is less than 10 years old you should have these keys, unless you have an IBM laptop or a Mac.!
Assuming you just want a key you can press to right click, most\many keyboards have a key between alt and ctrl that right clicks.

Resources