Skip to content

Commit

Permalink
trivial small _vimrc changes
Browse files Browse the repository at this point in the history
* RemoveDiacritics() function (for remove pinyin tone mark characters in Chinese)
* Store a handy <cftrace> tag in a register
* [Try to] override the background color setting
  • Loading branch information
emallove committed Jan 24, 2013
1 parent 0357ac3 commit 6e972e8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions _vimrc
Expand Up @@ -190,3 +190,21 @@ autocmd! BufEnter quickfix :setlocal winheight=99 nowinfixheight
" MacVim seems to default to a dark colorscheme, instead of the preferable
" light one
colorscheme default

set background=light


" 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 = 'aaaaaceeiooouuiie' " 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>)

" Various and sundry strings that I need again and again
let @z = '<cftrace category="eam_cftrace" abort="no" text="#GetFunctionCalledName()#">'
Expand Down

0 comments on commit 6e972e8

Please sign in to comment.