diff options
author | James McCoy <vega.james@gmail.com> | 2015-08-19 21:53:52 -0400 |
---|---|---|
committer | James McCoy <vega.james@gmail.com> | 2015-08-20 10:32:25 -0400 |
commit | f6f28c18e5824b13f4a20a481a9f350f0e652e9b (patch) | |
tree | 32a5dd8a94ae9891d9e3d3f65abdb14f75c8f108 /runtime | |
parent | 08bae4533704120199c188eb3cfac2b6ba4096c0 (diff) | |
download | rneovim-f6f28c18e5824b13f4a20a481a9f350f0e652e9b.tar.gz rneovim-f6f28c18e5824b13f4a20a481a9f350f0e652e9b.tar.bz2 rneovim-f6f28c18e5824b13f4a20a481a9f350f0e652e9b.zip |
7.4.813
patch 7.4.813
Problem: It is not possible to save and restore character search state.
Solution: Add getcharsearch() and setcharsearch(). (James McCoy)
https://github.com/vim/vim/releases/tag/v7.4.813
https://github.com/vim/vim/releases/tag/v7.4.826
Signed-off-by: James McCoy <vega.james@gmail.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5c2b570695..a4cc81a265 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1967,6 +1967,7 @@ server2client( {clientid}, {string}) Number send reply string serverlist() String get a list of available servers setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val} +setcharsearch( {dict}) Dict set character search from {dict} setcmdpos( {pos}) Number set cursor position in command-line setline( {lnum}, {line}) Number set line {lnum} to {line} setloclist( {nr}, {list}[, {action}]) @@ -3339,6 +3340,26 @@ getcharmod() *getcharmod()* character itself are obtained. Thus Shift-a results in "A" without a modifier. +getcharsearch() *getcharsearch()* + Return the current character search information as a {dict} + with the following entries: + + char character previously used for a character + search (|t|, |f|, |T|, or |F|); empty string + if no character search has been performed + forward direction of character search; 1 for forward, + 0 for backward + until type of character search; 1 for a |t| or |T| + character search, 0 for an |f| or |F| + character search + + This can be useful to always have |;| and |,| search + forward/backward regardless of the direction of the previous + character search: > + :nnoremap <expr> ; getcharsearch().forward ? ';' : ',' + :nnoremap <expr> , getcharsearch().forward ? ',' : ';' +< Also see |setcharsearch()|. + getcmdline() *getcmdline()* Return the current command-line. Only works when the command line is being edited, thus requires use of |c_CTRL-\_e| or @@ -5531,6 +5552,26 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()* :call setbufvar("todo", "myvar", "foobar") < This function is not available in the |sandbox|. +setcharsearch() *setcharsearch()* + Set the current character search information to {dict}, + which contains one or more of the following entries: + + char character which will be used for a subsequent + |,| or |;| command; an empty string clears the + character search + forward direction of character search; 1 for forward, + 0 for backward + until type of character search; 1 for a |t| or |T| + character search, 0 for an |f| or |F| + character search + + This can be useful to save/restore a user's character search + from a script: > + :let prevsearch = getcharsearch() + :" Perform a command which clobbers user's search + :call setcharsearch(prevsearch) +< Also see |getcharsearch()|. + setcmdpos({pos}) *setcmdpos()* Set the cursor position in the command line to byte position {pos}. The first position is 1. |