diff --git a/autoload/hugohelper.vim b/autoload/hugohelper.vim index 5c0fb64..d7a526f 100644 --- a/autoload/hugohelper.vim +++ b/autoload/hugohelper.vim @@ -13,6 +13,12 @@ function! hugohelper#TitleToSlug() exe 'normal! f-r f-r ' endfun +function! hugohelper#TitleCase() + normal gg + exe '/^title' + normal! vi"u~ +endfun + function! hugohelper#Draft() call s:set_key('draft', 'true') endfun diff --git a/plugin/hugohelper.vim b/plugin/hugohelper.vim index f567946..be94563 100644 --- a/plugin/hugohelper.vim +++ b/plugin/hugohelper.vim @@ -32,6 +32,7 @@ command! -nargs=0 HugoHelperUndraft call hugohelper#Undraft() command! -nargs=0 HugoHelperDateIsNow call hugohelper#DateIsNow() command! -nargs=0 HugoHelperLastmodIsNow call hugohelper#LastmodIsNow() command! -nargs=0 HugoHelperTitleToSlug call hugohelper#TitleToSlug() +command! -nargs=0 HugoHelperTitleCase call hugohelper#TitleCase() command! -nargs=1 HugoHelperHighlight call hugohelper#Highlight() command! -range -nargs=1 HugoHelperLink call hugohelper#Link()