From 78c5201234e478ff8f648adea95be18ca588a9cd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 04:54:24 +0200 Subject: 'cpoptions': remove "k" flag This was already removed in 3baba1e7bc66, except the documentation and CPO_VI entry. find_term_bykeys() is irrelevant to Nvim. --- runtime/doc/map.txt | 3 +-- runtime/doc/options.txt | 9 --------- runtime/doc/vim_diff.txt | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index f5b0233e6c..48d05bce58 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -444,8 +444,7 @@ There are two ways to map a special key: starts with . To enter a mapping like this you type ":map " and then you have to type CTRL-V before hitting the function key. Note that when the key code for the key is in the |terminfo| entry, it will automatically - be translated into the internal code and become the second way of mapping - (unless the 'k' flag is included in 'cpoptions'). + be translated into the internal code and become the second way of mapping. 2. The second method is to use the internal code for the function key. To enter such a mapping type CTRL-K and then hit the function key, or use the form "#1", "#2", .. "#9", "#0", "", "", "", etc. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index ca126f5a79..307c14a0e5 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1618,15 +1618,6 @@ A jump table for the options with a short description can be found at |Q_op|. J A |sentence| has to be followed by two spaces after the '.', '!' or '?'. A is not recognized as white space. - *cpo-k* - k Disable the recognition of raw key codes in - mappings, abbreviations, and the "to" part of menu - commands. For example, if sends ^[OA (where ^[ - is ), the command ":map X ^[OA" results in X - being mapped to: - 'k' included: "^[OA" (3 characters) - 'k' excluded: "" (one key code) - Also see the '<' flag below. *cpo-K* K Don't wait for a key code to complete when it is halfway through a mapping. This breaks mapping diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index ca07e613ed..20d1e5dc4e 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -332,7 +332,7 @@ Test functions: Other options: 'antialias' - 'cpoptions' ("g", "w", "H", "*", "-", "j", and all POSIX flags were removed) + 'cpoptions' (g j k H w * - and all POSIX flags were removed) 'encoding' ("utf-8" is always used) 'esckeys' 'guioptions' "t" flag was removed -- cgit From 0ea7e45bc1d1881f505da2b77e0b3e4eb56f12fe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 13:21:38 +0200 Subject: 'cpoptions': remove "<" flag; ignore Closes #6937 "nvim_get_keymap output is unreliable" --- runtime/doc/gui.txt | 3 --- runtime/doc/map.txt | 8 +++----- runtime/doc/options.txt | 9 --------- runtime/doc/tips.txt | 7 ++----- runtime/doc/vim_diff.txt | 2 +- runtime/doc/visual.txt | 6 +++--- 6 files changed, 9 insertions(+), 26 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 0bd3a40a7c..37462d4e96 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -490,9 +490,6 @@ expression register: > :amenu Insert.foobar "='foobar'P -Note that the '<' and 'k' flags in 'cpoptions' also apply here (when -included they make the <> form and raw key codes not being recognized). - Note that in Cmdline mode executes the command, like in a mapping. This is Vi compatible. Use CTRL-C to quit Cmdline mode. diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 48d05bce58..6f971a1305 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -570,9 +570,9 @@ Since the '|' character is used to separate a map command from the next command, you will have to do something special to include a '|' in {rhs}. There are three methods: use works when example ~ - '<' is not in 'cpoptions' :map _l :!ls more^M + always :map _l :!ls more^M \| 'b' is not in 'cpoptions' :map _l :!ls \| more^M - ^V| always, in Vim and Vi :map _l :!ls ^V| more^M + ^V| always :map _l :!ls ^V| more^M (here ^V stands for CTRL-V; to get one CTRL-V you have to type it twice; you cannot use the <> notation "" here). @@ -627,8 +627,7 @@ out about, ^D is CTRL-D). 1.8 EXAMPLES *map-examples* -A few examples (given as you type them, for "" you type four characters; -the '<' flag must not be present in 'cpoptions' for this to work). > +A few examples (as you type them: for "" you type four characters). > :map o#include :map /foocwbar @@ -880,7 +879,6 @@ character is mostly ignored otherwise. It is possible to move the cursor after an abbreviation: > :iab if if () -This does not work if 'cpoptions' includes the '<' flag. |<>| You can even do more complicated things. For example, to consume the space typed after an abbreviation: > diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 307c14a0e5..dc968cd666 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1568,7 +1568,6 @@ A jump table for the options with a short description can be found at |Q_op|. results in X being mapped to: 'B' included: "\^[" (^[ is a real ) 'B' excluded: "" (5 characters) - ('<' excluded in both cases) *cpo-c* c Searching continues at the end of any match at the cursor position, but not further than the start of the @@ -1751,14 +1750,6 @@ A jump table for the options with a short description can be found at |Q_op|. + When included, a ":write file" command will reset the 'modified' flag of the buffer, even though the buffer itself may still be different from its file. - *cpo-<* - < Disable the recognition of special key codes in |<>| - form in mappings, abbreviations, and the "to" part of - menu commands. For example, the command - ":map X " results in X being mapped to: - '<' included: "" (5 characters) - '<' excluded: "^I" (^I is a real ) - Also see the 'k' flag above. *cpo->* > When appending to a register, put a line break before the appended text. diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index 9b34cd7599..8bb49c2322 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -282,9 +282,7 @@ For Emacs-style editing on the command-line: > :cnoremap " forward one word :cnoremap - -NOTE: This requires that the '<' flag is excluded from 'cpoptions'. |<>| - +< *format-bullet-list* This mapping will format any bullet list. It requires that there is an empty line above and below each list entry. The expression commands are used to @@ -300,8 +298,7 @@ be able to give comments to the parts of the mapping. > :execute m |" define the mapping (<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not -CTRL-W. You can copy/paste this into Vim if '<' is not included in -'cpoptions'.) +CTRL-W.) Note that the last comment starts with |", because the ":execute" command doesn't accept a comment directly. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 20d1e5dc4e..d906b874f0 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -332,7 +332,7 @@ Test functions: Other options: 'antialias' - 'cpoptions' (g j k H w * - and all POSIX flags were removed) + 'cpoptions' (g j k H w < * - and all POSIX flags were removed) 'encoding' ("utf-8" is always used) 'esckeys' 'guioptions' "t" flag was removed diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index e9f5bf91f8..cf804444e5 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -271,7 +271,7 @@ mode. For example, if you would like the "/" command not to extend the Visual area, but instead take the highlighted text and search for that: > :vmap / y/" (In the <> notation |<>|, when typing it you should type it literally; you -need to remove the 'B' and '<' flags from 'cpoptions'.) +need to remove the 'B' flag from 'cpoptions'.) If you want to give a register name using the """ command, do this just before typing the operator character: "v{move-around}"xd". @@ -375,7 +375,7 @@ Here is an example, to replace the selected text with the output of "date": > :vmap _a `>a`!!datekJJ (In the <> notation |<>|, when typing it you should type it literally; you -need to remove the 'B' and '<' flags from 'cpoptions') +need to remove the 'B' flag from 'cpoptions') What this does is: stop Visual mode @@ -392,7 +392,7 @@ selected text: > :vmap X y/" (In the <> notation |<>|, when typing it you should type it literally; you -need to remove the 'B' and '<' flags from 'cpoptions') +need to remove the 'B' flag from 'cpoptions') Note that special characters (like '.' and '*') will cause problems. -- cgit From 0b88bf256d629cfe53c94896e140511e7f312b25 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 2 Jul 2017 13:46:41 +0200 Subject: doc: api.txt; deprecate --- runtime/doc/api.txt | 105 +++++++++++++++++++++++++++++++++++++++++++-- runtime/doc/deprecated.txt | 8 +++- runtime/doc/gui.txt | 12 +----- runtime/doc/map.txt | 14 ++---- runtime/doc/tips.txt | 3 -- 5 files changed, 114 insertions(+), 28 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index ebc2a40561..7c6b8a3c1a 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -165,7 +165,16 @@ nvim_input({keys}) *nvim_input()* *nvim_replace_termcodes()* nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) - Replaces any terminal codes with the internal representation + Replaces terminal codes and |keycodes| (, , ...) in a + string with the internal representation. + + Parameters:~ + {str} String to be converted. + {from_part} Legacy Vim parameter. Usually true. + {do_lt} Also translate . Does nothing if + `special` is false. + {special} Replace |keycodes|, e.g. becomes a "\n" + char. nvim_command_output({str}) *nvim_command_output()* TODO: Documentation @@ -182,8 +191,10 @@ nvim_eval({expr}) *nvim_eval()* Evaluation result or expanded object nvim_call_function({fname}, {args}) *nvim_call_function()* - Calls a VimL function with the given arguments. On VimL error: - Returns a generic error; v:errmsg is not updated. + Calls a VimL function with the given arguments + + On VimL error: Returns a generic error; v:errmsg is not + updated. Parameters:~ {fname} Function to call @@ -192,6 +203,23 @@ nvim_call_function({fname}, {args}) *nvim_call_function()* Return:~ Result of the function call +nvim_execute_lua({code}, {args}) *nvim_execute_lua()* + Execute lua code. Parameters might be passed, they are + available inside the chunk as `...`. The chunk can return a + value. + + To evaluate an expression, it must be prefixed with "return ". + For instance, to call a lua function with arguments sent in + and get its return value back, use the code "return + my_function(...)". + + Parameters:~ + {code} lua code to execute + {args} Arguments to the code + + Return:~ + Return value of lua code if present or NIL. + nvim_strwidth({str}) *nvim_strwidth()* Calculates the number of display cells occupied by `text`. counts as one cell. @@ -382,6 +410,17 @@ nvim_get_mode() *nvim_get_mode()* Return:~ Dictionary { "mode": String, "blocking": Boolean } +nvim_get_keymap({mode}) *nvim_get_keymap()* + Get a list of dictionaries describing global (i.e. non-buffer) + mappings Note that the "buffer" key will be 0 to represent + false. + + Parameters:~ + {mode} The abbreviation for the mode + + Return:~ + An array of maparg() like dictionaries describing mappings + nvim_get_api_info() *nvim_get_api_info()* TODO: Documentation @@ -414,6 +453,54 @@ nvim_call_atomic({calls}) *nvim_call_atomic()* error ocurred, the values from all preceding calls will still be returned. +nvim__id({obj}) *nvim__id()* + Returns object given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {obj} Object to return. + + Return:~ + its argument. + +nvim__id_array({arr}) *nvim__id_array()* + Returns array given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {arr} Array to return. + + Return:~ + its argument. + +nvim__id_dictionary({dct}) *nvim__id_dictionary()* + Returns dictionary given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {dct} Dictionary to return. + + Return:~ + its argument. + +nvim__id_float({flt}) *nvim__id_float()* + Returns floating-point value given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {flt} Value to return. + + Return:~ + its argument. + ============================================================================== Buffer Functions *api-buffer* @@ -492,6 +579,18 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()* Return:~ b:changedtickvalue. +nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()* + Get a list of dictionaries describing buffer-local mappings + Note that the buffer key in the dictionary will represent the + buffer handle where the mapping is present + + Parameters:~ + {mode} The abbreviation for the mode + {buffer_id} Buffer handle + + Return:~ + An array of maparg() like dictionaries describing mappings + nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()* Sets a buffer-scoped (b:) variable diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index 26cd5b24cc..b3e2f7a92f 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -39,10 +39,16 @@ Functions ~ *highlightID()* Obsolete name for |hlID()|. *last_buffer_nr()* Obsolete name for bufnr("$"). +Modifiers ~ +*:menu-* +*:menu-special* <> notation is always enabled. |cpo-<| +*:map-* +*:map-special* <> notation is always enabled. |cpo-<| + Options ~ *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. *'langnoremap'* Deprecated alias to 'nolangremap'. *'vi'* *'viminfo'* Deprecated alias to 'shada' option. - vim:tw=78:ts=8:ft=help:norl: + vim:noet:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 37462d4e96..b66a60c860 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -501,21 +501,13 @@ The ":set ic" will not be echoed when using this menu. Messages from the executed command are still given though. To shut them up too, add a ":silent" in the executed command: > :menu Search.Header :exe ":silent normal /Header\r" -"" may also appear just after "" or "