如何在记事本中一次缩进多行?

发布于 2024-08-05 22:20:56 字数 291 浏览 4 评论 0原文

在许多面向程序员的文本编辑器中,如果用户的选择范围超过 1 行并按下 TAB 键,这些行将缩进 1 TAB (或多个空格,具体取决于编辑器的配置方式)。

然而,这似乎不是 Notepad++ 的默认行为。有没有一种方法可以在 Notepad++ 中执行此操作,或者是否有一个插件可以让我执行此操作?

编辑:经过额外测试,SHIFT-TAB正确地按预期取消缩进行,但只有制表符只是在克拉所在的位置插入制表符。这是 5.4.5 Unicode 版本中的

In many text editors that are aimed at programmers, if the user has a selection that spans more than 1 line and presses the TAB key, those lines are indented by 1 TAB (or a number of spaces, depending on how the editor is configured).

However, this does not seem to be the default behavior of Notepad++. Is there a way I can do this in Notepad++, or is there a plugin that I can get to allow me to do this?

Edit: Upon additional testing, SHIFT-TAB correctly un-indents the lines as expected, but only a tab simply inserts a tab wherever the carat is. This is in version 5.4.5 Unicode

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

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

发布评论

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

评论(10

绳情 2024-08-12 22:20:56

问题出在 QuickText 插件上。删除后,缩进工作正常。

The problem was with the QuickText plugin. After removing it, indent worked as normal.

甜`诱少女 2024-08-12 22:20:56

Capslock + Tab 一次缩进多行。首先突出显示文本。

Capslock + Tab to indent multiple lines at once. Highlight the text first.

柠栀 2024-08-12 22:20:56

新版本的 QuickText 的问题似乎是它被设置为对 TAB 键做出反应。以前它被设置为使用 CTRL-ENTER。如果您更改快捷方式映射器中的组合键,那么您的 TAB 键应该再次开始工作,并且 QuickText 也应该可以工作(使用您分配的任何新键)。

The problem with the new version of QuickText seems to be that it is set to react to the TAB key. Previously it was set to use CTRL-ENTER. If you change the key combination in the shortcut mapper then your TAB key should start working again, and QuickText should also work (with whatever new key you've assigned).

毁梦 2024-08-12 22:20:56

它适用于我的 Notepad++ v.5.4.5。我只需选择多行并按 TAB

如果您希望将 TAB 替换为 SPACE,则需要转到“设置”>;首选项并选择编辑组件选项卡。接下来选中“选项卡设置”部分中的“用空格替换”复选框。

更新:在较新版本的 Notepad++ 中,此选项位于“设置”>“首选项>语言部分。

It works fine for my v. 5.4.5 of Notepad++. I just select multiple lines and press TAB.

If you want TAB to be replaced by SPACE than you need to go Settings > Preferences and select Edit Components tab. Next check Replace by spaces check box in Tab Setting section.

Update: In a newer version of Notepad++ this option is in Settings > Preferences > Language section.

扛刀软妹 2024-08-12 22:20:56

如果您使用 QuickText 并且喜欢按 Tab 键,则可以更改缩进键。

转到设置> Shortcup 映射器>闪烁指挥部。看一下数字 10。

  • 我将 10 更改为:CTRL + ALT + RIGHT,将
  • 11 更改为:CTRL+ ALT+

现在我认为它甚至比默认的 TABL / SHIFT + TAB 更好。

If you're using QuickText and like pressing Tab for it, you can otherwise change the indentation key.

Go Settings > Shortcup Mapper > Scintilla Command. Look at the number 10.

  • I changed 10 to : CTRL + ALT + RIGHT and
  • 11 to : CTRL+ ALT+ LEFT.

Now I think it's even better than the TABL / SHIFT + TAB as default.

南城旧梦 2024-08-12 22:20:56

我有 Notepad++ 5.3.1 (UNICODE)。我没有施展任何魔法,正如你所描述的那样,它对我来说效果很好。

也许这取决于(编程/标记/...)“语言”?

I have Notepad++ 5.3.1 (UNICODE). I haven't done any magic and it works fine for me as described by you.

Maybe it depends on the (programming/markup/...) "Language"?

顾北清歌寒 2024-08-12 22:20:56

只需安装NppAutoIndent插件,选择<强>插件> Npp自动缩进>忽略语言,然后插件> Npp自动缩进>智能缩进

Just install the NppAutoIndent plug-in, select Plugins > NppAutoIndent > Ignore Language and then Plugins > NppAutoIndent > Smart Indent.

何以笙箫默 2024-08-12 22:20:56

如果您手动缩进块中的第一行,Notepad++ 将仅自动插入后续缩进;否则您可以在事后使用 TextFX > 重新缩进您的代码TextFX 编辑>重新缩进 C++ 代码。

Notepad++ will only auto-insert subsequent indents if you manually indent the first line in a block; otherwise you can re-indent your code after the fact using TextFX > TextFX Edit > Reindent C++ code.

無處可尋 2024-08-12 22:20:56

在 Notepad++v6.1.8 (Unicode) 中,它在删除 QuickText 插件后起作用。

in Notepad++v6.1.8 (Unicode) it works after removing the QuickText plugin.

森林迷了鹿 2024-08-12 22:20:56

要增加缩进 - 按住 TAB


要减少缩进 - 按住 TAB + SHIFT

To increase indent - Press and hold TAB


To decrease indent - Press and hold TAB + SHIFT

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