npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jupyterlab-vimrc

v0.5.2

Published

add a basic vimrc to jupyterlab

Downloads

2

Readme

jupyterlab-vimrc

Github Actions Status

add 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+
pip install jupyterlab-vimrc

or for jupyterlab=2

jupyter labextension install [email protected]

Basic Usage

You can modify the contents of this psuedo vimrc by editing the settings using Settings > Advanced Settings Editor (Ctrl+,) and selecting the settings for vimrc. Commands are defined as arrays with the syntax: [lhs, rhs]. For example you can map ii to <Esc> in insert mode by adding the following to the settings:

{
"imap": 
    [
        ["ii", "<Esc>"],
    ],
}

See the Examples for other premade settings files such as hjkl -> jkl;

Supported Commands

Currently supports these commands:

imap
nmap
vmap
inoremap*
nnoremap*
vnoremap*

* noremap caveat

The noremap commands are also availiable but come with several caveats:

The comment for the noremap function in codemirror/keymap/vim.js says 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:

  1. The right hand side of the mapping must be defined in the default vim.js keymap
  2. The default keymap must not be an [Ex to Ex] or [Key to Key] mapping.

The result will then be that you have changed the lhs for 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.

Requirements

  • JupyterLab >= 3.0 (pip install jupyterlab-vimrc)
  • JupyterLab >= 2.0 (jupyter labextension install [email protected])
  • JupyterLab >= 1.0 (jupyter labextension install jupyterlab-vimrc@jlab1)

Contributing

Development install

Note: You will need NodeJS to build the extension package.

conda install -c conda-forge nodejs

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab-vimrc directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build

You 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 needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

With 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).

Uninstall

pip uninstall jupyterlab-vimrc
jupyter labextension uninstall jupyterlab-vimrc