如何在Geany中进行块选择?

28

我经常需要选择文本块,例如出现在许多行上的前导字符。LibreOffice具有块选择功能。那么我如何在Geany中执行此操作?

例如,我想要删除每行开头的|和空格:

| Create another 'Login Role' for the 'auth' user:
| Role name: auth
| Password: auth
| Role privileges: Create database objects

Alt + Shift + (拖动鼠标). - tod
@tod:可以不用鼠标完成此操作:Shift + Alt + 箭头键。 - Peter Mortensen
6个回答

21
它被称为“列模式编辑”。看这里:

列模式编辑(矩形选择)

支持基本的列模式编辑。要使用它,请按住Control和Shift键(或Windows上的Alt和Shift键)选择文本以创建矩形选择。一旦存在矩形选择,您可以开始在该选择中编辑文本,修改将应用于选择中的每一行。

还可以创建零列选择-这对于在多行上插入文本很有用。


彼得·莫滕森记录了如何在Lubuntu(适用于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).


1
我已经记录了如何进行Lubuntu的配置更改(针对LXQt)。 - Peter Mortensen

11
Debian中,以下方法适用于我:只需按下Ctrl键,然后通过鼠标选择(不要像手册中描述的那样同时按下CtrlShift键)。

6
Ubuntu MATE(Geany 1.25)中,我可以使用Shift + Alt,然后使用箭头键标记文本。

4
我认为,Ctrl+Shift+鼠标(!)。在使用Geany 1.23.1和Ubuntu系统时可以正确工作。请使用鼠标而不是箭头键。

3

Ctrl + Shift + Mouse on CentOS 7.3.


0

对我来说,关键快捷键是不同的。安装了 Extra Selection Geany 插件后,我可以使用:

Alt + Shift + C(然后使用上下箭头等箭头键移动光标;编辑文本;再次使用 Alt + Shift + C 返回“常规”编辑模式)。

更多信息在这里

(我使用 VirtualBoxXubuntu 16.04.4 LTS(Windows 10 主机)。)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接