Skip to content

Instantly share code, notes, and snippets.

@yoppi
Created March 15, 2011 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoppi/870777 to your computer and use it in GitHub Desktop.
Save yoppi/870777 to your computer and use it in GitHub Desktop.
changelog.vim.patch
diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim
--- a/runtime/ftplugin/changelog.vim
+++ b/runtime/ftplugin/changelog.vim
@@ -99,6 +99,8 @@
function! s:try_reading_file(path)
try
return readfile(a:path)
+ catch
+ " nop
endtry
return []
endfunction
@@ -178,7 +180,7 @@
" Look for an entry for today by our user.
let date = strftime(g:changelog_dateformat)
let search = s:substitute_items(g:changelog_date_entry_search, date,
- \ g:changelog_username)
+ \ s:username())
if search(search) > 0
" Ok, now we look for the end of the date entry, and add an entry.
call cursor(nextnonblank(line('.') + 1), 1)
@@ -197,7 +199,7 @@
" No entry today, so create a date-user header and insert an entry.
let todays_entry = s:substitute_items(g:changelog_new_date_format,
- \ date, g:changelog_username)
+ \ date, s:username())
" Make sure we have a cursor positioning.
if stridx(todays_entry, '{cursor}') == -1
let todays_entry = todays_entry . '{cursor}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment