diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-07-15 00:05:14 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-07-15 00:05:14 -0400 |
| commit | 69d4cd3899845d84767fa0e2ff9c8234e9dcbf84 (patch) | |
| tree | 4cdce2c77f17d9d79235c2ea64b2879e2c77d93e /plugin | |
Initial commit after stream
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/telescope.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plugin/telescope.vim b/plugin/telescope.vim new file mode 100644 index 0000000..50627bf --- /dev/null +++ b/plugin/telescope.vim @@ -0,0 +1,31 @@ +" let s:term_command = "rg preview_quit_map -l | fzf --preview 'bat --color=always --style=grid {-1}' --print0" +" let s:term_command = "rg preview_quit_map -l | fzf --preview 'bat --color=always --style=grid {-1}' > file.txt" +let s:term_command = "(rg preview_quit_map -l | fzf --preview 'bat --color=always --style=grid {-1}')" + +function! s:on_exit() abort + let g:result = readfile('file.txt') +endfunction + +function! TestFunc() abort + let g:term_output_stdout = [] + let g:term_output_stderr = [] + let g:term_output_onexit = [] + + vnew + let term_id = termopen(s:term_command, { + \ 'on_stdout': { j, d, e -> add(g:term_output_stdout, d) }, + \ 'on_stderr': { j, d, e -> add(g:term_output_stderr, d) }, + \ 'on_exit': { j, d, e -> s:on_exit() }, + \ 'stdout_buffered': v:false, + \ }) +endfunction + +function! PrintStuff() abort + echo len(g:term_output_stdout) len(g:term_output_stderr) len(g:term_output_onexit) +endfunction + +" call TestFunc() + +" echo g:term_output_stdout[-1] +" echo g:term_output_stderr +" echo g:term_output_onexit |
