Last active
January 3, 2016 09:41
-
-
Save koturn/c65c0ab20b53e961397a to your computer and use it in GitHub Desktop.
現在のカーソルの位置にhogehogeを挿入するコマンド
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
| function! s:inputcmd(text) abort | |
| let [curpos, line] = [getcurpos(), getline('.')] | |
| let line_parts = [line[: curpos[2] - 1], line[curpos[2] :]] | |
| call setline(line('.'), line_parts[0] . a:text . line_parts[1]) | |
| endfunction | |
| command! -nargs=* InputCmd01 call s:inputcmd(<q-args>) | |
| command! -nargs=* InputCmd02 call feedkeys("\<Esc>a<args>", 'n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment