Python Jupyter 快捷方式不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38195536/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:29:25  来源:igfitidea点击:

Jupyter Shortcut not working

pythonjupyterjupyter-notebook

提问by Curious Lad

I am working my code on Jupyter(Python). Normally, the shortcut to insert cell below is 'b' and for above is 'a', but when I do that search bar opens instead of insertion of cell.Jupyter shortcut problem

我正在 Jupyter(Python) 上运行我的代码。通常,下面插入单元格的快捷方式是“b”,上面是“a”,但是当我这样做时,搜索栏会打开,而不是插入单元格。Jupyter快捷方式问题

回答by Alex Chojnacki

I had this issue and it turned out that my Chrome plugin (Vimium) was intercepting keypresses before Jupyter could capture them.

我遇到了这个问题,结果是我的 Chrome 插件 (Vimium) 在 Jupyter 捕获按键之前拦截了它们。

In my case, I just added a rule to the plugin to disable it on my common notebook urls, like localhost:8888.

就我而言,我只是在插件中添加了一条规则,以在我的常用笔记本网址上禁用它,例如localhost:8888.

回答by Ani Menon

Your issue is probably because of your browser settings. bmust be set to something else or you are not on command mode.

您的问题可能是因为您的浏览器设置。b必须设置为其他内容,否则您不在命令模式下

Jupyter shortcuts:

Jupyter 快捷方式:

Command Mode (press Esc to enable)

Enter : enter edit mode

Shift-Enter : run cell, select below

Ctrl-Enter : run cell

Alt-Enter : run cell, insert below

Y : to code

M : to markdown

R : to raw

1 : to heading 1

2 : to heading 2

3 : to heading 3

4 : to heading 4

5 : to heading 5

6 : to heading 6

Up : select cell above

K : select cell above

Down : select cell below

J : select cell below

A : insert cell above

B : insert cell below

X : cut selected cell

C : copy selected cell

Shift-V : paste cell above

V : paste cell below

Z : undo last cell deletion

D,D : delete selected cell

Shift-M : merge cell below

S : Save and Checkpoint

Ctrl-S : Save and Checkpoint

L : toggle line numbers

O : toggle output

Shift-O : toggle output scrolling

Esc : close pager

Q : close pager

H : show keyboard shortcut help dialog

I,I : interrupt kernel

0,0 : restart kernel

Space : scroll down

Shift-Space : scroll up

Shift : ignore

命令模式(按 Esc 启用)

Enter : 进入编辑模式

Shift-Enter :运行单元格,在下面选择

Ctrl-Enter :运行单元格

Alt-Enter :运行单元格,在下方插入

Y : 编码

M : 降价

R : 生

1 : 到标题 1

2 : 到标题 2

3 : 到标题 3

4 : 到标题 4

5 : 到标题 5

6 : 到标题 6

上:选择上面的单元格

K : 选择上面的单元格

向下:选择下面的单元格

J : 选择下面的单元格

A : 在上面插入单元格

B : 在下方插入单元格

X : 剪切选中的单元格

C : 复制选中的单元格

Shift-V :粘贴上面的单元格

V : 在下方粘贴单元格

Z : 撤销最后一个单元格删除

D,D : 删除选中的单元格

Shift-M :合并下面的单元格

S : 保存和检查点

Ctrl-S : 保存和检查点

L : 切换行号

O : 切换输出

Shift-O : 切换输出滚动

Esc : 关闭寻呼机

问:关闭寻呼机

H : 显示键盘快捷键帮助对话框

I,I : 中断内核

0,0 : 重启内核

空格:向下滚动

Shift-Space : 向上滚动

Shift : 忽略



Edit Mode (press Enter to enable)

Tab : code completion or indent

Shift-Tab : tooltip

Ctrl-] : indent

Ctrl-[ : dedent

Ctrl-A : select all

Ctrl-Z : undo

Ctrl-Shift-Z : redo

Ctrl-Y : redo

Ctrl-Home : go to cell start

Ctrl-Up : go to cell start

Ctrl-End : go to cell end

Ctrl-Down : go to cell end

Ctrl-Left : go one word left

Ctrl-Right : go one word right

Ctrl-Backspace : delete word before

Ctrl-Delete : delete word after

Esc : command mode

Ctrl-M : command mode

Shift-Enter : run cell, select below

Ctrl-Enter : run cell

Alt-Enter : run cell, insert below

Ctrl-Shift-Subtract : split cell

Ctrl-Shift-- : split cell

Ctrl-S : Save and Checkpoint

Up : move cursor up or previous cell

Down : move cursor down or next cell

Shift : ignore

编辑模式(按 Enter 启用)

Tab:代码完成或缩进

Shift-Tab : 工具提示

Ctrl-] :缩进

Ctrl-[ : dedent

Ctrl-A : 全选

Ctrl-Z :撤消

Ctrl-Shift-Z : 重做

Ctrl-Y : 重做

Ctrl-Home :转到单元格开始

Ctrl-Up : 转到单元格开始

Ctrl-End : 转到单元格结尾

Ctrl-Down :转到单元格结尾

Ctrl-Left : 左移一个字

Ctrl-Right :向右移动一个词

Ctrl-Backspace : 删除之前的单词

Ctrl-Delete : 删除后的单词

Esc : 命令模式

Ctrl-M:命令模式

Shift-Enter :运行单元格,在下面选择

Ctrl-Enter :运行单元格

Alt-Enter :运行单元格,在下方插入

Ctrl-Shift-Subtract : 拆分单元格

Ctrl-Shift-- : 拆分单元格

Ctrl-S : 保存和检查点

向上:向上移动光标或上一个单元格

向下:向下移动光标或下一个单元格

Shift : 忽略

回答by Kohn1001

This is the solution if you have Vimium installed. just add rule to ignore B, attached enter image description here

如果您安装了 Vimium,这就是解决方案。只需添加规则以忽略 B,附加在此处输入图片说明

Add all the shortcuts you want to work (hit esc key prior to every command):

添加您想要使用的所有快捷方式(在每个命令之前按 esc 键):

  1. shift + enter run cell, select below.
  2. ctrl + enter run cell.
  3. option + enter run cell, insert below.
  4. A insert cell above.
  5. b/B insert cell below.
  6. C copy cell.
  7. V paste cell.
  8. D , D delete selected cell.
  1. shift + enter 运行单元格,在下面选择。
  2. ctrl + 输入运行单元格。
  3. 选项 + 输入运行单元格,在下方插入。
  4. 上面插入一个单元格。
  5. b/B 在下方插入单元格。
  6. C 复制单元格。
  7. V 粘贴单元格。
  8. D , D 删除选中的单元格。

回答by Landmaster

I figured this out! It has to do with a chrome extension blocking your jupyter shortcuts. You can test this by opening http://localhost:8888/notebooksin another browser.

我想通了!它与阻止您的 jupyter 快捷方式的 chrome 扩展有关。您可以通过在另一个浏览器中打开http://localhost:8888/notebooks进行测试。

In my case, I'd installed a chrome extension called Vimium, which was messing everything up.

就我而言,我安装了一个名为 Vimium 的 chrome 扩展,它把一切都搞砸了。

回答by Gautham Kumaran

In windows 10, it was this application - Easy Windows Switcherthat was causing the problem.

在 Windows 10 中,正是这个应用程序 - Easy Windows Switcher导致了问题。

回答by yunzhan

I meet the same problem, and I google it. I found answer from here. You just update your jupyter through pip install -U jupyter. Maybe it works.(if you install jupyter from anaconda,you can use conda update jupytercommand.)

我遇到了同样的问题,我谷歌了一下。我从这里找到了答案。您只需通过pip install -U jupyter. 也许它有效。(如果你从 anaconda 安装 jupyter,你可以使用conda update jupyter命令。)