Skip to content

Commit 25f2e51

Browse files
committed
docs: Update move_cursor documentation.
1 parent 32148c5 commit 25f2e51

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

doc/nvim-surround.txt

+17-4
Original file line numberDiff line numberDiff line change
@@ -613,16 +613,29 @@ configured separately. The default highlight group used is `Visual`:
613613
--------------------------------------------------------------------------------
614614
3.6. Cursor *nvim-surround.config.move_cursor*
615615

616-
By default, when a surround action is performed, the cursor moves to the
617-
beginning of the action.
616+
By default (or when `move_cursor = "begin"`), when a surround action is
617+
performed, the cursor moves to the beginning of the action.
618618

619619
Old text Command New text ~
620620
some_t*ext ysiw[ *[ some_text ]
621621
another { sample *} ds{ another *sample
622622
(hello* world) csbB *{hello world}
623623

624-
This behavior can be disabled by setting `move_cursor = false` in one of the
625-
setup functions.
624+
If `move_cursor` is set to `"sticky"`, the cursor will "stick" to the current
625+
character, and move with the text as the buffer changes.
626+
627+
Old text Command New text ~
628+
some_t*ext ysiw[ [ some_t*ext ]
629+
another { sample *} ds{ another sampl*e
630+
(hello* world) csbffoo<CR> foo(hello* world)
631+
632+
If `move_cursor` is set to `false`, the cursor won't move at all, regardless
633+
of how the buffer changes.
634+
635+
Old text Command New text ~
636+
some_t*ext ysiw[ [ some_*text ]
637+
another { *sample } ds{ another sa*mple
638+
(hello* world) csbffoo<CR> foo(he*llo world)
626639

627640
--------------------------------------------------------------------------------
628641
3.7. Indentation *nvim-surround.config.indent_lines*

0 commit comments

Comments
 (0)