diff options
author | Famiu Haque <famiuhaque@protonmail.com> | 2022-04-23 10:21:59 +0600 |
---|---|---|
committer | Famiu Haque <famiuhaque@protonmail.com> | 2022-04-30 21:04:51 +0600 |
commit | 8dbb11ebf633e40cb57568e77c7168deffc8bd7f (patch) | |
tree | ad5ce9c55bec9b2ee05c28a7c5a9c5262575370b /runtime | |
parent | 3c23100130725bb79c04e933c505bbeda96fb3bb (diff) | |
download | rneovim-8dbb11ebf633e40cb57568e77c7168deffc8bd7f.tar.gz rneovim-8dbb11ebf633e40cb57568e77c7168deffc8bd7f.tar.bz2 rneovim-8dbb11ebf633e40cb57568e77c7168deffc8bd7f.zip |
feat(api): add `nvim_parse_cmdline`
Adds an API function to parse a command line string and get command information from it.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 63 | ||||
-rw-r--r-- | runtime/doc/map.txt | 2 |
2 files changed, 64 insertions, 1 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 8e33e7a67b..907e8e06fc 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1350,6 +1350,69 @@ nvim_out_write({str}) *nvim_out_write()* Parameters: ~ {str} Message +nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* + Parse command line. + + Doesn't check the validity of command arguments. + + Attributes: ~ + {fast} + + Parameters: ~ + {str} Command line string to parse. Cannot contain "\n". + {opts} Optional parameters. Reserved for future use. + + Return: ~ + Dictionary containing command information, with these + keys: + • cmd: (string) Command name. + • line1: (number) Starting line of command range. Only + applicable if command can take a range. + • line2: (number) Final line of command range. Only + applicable if command can take a range. + • bang: (boolean) Whether command contains a bang (!) + modifier. + • args: (array) Command arguments. + • addr: (string) Value of |:command-addr|. Uses short + name. + • nargs: (string) Value of |:command-nargs|. + • nextcmd: (string) Next command if there are multiple + commands separated by a |:bar|. Empty if there isn't a + next command. + • magic: (dictionary) Which characters have special + meaning in the command arguments. + • file: (boolean) The command expands filenames. Which + means characters such as "%", "#" and wildcards are + expanded. + • bar: (boolean) The "|" character is treated as a + command separator and the double quote character (") + is treated as the start of a comment. + + • mods: (dictionary) |:command-modifiers|. + • silent: (boolean) |:silent|. + • emsg_silent: (boolean) |:silent!|. + • sandbox: (boolean) |:sandbox|. + • noautocmd: (boolean) |:noautocmd|. + • browse: (boolean) |:browse|. + • confirm: (boolean) |:confirm|. + • hide: (boolean) |:hide|. + • keepalt: (boolean) |:keepalt|. + • keepjumps: (boolean) |:keepjumps|. + • keepmarks: (boolean) |:keepmarks|. + • keeppatterns: (boolean) |:keeppatterns|. + • lockmarks: (boolean) |:lockmarks|. + • noswapfile: (boolean) |:noswapfile|. + • tab: (integer) |:tab|. + • verbose: (integer) |:verbose|. + • vertical: (boolean) |:vertical|. + • split: (string) Split modifier string, is an empty + string when there's no split modifier. If there is a + split modifier it can be one of: + • "aboveleft": |:aboveleft|. + • "belowright": |:belowright|. + • "topleft": |:topleft|. + • "botright": |:botright|. + nvim_paste({data}, {crlf}, {phase}) *nvim_paste()* Pastes at cursor, in any mode. diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index b874d6dc61..6e100e5854 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1421,7 +1421,7 @@ which by default correspond to the current line, last line and the whole buffer, relate to arguments, (loaded) buffers, windows or tab pages. Possible values are (second column is the short name used in listing): - -addr=lines Range of lines (this is the default) + -addr=lines line Range of lines (this is the default) -addr=arguments arg Range for arguments -addr=buffers buf Range for buffers (also not loaded buffers) -addr=loaded_buffers load Range for loaded buffers |