aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-09-22 19:52:25 -0600
committerJosh Rahm <rahm@google.com>2021-10-05 02:22:00 -0600
commit02e24d60c079f0810f56969519c5c23fbc733a41 (patch)
tree7fe65227e727dd537c7d9dca4ef490d75b95cb42
parentf293f94296fc9443f966025ae55743565221d732 (diff)
downloadrneovim-02e24d60c079f0810f56969519c5c23fbc733a41.tar.gz
rneovim-02e24d60c079f0810f56969519c5c23fbc733a41.tar.bz2
rneovim-02e24d60c079f0810f56969519c5c23fbc733a41.zip
Add documentation for the userregfun setting.
-rw-r--r--runtime/doc/options.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 30bc23d2b6..793b9d9ddc 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6657,6 +6657,44 @@ A jump table for the options with a short description can be found at |Q_op|.
written to disk (see |crash-recovery|). Also used for the
|CursorHold| autocommand event.
+ *'userregfun'* *'urf'*
+'userregfun' 'urf' string (default "")
+ global
+ The option specifies a function to be used to handle any registers
+ that Neovim does not natively handle. This option unlocks all
+ characters to be used as registers by the user.
+
+ The 'userregfun' function is called each time a user register is read
+ from or written to.
+
+ The 'userregfun' function must take the following parameters:
+
+ {action} The action being done on this register (either 'yank'
+ or 'put'
+
+ {register} The string holding the name of the register. This
+ is always a single character, though multi-byte
+ characters are allowed.
+
+ {content} If the action is 'yank' this is the content being
+ yanked into the register.
+
+ In case the action is 'put', the 'userregfun' function should return
+ the content to place in that location.
+
+ A very simple example of a 'userregfun' function that behaves exactly
+ like traditional registers would look like: >
+
+ let s:contents = {}
+ function! MyUserregFunction(action, register, content) abort
+ if a:action == "put"
+ return get(s:contents, a:register, "")
+ else
+ let s:contents[a:register] = a:content
+ endif
+ endfunction
+ set userregfun=MyUserregFunction
+<
*'varsofttabstop'* *'vsts'*
'varsofttabstop' 'vsts' string (default "")
local to buffer