summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-01-07 19:44:19 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-19 10:47:21 +1100
commit24a4302c528e3a11b30855c006669de1adf9e1d4 (patch)
tree4b8053168746c2978c2b47968bae1576d3718bcf /docs
parente887a2eb3c0ece1d2be78b869ff936a0703a3940 (diff)
Add range selection ability on list contexts
This adds range select ability in two ways: 1) Sticky: like what we already have with the staging view i.e. press v then use arrow keys 2) Non-sticky: where you just use shift+up/down to expand the range The state machine works like this: (no range, press 'v') -> sticky range (no range, press arrow) -> no range (no range, press shift+arrow) -> nonsticky range (sticky range, press 'v') -> no range (sticky range, press arrow) -> sticky range (sticky range, press shift+arrow) -> nonsticky range (nonsticky range, press 'v') -> no range (nonsticky range, press arrow) -> no range (nonsticky range, press shift+arrow) -> nonsticky range
Diffstat (limited to 'docs')
-rw-r--r--docs/Config.md5
-rw-r--r--docs/README.md3
-rw-r--r--docs/Range_Select.md14
3 files changed, 19 insertions, 3 deletions
diff --git a/docs/Config.md b/docs/Config.md
index 8b37c6aaa..8b8b62c11 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -201,6 +201,9 @@ keybinding:
toggleWhitespaceInDiffView: '<c-w>'
increaseContextInDiffView: '}'
decreaseContextInDiffView: '{'
+ toggleRangeSelect: 'v'
+ rangeSelectUp: '<s-up>'
+ rangeSelectDown: '<s-down>'
status:
checkForUpdate: 'u'
recentRepos: '<enter>'
@@ -263,8 +266,6 @@ keybinding:
commitFiles:
checkoutCommitFile: 'c'
main:
- toggleDragSelect: 'v'
- toggleDragSelect-alt: 'V'
toggleSelectHunk: 'a'
pickBothHunks: 'b'
submodules:
diff --git a/docs/README.md b/docs/README.md
index 604c8a07a..d840637a0 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -3,8 +3,9 @@
* [Configuration](./Config.md).
* [Custom Commands](./Custom_Command_Keybindings.md)
* [Custom Pagers](./Custom_Pagers.md)
+* [Dev docs](./dev)
* [Keybindings](./keybindings)
* [Undo/Redo](./Undoing.md)
+* [Range Select](./Range_Select.md)
* [Searching/Filtering](./Searching.md)
* [Stacked Branches](./Stacked_Branches.md)
-* [Dev docs](./dev)
diff --git a/docs/Range_Select.md b/docs/Range_Select.md
new file mode 100644
index 000000000..e46c26897
--- /dev/null
+++ b/docs/Range_Select.md
@@ -0,0 +1,14 @@
+# Range Select
+
+Some actions can be performed on a range of contiguous items. For example:
+* staging multiple files at once
+* squashing multiple commits at once
+* copying (for cherry-pick) multiple commits at once
+
+There are two ways to select a range of items:
+1. Sticky range select: Press 'v' to toggle range select, then expand the selection using the up/down arrow key. To reset the selection, press 'v' again.
+2. Non-sticky range select: Press shift+up or shift+down to expand the selection. To reset the selection, press up/down without shift.
+
+The sticky option will be more familiar to vim users, and the second option will feel more natural to users who aren't used to doing things in a modal way.
+
+In order to perform an action on a range of items, simply press the normal key for that action. If the action only works on individual items, it will raise an error. This is a new feature and the plan is to incrementally support range select for more and more actions. If there is an action you would like to support range select which currently does not, please raise an issue in the repo.