diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-12-04 13:09:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-12-04 15:38:47 +0900 |
| commit | 7482bb03a7943a3fd9049c7ba61033b42387fac2 (patch) | |
| tree | c5dcb4a27b723ca6fc14a22366e4d2b9477c694a /.config/nvim/plugin/dummy.vim | |
| parent | 12f18a076f79470941f7ed54ac2de7effcbff740 (diff) | |
| download | dotfiles-7482bb03a7943a3fd9049c7ba61033b42387fac2.tar.gz dotfiles-7482bb03a7943a3fd9049c7ba61033b42387fac2.tar.zst dotfiles-7482bb03a7943a3fd9049c7ba61033b42387fac2.zip | |
neovim: refactor
Diffstat (limited to '.config/nvim/plugin/dummy.vim')
| -rw-r--r-- | .config/nvim/plugin/dummy.vim | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/.config/nvim/plugin/dummy.vim b/.config/nvim/plugin/dummy.vim index ce7b901..dcf8ae4 100644 --- a/.config/nvim/plugin/dummy.vim +++ b/.config/nvim/plugin/dummy.vim @@ -6,9 +6,47 @@ endif -command! -bar -complete=customlist,dummy#complete -nargs=1 +let s:text = {} + +let s:text.lipsum = [ + \ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor', + \ 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis', + \ 'nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', + \ 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore', + \ 'eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt', + \ 'in culpa qui officia deserunt mollit anim id est laborum.', + \ ] + +let s:text.lipsum1 = join(s:text.lipsum) + +let s:text.quickbrownfox = 'The quick brown fox jumps over the lazy dog.' + +let s:text.ABC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + +let s:text.abc = 'abcdefghijklmnopqrstuvwxyz' + +let s:text.hiragana = 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん' + +let s:text.katakana = 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン' + +let s:text.ihatovo = 'あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら、うつくしい森で飾られたモリーオ市、郊外のぎらぎらひかる草の波。' + + + +function! Dummy_insert(type) + call append(line('.'), get(s:text, a:type, '')) +endfunction + + +function! Dummy_complete(arglead, cmdline, cursorpos) abort + return sort(filter(keys(s:text), {idx, val -> val[0:len(a:arglead)-1] =~? a:arglead})) +endfunction + + + +command! -bar -complete=customlist,Dummy_complete -nargs=1 \ Dummy - \ call dummy#insert(<f-args>) + \ call Dummy_insert(<f-args>) |
