Skip to content

Commit

Permalink
Add xolox#misc#str#ucfirst() function
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jun 3, 2013
1 parent ac6fc93 commit 5082965
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -37,8 +37,8 @@ from the source code of the miscellaneous scripts using the Python module

<!-- Start of generated documentation -->

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

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions autoload/xolox/misc.vim
@@ -1,7 +1,7 @@
" The version of my miscellaneous scripts.
"
" Author: Peter Odding <peter@peterodding.com>
" 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'
7 changes: 6 additions & 1 deletion autoload/xolox/misc/str.vim
@@ -1,9 +1,14 @@
" String handling.
"
" Author: Peter Odding <peter@peterodding.com>
" 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), " ")
Expand Down
14 changes: 10 additions & 4 deletions doc/misc.txt
Expand Up @@ -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
Expand Down Expand Up @@ -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*
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5082965

Please sign in to comment.