单元格分组层次结构的键盘导航?
我发现单元格分组对于组织我的笔记本非常有用。我一直通过在笔记本右侧的括号中单击鼠标来浏览此层次结构,但这有点乏味,并且需要一些手眼协调能力,而这种协调能力在凌晨时分会降低。我真的很希望能够使用键盘进行导航,但我无法使用我能找到的任何快捷方式来做到这一点。我一般用的是Mac版的Mm。
箭头键(或 Ctl-F、B、P、N a la emacs)将在显示的单元格和 Ctl- 之间移动光标。将选择封闭组,本质上是按照我希望的方式向上移动组层次结构。 Cmd-' 将打开/关闭一个组。然而,我还没有找到一种方法来在分组中移动 - 主要是,例如,在同一级别上向前和向后移动选择,但也可能向下移动一个级别。我错过了快捷方式还是有更好的方法来导航层次结构?
我想到的具体问题如下:
假设我有一个单元格集合,分为 A、B 和 C 部分,每个 A1、A2、B1、B2 中都有小节,单元格为 A1a、A1b 等。如果我' m 在单元格 A1a 中我可以使用 ctl-。依次选择更高的分组 - 例如,从 A1a 到 A1 到 A。现在我已经选择了整个 A 部分。我想做的是移动到 C 部分。如果我使用箭头键,我将前进到所选 A 之后任何级别的下一个显示单元格(与这些单元格之间的插入点交替)。但我想做的是在相同的(部分)级别前进 - 到 B 部分,然后到 C 部分。然后也许将选择下降到小节级别 - C1 - 并前进到 C3。
这没什么大不了的,但我像这样分层排列我的较长笔记本,以反映我头脑中的逻辑组织,并且更像我在思考问题一样导航笔记本会非常方便。
I find cell grouping very useful in organizing my notebooks. I've been navigating this hierarchy by clicking with the mouse in the brackets on the right hand side of the notebook, but that's kind of tedious and requires some hand-eye coordination that degrades in the early morning hours. I'd really like to be able to navigate with the keyboard, but I've been unable to do this with any shortcuts that I could find. I usually use the Mac version of Mm.
The arrow keys (or Ctl-F,B,P,N a la emacs) will move the cursor between cells displayed, and Ctl-. will select enclosing groups, essentially moving up the group hierarchy as I wish to do. And Cmd-' will open/close a group. However, I've not found a way to otherwise move through the groupings - primarily, say, moving the selection forward and backward at the same level but perhaps also down a level. Have I missed a shortcut or is there a better way to navigate the hierarchy?
The specific problem I have in mind is the following:
Suppose I have a collection of cells, grouped in sections A, B and C with subsections in each A1, A2, B1, B2, with cells A1a, A1b, etc. If I'm in cell A1a I can use ctl-. to select successively higher groupings - from A1a to A1 to A, for example. Now I have the whole A section selected. What I would like to do is to move to section C. If I use the arrow keys, I will advance to the next displayed cell at any level after the selected A (alternating with insertion points between those cells). But what I would like to do is to advance at the same (Section) level - to section B, then to section C. And then perhaps to drop the selection down to the subsection level - C1 - and advance to C3.
Its not a big deal, but I arrange my longer notebooks hierarchically like this to reflect a logical organization in my mind, and it would be very convenient to navigate the notebook more like I am thinking about the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不太清楚你到底想要什么,但这可能对你有帮助。
如果选择单元格括号并使用箭头键,您将选择附近的单元格括号。
如果您改为选择单元格内并使用箭头键,您将首先在单元格内移动,然后在附近的单元格内移动。
如果您想移动选定的单元格到其他位置:
这样您就可以快速更改单元格层次结构和顺序
It is not too clear to me exactly what you want, but this might help you.
If you select a cell bracket and use the arrow keys, you will select a nearby cell bracket.
If you instead select inside a cell and use the arrow keys you will move inside the cell first and then inside nearby cells.
If you want to move a selected cell somewhere else:
This way you can quickly alter the cell hierarchy and order
您可以通过编辑
MenuSetup.tr
或KeyEventTranslations.tr
添加至少部分您想要的功能。这些是重要的系统文件,所以要小心。首先将要编辑的文件从$InstallationDirectory
复制到同一树中的$UserBaseDirectory
。这应该看起来像:现在,在新位置编辑文件,您可以添加菜单项和键盘命令。在
Menu["&Cell",
部分下,请注意括号和逗号,我添加:这将在 Cell 下添加一个新的菜单项,以及一个用于移动到下一个 CellGroup 的新键盘命令:Ctrl+.。这应该允许您从一个突出显示的单元格组(例如一个部分)移动到同一级别的下一组。这是最容易实现的命令。我可能会返回到此尝试实现其他一些命令,或者您可以自己尝试使用
SelectionMove
的参数来看看可以做什么。You can add at least part of the functionality you want through editing
MenuSetup.tr
orKeyEventTranslations.tr
. These are important system files, so be careful. Start by copying the file you are going to edit from the$InstallationDirectory
to$UserBaseDirectory
in the same tree. This should look something like:Now, editing the file in the new location, you can add menu items and key commands. Under the
Menu["&Cell",
section, being careful to respect brackets and commas, I add:This adds a new menu item under Cell, and a new keyboard command to move to the next CellGroup: Ctrl+.. This should allow you to move from one highlighted cell group, such as a section, to the next group at the same level. This is the easiest of the commands to implement. I may return to this to try to implement some of the other commands, or you may experiment yourself with the arguments of
SelectionMove
to see what can be done.