Lock your Neovim cursor down in a specified region of lines.
The effect is limited to the active Neovim window, making this useful for having a separate, restricted view of a long document, while working on one part, while often referring to another part.
This will keep the cursor in the region starting at line 20, and ending at the
first line that starts with END
:
:CurlodEnable 20 /^END/
Arguments are optional, and can be line numbers, or Lua patterns passed to
string.match
, and wrapped in /
s.
Alternatively, make a visual selection and run CurlodEnableRange
on it:
:'<,'>CurlodEnableRange
Free your cursor again:
:CurlodDisable
Using vim-plug:
Plug 'walterl/curlod'
Curlod was developed with Conjure and Aniseed.
:CurlodLogLevel debug
Or info
(default) or error
.
There are many ways to change text in Vim without moving the cursor. Curlod won't take on the Herculean task of trying to prevent that from happening outside of the Curlod region.
This is considered out of scope for Curlod, since the primary motivation is to keep the cursor bound to the specified region, in order to limit a window's view on a buffer.
Attempts to prevent out-of-region edits are likely to degrade overall user experience with an explosion in corner cases caused by combinations of hard to predict effects.