# Node range

> Select whole sibling blocks with the keyboard or a modifier drag.

`node_range()` selects whole blocks that share a parent.

## Try it

Click “Draft the outline” and press **Shift + Down Arrow** to select the whole paragraph. Press it again to include “Review the draft”. Press **Shift + Up Arrow** to shrink the selection back to the first paragraph.

[Node range example](https://gpdoc.dev/docs/plugins/behavior/node-range/#node-range-example)

You can also hold Command on macOS or Control on Windows and Linux while dragging across two paragraphs. Release the mouse button while holding the key to select both blocks.

## Install

```sh
cargo add gpdoc-plugin-node-range
```

## Example

```rust
use gpdoc_plugin_node_range::node_range;


let config = gpdoc::EditorConfig::builder()
    .plugin(gpdoc_plugin_paragraph::paragraph())
    .plugin(node_range())
    .build()
    .expect("configure editor");
```

With a [drag handle](/docs/plugins/behavior/drag-handle/) installed, dragging a handle inside the selected range moves the blocks together.

## Source code

[node-range/src/lib.rs](/source/plugins/node-range/src/lib.rs.txt)