diff --git a/README.md b/README.md index f98dc22..eb8f2d2 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ from the source code of the miscellaneous scripts using the Python module -The documentation of the 66 functions below was extracted from -15 Vim scripts on June 2, 2013 at 22:18. +The documentation of the 67 functions below was extracted from +15 Vim scripts on June 3, 2013 at 21:23. ### Handling of special buffers @@ -411,6 +411,10 @@ Create a temporary directory and return the pathname of the directory. ### String handling +#### The `xolox#misc#str#ucfirst()` function + +Uppercase the first character in a string. + #### The `xolox#misc#str#compact()` function Compact whitespace in the string given as the first argument. diff --git a/autoload/xolox/misc.vim b/autoload/xolox/misc.vim index 37694a9..669d04b 100644 --- a/autoload/xolox/misc.vim +++ b/autoload/xolox/misc.vim @@ -1,7 +1,7 @@ " The version of my miscellaneous scripts. " " Author: Peter Odding -" Last Change: June 2, 2013 +" Last Change: June 3, 2013 " URL: http://peterodding.com/code/vim/misc/ -let g:xolox#misc#version = '1.4' +let g:xolox#misc#version = '1.5' diff --git a/autoload/xolox/misc/str.vim b/autoload/xolox/misc/str.vim index 901696c..cb3f59f 100644 --- a/autoload/xolox/misc/str.vim +++ b/autoload/xolox/misc/str.vim @@ -1,9 +1,14 @@ " String handling. " " Author: Peter Odding -" Last Change: May 19, 2013 +" Last Change: June 3, 2013 " URL: http://peterodding.com/code/vim/misc/ +function! xolox#misc#str#ucfirst(s) + " Uppercase the first character in a string. + return substitute(a:s, '^.', '\U\0', '') +endfunction + function! xolox#misc#str#compact(s) " Compact whitespace in the string given as the first argument. return join(split(a:s), " ") diff --git a/doc/misc.txt b/doc/misc.txt index 08d25ec..1f79c60 100644 --- a/doc/misc.txt +++ b/doc/misc.txt @@ -55,8 +55,9 @@ Contents ~ 11. The |xolox#misc#path#is_relative()| function 12. The |xolox#misc#path#tempdir()| function 11. String handling |misc-string-handling| - 1. The |xolox#misc#str#compact()| function - 2. The |xolox#misc#str#trim()| function + 1. The |xolox#misc#str#ucfirst()| function + 2. The |xolox#misc#str#compact()| function + 3. The |xolox#misc#str#trim()| function 12. Test runner & infrastructure for Vim plug-ins |misc-test-runner-infrastructure-for-vim-plug-ins| 1. The |xolox#misc#test#reset()| function 2. The |xolox#misc#test#summarize()| function @@ -135,8 +136,8 @@ For those who are curious: The function descriptions given below were extracted from the source code of the miscellaneous scripts using the Python module 'vimdoctool.py' included in vim-tools [5]. -The documentation of the 66 functions below was extracted from 15 Vim scripts -on June 2, 2013 at 22:18. +The documentation of the 67 functions below was extracted from 15 Vim scripts +on June 3, 2013 at 21:23. ------------------------------------------------------------------------------- *misc-handling-of-special-buffers* @@ -540,6 +541,11 @@ Create a temporary directory and return the pathname of the directory. *misc-string-handling* String handling ~ +------------------------------------------------------------------------------- +The *xolox#misc#str#ucfirst()* function + +Uppercase the first character in a string. + ------------------------------------------------------------------------------- The *xolox#misc#str#compact()* function