用于选择矩形内文本的编辑器

发布于 2024-08-02 22:12:29 字数 220 浏览 2 评论 0原文

我经常发现自己在处理某些文本时想要排除文本的特定部分,例如 40 行的前三个字符。我能想到的最快方法是绘制一个矩形并复制文本。我主要使用 Windows,但我确信 grep 或类似的东西可以用少量代码来完成此操作。我最好的方法是打开命令提示符。然后运行“编辑”(是的,旧的)。然后将文本粘贴到那里(这实际上需要大量时间)。然后我就可以选择我想要的矩形。

还有其他编辑器支持这个功能吗?我熟悉Notepad++。

Often I find myself with some text where I want to exclude a certain part of the text, say the first three characters of 40 lines. The fastest way I could think of to do this would be to draw a rectangle and copy the text. I am mostly using Windows, but I am sure grep or something similar could do this with a tiny bit of code. My best way of doing this is to open Command Prompt. Then run "Edit" (yes the good old one). Then paste the text in there (this actually takes a significant amount of time). Then I am able to select the rectangle I am after.

Is there any other editors that support this feature? I am familiar with Notepad++.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

惯饮孤独 2024-08-09 22:12:30

您可以在使用鼠标或 (Shift +) 光标键进行选择之前按 Alt 键,在 Visual Studio 中选择要剪切/复制的矩形区域。请参阅如何:选择和更改文本

You can select a rectangular area to cut/copy in Visual Studio be pressing the Alt key prior to making your selection with the mouse or (Shift +) cursor keys. See How to: Select and Change Text.

池木 2024-08-09 22:12:30

Zeus 编辑器可以进行键盘驱动的剪切/复制和粘贴。

另外,默认的 Zeus 鼠标标记处于模式。

The Zeus editor can do keyboard driven column cut/copy and paste.

Also the default Zeus mouse marking is in column mode.

深海夜未眠 2024-08-09 22:12:30

如果您使用 Vim,Ctrl + V 将让您选择一个矩形文本块。

文档Ctrl + Q 将允许您在 mswin 兼容性中进行矩形选择。

If you use Vim, Ctrl + V will let you select a rectangular block of text.

The documentation says Ctrl + Q will let you do a rectangular select in mswin compatibility.

趴在窗边数星星i 2024-08-09 22:12:30

Emacs 支持 kill-rectangle(默认绑定到 Cx r k)和 yank-rectagle (Cx r y)实现这一点。另外可能感兴趣的是delete-extract-rectangle(无默认绑定,用于编程使用)。

您可以通过导航到感兴趣区域的一个角落,点击 C- 设置标记,导航到对角,然后调用所需的功能来使用它。

Emacs supports kill-rectangle (bound to C-x r k by default) and yank-rectagle (C-x r y) to achieve this. Also of possible interest is delete-extract-rectangle (no default binding, and intended for programming use).

You use it by navigating to one corner of the interesting area, hitting C-<space> to set the mark, navigating to the opposite corner, and invoking the desired function.

绮筵 2024-08-09 22:12:30

UltraEdit 有列模式(菜单列/列模式、键盘
快捷键Alt + C)。这样就可以仅使用键盘(鼠标也可以)进行块选择、删除、按列插入等。

对于您的示例:在第 1 列位置选择 40 行的零宽度选择,然后按 Delete 三次。或者只需选择 3 x 40 块并按 Delete

UltraEdit has a column mode (menu Column/Column Mode, keyboard
shortcut Alt + C). This makes it possible to make block selections, delete, insert column-wise, etc. using only the keyboard (the mouse works too).

For your example: make a zero width selection at column position 1 for the 40 lines and press Delete three times. Or simply make the 3 x 40 block select and press Delete.

蓝戈者 2024-08-09 22:12:30

这可以使用 JGSoft 的 Editpad 来完成,它有一个没有损坏的免费软件精简版本。

This can be done using JGSoft's Editpad which has a freeware lite version that is not crippled.

从此见与不见 2024-08-09 22:12:30

您可以使用 NEdit(适用于 Windows)来执行此操作。按住 Ctrl 并拖动鼠标(左键单击)以选择矩形。

在 Linux 中,您也可以只使用 cut

cut -b4- file

它将删除每行的前三个字符并将结果打印到标准输出。

You can do this with NEdit (which is available for Windows). Hold down Ctrl and drag the mouse (left-click) to select rectangles.

In Linux, you could also just use cut:

cut -b4- file

It will remove the first three characters from every line and print the result to standard output.

唔猫 2024-08-09 22:12:30

jEdit 支持垂直选择(键盘快捷键是 Alt + \)。它还可以进行多个非连续选择(键盘快捷键是 Ctrl + \)。当您键入时,它会影响所有选择,因此您可以同时编辑多行,或同时编辑多个位置的同一行。或者两者兼而有之。

还支持垂直粘贴。这是我一直使用的功能。它使编辑列变得轻而易举。

如果您有太多行无法轻松选择,那么 jEdit 的查找和替换就足够了。

jEdit 是一个 Java 应用程序,因此比大多数编辑器使用更多的系统资源。但另一方面,它适用于大多数系统,并且有大量插件可以使文本编辑更加高效。

jEdit supports vertical selections (keyboard shortcut is Alt + \). It can also do multiple, non-continuous selections (keyboard shortcut is Ctrl + \). And when you type it affects all selections, so you can edit multiple lines at the same time, or the same line in more than place simultaneously. Or both.

Vertical pasting is also supported. This is a feature I use all the time. It makes editing columns a breeze.

If you have too many lines to select easily, then jEdit's Find And Replace is as good as it gets.

jEdit is a Java application, and so uses more system resources than most editors. But on the other hand it works on most systems, and it has loads of plug-ins to make editing text more efficient.

盛夏已如深秋| 2024-08-09 22:12:30

在 IntelliJ 中,转到“编辑”,然后单击“列选择模式”。或者使用 ALT+SHIFT+INSERT 快捷键。

In IntelliJ, go to Edit and then click on Column Selection Mode. Or use the ALT+SHIFT+INSERT shortcut.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文