diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-08-20 12:45:11 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-08-20 12:45:11 -0400 |
commit | f253c8d9b4ab0b31ce0d9a6a1b60428785d93d50 (patch) | |
tree | 0738ac32b832368df873e3e8d1a244af8e0c22f5 /runtime | |
parent | 2647677618118a1d9c34f7210c149ce9bc6e3d2a (diff) | |
parent | f6f28c18e5824b13f4a20a481a9f350f0e652e9b (diff) | |
download | rneovim-f253c8d9b4ab0b31ce0d9a6a1b60428785d93d50.tar.gz rneovim-f253c8d9b4ab0b31ce0d9a6a1b60428785d93d50.tar.bz2 rneovim-f253c8d9b4ab0b31ce0d9a6a1b60428785d93d50.zip |
Merge pull request #3203 from jamessan/vim-7.4.813
Add getcharsearch() and setcharsearch()
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. |