# Wow Vivaldi and JupyterLab Vim are cool

- Link: https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/
- Published: 2021-05-30T11:06:29-07:00
- Author: rich

OK, spent the day making JupyterLab really work for me. Key to this has been keyboard
shortcuts. They are so different on Colab, Deepnote and even between JupyterLab 
and Jupyter Notebook. But there is hope with two cool finds:

Vivaldi is a Chromium based browser, so it can accept Chrome Store extensions but
it is completely private. So it is kind of the best of both words. I’m typing on
it now and other than having to set up Vivaldi sync instead of Google Sync of actions,
Its a wonder I had not found it earlier.

Then as I’ve switched from Deepnote to my roll my own JupyterLab environment so 
I can use things like [JupyterLab-vim](https://github.com/jwkvam/jupyterlab-vim)
I’ve discovered a whole new set of short cuts and things. Here are some of the most
valuable for folks trying to make a JupyterLab notebook a way to present data:

You can now fold code so that you don’t have to display the code and just get the
output. They already do this for Markdown, so when you close a text window, you 
just get the output Markdown and for most code, you want to do the same. You can
set this with a simple typing and for Vi nerds, these are same folding commands 
that it has:

 * `ZM` which hides all code
 * `ZC` if you just want to hide a specific cell so you can have charting stuff 
   appear as just charts,
 * `ZO` but you can leave real code open with `ZO` when on a specific cell or
 * `ZR` to expand all code.

Add you can use VI shortcuts and things really easily. If you want to try it checkout
[https://docker.com/tongfamily/jupyterlab](https://docker.com/tongfamily/jupyterlab)
where I’ve stuck an image that does this.

The one remaining nagging problem is word wrapping, it doesn’t seem to work. Sigh,
always something. So in studying this, for [code line wrap](https://github.com/jupyterlab/jupyterlab/issues/2394),
you can go to Settings > Advanced Setting Notebook and add to the User Preferences

    ```wp-block-code
    "{codeCellConfig: { "lineWrap": true }}
    ```

Then for text, I’m not sure how this interacts with the super awesome vim bindings,
but you go to Settings > Advanced Settings > Text Editor and then in the User Preferences,
you can add which says instead of wrapping and the size of the windows you are editing
in, it looks for the wordWrapColumn and breaks it there.

    ```wp-block-code
    {"editorConfig": {"lineWrap": "wordWrapColumn", "wordWrapColumn": 80, }}
    ```

## Installing the rest of an IDE

Well, the big change with JupyterLab is that the extensions are way more robust,
so here is the collection I’ve been using to try to make it work as vim does with
code formatting, etc. The nice thing is that you pip to install these and then JupyterLab
automagically picks them up. You can see all the available commands with ⌘-⌃-C and
you can see all the assigned shortcuts too.

 * [Jupyterlab_vim](https://github.com/axelfahy/jupyterlab-vim). Add vim bindings
   like `gg` to go to the top of the document and editing that works like vim.
 * Jupyterlab_git. I haven’t quite gotten this working yet, but basically, you should
   be able to check in and check out a repo that has the notebooks in them. The 
   reported fix is that it doesn’t recognize you are in the repo so you need an 
   explicit `jupyter server extension enable --py jupyterlab_git`
 * [Jupyterlab_github](https://github.com/jupyterlab/jupyterlab-github). Browse 
   github repos and look at notebooks there.
 * [Jupyter_code_formatter](https://jupyterlab-code-formatter.readthedocs.io/en/latest/how-to-use.html).
   This lets you use Python tools like Black to format things and make your code
   look nice. You can’t run this automatically, so you need to assign a keyboard
   shortcut to it which is yet more Jason in the Settings > Advanced Settings > 
   Keyboard Shortcuts
 * [Jupyter DEbugger](https://jupyterlab.readthedocs.io/en/stable/user/debugger.html).
   This requires the new Xeus-Python but you get single-stepping, variables and 
   all the rest
 * [Jupyterlab-hdf5](https://github.com/jupyterlab/jupyterlab-hdf5). Look at HDF5
   files and see what data is there.

### Share this:

 * [  Mastodon ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=mastodon)
 * [  LinkedIn ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=linkedin)
 * [  Facebook ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=facebook)
 * [  WhatsApp ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=jetpack-whatsapp)
 * [  Email ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?subject=%5BShared%20Post%5D%20Wow%20Vivaldi%20and%20JupyterLab%20Vim%20are%20cool&body=https%3A%2F%2Ftongfamily.com%2F2021%2F05%2F30%2Fwow-vivaldi-and-jupyterlab-vim-are-cool%2F&share=email)
 * [More](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/#)

 * [  Telegram ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=telegram)
 * [  Print ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/#print?share=print)
 * [  Pinterest ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=pinterest)
 * [  Tumblr ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=tumblr)
 * [  X ](https://tongfamily.com/2021/05/30/wow-vivaldi-and-jupyterlab-vim-are-cool/?share=twitter)

### Like this:

Like Loading…
