Package: jupyterlab-vimrc
jupyterlab-vimrcadd a basic vimrc to jupyterlab  + support for yanking to the system clipboard.I also recommend:https://github.com/axelfahy/jupyterlab-vim(vim in the notebook)https://github.com/ianhi/jupyterlab_vim-system-clipboard-support(yank to + or * registers)(Now included in this extension!)Install# for jlab 3+pipinstalljupyterlab-vimrcor for jupyterlab=2jupyterlabextensioninstalljupyterlab-vimrc@0.3.0Basic UsageYou can modify the contents of this psuedo vimrc by editing the settings using Settings > Advanced Settings Editor (Ctrl+,) and selecting the settings forvimrc. Commands are defined as arrays with the syntax:
[lhs, rhs]. For example you can mapiito<Esc>in insert mode by adding the following to the settings:{"imap":[["ii","<Esc>"],],}See theExamplesfor other premade settings files such ashjkl->jkl;Supported CommandsCurrently supports these commands:imap
nmap
vmap
inoremap*
nnoremap*
vnoremap**noremap caveatThe noremap commands are also availiable but come with several caveats:The comment for thenoremapfunction incodemirror/keymap/vim.jssays the following:Non-recursive map function.NOTE: This will not create mappings to key maps that aren't present in the default key map. See TODO at bottom of function.My reading of this comment and looking through the actual function leads me to believe that the restrictions are:The right hand side of the mapping must be defined in thedefault vim.js keymapThe default keymap must not be an [Ex to Ex] or [Key to Key]  mapping.The result will then be that you have changed thelhsfor the default keymapping but nothing else. If your mapping doesn't meet these conditions then the mapping will not be performed and this extension will put an error message in the console. So it may be in your best interest to just use the map commands and be careful to not get caught in infinite mapping loops.RequirementsJupyterLab >= 3.0 (pip install jupyterlab-vimrc)JupyterLab >= 2.0 (jupyter labextension install jupyterlab-vimrc@0.3.0)JupyterLab >= 1.0 (jupyter labextension install jupyterlab-vimrc@jlab1)ContributingDevelopment installNote: You will need NodeJS to build the extension package.condainstall-cconda-forgenodejsThejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab-vimrc directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmrunbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).Uninstallpipuninstalljupyterlab-vimrc
jupyterlabextensionuninstalljupyterlab-vimrc