Skip to content

Instantly share code, notes, and snippets.

@mattn
Last active August 29, 2015 14:06
Show Gist options
  • Save mattn/965439256bae3fb6265d to your computer and use it in GitHub Desktop.
Save mattn/965439256bae3fb6265d to your computer and use it in GitHub Desktop.
scriptencoding utf-8
inoremap <silent> <c-t> <C-R>=lambda("
\ let line = getline('.')[:col('.')] \n
\ let tok = matchlist(line, '^\\(.\\+\\s\\+\\)\\(.*\\)$') \n
\ call complete(len(tok[1]) + 1, filter([
\ {'abbr': 'sono', 'word': 'そのまさかだ!'},
\ {'abbr': 'fuha', 'word': 'ふははははは!'},
\ {'abbr': 'shusei', 'word': '修正しました!'},
\ ], 'stridx(v:val.abbr, tok[2]) == 0')) \n
\ return ''
\")()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment