@@ -388,6 +388,39 @@ func OptionInfo(name string) (opinfo OptionInfo) {
388
388
returnPtr ()
389
389
}
390
390
391
+ // OptionValue gets the value of an option.
392
+ //
393
+ // The behavior of this function matches that of |:set|: the local value of an option is returned if it exists; otherwise,
394
+ // the global value is returned.
395
+ // Local values always correspond to the current buffer or window.
396
+ //
397
+ // To get a buffer-local or window-local option for a specific buffer or window, use BufferOption() or WindowOption().
398
+ //
399
+ // name is the option name.
400
+ //
401
+ // opts is the Optional parameters.
402
+ //
403
+ // scope
404
+ //
405
+ // Analogous to |:setglobal| and |:setlocal|, respectively.
406
+ func OptionValue (name string , opts map [string ]OptionValueScope ) (optionValue interface {}) {
407
+ name (nvim_get_option_value )
408
+ }
409
+
410
+ // SetOptionValue sets the value of an option. The behavior of this function matches that of
411
+ // |:set|: for global-local options, both the global and local value are set
412
+ // unless otherwise specified with {scope}.
413
+ // name is the option name.
414
+ //
415
+ // opts is the Optional parameters.
416
+ //
417
+ // scope
418
+ //
419
+ // Analogous to |:setglobal| and |:setlocal|, respectively.
420
+ func SetOptionValue (name string , value interface {}, opts map [string ]OptionValueScope ) {
421
+ name (nvim_set_option_value )
422
+ }
423
+
391
424
// SetOption sets an option value.
392
425
func SetOption (name string , value interface {}) {
393
426
name (nvim_set_option )
@@ -855,6 +888,33 @@ func EvalStatusLine(name string, opts map[string]interface{}) (statusline map[st
855
888
name (nvim_eval_statusline )
856
889
}
857
890
891
+ // AddUserCommand create a new user command.
892
+ //
893
+ // name is name of the new user command. Must begin with an uppercase letter.
894
+ //
895
+ // command is replacement command to execute when this user command is executed.
896
+ // When called from Lua, the command can also be a Lua function.
897
+ //
898
+ // opts is optional command attributes. See |command-attributes| for more details.
899
+ //
900
+ // To use boolean attributes (such as |:command-bang| or |:command-bar|) set the value to "true".
901
+ // In addition to the string options listed in |:command-complete|,
902
+ // the "complete" key also accepts a Lua function which works like the "customlist" completion mode |:command-completion-customlist|.
903
+ //
904
+ // desc (string)
905
+ // Used for listing the command when a Lua function is used for {command}.
906
+ //
907
+ // force (bool, default true)
908
+ // Override any previous definition.
909
+ func AddUserCommand (name string , command UserCommand , opts map [string ]interface {}) {
910
+ name (nvim_add_user_command )
911
+ }
912
+
913
+ // DeleteUserCommand delete a user-defined command.
914
+ func DeleteUserCommand (name string ) {
915
+ name (nvim_del_user_command )
916
+ }
917
+
858
918
// buffer.c
859
919
860
920
// BufferLineCount gets the buffer line count.
@@ -1079,6 +1139,20 @@ func BufferMark(buffer Buffer, name string) (pos [2]int) {
1079
1139
name (nvim_buf_get_mark )
1080
1140
}
1081
1141
1142
+ // AddBufferUserCommand create a new user command |user-commands| in the given buffer.
1143
+ //
1144
+ // Only commands created with |:command-buffer| or this function can be deleted with this function.
1145
+ func AddBufferUserCommand (buffer Buffer , name string , command UserCommand , opts map [string ]interface {}) {
1146
+ name (nvim_buf_add_user_command )
1147
+ }
1148
+
1149
+ // DeleteBufferUserCommand create a new user command |user-commands| in the given buffer.
1150
+ //
1151
+ // Only commands created with |:command-buffer| or this function can be deleted with this function.
1152
+ func DeleteBufferUserCommand (buffer Buffer , name string ) {
1153
+ name (nvim_buf_del_user_command )
1154
+ }
1155
+
1082
1156
// BufferExtmarkByID beturns position for a given extmark id.
1083
1157
//
1084
1158
// opts is optional parameters.
0 commit comments