-
-
Save eagletmt/444053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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