diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/editing.txt | 3 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 23 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 1 | ||||
-rw-r--r-- | runtime/plugin/matchparen.vim | 4 |
4 files changed, 28 insertions, 3 deletions
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 0ad917006f..b1dd3239ea 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -77,7 +77,8 @@ g CTRL-G Prints the current position of the cursor in five than one position on the screen (<Tab> or special character), both the "real" column and the screen column are shown, separated with a dash. - See also 'ruler' option. + Also see the 'ruler' option and the |wordcount()| + function. *v_g_CTRL-G* {Visual}g CTRL-G Similar to "g CTRL-G", but Word, Character, Line, and diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1990cf735d..6ae137a6ce 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2140,6 +2140,7 @@ winrestcmd() String returns command to restore window sizes winrestview( {dict}) none restore view of current window winsaveview() Dict save view of current window winwidth( {nr}) Number width of window {nr} +wordcount() Dict get byte/char/word statistics writefile( {list}, {fname} [, {flags}]) Number write list of lines to file {fname} xor( {expr}, {expr}) Number bitwise XOR @@ -7122,6 +7123,28 @@ winwidth({nr}) *winwidth()* : exe "normal 50\<C-W>|" :endif < +wordcount() *wordcount()* + The result is a dictionary of byte/chars/word statistics for + the current buffer. This is the same info as provided by + |g_CTRL-G| + The return value includes: + bytes Number of bytes in the buffer + chars Number of chars in the buffer + words Number of words in the buffer + cursor_bytes Number of bytes before cursor position + (not in Visual mode) + cursor_chars Number of chars before cursor position + (not in Visual mode) + cursor_words Number of words before cursor position + (not in Visual mode) + visual_bytes Number of bytes visually selected + (only in Visual mode) + visual_chars Number of chars visually selected + (only in Visual mode) + visual_words Number of chars visually selected + (only in Visual mode) + + *writefile()* writefile({list}, {fname} [, {flags}]) Write |List| {list} to file {fname}. Each list item is diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 8017b99f97..fc8419a522 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -921,6 +921,7 @@ Various: *various-functions* py3eval() evaluate Python expression (|+python3|) pyeval() evaluate Python expression (|+python|) + wordcount() get byte/word/char count of buffer ============================================================================== *41.7* Defining a function diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 2a5a16a57e..873302efee 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2014 Jul 19 +" Last Change: 2015 Dec 31 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -55,7 +55,7 @@ function! s:Highlight_Matching_Pair() let before = 0 let text = getline(c_lnum) - let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\)') + let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\=\)') if empty(matches) let [c_before, c] = ['', ''] else |