Git Product home page Git Product logo

jupyterlab-vim's Introduction

jupyterlab-vim

npm version Build Status npm downloads

Notebook cell vim bindings

jlabvim

Special Thanks

I want to acknowledge Alisue and his excellent work creating vim bindings for Jupyter notebooks. I hope this extension can meet the high bar his work set.

Modes

This extension splits Jupyter edit mode into two modes: Vim command mode and Vim insert mode. Three editing modes now exist: Jupyter command, Vim command, and Vim insert.

Install

Prerequisites

  • JupyterLab 1.0

Install or upgrade

jupyter labextension install jupyterlab_vim

Uninstall

jupyter labextension uninstall jupyterlab_vim

Key Bindings

Please note that all keys are lowercase unless Shift is explicitly indicated. For example, Y, Y is two lowercase ys, Shift-Y, Y is one uppercase Y followed by a lowercase y.

Shortcuts this extension introduces:

Vim Ex commands

Command Action
:w[rite] Save Notebook
:q[uit] Enter Jupyter command mode

Vim command bindings

Chord Action
Ctrl-O, U Undo Cell Action
- Split Cell at Cursor
Ctrl-O, - Split Cell at Cursor
Ctrl-O, D Cut Cell
Ctrl-O, Y Copy Cell
Ctrl-O, P Paste Cell
Ctrl-Shift-J Extend Marked Cells Below
Ctrl-Shift-K Extend Marked Cells Above
Ctrl-O, O Insert Cell Below
Ctrl-O, Ctrl-O Insert Cell Above
Ctrl-J Select Cell Below
Ctrl-K Select Cell Above
Ctrl-O, G Select First Cell
Ctrl-O, Ctrl-G Select Last Cell
Ctrl-E Move Cell Down
Ctrl-Y Move Cell Up
Ctrl-O, Z, Z Center Cell
Ctrl-G Show Tooltip
Command/Ctrl-1 Code Cell Mode
Command/Ctrl-2 Markdown Cell Mode
Command/Ctrl-3 Raw Cell Mode
Shift-Escape Leave Vim Mode

Jupyter command bindings

Chord Action
G, G Select First Cell
Shift-G Select Last Cell
D, D Delete Cell
Y, Y Yank (Copy) Cell
P Paste Cell
Shift-P Paste Cell Above
O Insert Cell
Shift-O Insert Cell Above
U Undo Cell Action
Ctrl-E Move Cells Down
Ctrl-Y Move Cells Up
Z, Z Center Cell

Contributing

Contributions and feedback are most welcome!

Development

For a development install (requires npm version 4 or later), do the following in the repository directory. Please note, you need to make sure that you satisfy all the prerequisites, i.e. the JupyterLab version.

jlpm install
jlpm run build
jupyter labextension link .

To rebuild the package and the JupyterLab app:

jlpm run build
jupyter lab build

jupyterlab-vim's People

Contributors

ah- avatar blink1073 avatar jwkvam avatar llinfeng avatar mistervulcan avatar stsievert avatar willprice avatar wmayner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyterlab-vim's Issues

Installation not working on node 10.4, works on 9.11

Installation hangs forever on following output with node 10.4

> node /data/scratch/krystian/conda3/lib/python3.6/site-packages/jupyterlab/staging/yarn.js install
yarn install v1.5.1
info No lockfile found.
[1/4] Resolving packages...

Downgrading node to 9.11 fixes the issue.

Steps to reproduce:
Run usual installation. I am using latest anaconda /w python 3.6 distribution here

conda install -c conda-forge nodejs
jupyter labextension install jupyterlab_vim
# does not work

When nodejs is downgraded the installation works.

conda install -c conda-forge nodejs=9.11.1
jupyter labextension install jupyterlab_vim
#works

Thanks.

[Dependencies] Update for jupyterlab v0.34

jupyterlab 0.34.1 pushed yesterday, includes v18.3 of @jupyterlab/application & @jupyterlab/notebook, causes install with jupyterlab_vim master branch to fail at linking stage due to package incompatibility.

Recompiled after updating package.json file for these packages, seems to work okay, don't know how other dependencies are affected.

How to get into vim command mode but not JupyterLab command mode?

This extension is great, and I can finally actually use JupyterLab! <3

If I'm in insert mode in a cell, and hit esc, it takes me to Jupyterlab command mode. If I want to get back into vim command mode, I've to click on the cell again. Is there a way to go from vim edit mode to vim command mode?

cut release

I think this is ready for an initial release.

  • make release 0.1.0
  • announce on original jupyterlab issue

Implement :q to leave vim mode as alternative to Shift + escape

On certain keyboard (compact and 60%) the shortcut Shift + escape is not possible. This shortcut is already used for the tide character instead (~) and will not work as intended. Therefore, it would be nice to implement the same solution as jupyter-vim-binding and implement :q to leave vim mode and re-enter jupyter-lab interface.

Thanks for the great works, it is life changer.

manual install?

I'm behind a corporate firewall (that blocks yarnpkg.com), is there a way to manually install this (by downloading from git, for example)?

Installation question (stopped at webpack)

Hi, I found about jupyterlab recently and because I can't work without vim coding style, I have been trying to install jupyterlab_vim. I am currently using Linux on windows, it is an Ubuntu xenial without UI.

Initially, I had to install nodejs from the github as it wasn't working with the version provided by Ubuntu.
but now the process seems to hang forever at:
webpack --config webpack.prod.config.js

jupyter 4.4.0
jupyter lab 0.31.12
nodejs 9.8.0

Update: found a similar issue with another extension, it seems to work by adding --dev to the install command

Vim cell commands

It'd be nice if Vim bindings could while in the notebook cell mode (not editing a cell). i.e., dd deletes a cellandyy` copies a cell.

I keep on running into this bug from Jupyter notebook muscle memory. It'd be nice if installing this package meant that those keybindings were enabled (and yes, I could go into settings and change them all but this would be easier).

Esc back to normal mode.

I realize this is still alpha stage. I just wanted to point out that [Ctrl + c] is the only key combination that I can use to get back into normal mode.

single-user solution for jupyterhub?

I really want to use this plugin, but I work in a DS team which uses jupyterhub, and sadly my colleagues are not fans of vim. When I install jupyterlab-vim it seems to take effect for all users, and there is no way to toggle it on/off, so unfortunately I have to uninstall it. Am I missing something obvious or is there no workaround for this at the moment?

Collection of all available commands?

Is there a good list of all available commands? I am interested in mapping/remapping some of the shortcuts.

Some more instruction on how the index.ts file works is also helpful! For example, I see how Ctrl Y get mapped to "move a cell up" through the following "mappings". Yet, it is unclear where the command: notebook:move-cell-up is defined.

        commands.addKeyBinding({
            selector: '.jp-Notebook:focus',
            keys: ['Ctrl Y'],
            command: 'notebook:move-cell-up'
        });

Thanks a lot!

Resolving packages hangs forever

I'm having trouble trying to install this extension because it hangs forever in the "[1/4] Resolving packages..."

[1/4] Resolving packages...
โก€ jupyterlab_vim@file:../extensions/jupyterlab_vim-0.7.0.tgz

The traceback:


File "/opt/python/bin/jupyter-labextension", line 11, in
sys.exit(main())
File "/opt/python/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/opt/python/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/opt/python/lib/python3.6/site-packages/jupyterlab/labextensions.py", line 213, in start
super(LabExtensionApp, self).start()
File "/opt/python/lib/python3.6/site-packages/jupyter_core/application.py", line 255, in start
self.subapp.start()
File "/opt/python/lib/python3.6/site-packages/jupyterlab/labextensions.py", line 75, in start
logger=self.log, command=command)
File "/opt/python/lib/python3.6/site-packages/jupyterlab/commands.py", line 259, in build
command=command, clean_staging=clean_staging)
File "/opt/python/lib/python3.6/site-packages/jupyterlab/commands.py", line 400, in build
self._run(['node', YARN_PATH, 'install'], cwd=staging)
File "/opt/python/lib/python3.6/site-packages/jupyterlab/commands.py", line 1278, in _run
return proc.wait()
File "/opt/python/lib/python3.6/site-packages/jupyterlab/process.py", line 108, in wait
time.sleep(1.)
KeyboardInterrupt


Does someone have the same problem?

Details

Jupyter version: 4.4.0
JupyterLab version: 0.32.0
Node version: v10.0.0
Npm version: 6.0.0

Thanks!

Hi! I want to use Vim keybindings whenever I run the JupyterLab text editor. Right now I have to go to Settings -> Text Editor Key Map -> vim every time I start a new run to get the behavior I want. Is there a way to make this a permanent user setting whenever I run JupyterLab?

Hi!
I want to use Vim keybindings whenever I run the JupyterLab text editor. Right now I have to go to Settings -> Text Editor Key Map -> vim every time I start a new run to get the behavior I want. Is there a way to make this a permanent user setting whenever I run JupyterLab?

Binding for auto-completion

In Jupyter, Python docstrings are shown with Ctrl-Tab, which isn't a convenient shortcut. The vim plugin for Jupyter notebooks maps Ctrl-g to this function and has other bindings for completion. May we have something similar?

fix README.md shortcut listings

The documentation has all of the shortcuts listed as capital letters, eg: 'O'. However all of the mappings work without needing any use of capitals. This is misleading to long time vim users that understand their is a difference in mappings between a lowecase letter 'o' and the uppercase letter 'O' created by the combination of SHIFT+o

Copy to system clipboard

I know that browsers prohibit the use of custom keybindings to copy to and paste from the system clipboard. We are therefore limited to use the browser keybindings, which usually are CTRL-C and CTRL-V by default.

My problem now is that I cannot manage to copy to the system clipboard with CTRL-C. With the jupyter-vim-binding I was able to do it by selecting text in visual mode (or with the mouse) then pressing CTRL-C. That doesn't work with this extension. Though pasting works by pressing CTRL-V in insert mode.

Any idea? In case I missed something, how are we supposed to copy to the system clipboard?

PS: thanks for this great extension! ๐Ÿ‘ It was the feature that prevented me to switch from the notebook to the lab.

ctrl-o + shift-p for pasting a cell above the current cell

It would be good to have ctrl-o + shift-p for pasting a cell above another cell (just like ctrl-o + p pastes below). This command already exists in the Jupyter command pallette so it should only be a matter of binding the key combination (unless there are issues with binding shift commands with ctrl-o in general, like in #6).

Installation failing with provided directions.

I wanted to say that I really appreciate you working on this. However, similarly to @garyzhalo, I was not able to install the plugin using your directions.

jupyterlab/jupyterlab#1362

# Install jupyterlab_vim
(jupyterlab_vim) $ jupyter labextension install jupyterlab_vim
npm ERR! code E404
npm ERR! 404 Not Found: jupyterlab_vim@latest

However this works:

(jupyterlab_vim) $ jupyter labextension install https://github.com/jwkvam/jupyterlab_vim

You may want to add a note to your readme.

My environment setup

# Set up environemnt
$ conda config --add channels defaults
$ conda config --add channels conda-forge
$ conda config --add channels bioconda
$ conda create -n jupyterlab_vim python=3.6 jupyterlab=0.30.2 nodejs=8.8.1 -y
...
$ source activate jupyterlab_vim

(jupyterlab_vim) $ npm --version
5.4.2

holding down 'jkhl' keys but no repeat

I am using Ubuntu 16.04 as host machine & Chome on Mac OS High Sierra as the client
The simple issue is that holding down 'jkhl' inside the cell does not repeat the keystroke -> 'j' only goes down one character rather than continue to move down the line until I take my finger off. So, in order to move 5 lines, I need to hit 'j' times 5 -> jjjjj
Did I set something wrong?
Thanks,
(host): Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.15.0-1017-gcp x86_64)
(start jupyter) jupyter lab --ip=0.0.0.0 --no-browser --port=XXXX
http://datasci.mooo.com:8999/lab
jupyter labextension list
JupyterLab v0.34.2
Known labextensions:
app dir: /home/hoon/.local/share/virtualenvs/simulation-RVBo82bs/share/jupyter/lab
@jupyterlab/plotly-extension v0.17.1 enabled OK
@jupyterlab/shortcutui v0.1.4 enabled OK
jupyterlab_vim v0.9.0 enabled OK

Mode-switching sometimes breaks insert mode

Per a request on Twitter, I'm opening an issue about sometimes getting a particular cell stuck in insert mode. I don't yet have a reliable set of repro steps, but it seems to happen when I'm frequently switching between vim-insert mode and normal mode. Sometimes I do this with SHIFT-ESC, sometimes I chain ESC to SHIFT-ESC. Might be some kind of race condition?

Once the buggy behavior begins, a cell appears stuck in insert mode (can type new lines), but has strange behaviors when deleting or some keys (i.e. p) that have special behavior in another mode.

I'll report back if I figure out how to consistently cause it, and welcome any input about how I can provide better information about how this happens.

Error on installation

I get the following error on trying to install:

 โฏ jupyter labextension install jupyterlab_vim --debug                                                                                                                  [3:18:58 pm]
Searching ['/Users/xxx/Documents/Documents - xxx MacBook/test', '/Users/xxx/.jupyter', '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
Looking for jupyter_config in /etc/jupyter
Looking for jupyter_config in /usr/local/etc/jupyter
Looking for jupyter_config in /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/etc/jupyter
Looking for jupyter_config in /Users/pdd/.jupyter
Looking for jupyter_config in /Users/pdd/Documents/Documents - xx MacBook/test
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found
> /usr/local/bin/npm pack jupyterlab_vim
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
  Referenced from: /usr/local/bin/node
  Reason: image not found
Traceback (most recent call last):

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/labextensions.py", line 71, in start
    ans = self.run_task()

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/labextensions.py", line 100, in run_task
    for arg in self.extra_args

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/labextensions.py", line 100, in <listcomp>
    for arg in self.extra_args

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/commands.py", line 210, in install_extension
    return handler.install_extension(extension)

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/commands.py", line 347, in install_extension
    info = self._install_extension(extension, tempdir)

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/commands.py", line 1095, in _install_extension
    info = self._extract_package(extension, tempdir)

  File "/usr/local/lib/python3.6/site-packages/jupyterlab/commands.py", line 1135, in _extract_package
    raise ValueError(msg % source)

ValueError: "jupyterlab_vim" is not a valid npm package


Errored, use --debug for full output:
ValueError: "jupyterlab_vim" is not a valid npm package

Cannot merge cells using key-bindings

I found this extension tremendous helpful in making jupyterlab the No.1 perfect editor for editing remote codes, while the original keybindings of jupyterlab won't reach that. I hope this repository would someday be merged as a standard jupyterlab function rather than a plug-in extension.
However, as this repository is currently installed as a plug-in into my jupyterlab v.0.32.0, I found some original keybindings have been altered. One very useful key-binding is to quickly merge small cells into one big cell, and in Jupyterlab it's supposed to be Shift-M. However, I didn't found the key-binding of the same function in jupyterlab_vim, and when I tried Shift-M, the cursor just jumped to the central of the cell and no cells are merged. When I seleted two cells and tried Shift-M, all the firefox tag-pages are muted and still nothing happened to cells.
I used the menu to merge cells and it worked as expected.
So since the plugin has provided - to split cells, shall we consider adding some key-bindings to merge them quickly rather than using the menu?

Jupyterlab 0.33.0 compatibility?

A tracking issue with a few references on the upcoming 0.33 jupyterlab release, which appears to break jupyterlab-vim.

Currently seeing errors on startup with a jupyterlab 0.33.0rc1 installation:

vendors~main.2db678f28b01a454cf16.js:1 Plugin 'jupyterlab_vim' failed to activate.

vendors~main.2db678f28b01a454cf16.js:1 Error: No provider for: @jupyterlab/notebook:INotebookTracker.
    at g.e.resolveRequiredService (vendors~main.2db678f28b01a454cf16.js:1)
    at vendors~main.2db678f28b01a454cf16.js:1
    at Array.map (<anonymous>)
    at g.e.activatePlugin (vendors~main.2db678f28b01a454cf16.js:1)
    at vendors~main.2db678f28b01a454cf16.js:1
    at Array.map (<anonymous>)
    at g.e.start (vendors~main.2db678f28b01a454cf16.js:1)
    at a (main.29ab08b97f4632483c58.js:1)

Reproducable with a conda-based installation:

$conda install asford::jupyterlab=0.33.0rc0
[...]

$jupyter labextension install jupyterlab_vim
[...]

$jupyter labextension list
    JupyterLab v0.33.0rc0
    Known labextensions:
       app dir: /home/fordas/.conda/envs/jupyter/share/jupyter/lab
    jupyterlab_vim
	    jupyterlab_vim v0.7.0  enabled  OK

It appears that 0.33 will require updates to extension modules. Quoting from holoviz/holoviews#2850:

"
Our changelog issue has a few notes that we'll be filling out over the next few days, especially as we update some of the extensions we maintain: jupyterlab/jupyterlab#4622

The release milestone has the merged PRs: https://github.com/jupyterlab/jupyterlab/milestone/12?closed=1

And we'll be coordinating the release in this issue: jupyterlab/jupyterlab#4827
"

bindings in console

Is there a way to use the same vim bindings in the Jupyter console attached to a notebook?

Macros do not interact nicely with bracket closing.

How to reproduce:

in a new cell, starting in command mode, type:

qqistr('abc<ESC>q

The cell displays

str('abc')

And you now have a macro associated to q, corresponding to typing str('abc.

Now, in command mode, type

o@q

to execute the macro on a new line. The new line should be identical, but reads

str()''abc

I unfortunately do not have enough time nor TypeScript experience to propose a pull request. But thanks for the extension!

custom key mappings

Thanks for the great work! A vim binding was the only thing holding me back from using jupyterlab..is there a way to have custom key mappings such as jj instead of Esc? Thanks!

cells should leave insert mode when left or activated

Right now cells can stay in insert mode. When returning to a cell the cursor looks like it's in vim command mode but it's actually in insert mode. This is very confusing and I think it would be better to just make sure we enter cells in vim-command mode.

change cell type shortcuts

I found myself missing cell type shortcuts. I think in jupyter-vim-binding the shortcuts were cmdctrl-{1,2,3} to switch to code, markdown and raw cells. Do people like those shortcuts? Or would people like something more mnemonical: e.g. we could make it ctrl-o m for markdown, ctrl-o c for code and ctrl-o r for raw. Any thoughts or concerns? I was trying to think if those shortcuts may be better used for something else.

Trouble with development install on Windows 10

I cloned the repo and tried to issue the first command for development install, and here goes the error message that I see:

USER MINGW64 /d/Git_Warehouse/jupyterlab-vim (master)
$ jlpm install
yarn install v1.9.4
[1/4] Resolving packages...
success Already up-to-date.
$ npm run build

> [email protected] build D:\Git_Warehouse\jupyterlab-vim
> tsc

src/index.ts(214,38): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(216,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(227,38): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(229,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(240,29): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(253,29): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(266,29): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(279,29): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(281,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(292,29): error TS2459: Type 'NotebookPanel' has no property 'notebook' and no string index signature.
src/index.ts(305,33): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(306,34): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(308,64): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(319,33): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(320,34): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(322,64): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(333,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(334,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(336,33): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(337,33): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(349,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(349,64): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(350,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(352,33): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(353,33): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(365,38): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
src/index.ts(366,29): error TS2339: Property 'notebook' does not exist on type 'NotebookPanel'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\llinfeng\AppData\Roaming\npm-cache\_logs\2018-10-16T20_00_20_567Z-debug.log

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Failed attempts

I have tried to install node.js though its Windows installer; and have tried to call the nodejs installed through Anaconda. Together with the jlpm command, all three attempts yielded the same error.

  • Attempt 1: npm run build
  • Attempt 2: /c/ProgramData/Anaconda3/npm run build
  • Attempt 3 as shown above.

On more question: is there an easier way to set customized mappings?

In reference to issue #17, I was happy to have implemented a few mappings of mine in this fork. However, it has been challenging to replicate per my recent OS-rebuild. Please advise if this is worth a new issue to discuss.

startup problem: 'IOLoop' has no attribute 'initialized'

I have have installed the the extension into jupyterlab.
After restarting the server I get the following message:

Traceback (most recent call last):
  File "/home/<>/anaconda3/bin/jupyter-lab", line 7, in <module>
    from jupyterlab.labapp import main
  File "/home/<>/anaconda3/lib/python3.6/site-packages/jupyterlab/labapp.py", line 7, in <module>
    from notebook.notebookapp import NotebookApp, aliases, flags
  File "/home/<>/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 45, in <module>
    ioloop.install()
  File "/home/<>/anaconda3/lib/python3.6/site-packages/zmq/eventloop/ioloop.py", line 210, in install
    assert (not ioloop.IOLoop.initialized()) or \
AttributeError: type object 'IOLoop' has no attribute 'initialized'

When uninstalling the extension the server works again.

Details

  • Jupyter version: 4.4.0
  • JupyterLab version: 0.32.1

Any idea what the issue could be?

Thanks for the awesome work ๐Ÿ‘

Moving cells causes the cursor to go to last location

When in normal mode, j/k can move cells if at the bottom/top of a cell.

If the cell below/above the current cell has been visited previously, the cursor moves to previous location.

If I press j/k accidentally, then I have to press j/k many times to get back to the current position.

This video illustrates the issue:

search with `/` doesn't work

Asked a question on codemirror's forum: https://discuss.codemirror.net/t/cant-start-search-or-enter-command-line-mode/1444

From gitter:

https://gitter.im/jupyterlab/jupyterlab?at=5a3174cb3ae2aa6b3fc25d6c

Jacques Kvam @jwkvam 10:43
I'm trying to experiment with the codemirror dialogs for my vim extension. I noticed they were disabled (display: none) in packages/codemirror/style/index.css for ux reasons. I overrode it in my package with display: inline. Now the dialogs appear. When I try to open a dialog by searching or entering command line mode in vim, the cursor stays focused in the text box and doesn't go to the dialog. This works for the editor in vim mode. Wonder if I'm missing something else. My in progress attempt is here https://github.com/jwkvam/jupyterlab_vim/pull/8/files

Steven Silvester @blink1073 10:52
This is because the cell is ensuring its own focus repeatedly. Finding the spot in the code...

Jacques Kvam @jwkvam 11:21
I see, it seems like the _ensureFocus method is doing that. I'll have to think about this.

Steven Silvester @blink1073 11:22
https://github.com/jupyterlab/jupyterlab/blob/master/packages/notebook/src/widget.ts#L890

RFC: Keyboard shortcuts for moving cells

I am thinking Ctrl-E and Ctrl-Y to move cells up and down respectively. The main reason, I was thinking those chords was that they don't seem very useful in JupyterLab. In vim they are used to move the view up and down.

Others that I considered were:

  1. Shift J and Shift K, but Shift J is very useful for joining lines.
  2. Ctrl U and Ctrl D, but that can be useful for moving through a large cell quickly.

I already have it working, attached is a demo.

moving

cc: @imbolc

`i` to edit selected cell

One of the nice features of jupyter-vim-binding is that you can press i to immediately start editing the selected cell. Here, you first need to press Enter, then i.

Would it be possible to add this functionality?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.