Skip to content

A JavaScript library to manipulate multiple selections, inspired by Kakoune

License

Notifications You must be signed in to change notification settings

alexherbo2/selection.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

selection.js

selection.js is a JavaScript library to manipulate multiple selections, inspired by Kakoune.

Thumbnail Button

Installation

Add selection.js and selection.css to your project.

Usage

Navigate to https://kakoune.org:

const selections = new SelectionList

// Getting Started
const getStarted = document.querySelector('a[href*="getting-started"]')

selections.add(getStarted) // Selects “Getting Started”
selections.parent(2) // Selects the navigation section
selections.select('a') // Selects all links
selections.focus(getStarted) // Selects “Getting Started”
selections.next(2) // Selects “Issue Tracker”
selections.children() // Selects all of the child elements
selections.previous() // Selects the bug icon
selections.remove(selections.mainSelection) // Removes the main selection

You can find some examples in Krabby.

See the source for a complete reference.

About

A JavaScript library to manipulate multiple selections, inspired by Kakoune

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages