diff options
Diffstat (limited to 'vim/autoload')
-rw-r--r-- | vim/autoload/html.vim | 6 | ||||
-rw-r--r-- | vim/autoload/mail.vim | 23 | ||||
-rw-r--r-- | vim/autoload/spellfile_local.vim | 2 |
3 files changed, 27 insertions, 4 deletions
diff --git a/vim/autoload/html.vim b/vim/autoload/html.vim index 9466be33..7ac4f9d3 100644 --- a/vim/autoload/html.vim +++ b/vim/autoload/html.vim @@ -28,11 +28,11 @@ function! html#TimestampUpdate() abort endif let cv = winsaveview() call cursor(1,1) - let li = search('\C^\s*<em>Last updated: .\+</em>$', 'n') + let li = search('\m\C^\s*<em>Last updated: .\+</em>$', 'n') if li - let date = substitute(system('date -u'), '\C\n$', '', '') + let date = substitute(system('date -u'), '\n$', '', '') let line = getline(li) - call setline(li, substitute(line, '\C\S.*', + call setline(li, substitute(line, '\S.*', \ '<em>Last updated: '.date.'</em>', '')) endif call winrestview(cv) diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim index 40b7fb7f..3fbba860 100644 --- a/vim/autoload/mail.vim +++ b/vim/autoload/mail.vim @@ -79,3 +79,26 @@ function! mail#NewBlank(count, up, visual) abort endif endfunction + +function! mail#StrictQuote(start, end) abort + let body = 0 + for lnum in range(a:start, a:end) + + " Get current line + let line = getline(lnum) + + " Get the leading quote string, if any; skip if there isn't one + let quote = matchstr(line, '^>[> ]*') + if !strlen(quote) + continue + endif + + " Normalise the quote with no spaces + let quote = substitute(quote, '[^>]', '', 'g') + + " Re-set the line + let line = substitute(line, '^[> ]\+', quote, '') + call setline(lnum, line) + + endfor +endfunction diff --git a/vim/autoload/spellfile_local.vim b/vim/autoload/spellfile_local.vim index f3d9b987..e119b718 100644 --- a/vim/autoload/spellfile_local.vim +++ b/vim/autoload/spellfile_local.vim @@ -42,7 +42,7 @@ function! spellfile_local#() abort endif try - let path = substitute(expand('%:p'), '/', '%', 'g') + let path = tr(expand('%:p'), '/', '%') if path ==# '' echoerr 'Blank path' endif |