Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Forked from tyru/gist:444017
Created June 18, 2010 18:57
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 eagletmt/444053 to your computer and use it in GitHub Desktop.
Save eagletmt/444053 to your computer and use it in GitHub Desktop.
" For test (Do quickrun on the target character!):
" aiu
" あいう
function! s:get_current_character()
if mode() ==# 'c'
let str = getcmdline()
let cur_idx = getcmdpos() - 1
return matchstr(str, '.', cur_idx)
elseif mode() ==# 'n'
let str = getline('.')
let cur_idx = col('.') - 1
return matchstr(str, '.', cur_idx)
else
echoerr 'not supported'
endif
return char
endfunction
echom s:get_current_character()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment