适用于 Linux 的与语言无关的正确制表符代码编辑器?

发布于 2024-07-06 20:28:36 字数 1295 浏览 4 评论 0原文

我需要一个 Linux 文本编辑器来替换 Textpad 4.7.3(一个 Windows nagware 应用程序),但我尝试过的所有替代方案要么臃肿要么不完整。 以下是我认为最重要的功能,按降序排列:

  • 正则表达式搜索、标记和替换(甚至在所有打开的文件中)、目录树中的正则表达式搜索
  • 带有适当键盘快捷键的选项卡式编辑器([ctrl ]+[tab] 应该与 [alt]+[tab] 在完全相同的模型上工作
  • 自动缩进、缩进保留和缩进操作(tab、shift-tab)
  • 智能导航键:[ home] 在行开头和非空白开头之间切换,[F2] 查找下一个书签,点击向上和向下箭头键会将您带到上次导航的列,而不是上次键入的位置 (我认为 Textpad 是我见过的唯一地方)
  • 语法突出显示(奖励:混合语言突出显示,TextPad 缺乏)
  • 块选择模式
  • 从程序(例如编译器)运行用户定义的命令,具有交互式命令结果(Textpad可以让您定义正则表达式来匹配文件名和行号,这样您就可以双击错误并转到该文件中的该行。)
  • 工作区(要同时打开的文件集合)

这是我发现的我尝试过的编辑器令人厌恶:

  • Vim 和 emacs 没有充分利用我的屏幕、鼠标和键盘。 此外,还有相当长的学习曲线 - 您必须学习一种与键盘交互的全新方式。 (当然,如果他们有我想要的一切,我会学习他们。)
  • Gedit 几乎是完美的,但它(像大多数一样)有蹩脚的选项卡,这是无法忍受的
  • Eclipse 是一个怪物,而且我不会碰它,除非我正在做Java
  • 正则表达式功能是非常罕见的
  • 几乎没有什么有最后看到的选项卡遍历
  • 我没有看到任何与最后导航-列游标遍历。 (一旦我开始使用它,我发现我离不开它。)

我没有时间或所需的具体知识来构建我的“理想编辑器”,所以我希望有人在编辑器方面具有相同的品味可能偶然发现了一颗宝石。

ETA:请不要推荐您未亲自使用过的编辑器。 我听说过 SciTE、Eclipse、gedit、medit、nedit、GVim、Gemacs、Kate、Geany、Gnotepad、ozeditor 等。我确信它们中的大多数都具有我提到的一些功能。 如果您不确定它是否具有基本功能(例如 ctrl-tab 与 alt-tab 一样工作),那么您并没有真正提供帮助,不是吗?

I need a Linux text editor to replace Textpad 4.7.3 (a Windows nagware app), but all the alternatives I've tried are either bloated or incomplete. Here are the features I find most important, in descending order:

  • Regex search, mark, and replace (across all open files, even), regex search in directory trees
  • Tabbed editor with proper keyboard shortcuts ([ctrl]+[tab] should work on the exact same model as [alt]+[tab])
  • Auto-indent, indent preservation, and indent manipulation (tab, shift-tab)
  • Smart navigation keys: [home] toggles between start of line and start of non-whitespace, [F2] seeks to next bookmark, hitting the up and down arrow keys take you to the column where you last navigated, not where you last typed (I think Textpad's the only place I've seen this)
  • Syntax highlighting (bonus: mixed-language highlighting, which TextPad lacked)
  • Block select mode
  • Run user-defined commands from program (such as compilers), have interactive command results (Textpad would let you define regexes to match filenames and line numbers so you could double-click on an error and be taken to that line in that file.)
  • Workspaces (collections of files to be open at the same time)

Here's what I've found distasteful in the editors I've tried:

  • Vim and emacs do not take full advantage of my screen, mouse, and keyboard. Also, there's have quite a learning curve -- you have to learn an entirely new way of interacting with the keyboard. (Of course, if they had everything I wanted, I would learn them.)
  • Gedit is almost perfect, but it (like most of them) has crappy tabbing, which is intolerable
  • Eclipse is a monstrosity, and I won't touch it unless I'm doing Java
  • Regex capability is frighteningly rare
  • Almost nothing has last-seen tab traversal
  • I've not seen anything with last-navigation-column cursor traversal. (Once I started using it I found I couldn't do without.)

I don't have the time or the specific knowledge required to build my "ideal editor", so I'm hoping someone out there with the same taste in editors might have stumbled across a gem.

ETA: Please don't recommend an editor you haven't personally used. I've heard of SciTE, Eclipse, gedit, medit, nedit, GVim, Gemacs, Kate, Geany, Gnotepad, ozeditor, etc. I'm sure that most of them have some of the features I mentioned. If you're not sure if it has an essential feature (e.g. ctrl-tab works just like alt-tab), then you're not really helping, are you?

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

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

发布评论

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

评论(13

多情癖 2024-07-13 20:28:36

这是对 jEdit 的投票,我已经使用它大约 5 年了:

* 正则表达式搜索标记,并替换(甚至在所有打开的文件中),正则表达式 
  

在目录树中搜索

的,并返回引用,包括整个匹配的 $0

* 具有适当键盘快捷键的选项卡式编辑器 ([ctrl]+[tab] 
  

应该在相同的模型上工作
[alt]+[tab])

多种显示缓冲区的方式,以及完全可定制的键盘导航。 我最常用的功能之一是“返回到最后一个缓冲区”,我已将其映射到 F12

* 自动缩进、缩进保存和缩进操作 
  

(制表符、Shift-制表符)

是的。 您还可以将它们设置为制表符或空格并在两者之间进行转换

* 智能导航键:[home] 在行首和行首之间切换 
  

非空白开始,[F2] 寻求
下一个书签,上下打
箭头键将您带到该列
您上次导航的位置,而不是位置
你上次输入的内容(我认为 Textpad 是
我唯一见过这个的地方)

一般预期的导航。 将它们映射到您选择的键。 如果将光标置于特定列并使用向上翻页或向上箭头,光标将保持在该列中

  • 语法突出显示(奖励:
    混合语言突出显示,
    缺少文本板)

许多不同的语言都带有 xml 文件来自定义标记匹配。 一些混合,例如 php + javascript

* 块选择模式 
  

不,据我所知还没有……等等! 是的! 在编辑下 -> 更多选择-> 矩形选择。 感谢 dwhall 指出这一点

* 从程序(例如编译器)运行用户定义的命令,有 
  

交互式命令结果(文本板
可以让你定义正则表达式来匹配
文件名和行号,以便您
可以双击错误并
转到该文件中的该行。)

为此提供了许多插件,从完整的命令行控制台(在 Linux 和 Windows 中工作)到可以进行系统调用的 BeanShell 宏。 许多常见任务的插件,如 ant、cc、make、svn 等

* 工作区(同时打开的文件集合) 
  

yup 插件也适用于此,jEdit 还跟踪打开的文件、未保存的更改以及会话之间的光标位置

以下是我发现的令人反感的内容
我尝试过的编辑器:

* Vim 和 emacs 没有充分利用我的屏幕、鼠标和 
  

键盘。 另外,还有相当多的
学习曲线。 (当然,如果他们
拥有我想要的一切,我会学习
他们。)

是一个 Java 程序,但仍然很好地利用了跨平台剪贴板和拖放功能

* 正则表达式功能极其罕见 
  

jEdit 具有我见过的最好的正则表达式处理,正则表达式搜索可以返回多个结果 grep 样式,并且当您在搜索后添加或删除文本行时,结果位置不会混淆

* 几乎没有任何内容具有上次看到的选项卡遍历 
  

就像我说的,我最喜欢的功能之一是“转到最后一个缓冲区”

* 我没有看到任何带有最后导航列光标的内容 
  

遍历

正如我所说,上下翻页时光标会停留在列中

我喜欢的其他功能:

  • 基于缩进的折叠:不需要语法意识,只需在缩进上折叠
  • 并排Diff:漂亮的图形差异视图
  • 多个视图和分割窗格
  • 使用beanshell进行宏录制
  • 缩写:我有简短的2-3个字母关键字当我点击空格时会扩展为代码片段

Here is a Vote for jEdit, which I have been using for about 5 years:

* Regex search mark, and replace (across all open files, even), regex

search in directory trees

yup, and back references including $0 for the whole match

* Tabbed editor with proper keyboard shortcuts ([ctrl]+[tab]

should work on the same model as
[alt]+[tab])

multiple ways of displaying buffers, and completely customizable keyboard navigation. One of my most used function is "go back to last buffer" which I have mapped to F12

* Auto-indent, indent preservation, and indent manipulation

(tab, shift-tab)

Yup. You can also set these to be tabs or spaces and convert between the two

* Smart navigation keys: [home] toggles between start of line and

start of non-whitespace, [F2] seeks to
next bookmark, hitting the up and down
arrow keys take you to the column
where you last navigated, not where
you last typed (I think Textpad's the
only place I've seen this)

Generally expected nav. Map these to your key of choice. If you place the cursor at a particular column and page up or up arrow, the cursor stays put in that column

  • Syntax highlighting (bonus:
    mixed-language highlighting, which
    TextPad lacked)

Many different languages with xml files to customize token matching. Some mixing for example php + javascript

* Block select mode

Nope, not as far as I know...wait! Yup! Under Edit -> More Selection -> Rectangular Selection. Thanks dwhall for pointing that out

* Run user-defined commands from program (such as compilers), have

interactive command results (Textpad
would let you define regexes to match
filenames and line numbers so you
could double-click on an error and be
taken to that line in that file.)

Many plugins for this from a full command line console (works in linux and windows) to BeanShell macros that can make system calls. Many plugins for common taks such as ant, cc, make, svn etc

* Workspaces (collections of files to be open at the same time)

yup plugins for this too, and jEdit also keeps track of open files, unsaved changes and cursor position between sessions

Here's what I've found distasteful in
the editors I've tried:

* Vim and emacs do not take full advantage of my screen, mouse, and

keyboard. Also, there's quite a
learning curve. (Of course, if they
had everything I wanted, I would learn
them.)

jEdit is a java program but still makes good use of cross-platform clip boards and drag and drop

* Regex capability is frighteningly rare

jEdit has the best regex handling I've seen yet, Regex searches can return multiple results grep style and result positions aren't confused when you add or removes text lines after the search

* Almost nothing has last-seen tab traversal

Like I said one of my favorite features is "go to last buffer"

* I've not seen anything with last-navigation-column cursor

traversal

Like I said, your cursor stays put in the column when paging up and down

Other features I like:

  • indent based folding: No syntax awareness necessary, simply fold on indent
  • side-by-side Diff: nice graphical difference view
  • multple views and split panes
  • macro recording with beanshell
  • abbreviations: I have short 2-3 letter keywords that expand to code snippets when I hit space
自由如风 2024-07-13 20:28:36

Vim 和 emacs 没有充分利用我的屏幕、鼠标和键盘。

你看过 gvim 吗? 我自己是一个控制台爱好者,但我很确定它是 GUIlicious 的。

Vim and emacs do not take full advantage of my screen, mouse, and keyboard.

Have you looked at gvim? I'm a console guy myself, but I'm pretty sure it's GUIlicious.

深居我梦 2024-07-13 20:28:36

我推荐Geany(现在版本0.15)。 它具有您需要的所有(或几乎所有)功能。
查看手册找到按键(在发现它具有块选择功能之前我使用了它一年)。

I recommend Geany (version 0.15 now). It has all (or almost all) the features that you need.
Look in the manual to find the keys (I used it for a year before discovering that it had block selection).

酒与心事 2024-07-13 20:28:36

我认为你对事情的运作方式如此挑剔,犯了一个严重的错误。 您可能找不到在各个方面都完全类似于 TextPad 的东西。 您错过了一些建议的文本编辑器中的一些强大功能。

在使用 Emacs 的这些年里我学到的一件事是“你能在 Emacs 中做 X 吗”这个问题的答案是总是是! (当然,有一些极端情况是不正确的,但它基本上是现实的一个很好的近似。)所以,我意识到有人可能已经实现了一个模块来使 Emacs 更加 Windowsy(CUA-shortcuts,< kbd>Ctrl-Tab等)在谷歌搜索“emacs中的windows键”后,我发现EmacsW32。 它似乎具有您要求的许多功能:

  • 正则表达式支持:是
  • Ctrl-Tab 缓冲区切换:是
  • 自动缩进:是
  • 语法突出显示:是
  • “智能导航键”:不是直接的,但这应该可以通过简单地重新绑定正确的命令来实现。
  • 块选择:是
  • 用户定义的命令:是
  • 直接跳转到编译器错误位置:是,但如果您使用的编译器具有非标准错误格式,则可能需要调整用于提取错误消息的正则表达式
  • 工作区:是(我认为现在这已作为标准包包含在内)

并且请记住,Emacs 有一个庞大且活跃的社区,拥有大量在线资源,并且有很多人愿意帮助您定制 Emacs。 如果您缺少 Emacs 中的某个功能,很可能其他人已经实现了它!

I think you're making a serious mistake in being so extremely picky on how things should work. You will probably not find something which is exactly like TextPad in every single respect. You're missing out on some great functionality in some of the suggested text-editors.

One thing I've learned during my years using Emacs is the answer to the question "can you do X in Emacs" is always YES! (Of course, there are a few cornercases where this isn't true, but it is basically a good approximation of reality.) So, I realized that someone probably already has implemented a module for making Emacs more Windowsy (CUA-shortcuts, Ctrl-Tab, etc.) After googling on "windows keys in emacs", I found EmacsW32. It seems to have many of the features you're asking for:

  • Regexp support: Yes
  • Ctrl-Tab buffer switching: Yes
  • Auto-indent: Yes
  • Syntax highlighting: Yes
  • "Smart navigation keys": Not directly, but this should be possible with a simple rebinding of the proper commands.
  • Block select: Yes
  • User-defined commands: Yes
  • Jumping directly to compiler error locations: Yes, but if you're using a compiler with a non-standard error format, you may need to tweak the regexps used to extract error messages
  • Workspaces: Yes (I think this included as a standard package nowadays)

And remember, Emacs has a big and active community with a lot of resources online, and a lot of people who are willing to help you customizing Emacs. If you're missing a feature in Emacs, chances are someone else has already implemented it!

醉城メ夜风 2024-07-13 20:28:36

我还建议 jEdit。 它有很多功能和很多插件。

维基百科对可能也有用的文本编辑器进行了很好的比较:
http://en.wikipedia.org/wiki/Comparison_of_text_editors

I would also suggest jEdit. It has many features and many plugins.

Wikipedia has a good comparison of text editors that may be of use as well:
http://en.wikipedia.org/wiki/Comparison_of_text_editors

无敌元气妹 2024-07-13 20:28:36

你试过赛特吗?

http://www.scintilla.org/SciTE.html

您的发行版可能已经有一个软件包。

我相信有一个插件可以添加项目,但我记不起它了。 我不确定是否能够双击错误跳转到该行。

Have you tried scite?

http://www.scintilla.org/SciTE.html

Your distro might already have a package for it.

I believe there was a plugin that could add projects, but I can't remember it off the top of my head. I'm not sure about being able to double-click on errors to jump to the line.

人事已非 2024-07-13 20:28:36

您是否尝试过在 Linux 中使用 Wine 运行 Textpad?

Have you tried running Textpad in Linux with Wine?

你曾走过我的故事 2024-07-13 20:28:36

jEdit 可能就是您要找的。 它开箱即用,包含您正在寻找的相当多的内容,其余所有内容都可以在大量可用插件中找到。

jEdit might be what you're looking for. Out of the box it has quite a bit of what you're looking for, and all the rest can likely be found in the large collection of plugins available.

花想c 2024-07-13 20:28:36

我当然推荐 PowerPad 如果没有其他原因,除了我写它。

以下是 Linux 版本中的一些精彩功能:

  • 多选项卡界面
  • 基于 Python 的强大脚本语言
  • 无限制撤消
  • 自动缩进
  • 支持通过 FTP 打开和编辑文件
  • 能够打开 UTF-8 和 UTF-16 编码文件

I certainly recommend PowerPad if for no other reason than that I wrote it.

Here are some of the wonderful features you will find in the Linux version:

  • Multi-tab interface
  • Powerful scripting language based on Python
  • Unlimited undo
  • Auto-indent
  • Support for opening and editing files over FTP
  • Ability to open UTF-8 and UTF-16 encoded files
晨曦÷微暖 2024-07-13 20:28:36

您尝试过凯特吗? 我不确定它是否符合您的所有要求,但可能会。 另外,对于更面向开发的工具,您可以尝试 KDevelop,其默认编辑器是 Kate(但您可以对于实现 KTextEditor 接口的任何其他编辑器进行更改)

Have you tried Kate? I'm not sure it complies with all your requirements, but it may. Also, for a more development oriented tool, you could try KDevelop, whose default editor is Kate (but you can change for any other editor implementing the KTextEditor interface)

等往事风中吹 2024-07-13 20:28:36

notepad++ 功能齐全,我一直用它来处理所有语言!

它在 Windows 上,但显然它可以使用 WINE 在 Linux 上运行
http://notepad-plus.sourceforge.net/uk/nppLinux.php

notepad++ is full featured, I use it for all languages, all the time!

It's on windows but apparently it can be run on linux using WINE
http://notepad-plus.sourceforge.net/uk/nppLinux.php

月野兔 2024-07-13 20:28:36

ActiveState 的 Komodo Edit 有一个 Linux 版本,它可以完成您描述的大部分操作。 我已经 24/7 全天候使用它一年多了,虽然我不喜欢它,但我在 Linux 上还没有找到更好的东西。 这是他们商业产品的精简功能免费版本,如果它工作得更好,我会很想购买他们功能更多的 Komodo IDE。

它并不是真正稳定,至少在我的系统上是这样。 它经常崩溃或冻结,因此如果您尝试的话请经常保存。

我最近从 4.2 升级到了 5 版,但并没有什么改进。 他们破坏了很多东西,所以我要回到 4.2。 他们破坏的最让我伤心的是用于编辑多个文件的选项卡。 在 4.2 中,他们将 x 关闭在选项卡行的右边缘,其位置从未改变。 在 5 中,它移至活动选项卡的末尾。 现在,如果不将鼠标瞄准每个文件,就无法关闭多个文件。

我在 Komodo 之前使用过 Eclipse,Komodo 4.2 比一年前的 Eclipse 好一些。

事实上,这个回应并不是对 Komodo Edit 的认可。 我真的对此不满意,我希望你能找到一个好的编辑来解决这个问题,这样我也可以切换。

Komodo Edit by ActiveState has a linux version, and it does most of the things you describe. I've been using it 24/7 for well over a year now, and while I don't like it, I haven't found anything better on Linux. It's the reduced feature free version of their commercial product, and if it worked better I'd be tempted to buy their more-featured Komodo IDE.

It's not real stable, at least on my system. It crashes a lot or freezes, so save often if you try it.

I recently upgraded to version 5 from 4.2, and it was not an improvement. They broke a lot of things so I'm going to go back to 4.2. The main thing they broke which really makes me sad is the tabs for editing multiple files. In 4.2 they had the x to close in the right edge of the tab row, where its position never changed. In 5 it moved to the end of the active tab. Now you can't close multiple files without aiming the mouse for each one.

I used Eclipse before Komodo, and Komodo 4.2 is less bad than Eclipse was a year ago.

Really, this response isn't an endorsement of Komodo Edit. I'm really not happy with it, and I'm hoping you find a good editor with this question so I can switch too.

深府石板幽径 2024-07-13 20:28:36

我刚刚根据 Kknd 的帖子安装了 Geany,它很可爱。

我最近从 Mac 跳到了 Linux (Ubuntu),并且一直想念 BBEdit。 经过几个月在 gvim 和 gedit 之间来回切换并发现 jedit 有点笨拙之后,我相信 Geany 就是我的答案。 开箱即用,完全直观,当您开始挖掘时会发现很多好东西。

不确定它是否在 phyzome 测试中获得 A,但肯定是 A-:

完全可配置的语法/颜色主题——我刚刚安装了 Barry Van 创建的深色主题,但如果您愿意,您可以创建自己的主题。 必须承认,我从未想过混合语言突出显示是一种真正的可能性,所以不确定。

多文件搜索,正则表达式。

定向和历史选项卡导航。

很棒的自动缩进选项(不同的大括号模式,制表符与空格,您甚至可以使用制表符进行编辑并在保存时自动转换为空格!)

老实说,我并没有过多地考虑“智能导航键”(超出了基础知识),所以不能真正说明这一点,但它似乎确实有很多键盘快捷键的配置选项..?

还没有研究过块选择模式,但 Kknd 说它就在那里。

运行/编译控件,用于运行命令的虚拟终端模拟器。

工作空间... 哦! 也许不会。 它确实有一个文档侧边栏..也许某处有一个工作区插件? “添加一些东西”仍然比“从头开始构建”要好得多;)

I just installed Geany based on Kknd's post and it is SWEET.

I recently jumped from Mac to Linux (Ubuntu), and have been missing BBEdit. After months of bouncing back and forth between gvim and gedit and finding jedit kinda clunky, I believe Geany is the answer for me. Totally intuitive out of the box, lots of goodies when you start digging.

Not sure if it gets an A on the phyzome test, but certainly an A-minus:

Fully configurable syntax/color themes -- I just installed a dark theme created by Barry Van, but you can create your own if you want. Have to admit I'd never thought about mixed-language highlighting as a real possibility, so not sure about that one.

Multifile search, regex.

Directional and historical tab navigation.

Great auto-indent options (different brace modes, tabs vs spaces, you can even edit with tabs and have it autoconvert to spaces on save!)

I honestly don't think about "smart navigation keys" too much (beyond the basics), so can't really speak for that, but it does seem to have a lot of config options for keyboard shortcuts..?

Haven't looked into block-select mode yet, but Kknd says it's in there.

Run/Compile controls, Virtual Terminal Emulator for running commands.

Workspaces... doh! Maybe not. It does have a documents sidebar.. maybe there's a workspaces plugin somewhere?? "Add a couple things" is still way better than "build from scratch" ;)

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