" Remove diacritical signs from characters in specified range of lines. " Examples of characters replaced: á -> a, ç -> c, Á -> A, Ç -> C. function! s:RemoveDiacritics(line1, line2) let diacs = 'áâãàçéêíóôõöőüúű' " lowercase diacritical signs let repls = 'aaaaceeiooooouuu' " corresponding replacements let diacs .= toupper(diacs) let repls .= toupper(repls) let all = join(getline(a:line1, a:line2), "\n") call setline(a:line1, split(tr(all, diacs, repls), "\n")) endfunction command! -range=% RemoveDiacritics call s:RemoveDiacritics(<line1>, <line2>)
Pingback: Solarized for OS X CLI | eFi.blog