From 23c7e16302edcd844cf2c4266390ae57d6d825ad Mon Sep 17 00:00:00 2001 From: kamecha Date: Fri, 30 Aug 2024 22:58:21 +0900 Subject: [PATCH] update doc --- doc/traqvim.jax | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/traqvim.jax b/doc/traqvim.jax index 42550df..97f3a19 100644 --- a/doc/traqvim.jax +++ b/doc/traqvim.jax @@ -271,19 +271,31 @@ bellow. https://github.com/gw31415/denops-sixel-view.vim > + " Clear the image like + function s:clear() abort + call sixel_view#clear() + endfunction + function s:preview_img(fileId) abort - let file = denops#request("traqvim", "getFile", [a:fileId]) - call sixel_view#view_sixel(file['data'], 0, 0) + " download the file and convert it to sixel data + let sixel = denops#request("traqvim", "getFile", [a:fileId]) + call sixel_view#view_sixel(sixel['data'], 0, 0) endfunction function s:preview_cursor_img() abort let cursor_url = getline('.') let fileId = matchstr(cursor_url, 'https://q.trap.jp/files/\zs.*') call s:preview_img(fileId) + " Close the image by moving the cursor + autocmd CursorMoved,BufLeave ++once call s:clear() + endfunction + + function s:traqvim_setting() + nnoremap K + \ call preview_cursor_img() endfunction - nnoremap K - \ call preview_cursor_img() + autocmd FileType traqvim call s:traqvim_setting() < ==============================================================================